8051 MicroController Assembly Code to Implement Division of two Numbers using Subtraction Instructions.
Below Code is Complied and Verified in Keil uVision 3.
The .asm file is given below after the code. For clarifications and suggestion comment in the comment section
; 8051 ASSEMBLY CODE -- CODESexplorer BLOG
; IMPLEMENTATION OF DIVISION USING SUBRACTION
; BELOW CODE DIVIDES 10H WITH 2H
ORG 0000H
MOV A,#10
MOV R1,#2
MOV R2,#00 ;QUIOTIENT WILL BE STORED HERE
loop:SUBB A,R1
INC R2 ;EACH TIME THE QUIOTIENT WILL BE INCREMENTED
CJNE A,#00,loop
END
how do you account for when there is a remainder