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...
PLEASE EXPLAIN EACH LINE OF CODE ONLY. USE COMMENTS NEXT TO EACH LINE TO EXPLAIN WHAT...
PLEASE EXPLAIN EACH LINE OF CODE ONLY. USE COMMENTS NEXT TO EACH LINE TO EXPLAIN WHAT EACH IS CODE IS DOING THANKS. PLEASE COPY PASTE AFTER YOURE DONE NOT SCREENSHOT BECAUSE I NEED TO BE ABLE TO EDIT IT THANKS. // MODULE B: Method 2: Embedding an in-line asssembly language module in a C progrmming #include "stdafx.h" #include "stdio.h" #include<iostream> int main () { printf(" Lab_No_01_Getting_Stated_into_x86_Assembly_from_a_C++_program\n"); // Lab number and title here printf(" Module B: Embedding an in-line asssembly language...
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:...
In assembly masm use the code below! Write a program that reverse a string using indirect...
In assembly masm use the code below! Write a program that reverse a string using indirect addressing (may not use the stack - push/pop). The string will be given by the user and be up to 64 characters long INCLUDE Irvine32.inc INCLUDE macros.inc MAX = 64 .data source BYTE MAX DUP('#'),0 destination BYTE LENGTHOF source DUP('*'),0 actual_length DWORD ? ask BYTE "Enter a String: ",0 .code main proc ; ask user for input mov edx, OFFSET ask call WriteString ;...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in BL. Bits 6-7 in BL should be cleared, and AL should be unchanged             Mov al, bl       And 00111111, bl       Write a sequence of two instructions that copies the integer in bits 4-7 from AL register into bits 0-3 of the BL register. Upper 4 bits of AL and BL will be cleared             Shr al, 4       Mov bl,...
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
Follow the instructions below to create a full running Assembly program: Create a ​WORD ​sized array...
Follow the instructions below to create a full running Assembly program: Create a ​WORD ​sized array with ​5​ elements of ​A2D5h ​using the ​DUP​ operator. Move the ​OFFSET ​of this array into register ​ESI​. Move the number of elements in the array initialized using the ​LENGTHOF​ instruction and move it into ECX as your loop counter. Create a ​LOOP​ that adds the value 1F33h to each element. Traverse through the array by adding the size of each element to the...
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
Question 1 Which statement is false about what Data Types defines Question 1 options: What values...
Question 1 Which statement is false about what Data Types defines Question 1 options: What values a variable cannot hold? How much memory will be reserved for the variable? What value a variable will hold? How the program will use the data type? Question 2 Using the structure below, which of the following statements about creating an array (size 20) of structures are not true? struct Employee{     string emp_id;     string emp_name;     string emp_sex; }; Question 2 options:...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT