Question: Consider the following code and answer the questions that follow. #include extern C { unsigned long _ _ stdcall mode ( _ _

Consider the following code and answer the questions that follow.
#include
extern "C"
{
unsigned long __stdcall
mode(__int64*,__int64);
}
int main(int argc, char* argv[])
{
_int64 A[]={1,2,3,4,5,6};
_int64 B = mode(A,3);
printf("
B:%ld", B);
return 0;
}
.data
D QWORD 1,2,3,4,5,6,7,8
.code
mode PROC C
//A
;mov rax, [D+16]
;and rax, 3
//B
;mov rax,-1
;and rax,11
;shr rax,1
//C
;mov rax,8[8*rdx+rcx]
//D
;xor rax,rax
;add rax,rdx
//D stops here
RET
mode ENDP
end
A
(i) Name the addressing mode used by each highlighted
line [A to D].
(ii) Predict the value printed to screen when each
highlighted section of code [A to D] is run separately.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!