My project is for MC68HC11. It's almost complete.
I’m adjusting RTC with keypad - scan the keypad and compare every key if it’s pressed. If it’s pressed I write his value in variable and display it on the LCD.
This is working without problems:
adj21: jsr keypad_wytec
stab Oldkey
ldaa Oldkey
cmpa #$03
bne adj21
jsr adj1
rts
adj1:
ldaa #$32
staa value
ldx #value
ldab #1
jsr lcd_line1
rts
I want to do the following thing, but I don’t know how: Compare if a key is pressed and write its value to “Index Register Y”. After than again to compare if a key is pressed and writes the second value again in “Index Register Y”. I know how to make the compares. I don't know how to write to “Index Register Y” and after that read the value.
Example: press 2 and write to LCD; after that press 5 and display 25 on LCD.
I’m adjusting RTC with keypad - scan the keypad and compare every key if it’s pressed. If it’s pressed I write his value in variable and display it on the LCD.
This is working without problems:
adj21: jsr keypad_wytec
stab Oldkey
ldaa Oldkey
cmpa #$03
bne adj21
jsr adj1
rts
adj1:
ldaa #$32
staa value
ldx #value
ldab #1
jsr lcd_line1
rts
I want to do the following thing, but I don’t know how: Compare if a key is pressed and write its value to “Index Register Y”. After than again to compare if a key is pressed and writes the second value again in “Index Register Y”. I know how to make the compares. I don't know how to write to “Index Register Y” and after that read the value.
Example: press 2 and write to LCD; after that press 5 and display 25 on LCD.