0% found this document useful (0 votes)
11 views

Assignment Division 8 Bit Hex Num: Microprocessor & Peripheral Interfacing

The document describes dividing an 8-bit hexadecimal number stored at memory location 2500 by the divisor stored at 2501. The quotient is stored at 2502 and remainder at 2503. The flowchart and code show the logic to repeatedly subtract the divisor from the dividend, incrementing the quotient digit until the subtraction results in a borrow.

Uploaded by

aaaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Assignment Division 8 Bit Hex Num: Microprocessor & Peripheral Interfacing

The document describes dividing an 8-bit hexadecimal number stored at memory location 2500 by the divisor stored at 2501. The quotient is stored at 2502 and remainder at 2503. The flowchart and code show the logic to repeatedly subtract the divisor from the dividend, incrementing the quotient digit until the subtraction results in a borrow.

Uploaded by

aaaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MICROPROCESSOR & PERIPHERAL INTERFACING

ASSIGNMENT
DIVISION 8 BIT HEX NUM
Date:23/01/2018

AIM: A) WAP to divide 8-bit hex number which is stored at memory location 2500. Divisor is
stored at 2501. Store the quesent in 2502 and reminder 2503.

FLOWCHART:
LXI H 2500

MOV A,M

INX H

MVI B 00

SUB M

INR B

JNC back

If carry
DCR B

ADD M

INX H

MOV M,B

INX H

MOV M,A
Division of 8 bit hex num

RST 5
MICROPROCESSOR & PERIPHERAL INTERFACING

CODE:
2000 LXI 2500
2003 MOV A,M
2004 INX H
2005 MVI B 00
2007 SUB M
2009 INR B
200A JNC 2007
200D DCR B
200E ADD M
2011 INX H
2012 MOV M,B
2013 INX H
2014 MOV M,A
2015 RST 5

INPUT:

2500 07H 2500 FFH 2500 02H


2501 03H 2501 FFH 2501 05H

OUTPUT:

2502 02H 2502 01H 2502 00H


2503 01H 2503 00H 2503 02H

RESULT: Thus we have obtained division of 8 bit hex number.

You might also like