8051 Program to Implement Division using Subraction (AT89C51)

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





Please Click on link below to Download Assembly Source Code
Division using Subtarction  ASM File

1 comment:

  1. how do you account for when there is a remainder

    ReplyDelete

Powered by Blogger.