The latest archive upload shows the new assembler, which just passed all the self-tests. The few corner cases gave some difficulties but they were solved.
Part of the self-test includes throwing "stuff" at the assembler and disassemble it, to see if the parser chokes on anything. Of course this is not perfect but most cases of user abuse are covered.
The other part scans the WHOLE INSTRUCTION SPACE. The instruction is disassembled, reassembled an re-disassembled to check discrepancies. This is where the ambiguities become obvious.
- Instructions with small immediate values are always assembled to Imm4 but it is also possible to encode them in binary as Imm8. This is a sort of "funnel" and 824 Imm8 codes are converted to Imm4 codes.
- ADD SND Imm4 increments the Imm4 field when it is not negative. This creates an additional mismatch with ADD SND Imm8, which creates an additional "funnel" of 64 codes.
- LDCH and LDCL don't take conditions into account, which creates another "funnel" of 3712 codes.
All these test ensure that no "blind spot" or undefined behaviour exists, not just in the assembler and disassembler, but also in the ISA itself.
Overall, VHDL is perfectly capable of assembling and disassembling instructions with only the basic feature set. It's not the easiest language but the Ada legacy helps a lot ! Thanks to GHDL there is no need of an external software module and this package ygrec8_asm adds a lot of convenience in the simulator, emulator and debugger !
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.