You are on page 1of 4

Lab Manual# 06

Task1:
Take two binary numbers such as11111111 & 11111111
Perform two’s complement of the first number and save it to register. Then, reverse the bits of
second binary number and save it to the other register.
a) Take the value 0 in third register and perform the AND operation with both results
computed above.
b) Take the value 1 in third register and perform the AND operation with both results
computed above.
MOV AX, 11111111B
MOV BX, 11111111B
NOT AX
ADD AX, 1B
NOT BX
MOV CX, AX
MOV DX, BX
AND AX, 0B
AND CX, 0B
AND CX, 1B
AND DX, 1B
TASK 2:
a) Division of 8-bit numbers using immediate addressing mode.
b) Write a code to perform multiplication on 16-bit numbers in consecutive memory
locations?
c) Write a code to add 16-bit numbers and find the average of numbers?
LEA SI, ARRAY
MOV AL, 10
MOV BL, 2
DIV BL
MOV [150H], AX
MOV AX, 250
MOV BX, 350
MUL BX
MOV [152], AX
MOV CX, 4
MOV AX, 0
MOV BL, [SI]
LOOP1:
ADD BL, [SI+1]
INC SI
LOOP LOOP1
MOV AL, BL
MOV BH, 5
DIV BH
MOV [154], AX
RET

ARRAY DB 1,2,3,4,5
TASK 3:
Translate the high-level language assignment statement:
A=5×A+12×B
Let A and B be word variables and suppose there is no overflow.
MOV AX, 05H
MOV BX, 0AH
MUL BX
MOV CX, AX
MOV AX, 12H
MOV DX, 0B
MUL DX
ADD AX, CX
RET

You might also like