Have a look at **broken link removed** especially the Print subroutine.
I'll include the relevant bits here for completeness.
Obviously, you will have to change the sndchar so that it writes to the LCD. Can you see from this example why hardware has never been designed to do what you are trying to accomplish?
Mike.
I'll include the relevant bits here for completeness.
Code:
lcall print ; print welcome message
db 0ah, 0dh,'TOMS 8051 MONITOR Jul 13,1997',0ah, 0dh
db 'press h for help',0ah, 0dh, 0h
;===============================================================
; subroutine print
; print takes the string immediately following the call and
; sends it out the serial port. the string must be terminated
; with a null. this routine will ret to the instruction
; immediately following the string.
;===============================================================
print:
pop dph ; put return address in dptr
pop dpl
prtstr:
clr a ; set offset = 0
movc a, @a+dptr ; get chr from code memory
cjne a, #0h, mchrok ; if chr = ff then return
sjmp prtdone
mchrok:
lcall sndchr ; send character
inc dptr ; point at next character
sjmp prtstr ; loop till end of string
prtdone:
mov a, #1h ; point to instruction after string
jmp @a+dptr ; return
Obviously, you will have to change the sndchar so that it writes to the LCD. Can you see from this example why hardware has never been designed to do what you are trying to accomplish?
Mike.