Super Simple CPU
- 16 memory locations
- 16 bits at each memory location
- Registers
- Instruction is 16 bits
- 4 bit opcode
- 12 bit operand
- Instructions
- 1111 Stop
- 0001 Add ADDRESS, add memory at operand to the acc
- 0010 SUB ADDRESS, subtract the memory at operand from the acc
- 0011 LOD ADDRESS, load the value at the address into the acc
- 0100 LDI IMM, load IMM into the acc
- 0101 STO ADDRESS, store the accumulator to the address
- 0110 INP , input to the accumulator
- 0111 OUT, output the accumulator
- 1000 JMP ADDRESS jump to the new address
- 1001 JNG ADDRESS, jump if the accumulator is negative to the address
- 1010 JZR ADDRESS, jump if the accumulator is zero to the address
- Write a program to find the perimeter of a rectangle given the length
of the sides
- Write a program that reads in two numbers and prints out the largest