Both the assembler and the disassembler should now support all the instructions I've layed out thus far.

This commit is contained in:
2022-08-29 18:51:48 +00:00
parent e3b4293314
commit 5f437b6869
6 changed files with 133 additions and 16 deletions
+8 -1
View File
@@ -14,7 +14,8 @@ Instruction instructions[OPCODECOUNT] = {
{ "in", IN, Constant | Reg, None},
{ "out", OUT, None, None},
{ "nop", NOP, None, None},
{ "jz", JZ, Address, None}
{ "jmp", JMP, Address, None},
{ "call", CALL, Address, None}
};
unsigned char GetInstructionMask(TokenType type, TokenClass parameterOneType) {
@@ -33,6 +34,12 @@ unsigned char GetInstructionMask(TokenType type, TokenClass parameterOneType) {
return 0x01;//0b00000001;
case INT:
return 0x02; //0b00000010;
case YLD:
return 0x03;
case RET:
return 0x04;
case CALL:
return 0x05;
case JMP:
return 0x06;//0b00000110;
case IN: