Design ------ - MISC or RISC - load/store or allow things like adding register to memory - make most aspect configurable at runtime because we want to use it to stress the compiler (things like "what if we have 1k RAM and 4 registers?") - fixed size instruction set or not or how much do we care about being optimized to be implementable in hardware or in FPA? - the PDB-8 had 8 opcodes? MISC requires 32 or less opcodes - RISC requires operands to be part of the opcode, this is not really practicable with 8-bit words, mostly RISCs are 32 or 64 bit wasting tons of memory for code. - von Neumann or Harvard? Opcodes ------- Load/Store MOV Integer Arithmetic and logical operations ADD SUB MUL DIV INC DEC AND OR NOT XOR NEG SHR SHL ROTR ROTL Floating Point Arithmetic FADD FSUB FMUL FDIV Testing and Branching CMP JC JNC JZ JNZ Subroutine CALL RET Not sure about those Stack PUSH POP I/O-ports GET PUT Other HLT NOP not sure about NOP, as long as we don't do branch-prediction or code patching for relocation? Building -------- gcc -I../minilib -g -O0 -m32 -march=i386 -ffreestanding -Werror -Wall -Wno-return-type -pedantic -std=c89 -o miniemu *.c ../minilib/*.c clang -I../minilib -g -O0 -march=i386 -fno-builtin -std=c89 -Werror -Wall -Wno-return-type -o miniemu *.c ../minilib/*.c tcc -I../minilib -g -O0 -march=i386 -fno-builtin -std=c89 -Werror -Wall -Wno-return-type -o miniemu *.c ../minilib/*.c pcc -I../minilib -g -O0 -march=i386 -fno-builtin -std=c89 -Wall -Wno-return-type -o miniemu *.c ../minilib/*.c Usage ----- ./miniemu test1.bin ./miniemu test2.bin ./miniemu test3.bin ./miniemu test4.bin ./miniemu test5.bin ./miniemu test6.bin ./miniemu test7.bin ./miniemu test8.bin