1. Suppose that you are given the following partial data segment, which starts a
ID: 666291 • Letter: 1
Question
1.
Suppose that you are given the following partial data segment, which starts at address 0x0700 :
.data
idArray DWORD 1800, 1719, 1638, 1557, 1476, 1395, 1314, 1233, 1152, 1071, 990
u DWORD LENGTHOF idArray
v DWORD SIZEOF idArray
2.
What value does EAX contain after the following code has executed? (Ignore the .0000 that Canvas sticks on the end)
mov esi, OFFSET idArray
mov eax, [esi+2*TYPE idArray]
Assume that your program has access to the following data segment (starting at address 0x310):
.data
id DWORD 7
matrix WORD 50 DUP(10 DUP(?))
3.
Suppose that you are given the following partial data segment, which starts at address offset 0x1000 :
.data
idArray WORD 3546, 1534, 12, 3481, 154, 6423
x DWORD LENGTHOF idArray
y DWORD SIZEOF idArray
z DWORD TYPE idArray
z contains what value, in decimal?
4.
Given the following array declaration, how many bytes of memory does array matrix require? (in decimal - ignore the .0000 from Canvas)
.data
matrix WORD 15 DUP(43 DUP(?))
5.
Which of the following postfix expressions corresponds to the given infix expression?
(13 + 14 - 3 + 2) / 2 ^ 3
6.
Which of the following infix expressions corresponds to the given postfix expression?
4 5 + 5 ^ 3 4 / -
Explanation / Answer
(1)
The below instruction describes the MOV operation.
MOV esi, OFFSET idArray .
MOV eax, [esi+7*TYPE idArray]
So, the value at eax will be 1233.
(2)
Matrix starts with [1][1].
[6] Rows contains 20 elements.
[3]-[1] = 2 columns .
Base address is 0X310 and its have 44 bytes then
Thus the correct option is 0X350
(4)
It contains Array of memory 15 * 43 elements.
The memory of the requires array matrix is 1290 bytes.
(5)
(13 + 14 - 3 + 2) / 2 ^ 3 these infix expression converted into postfix expression
Thus the correct answer is 13 14 + 3 2 + - 2 3^ /
(6)
4 5 + 5 ^ 3 4 / - the post fix expression will be converted into infix expression.
Thus the correct answer is (4+5)^5 -3/4
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.