  mov  dptr,#msg_table ;Init the base of the Message Table

;  ************************
;  *** Input Validation ***
;  ************************

  jz   msg_index       ;If acc=0 we have an acceptable value.
  cjne a,#3,eval_acc   ;We have a non-zero value is other than 3?
  jmp  msg_index       ;No it is 3, a valid value.

; *** It's not either a 0 or 3 value ***
; *** Test for an invalid value      ***

eval_acc:
  jnc  input_err       ;If we didn't carry the value exceeds that allowable.

; *****************************
; *** Compute Message Index ***
; *****************************

msg_index:
  mov  b,#7            ;Init msg length multiplier
  mul  ab              ;Multiply Index (Element Number) by Element size.

; ************************************
; *** One Approach to Table Access ***
; ************************************

  add  a,dpl            ;Add the Index Value to the low byte of dptr
  mov  dpl,a
  mov  a,dph            ;Correct for any carry (cross page boundry)
  addc a,#0
  mov  dph,a

 *******************************************
 *** We have an index into the Msg Table ***
 ***      Output the Selected Message    ***
 *******************************************

  mov  r2,#7             ;Init a msg counter - msg length
msg_loop:
  clr  a                 ;Index already in dptr so clear acc
  movc a,@a+dptr
  inc  dptr             ;Point to next char
  call txo              ;Output to display
  djnz r2,msg_loop      ;Down count through available chars.
  ret

input_err:
 (error handling)

txo:
 (your display routine. (Must not contaminate DPTR or R2)