0% found this document useful (0 votes)
515 views5 pages

Assembly Language Programming: - Addition of Two 8-Bit Numbers

LXI H, 2501H Get address of 1st number in HL pair MOV A,M 1st Number in accumulator INX H Increment content of HL Pair ADD M Add 1st and 2nd numbers STA 2503H Store sum in 2503H The document discusses assembly language programming techniques including addition of two 8-bit numbers using LXI H, MOV A, INX H, ADD M and STA instructions. It also covers subtraction, 16-bit addition, finding minimum values, BCD number packing and unpacking, data transfers, multiplication and adding multiple numbers.

Uploaded by

Santhosh Kumar J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
515 views5 pages

Assembly Language Programming: - Addition of Two 8-Bit Numbers

LXI H, 2501H Get address of 1st number in HL pair MOV A,M 1st Number in accumulator INX H Increment content of HL Pair ADD M Add 1st and 2nd numbers STA 2503H Store sum in 2503H The document discusses assembly language programming techniques including addition of two 8-bit numbers using LXI H, MOV A, INX H, ADD M and STA instructions. It also covers subtraction, 16-bit addition, finding minimum values, BCD number packing and unpacking, data transfers, multiplication and adding multiple numbers.

Uploaded by

Santhosh Kumar J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Assembly Language Programming

• Addition of Two 8-bit Numbers

LXI H, 2501H Get address of 1st number in HL pair


MOV A,M 1st Number in accumulator
INX H Increment content of HL Pair
ADD M Add 1st and 2nd numbers
STA 2503H Store sum in 2503H
HLTStop

Example: DATA:
2501H – 49H
2502H – 56H
RESULT:
2503 H– 9FH
Addition of Two 8-bit Numbers

MVI A, 49H
MVI B, 56H
ADD B
STA 2503H
HLT
(Or) MVI A, 49H
ADI 56H
STA 2503H
HLT

LDA 2501H
MVI B, 56H
ADD B
STA 2503H
HLT
Addition of Two 8-bit Numbers
LXI H, 2501H
Sum: 16 bits
MVI C, 00H
MOV A,M
INX H
ADD M
JNC AHEAD
INR C
STA 2503H
MOV A,C
STA 2504H
HLTExample:
DATA: 2501H – F5H
2502H – 8AH
RESULT:
2503 H– 7FH
2504H – 01H
8-bit Subtraction
LXI H, 2501H Get address of 1st number in HL pair
MOV A,M 1st Number in accumulator
INX H Increment content of HL Pair
SUB M subtract 1st and 2nd numbers
STA 2503H Store sum in 2503H
HLT Stop

Example: DATA:
2501H – 49H
2502H – 32H
RESULT:
2503 H– 17H
Assembly Language Programming
• Twos Complement of an 8-bit Number
• 16-bit addition
• To find smaller of two numbers
• Unpacking of a BCD number
• Packing of a BCD number
• Transfer a Block of Data
• 8-bit Multiplication
• Addition of ‘n’ Numbers

You might also like