Lab Manual 5

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Lab Manual # 05

Advance use addressing modes in different language programs using EMU8086.

Task1: Run the following code and observe the registers/ memory locations:
org
0x100
mov
ax,10
mov
bx,10
mov [200h],
ax mov
[201h], bx ret
TASK 2: Write a code to add first ten natural numbers starting from the memory location 0200H?
ORG 0X100
BLOCK1 DB 160 DUP(?)
DB 01H,02H,03H,04H,05H,06H,07H
LEA SI, BLOCK1
MOV DI, 200H
MOV CX, 10
LOOP1:
MOV BX, [SI]
MOV AL, [BX+DI]
ADD [DI],BX
MOV [BX+DI], AL
INC SI
INC DI
LOOP LOOP1
END
TASK 3: Write a code to transfer a block of data from source memory block to destination memory
block. Use any starting address.
MOV SI, 100H
MOV BP, 200H
MOV AX, 1
MOV CX, 5
START: //Loop starts
MOV [SI], AX
TASK 4: Write a code to perform addition on 8-bit data stored in consecutive memory locations
(10) and store result in next memory locations. Use any starting address.

ORG 0X100
ARRAY1 DB 160 DUP(?)
DB 02H,04H,06H,08H,10H,12H
MOV BX, OFFSET ARRAY1
MOV DI, 200H
MOV SI, 210H
MOV CX, 10
LOOP:
MOV AL, [BX+DI]
ADD AL, [BX]
INC [BX]
INC DI
MOV [BX+DI], AL
MOV [BX+SI], AL
LOOP LOOP1
END

You might also like