Program to divide an 8 bit no by another 8 bit number
16. Program to divide an 8 bit no by another 8 bit number :
mov r0,#26h ;load r0 with immediate data 26hmov a,@r0 ;load a with data from internal RAM location(dividend)
inc r0 ;increment r0
mov b,@r0 ;move data from internal RAM location to b(divisor)
div ab ;divide a by b
inc r0 ;increment r0
mov @r0,a ;load internal RAM location with data from a
inc r0 ; increment r0
mov a,b ;move data from b to a
mov @r0,b ;move data from b to internal RAM location
here:sjmp here
end