A sample instruction set, assembler, and emulator. Uses 3 bit opcodes and 5 bit memory addresses. Can address 32 bytes of memory.
A POSIX C compiler, probably requires GCC. Untested on Windows.
editor prog.asm bin/w832_asm prog.asm prog.bin bin/w832_sim prog.bin
Assembly Language Reference
All instructions can act on the memory, program counter, and the primary register A (the only general purpose register).
LOD nLOAD value from memory address N into register A.
STO nSTORE register A in memory address N.
CMP nCOMPARE register A to memory address N. Skip next instruction if equal.
JMP nJUMP PC to memory address N.
ADD nADD value from memory address N to register A.
NEGTWOS COMPLEMENT NEGATE value in register A.
AND nAND value from memory address N with register A.
NOTBINARY NEGATE value in register A.
0x[0-F]+will insert a literal hexadecimal value into memory.
[0-9]+will insert a literal decimal value into memory.
0[0-9]+will insert a literal octal value into memory.
ORG nOnly affects assembly process. Places the following instruction at memory location n, the one after that at n+1, and so on.
This program counts by 4's in the addresses 16-31
LOD 16 ADD 16 STO 17 LOD 2 ADD 15 STO 2 LOD 0 ADD 15 STO 0 JMP 0 ORG 15 0x01 0x04