I wasn't sure where to put this thread so I've just posted it here since it's the first forum on the list
Here's the instructions I've implemented so far:
Code:
Opcode Mnemonic Operands Registers Affected Flags Affected Comment
------ -------- -------- ------------------ -------------- -------
0000 nop -, - - - No Operation
FFFF end -, - PC, SP - End of program [reset PC]
0001 push r/k, - SP - Push value to stack
0002 pop r, - SP - Pop value off top of stack into r
0003 mov r, r - Z Move (copy) value in r into r
0004 inc r, - - Z Increment value in r
0005 dec r, - - Z Decrement value in r
0006 jmp k, - PC - Unconditional jump to instruction at memory
location k
0007 cmp r/k, r/k - Z, E, LT, GT Compare r/k with r/k
0008 je k, - PC - Jump to instruction @ k if E is set
0009 jne k, - PC - Jump to instruction @ k if E not set
000A jz k, - PC - Jump to instruction @ k if Z is set
000B jnz k, - PC - Jump to instruction @ k if Z not set
000C jgt k, - PC - Jump to instruction @ k if GT is set
000D jlt k, - PC - Jump to instruction @ k if LT is set
000E ld r, k - Z Load r with value k
Some modifications and fixes still need to be made, but otherwise all's working well. My assembler is kept up to date at the same time which means adding a new instruction takes about 10 minutes before I can actually start debugging it, but at least I've got it working (the assembler).
So I was wondering which instruction(s) I should implement next. I guess it would be logical to start working on sub routine call / ret since I have the jumps working. I still need to get the maths & logic instructions implemented too.
Thoughts?