GetString: mov R1,StringNumber ;StringNumber + 1
inc R1
mov dptr,#Strings ;Initialize dptr with base address of strings
djnz R1,LBL0070
jmp LBL0071
LBL0070: clr a
movc a,@a+dptr ;Read length actual string
add a,dpl ;add it to dptr
mov dpl,a
jnc LBL0072 ;check overflow
inc dph ;increment dph when overflow
LBL0072: inc dptr ;+1 byte due to string length
inc dptr ;+1 byte due to trailing 0
djnz R1,LBL0070 ;Reached wanted string? No: again
LBL0071: inc dptr ;Yes: inc dptr duet o string length
mov R7,dph ;store dptr in R7 en R6
mov R6,dpl
mov R5,#0 ;Initialize character counter at 0
LBL0073: mov dph,R7 ;Reload dptr from R6 & R7
mov dpl,R6
mov a,R5 ;Character counter
movc a,@a+dptr ;Get character into accumulator
jz LBL0074 ;Character = 0? Yes: job done
;Do what you need to do with the character here
;In this example send it to LCD using some subs
;Since these subs use the dptr I need to store it in R6 & R7
;You could also push it on the stack
;
mov dptr,#LCD_DataRegister
call LCD_Ready ;LCD Busy ??
movx @dptr,A ;Send character to LCD
inc R5 ;Increment character pointer
jmp LBL0073 ;Next character
LBL0074: ;END GetString: