Fixed a bug with the opcode and register types not being set correctly.
This commit is contained in:
+2
-2
@@ -31,7 +31,7 @@ int IsOpcode(const char* text, TokenType* opcode) {
|
|||||||
|
|
||||||
for(int i = 0; i < OPCODECOUNT; i++) {
|
for(int i = 0; i < OPCODECOUNT; i++) {
|
||||||
if (strcmp(opcodes[i].lexeme, text) == 0) {
|
if (strcmp(opcodes[i].lexeme, text) == 0) {
|
||||||
opcode = &opcodes[i].op;
|
*opcode = opcodes[i].op;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ int IsRegister(const char* text, TokenType* reg) {
|
|||||||
|
|
||||||
for(int i = 0; i < REGISTERCOUNT; i++) {
|
for(int i = 0; i < REGISTERCOUNT; i++) {
|
||||||
if (strcmp(registers[i].lexeme, text) == 0) {
|
if (strcmp(registers[i].lexeme, text) == 0) {
|
||||||
reg = ®isters[i].type;
|
*reg = registers[i].type;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user