Return to Menu
= = = DUO COMPACT DESCRIPTION = = =
Architecture by Jack Eisenmann

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.

[src address] [dest address] [skip address 1] [skip address 2]

Three steps occur when executing the instruction:

  1. Load the byte at the first and second address. NOR these bytes together.
  2. Store the result of step 1 in the second address.
  3. If the result of step 1 was zero, then skip to the instruction at the fourth address; otherwise, skip to the instruction at the third address.

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.

0000: 00 01 60 0C
4000: 80 00 80 00
8000: FF FB FF FB
C000: 80 00 80 00
0001: 4E 00 00 00

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.

0000: 10 01 00 08
4000: 80 00 80 00
8000: A0 0C 00 08
C000: 01 00 01 00
0100: 00 08 60 0C
4100: 00 00 00 00
0001: 00 FF 00 00

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.

0000: 10 01 00 08
4000: 80 00 80 00
8000: A0 0C 00 08
C000: 01 00 01 00
0100: 20 01 00 08
4100: 02 00 81 00
8100: 30 01 60 0C
C100: 00 00 00 00
0200: 10 01 60 0C
4200: 00 00 00 00
0001: 00 FF F0 EF
Return to Menu
Return to the Ostracod Pond