To write a string to the LCD on the HCS12, I wrote the following bit of assembly:
;main bit of program running up here ; .... ........ ; .... ........ LDX #NEX_FLR ;load X with string pointer LDY #NEX_LEN ;load Y with string length JSR WRT_STRING ;jump to WRT_STRING sub WRT_STRING DISP LDAA X ;put the value at X in A JSR DATWRT4 ;sub to write the character JSR DELAY ;required delay for LCD INX ;next letter in the string DBNE Y, DISP ;decrement string count and repeat RTS ;once string is all printed, return NEX_LEN EQU 11 ;string length NEX_FLR FCB 'Next Floor ' ;string contents
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.