Question
Assembly language Consider the following data segment .data Val WORD 1AFEh, 3EF9h 1. The mov ax, [val+1] instruction will store the value A. 1A into
Assembly language
Consider the following data segment
.data
Val WORD 1AFEh, 3EF9h
1. The mov ax, [val+1] instruction will store the value
A. 1A into ax
B. FE intto ax
C. F91A intoto ax
D. FE3E intoto ax
2. suppose that AX has the value from 1. add al, 5 instruction will store
A. 1F into AL
b. 43 into AL
c. 03into AL
D. FC into AL
3. mov IP, 0FEDh is an invalid instruction because
A. IP cannot be the source
B. IP is not a register
C. The operands are of different size
D. IP cannot be the destination
4. mov var1, var2 - where var1 and var2 are mem 16 - instruction is
A. valid because you can use mov with two mem 16 operands
B. invalid because you cannot use mov with two mem operands
C. invalid because var1 and var2 are not mem32
D. valid because the two operands are not imm
5. movzx ESI, 33 instruction
A. is an invalid because ESI register cannot be the source
B. is an invalid because ESI register cannot be the destination
C. is an invalid because 33 is an immediate value
D. will be valid if movzx is replaced with mov
6. xchg ax, var1 instruction - var1 is mem 16 will
A. swap the values of var1 and register ax
B. not assemble because ax is 32-bit
C. not assemble because var1 is mem 16
D. set the Carry Flag
E. A and D
Consider the following Code
.data
array1 WORD 10 DUP(?),0,0
array2 DWORD 4 DUP(3 DUP(?))
noArrSize = ($ - array1) ; Line 0
.code
mov ECX, LENGTHOF array 1 ;Line 1
mov EBX, SIZEOF array2 ; Line2
mov EAX, TYPE array1 ;Line3
7. Line 0 will store into noArrSize the decimal value
A . 12
B. 24
C. 48
D. 72
8. Line 1 instruction will store
A. 10 into ECX
B. 12 into ECX
C. DWORD into ECX
D. 48into ECX
9. Line 2 instruction will store
A. 8 in EBX
B. 12 in EBX
C. 24 in EBX
D. 48 in EBX
10. Line 3 instruction will store
A. WORD into EAX
B. 2 into EAX
C. 4 into EAX
D. 12 into EAX
11. The 16- bit hexadecimal representation of the signed number - 13647
A. 7CAB
B. 6BAC
C. CAB1
D. CAB24
Consider the following data section
.data
var1 SBYTE -4, -3, 3, 1
12. The instruction mov al, var1 will load the hexadecimal number _____ to AL register
A. FC
B. FFCF
C. FD
D. 1
13. The INC instruction can set the carry flag
A. true
B. false
14. The NEG instruction can set the overflow flag
A. True
B. false
Consider the following
.data
myWords WORD 8Ah, 3Ch, 0ABh, 0CDh, 3400h
myVar BYTE 0f1h, 58h
,code
mov esi, OFFSET myWords
mov ac, [esi] ; Line 1
mov esi,3
mov ax [myWords + esi] ; Line 2
mv bx, WORD PTR [myVar -3] ; Line 3
15. Line 1 is an example of
A. indirect addressing
B. indexed addressing
C> register addressing
D. direct addressing
16. Line 2 is an example of
A. indirect addressing
B. indexed addressing
C> register addressing
D. direct addressing
17. Line 3 will store into BX the number
A. -3
B. 581Fh
C. 0000h
D. AB00h
18. when adding two negative numbers and the result is positive
A. The overflow flag will be set
B. the sign flag will be set C. The carry flag will be equal to 2
D. the ESL register will be set to 0
19 .code and .data are
A.instructions
B.operators
C.directives
D.labels
20. in real address mode, the register that controls the loop structure is
A. CX
B. CL
C.CH
D. ECX
21 A JMP instruction is a type of an unconditional transfer
A. true
B. Flase
22. MOV BX, 7Fh followed by MOVSX EBX, BX will move to EBX the value
A. 0000007Fh
B. FFFFFF7Fh
C. 1111117Fh
D. 7F000000h
23. the destination operand of a MOV instruction cannot be a segment register
A. true
B. false
24. The LOOP instruction first checks to see whether ECX is not equal to zero; then LOOP decrements ECX and jumps to the destination label
A. true
B. false
25. The OFFSET operator always returns a 16-bit value
A. true
B. false
Consider the following code
mov ecx, -5
x2:
inc ax // Line 1
Loop X2
26. The loop above
A. will create an infinite loop
B. will not assemble
C. will run 5 times
D. will run 2^32 +5 times
E. will run 2^32 -5 times
27. the loop
A. will create an infinite loop
B. will not assemble
C. will run 5 times
D. will run 2^32 +5 times
E. will run 2^32 -5 times
28. The target a LOOP instruction must be within 256 bytes of the current location
A.True
B. Flase
29 a JMP instruction can only jump to a label inside the current procedure.
A. True
B. False
30. implement the following expression in assembly language, using 32 bite integers (you may modify any registers you wish): dword1 is a 32-bit in size
eax = -dwird1 +ebx - ecx
31. using the code below finish implementing the following expression in assembly language, (you may not modify any of the variables - except Rval-:)
Rval = -Xval + (-Yval - Zval)
.Data
Rval DWORD?
xVal DWORD 34h
yVal DWORD 52h
zVal DWORD 10h
.code
main Proc
; you code goes here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started