NewGeek
New Member
OK this is a bit of code, modified from Nigels LCD routine. The sub 'text2a' is where you input the characters to be written to the LCD.
I am trying to substitute the value stored in an address 'MyNum' for a character.
In this case, 'X' and 'Y' are both written to the LCD fine, but the value of 'MyNum' (5) is just blank. Why not? This code should write "5XY" to LCD, correct?
I am trying to substitute the value stored in an address 'MyNum' for a character.
In this case, 'X' and 'Y' are both written to the LCD fine, but the value of 'MyNum' (5) is just blank. Why not? This code should write "5XY" to LCD, correct?
Code:
cblock 0x0C
MyNum ;adds variable 'MyNum' to address 0x0C
endc
Text2a ADDWF PCL, f
call GetNumber
retlw MyNum
retlw 'Y'
retlw 'Z'
retlw 0x00
GetNumber
movlw d'5' ;move 5 to W
movwf MyNum ;Move 5 to 'MyNum'
return