Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) What will be the value of EAX when the following sequence of instructions has

ID: 3554824 • Letter: 1

Question

1) What will be the value of EAX when the following sequence of instructions has executed?

push 5

push 10

push 20

pop eax

2) What will be the value of EAX when the following sequence of instructions has executed?

push 5

push 10

pop ebx

pop eax

3) Code a PROC declaration for a procedure named MySub. Use the USES operator to preserve the EAX and EBX registers.

4)Code a label named Here that can be the target of a jump instruction origination in a different procedure

5) Write a sequence of statements that read a singed integer from standard input and write the same integer to standard output. Use library procedures.

6) Given the following string definition, write a sequence of statements that write the string to standard output. Use a library procedure

            Strl BYTE

Explanation / Answer

1) What will be the value of EAX when the following sequence of instructions has executed?

push 5

push 10

push 20

pop eax

2) What will be the value of EAX when the following sequence of instructions has executed?

push 5

push 10

pop ebx

pop eax

3) Code a PROC declaration for a procedure named MySub. Use the USES operator to preserve the EAX and EBX registers.

DumpRegs - Displays the EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP, EFLAGS, and EIP registers in hexadecimal. Also displays the Carry, Sign, Zero, and Overflow flags.

4)Code a label named Here that can be the target of a jump instruction origination in a different procedure

if(allocated_size*4 > 10000) {
cout << " Can not allocate more, the upper limit reached! ";
break;

This code will  jump instruction origination in a different procedure

5) Write a sequence of statements that read a singed integer from standard input and write the same integer to standard output. Use library procedures.

size = prompt4Size(user_array_size, allocated_size);
re_allocated_size = size;
if(size > user_array_size){
for(int i=user_array_size; i<size;i++)
*(iProgMemPtr+i) = 0;

6) Given the following string definition, write a sequence of statements that write the string to standard output. Use a library procedure

            Strl BYTE