Professional Documents
Culture Documents
Laboratory Manual: For Computer Organization and Assembly Language
Laboratory Manual: For Computer Organization and Assembly Language
Laboratory Manual
for
Example 3.1: Assemble the given program and give Estimated completion time:20 mins
answers the questions given below.
4. Find out the offset address of W_VAR2 and COUNT from memory1?
The offset address of W_var2 is 00AD4001. As count is symbolic constant so it occupy no
memory. Its offset is unable to compute.
Example 3.2: Assemble the given program and give Estimated completion time:20 mins
answers the questions given below.
1. What is the value of BX register after instruction MOV BX, WORD PTR D_ARRAY3+1 and
give a brief explanation?
The value of bx is 3456. The data directive of array3 is dd. When we add array3+1 it move
byte next and start point 56. Bx is of 16 bits(2 bytes). We use ptr with data
directive of word so it move 3456 to bx.
2. After the execution of whole program write down the updated value of array NUM2 and
NUM1?
value of num1 is 0330.
Value of num2 is 340010.
val1 SDWORD 8
val2 SDWORD -15
val3 SDWORD 20
include irvine32.inc
.data
val1 sdword 8
val2 sdword -15
val3 sdword 20
.code
main PROC
neg val3
mov eax,val3 ;FFFFFFEC
add eax,7 ;FFFFFFF3
sub eax,val2 ;00000002
add eax,val1 ;0000000A
exit
main endp
end main
.data
x
.data
uarray WORD 1000h, 2000h, 3000h, 4000h
sarray SWORD -1, -2, -3, -4
.code
main PROC
jmp asad
asad1:
mov ax,uarray
mov bx,uarray+2
mov cx,uarray+4
mov dx,uarray+6
mov eax,-1
mov ebx,-1
mov ecx,-1
mov edx,-1
mov ax,sarray
mov bx,sarray+2
mov cx,sarray+4
mov dx,sarray+6
exit
asad:
mov eax,0
mov ebx,0
mov ecx,0
mov edx,0
jmp asad1
main endp
end main