Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions