From bill rowe@21:1/5 to All on Sat Mar 11 04:14:50 2017
I'm working on a version of LCC42 targeted on the RCA 1802 processor.
If I have the statement --i; in open code (and i is in a register) i emit a decrement for the register but if the --i is in a do/while test it copies the reg to a temp, decrements the temp, and copies it back. It also uses the temp for the loop test so
my peephole optimizer doesn't cut out the double copy. I would ideally like to emit a single "decrement and jump if not 0" but i would settle for getting rid of the temp. Any suggestions?
In the code below I hope the mnemonics are obvious. R7 is the variable i and R11 is a temp. The assembly macros are decorated with the LCC table entries that emit them except for the first cpy2 which I am tracking down. Any suggestions?