On the right side of a rule, you can write asm{ ... } to insert another instruction/rule that was already defined somewhere else. I used this to define pseudo-instructions, which are replaced by normal instructions but allow more convenient assembler programming. Here's an example of such a pseudo-instruction I defined:
beqi {imm: i8}, {addr: u16} => asm{ li B, {imm} } @ asm{ beq {addr} }
It would be nice to have a command-line flag that outputs the complete program (not the generated bytes) without pseudo-instructions/a version of the program where all pseudo-instructions are replaced with their corresponding normal instructions. This would help a lot in debugging my current project.
Example:
The program
beqi 12, 0x1234
with the new flag activated should output
li B, 12
beq 0x1234
On the right side of a rule, you can write asm{ ... } to insert another instruction/rule that was already defined somewhere else. I used this to define pseudo-instructions, which are replaced by normal instructions but allow more convenient assembler programming. Here's an example of such a pseudo-instruction I defined:
beqi {imm: i8}, {addr: u16} => asm{ li B, {imm} } @ asm{ beq {addr} }
It would be nice to have a command-line flag that outputs the complete program (not the generated bytes) without pseudo-instructions/a version of the program where all pseudo-instructions are replaced with their corresponding normal instructions. This would help a lot in debugging my current project.
Example:
The program
beqi 12, 0x1234
with the new flag activated should output
li B, 12
beq 0x1234