| ??? 10/19/01 03:37 Read: times |
#15853 - RE: Converting my o/p to drive LCD disp |
one problem: register A is not initiallized during the first pass through the print loop meaning it could start anywhere depending upon the accumulator contents when the call is made to search_table:
;----- search_table: MOV R7,A 'PUSH ACC MOV DPTR,#table 'point DPTR @ table loop: ' 'you must initialize or clear a before this opcode. omitted first time through MOVC A,@A+DPTR 'get a character JZ exit 'jump if acc 0 to exit LCALL WRITE_TEXT 'write it to the port INC DPTR 'get next char CLR A 'clear acc for next character (if the 1st char didn't terminate this will restore for substequent characters SJMP loop 'loop back to get a character 'exit of acc = 00 exit: 'POP ACC MOV A,R7 'pop back the value of the acc RET ;----- |



