Following program was written to display any two digit number given to the Accumulator on the LCD screen ( AES 8051 board ) . I do not understand the process of of the 'div ab' command and why it is used. Can you explain it to me ?
Code:
ORG 7000h ;start
call 4100h ; clear screen
mov a, #65 ;add 65 to a
mov b, #10 ;add 10 to b
div ab ;divid a by b
mov r1, a ;mov a to r1
mov r2, b ;mov b to r2
mov a, r1 ;mov r1 to a
add a, #48 ;add 48 to a
call pro ;call pro
clr a ;clear accumulator
mov a, r2 ;mov r2 to a
add a, #48 ;add 48 to a
pro: clr 90h ; select data write
mov dptr, #0fff3h ; lcd address
movx @dptr, a ; send data to lcd
mov r0, #0
djnz r0, $ ; delay > 1ms
djnz r0, $ ; (1020 machine cycles)
clr 91h
setb 91h
ret
END