The DUO Compact is an 8-bit OISC (one instruction set computer) using TTL. It was designed to have the fewest chips possible while still being useful.
The machine has 64 KB of available memory. Certain ranges of memory are mapped to EEPROM, SRAM and I/O ports.
There is only one kind of instruction: NOR and fork conditionally ("NFC"). The command accepts 4 memory addresses, each 16 bits long. The opcode is implicit because there are no other operations.
Three steps occur when executing the instruction:
Note that when reading from an output port, the value read will always be 0 regardless of the stored value. This includes 600C, the debug output port.
(Note: For hexadecimal and binary, I list digits from least significant to most significant. This is contrary to normal convention, but I prefer it.)
When the machine is turned on, execution begins at address 0000.
In this example program, the machine writes the value 27 to the debug output port. The first instruction copies the value E4 and stores the inverted value in 600C. (Recall that output ports always read as 00 to the data bus. X NOR 00 = NOT X.) The second instruction repeats indefinitely, NORing data in an unused location. This is effectively halts the program.
You can test the program by pasting the machine code into the Emulator.
This next program constantly copies debug input to debug output. While running the program, try setting a new input value. The first instruction clears the data at 0008. (FF NOR X = 00.) Next, the inverse of the debug input value is stored in 0008. After that, the value is inverted again and stored in the debug output port. This last instruction leads execution back to 0000.
The program below will yield a debug output of 1 if the debug input is less than 16. If the input is greater than 15, the output is 0. Note the usage of a conditional fork at 4100.