Question

After running the program below, what will be the values in registers EAX and EBX? mov...

After running the program below, what will be the values in registers EAX and EBX?

mov EAX,0123ABCDh

      mov EBX,4455AABBh

      PUSH BX

      PUSH AX

      POP AX

      POP BX

Question 2 options:

EAX=ABCD 0123 EBX=AABB4455

EAX= ABCD0123 EBX=4455AABB

EAX=0123ABCD   EBX=4455AABB

EAX=ABCD0123    EBX=AABB4455

Homework Answers

Answer #1

Correct Answer:

Explanation:

A stack is a linear data structure in which insertion and deletion operation performed at the top always.

The first two statements load the register EAX and EBX as given below:

EAX = 0123ABCD

EBX = 4455AABB

The register AX and BX have the lower 16 bits of the register EAX and EBX respectively as given below:

AX = ABCD

BX = AABB

The PUSH operation will push the content of the register BX onto the stack, the second PUSH operation push the content of the register AX onto the stack, and the status for the stack after the third instruction will be as given below:

PUSH AX

The fourth instruction POP operation will pop the top element from the stack and load the register AX.

POP AX

The fifth instruction POP operation will pop the top element from the stack and load the register BX.

POP BX

Now, the stack will be empty and the content in the register AX and BX will be as given below:

AX = ABCD

BX = AABB

So, the status of the register EAX and EBX will be as given below:

EAX = 0123ABCD

EBX = 4455AABB

So, only the third option is correct.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
;Assembly x86-64 ;Q9: What is the value of eax (in decimal) after the function call in...
;Assembly x86-64 ;Q9: What is the value of eax (in decimal) after the function call in _start returns? global _start _start: mov edi, 4 call function1 global function1 function1: push rdi inc edi mov esi, 2 call function2 pop rdi mul edi ret global function2 function2: mov eax, edi mov edx, 0 div esi add eax, edi add eax, edx ret ;Q10: A function uses 10 integer arguments. What is the appropriate value for the blank operand to clear the...
7. (True/False): Nested procedure calls are not permitted by the Microsoft assembler unless the NESTED operator...
7. (True/False): Nested procedure calls are not permitted by the Microsoft assembler unless the NESTED operator is used in the procedure definition. 15. What will be the final value in EAX after these instructions execute? push 5 push 6 pop eax pop eax 3. Which instruction pops the stack into the EFLAGS register? 17. Which statement is true about what will happen when the example code runs? 1: main PROC 2: mov eax,30 3: push eax 4: push 40 5:...
13. (True/False): The register list in the USES directive must use commas to separate the register...
13. (True/False): The register list in the USES directive must use commas to separate the register names. 11. (True/False): The USES operator lets you name all registers that are modified within a procedure. 2. Which instruction pushes the 32-bit EFLAGS register on the stack? 18. Which statement is true about what will happen when the example code runs? 1: main PROC 2: mov eax,40 3: push offset Here 4: jmp Ex4Sub 5: Here: 6: mov eax,30 7: INVOKE ExitProcess,0 8:...
Consider the program below The initial value of the Stack Pointer ESP = 0018 FF8C. What...
Consider the program below The initial value of the Stack Pointer ESP = 0018 FF8C. What is the value of the STACK POINTER (ESP) after each CALL instruction and each RET instruction below. INCLUDE Irvine32.inc .DATA .CODE main PROC mov ax,val1 call proc1 (1) ESP=____________(After the CALL) nop exit main ENDP proc1 PROC ;Begin Procedure nop call proc2 (2) ESP=____________(After the CALL) nop ret (3) ESP=____________(After the RET) proc1 ENDP proc2 PROC ;Begin Procedure nop call proc3 (4) ESP=___________(After the...
1) Given the code below: What will be the resulting value of the Sign Flag (SF),...
1) Given the code below: What will be the resulting value of the Sign Flag (SF), and the Zero Flag (ZF) and will the Jump occur or will the Jump NOT occur? mov ax,0h cmp ax,0fh js loop1 Question 1 options: SF=1 ZF=0 JUMP WILL NOT OCCUR SF=1 ZF=0 JUMP WILL OCCUR SF=0 ZF=0 JUMP WILL OCCUR SF=0 ZF=1 JUMP WILL NOT OCCUR
Please write the code in Python. Write a program/function in any Object-Oriented programming language that will...
Please write the code in Python. Write a program/function in any Object-Oriented programming language that will implement Queue Abstract Data Type with the following functions/methods.  Any build-in/pre-defined Queue function/library (e.g., java.util.Queue in Java) is NOT allowed to use in your code. push(Element):  insert the input Element (e.g., String or Integer in Java) to the end of the queue. pop(): remove the head element of the queue and print the head element on screen. count():  return the total number of elements in the queue...
Assume all memory locations start with unknown values. What is the contents of memory after this...
Assume all memory locations start with unknown values. What is the contents of memory after this program runs? addiu $t0, $zero, 8 addi $t1, $t0, 1 sw $t1, -4($t0) addi $t1, $t0, -4 sw $t1, 4($t0) Match the options with these mem locations. 0x0: 0x4: 0x8: 0xC: 0x10: 0x14: Options to match with mem adress 12 -4 4 5 0 9 unknown 1
I. What value will be in register r2 after execution of the following instructions? Show your...
I. What value will be in register r2 after execution of the following instructions? Show your work with the register values after executing each instruction. MOV r2, #0x0 LDR r1, =0xCF MOVS r1, r1, LSR #1 ADC r2, r2, #0 MOVS r1, r1, LSR #1 ADC r2, r2, #0 II. Assume a 32 bit register holds a data of four bytes as B3B2B1B0. Write a sequence of ARM instruction that takes this data as input and swaps the bytes 0...
in assembly 1. Real mode allows access to memory below which memory address? 2. Under real...
in assembly 1. Real mode allows access to memory below which memory address? 2. Under real and protected mode, the far jump modifies the current instruction address by changing which register or registers? 3. Under real and protected mode, the near jump modifies the current instruction address by changing which register or registers? 4. Under real mode, briefly explain what happens when the PUSH BX instruction executes. Make sure to show where BH and BL are stored. Assume that initially...
In the main(), below, write a program that prompts for (1) how many values to sum,...
In the main(), below, write a program that prompts for (1) how many values to sum, and then (2) uses a summing loop to prompt for and add up 5 numbers. #include <iostream> #include <iomanip> using namespace std; int main() {     < your answer goes here> return 0; }