Closed kevinramharak closed 5 years ago
Good catch, I'll push a fix when I come back from work
[01/15 20:32:34:815] [SEVERE] Unknown mnemonic "SHL"@2
The current code will overwrite SAL
with the SHL
instruction. I am not what a simple implementation woul be that works for the assembler and the cpu. Maybe have an alias slot in the instruction class? Or rethink the instruction map to a map that does not replace opcodes when a new one is added with the same opcode. What about a mnemonic to instruction hashmap? The CPU only needs to know about opcodes and retrieve the correct instruction while the assembler can use a different map to find an instruction. This will keep most of the current logic the same.
This is because in the ADD instruction set the instruction gets ignored if its an alias for another instruction.
But the assembler uses the mnemonic's inside the
instructionMap
to encode the instructions:I found it while trying to figure out how to alias some of the
SETcc
instructions as some of those instructions are aliases as well.