0% found this document useful (0 votes)
3K views5 pages

Addition of Two 8-Bit Numbers With Indirect Addressing Mode

The document contains examples of 8086/8088 assembly language code demonstrating various operations including: addition and subtraction of 8-bit and 16-bit numbers; finding the largest/smallest number in an array; multiplication and division; BCD arithmetic; matrix addition/subtraction; and moving a block of data.

Uploaded by

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

Addition of Two 8-Bit Numbers With Indirect Addressing Mode

The document contains examples of 8086/8088 assembly language code demonstrating various operations including: addition and subtraction of 8-bit and 16-bit numbers; finding the largest/smallest number in an array; multiplication and division; BCD arithmetic; matrix addition/subtraction; and moving a block of data.

Uploaded by

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

1.

Addition of two 8-bit numbers with indirect addressing mode

MOV SI, 1200


MOV AL,[SI]
INC SI
ADD AL,[SI]
INC SI
MOV [SI],AL
HLT

2. Floating point addition

MOV AL, 66h


MOV BL, 33h
ADD AL, BL
MOV SI, 1100h
MOV [SI], AL
HLT

;OUTPUT: 99
;FLOATING POINT OPERATION:(Q8 FORMAT)
;INPUT:
;FLOAT HEX
;0.2 0.2*256=51.2D=33H
;0.4 0.4*256=102,4D=66H
;OUTPUT:
;HEX DECIMAL FLOAT
;99 153 153/256=0.6

3. Smallest number in an array

MOV SI, 1500H Initialize array size


MOV CL,[SI] Initialize the count
INC SI Go to next memory location
MOV AL,[SI] Move the first data in AL
DEC CL Reduce the count
L2: INC SI Move the SI pointer to next data
CMP AL,[SI] Compare two data’s
JB L1 If AL > [SI] then go to L1 ( no swap)
MOV AL,[SI] Else move the large number to AL
L1: DEC CL Decrement the count
JNZ L2 If count is not zero go to L2
MOV [2000], AL Else store the biggest number in 2000 location
HLT Stop the program
4. Perform addition of two array using 8086 microprocessor (MATRIX ADITION
PROGRAM)

5. Largest number

MOV SI, 1500H Initialize array size


MOV CL,[SI] Initialize the count
INC SI Go to next memory location
MOV AL,[SI] Move the first data in AL
DEC CL Reduce the count
L2: INC SI Move the SI pointer to next data
CMP AL,[SI] Compare two data’s
JNB L1 If AL > [SI] then go to L1 ( no swap)
MOV AL,[SI] Else move the large number to AL
L1: DEC CL Decrement the count
JNZ L2 If count is not zero go to L2
MOV [2000], AL Else store the biggest number in 2000 location
HLT Stop the program

6. 8-bit multiplication using MASM

code segment
assume cs:code,ds:code
org 1000h
start:
MOV DI,3000H
mov al,04h
mov bl,03h
mul bl
mov [DI],ax
hlt
mov ah,4ch
int 21h
code ends
end start
end

7. 8-bit addition using MASM software.

code segment
assume cs:code,ds:code
org 1000h
start:
mov al,15h
add al,30h
mov si,2000h
mov [si],al
hlt
mov ah,4ch
int 21h
code ends
end start
end

8. 16-bit addition in ‘Indirect addressing mode’

MOV SI, 1200


MOV AX,[SI]
INC SI
INC SI
ADD AX,[SI]
INC SI
MOV [SI], AX
HLT

9. Perform BCD subtraction


MOV AL,[1100]
SUB AL, [1101]
DAS
MOV [1200],AL
HLT

10. Division of 16/8 bit number


DIV BL Divide word in AX by byte in BL; Quotient in AL, remainder in AH

MOV DI,2000H
MOV AX,0008H
MOV BL,02H
DIV BL
MOV [DI],AX
HLT
11.BCD arithmetic using MASM

code segment
assume cs:code,ds:code
org 1000h
start:

MOV SI,2000
MOV AL,06H
ABB AL, 07H
DAA
MOV [SI],AL
HLT
mov ah,4ch
int 21h
code ends
end start
end

12. DAC INTERFACING

TRIANGULAR WAVE:

L3: MOV BL,00h


L1: MOV AL,BL
OUT C8,AL
INC BL
JNZ L1
MOV BL,FFh
L2: MOV AL,BL
OUT C8,AL
DEC BL
JNZ L2
JMP L3

12. Perform matrix addition and subtraction using 8086 using MASM.

13. Move a block of 5 bytes from source to destination using MASM.

You might also like