I am looking to reduce the amount of repetitive typing. My application displays a lot of messages on a 16x2 lcd. I use the following to load the z register and output the data to the lcd
ldi zh,high(line1*2)
ldi zl,low(line1*2)
rcall out;send line 1 to lcd
ldi zh,high(line2*2)
ldi zl,low(line2*2)
rcall line2;first call line 2 to set lcd for second line
I have all my messages at the end of the code as .db
This all works well, but I have to rewrite the above for every message I want to send. (the line1 and line2 are actually the name of the lines i want to display so the change with each message)
What I would like to do is take the above code and turn it into a subroutine where first I load 'line1' and 'line2' with the message and then call the above to display it. I thought the .set directive would do the trick, but no good.
Any ideas?
Jim