Problem Statement: 8086 Process
Problem Statement: 8086 Process
Problem Statement: 8086 Process
ID:22295
DEPT:BIO
MICROCOMPUTING REPORT
General purpose registers:
Register Function
AX This is the accumulator. It is 16-bit registers, but it is divided into two 8-bit registers. These
registers are AH and AL. AX generally used for arithmetic or logical instructions, but it is not
mandatory in 8086.
BX BX is another register pair consisting of BH and BL. This register is used to store the offset
values.
CX CX is generally used as control register. It has two parts CH and CL. For different looping
and counting purposes these are used.
DX DX is data register. The two parts are DH and DL. This register can be used in Multiplication,
Input/output addressing etc.
SP This is the stack pointer. The stack pointer points the top most element of the stack. For
empty stack SP will be at position FFFEH.
BP BP is another 16-bit register. This is base pointer register. This register is primary used in
accessing the parameters passed by the stack. It’s offset address relatives to stack segment.
SI This is Source Index register. This is used to point the source in some string related
operations. Its offset is relative to data segment.
DI This is destination index register. This is used to point destination in some string related
operations. Its offset is relative to extra segment.
8086 process :
n this program we will see how to subtract two 16-bit BCD numbers.
Problem Statement
Write 8086 Assembly language program to subtract two 16-bit BCD numbers stored
in memory offset 500H – 501H and 502H – 503H.
Discussion
Here we are adding the 16-bit data byte by byte. At first we are subtracting lower
byte and perform the DAS instruction, then Subtract higher bytes with borrow, and
again DAS to adjust. The final result is stored at location offset 600H, and if borrow
is present, it will be stored at 601H.
We are taking two numbers 8523 - 7496 = 1027
Problem Statement
Write 8086 Assembly language program to add two 16-bit number stored in memory
location 3000H – 3001H and 3002H – 3003H.
Discussion
8086 is 16-bit register. We can simply take the numbers from memory to AX and BX
register, then add them using ADD instruction. When the Carry is present store carry
into memory, otherwise only store AX into memory.
Problem Statement
Write 8085 Assembly language program to divide two 16-bit numbers.
Discussion
8085 has no division operation. To perform division, we have to use repetitive
subtraction. To perform 16-bit division, we have to do the same but for the register
pairs. As the register pairs are used to hold 16-bit data.
The Divisor is stored at location FC00 and FC01, the dividend is stored at FC02 and
FC03. After division, the quotient will be stored at FC04 and FC05, and the
remainder will be stored at FC06 and FC07.
multiply two 8-bit numbers.
Problem Statement
Write 8086 Assembly language program to multiply two 8-bit numbers stored in
memory address offset 500 and 501.
Discussiont
In 8086 there is MUL instruction. So the task is too simple. Here we are taking the
numbers from memory and after that performing the multiplication operation. As 8-
bit numbers are taken, after multiplication AX (16-bit) will store the result.