answersLogoWhite

0

The 8085 is an 8-bit computer, with only limited capability to do 16 bit arithmetic. In order to add two 16-bit numbers, NUM1 and NUM2, together, and store the result at NUM3, you can use the code...

LHLD NUM1

XCHG

LHLD NUM2

DAD D

SHLD NUM3

If you want to subtract NUM1 from NUM2, you need to take the two's complement first, by inverting it and adding one...

LHLD NUM1

MOV A,H

CMA

MOV H,A

MOV A,L

CMA

MOV L,A

INX H

... and then continue with adding NUM2...

XCHG

LHLD NUM2

DAD D

SHLD NUM3

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan

Add your answer:

Earn +20 pts
Q: Addition and subtraction of two 16 bit numbers using 8085 microprocessor?
Write your answer...
Submit
Still have questions?
magnify glass
imp