Hi,
Could you send me a program for Division of two nos in microprocessor 8085?
Regards,
Zahid
|
Newbie Member
|
|
| 12May2007,01:47 | #2 |
|
Hey guy, try this...
Code:
LHLD 2200H ; Get the devidend
LDA 2202H
MOV C, A ; Get the divisor
LXI D, 0000H ; Quotient = 0
BACK : MOV A, L
SUB C ; Subtract divisor
MOV L, A ; Save partial result
JNC SKIP ; if CY # 1 jump
DCR H ; Subtract borrow of previous subtraction
SKIP : INX D ; Increment quotient
MOV A, H
CPI, 00 ; Check if dividend < divisor
JNZ BACK ; if no repeat
MOV A, L
CMP C
JNC BACK
SHLD 2302H ; Store the remainder
XCHG
SHLD 2300H ; Store the quotient
HLT
Last edited by shabbir; 12May2007 at 09:23.. Reason: Code block |
