1 Sample - Answer
1 Sample - Answer
1 Sample - Answer
What will be the value in AX after executing the following instructions? Give the answer
in both hexadecimal and binary.
mov al,15 AX=??0F CL=??
mov ah,15 AX=0F0F CL=??
xor al,al AX=0F00 CL=??
mov cl,3 AX=0F00 CL=03
shr ax,cl AX=01E0 CL=03
add al,90h AX=0170 CL=03 CY=1
adc ah,0 AX=0270
___0270h______________
___0000 0010 0111 0000
Problem 3)
Suppose you had a different processor that was designed and operated similarly to the
8086/8088 architecture with the following differences: All of the registers are 8-bit
registers, and the physical address (PA) is a 10-bit number.
Question A (5 points) Given what you know about the 8086/8088 architecture, what
would be the size of the total addressing space on this new device?
____1KB or 1,024 Bytes___
Question B (5 points) Given what you know about 8086/8088 addressing, what would
be the size of the “offset window” at each segment location through which you could
address memory?
_____256 Bytes__________
Problem 4)
What will be the value in AX after executing the following instructions? Assume that DS
and ES are set up appropriately to access the variable ‘array’. Give the answer in
hexadecimal:
Byte Offset 1 0 3 2 5 4 7 6
array dw 1111h, 2222h, 3333h, 4444h
mov bx,1 BX = 0001
mov si,6 SI = 0006
mov ax,array[bx][si-2]
BX + SI – 2 = 5 ___44 33h______________
mov ax,array[bx][si] ; __55 44h______________
Problem 5)
Consider the following fragment of assembly code:
array dw 7,6,5,4
count dw 4
...
xor ax,ax
stc
mov cx,count
mov si,offset array
label1: adc ax,word ptr [si]
add si,2
loop label1
label2:
Question A:
The body of the loop will execute 4 times (CX = 4). On each pass through the
loop, AX will have the following values:
AX Array[SI] CF
AX = 0 + 7 + 1 = 8
AX = 8 + 6 + 0 = 14
AX = 14 + 5 + 0 = 19
AX = 19 + 4 + 0 = 23 = 17h
a) What will be the value in AX when control reaches label2?
____23 or 17h __________
Question B:
b) What is the purpose of the line:
xor ax,ax
_It zeroes the AX register._______
Question C:
c) Write an efficient and functionally equivalent code segment for the
line:
loop label1
DEC CX
CMP CX, 0
JNZ label1
Problem 6)
What will be the final value of AX in this example?
mov ax,0
mov cx,10 ; outer loop counter
L1:
mov ax,3
mov cx,5 ; inner loop counter
L2:
add ax,5
loop L2 ; repeat inner loop
loop L1 ; repeat outer loop
Problem 7)
Write a single intel instruction to replace each of the following.
Choice:
1.Covert 215D to binary ( )。
① 11101010B ②11101011B ③11010111B ④11010110B
①(Y)=27H,(Y+1)=2FH ②(Y)=7BH,(Y+1)=0FH
② (Y)=39,(Y+1)=63 ④(Y)=63,(Y+1)=39
8. suppose:VAR DW 1,2,$+2,5,6
The offset of VAR is 0010H,(0014H)=( ).
① 2H ②4H ③6H ④16H
9. To reserve a 200 bytes for BUFFER, which instruction is correct? ( d )
a. BUFFER DW 200 DUP(?) b. BUFFER DB 200
c. BUFFER DD 200 DUP(?) d. BUFFER DB 200 DUP(?)
11.(CS)=3000H,(DS)=4000H,(ES)=2000H,(SS)=5000H,(AX)=2060H,
(BX)=3000H,(CX)=0005,(DX)=0,(SI)=2060H,(DI)=3000H,(43000H)=0A006H,
(23000H)=0B116H,(33000H)=0F802H,(25060H)=00B0H,(SP)=0FFFEH, (CF)=1,
What will be the value in registers after executing the following instructions?
1.SBB AX,BX; AX=___f05f____cf=1
2.XOR BX,0FFE7H; BX= CFE7______
3.SAR AX,CL; AX=_0103_______
4.JMP WORD PTR[BX]; IP=___0A006H _____
5.XCHG AX,ES:[BX+SI]; AX=___00B0_____
Programming: