Professional Documents
Culture Documents
vidhan.docx
vidhan.docx
vidhan.docx
2.
a. Add two 8-bit Numbers with and
without a carry
b. Add two 16-bit Numbers with and
without a carry
c. Subtract two 8-bit Numbers with and
without a borrow
d. Subtract two 16-bit Numbers with and
without a borrow
3.
Theory-
The instruction is to load data from memory 1000 into
the AX register and data from memory 1002 into the
BX register. The value 00h is loaded into the CL
register as a carry flag. Then, BX is added to the
accumulator AX and a jump is performed based on
the carry result. If a carry is present, CL is
incremented by
1. Finally, the data in the CL register is moved to
memory address 1015 and the operation is stopped.
Code-
mov al,[1000h]
mov bl,[1001h]
mov cl,00h
add al,bl
mov [1007h],al
jnc shreyas
inc cl
shreyas:
mov [1009h],cl
hlt
With Carry-
Without carry-
AIM - Write a program to add a two 16 bit
numbers with and without carry
Theory-
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.
Codes-
mov ax,[1000h]
mov bx,[1002h]
mov cl,00h
add ax,bx
mov
[1012h],ax Jnc
shreyas
inc cl
shreyas:
mov [1009h],cl
hlt
Without carry-
With carry-
Experiment -3