Hi,
I am retargeting LCC for a hobby cpu with 8 registers. I am stuck on the following:
I have an instruction 'ldw reg1, offset(reg2)' that loads a memory word located at reg2+offset into reg1. However, this instruction can only target a subset of registers. It cannot for example target reg5.
The thing I can't figure out is how to tell LCC that this instruction can only be used for certain regs (reg1 to reg4 in my case). And that it should use another instruction in all other cases: ldw tgt (base, index) can target any register.
Any insight on how to achieve this would be greatly appreciated.
Erwin
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 185 |
Nodes: | 16 (1 / 15) |
Uptime: | 64:22:31 |
Calls: | 3,747 |
Files: | 11,167 |
Messages: | 3,458,995 |