| ??? 10/19/01 16:28 Read: times |
#15875 - RE: Converting my o/p to drive LCD disp |
if you want to support variable length records, which haven't been the objective here, this is my code:
My code: ;----- display_variable_length_line_R2: mov a,r2 ;0-255 subroutine input mov dptr,#index ;high address table movc a,@a+dptr ;get high addr xchg a,r2 ;reload msg#, store high inc dph ;bump to low address table movc a,@a+dptr ;get low addr mov dpl,a ;put low addr mov dph,r2 ;put high addr call search_table: ;go ret index: ;@addr XXXXh, byte sized table db high(msg0) ... db high(msg255) db low(msg0) ;@index+256 ... db low(msg255) msg0: DB "variable length messages",eot ... msg255: DB "the end",eot ;----- note the advantage of spliting your dw table into a high and low db set of tables: the access to the table data is quicker and more concise. duh |



