Question

After the following MASM code is executed: MOV EAX, 212 MOV EBX, 19 CDQ DIV EBX...

After the following MASM code is executed:

  MOV   EAX, 212
  MOV   EBX, 19
  CDQ
  DIV   EBX

What is the value in the EAX register (in decimal)?
What is the value in the EBX register (in decimal)?
What is the value in the EDX register (in decimal)?

Homework Answers

Answer #1

Please up vote ,comment if any query .

Answer :

EAX =11

EBX = 19

EDX = 3

Explanation :

MOV EAX ,212 ; this instruction copy value 212 immediate value into EAX register EAX = 212

MOV EBX ,19 ; This instruction copy immediate value 19 into EBX register EBX = 19

CDQ ; this instruction convert 32 bit EAX to 64 bit EDX : EAX by copying sign bit (bit 31 ) of EAX to every bit position 0 to 31 of EDX

Suppose sign bit bit 31 is 1 of eax register so edx

EDX = FFFFFFFFh

In our program

EAX = 212 0000 0000 0000 0000 0000 0000 1101 0100 in binary

Sign bit is 0 of eax register

EDX = 00000000h

EDX : EAX = 00000000h : 000000D4 h

Next instruction

DIV EBX

this instruction divide the value of EDX : EAX by EBX

EDX : EAX / EBX

Reminder in EDX

Quotient stored in EAX

212/19 quotient = 11 reminder =3

EDX = 3

EAX = 11

EBX = 19

Please upvoe . Comment if any query .

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
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 ;...
;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...
A) Is the code below secure? Explain your rationale. ExitProcess PROTO .data firstval qword 20002000h secondval...
A) Is the code below secure? Explain your rationale. ExitProcess PROTO .data firstval qword 20002000h secondval qword 11111111h thirdval qword 22222222h sum qword 0 .code main proc      mov rax,firstval                         add rax,secondval             add    rax,thirdval      mov    sum,rax      mov    ecx,0      invoke ExitProcess main endp end main b) Transmitted messages often include a parity bit, whose value is combined with a data byte to produce an even number of 1 bits. Suppose a message byte in the AL...
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,...
What would be the result after the following code is executed? final int SIZE = 25;...
What would be the result after the following code is executed? final int SIZE = 25; int[] array1 = new int[SIZE]; // Code that will put values in array1 int value = 1; for (int a = 0; a < array1.length; a++) { array1[a] = value; value = value + array1[a]; }
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:...
Consider the following data segment .data array1 WORD 10 DUP(?),0,0 array2 DWORD 4 DUP(3 DUP(?)) What...
Consider the following data segment .data array1 WORD 10 DUP(?),0,0 array2 DWORD 4 DUP(3 DUP(?)) What decimal value the instruction : mov EBX , SIZEOF array2 stores in EBX. Show your work for full credit.
The following command has been successfully executed: Create Sequence EmpSeq; The following block of PL/SQL code...
The following command has been successfully executed: Create Sequence EmpSeq; The following block of PL/SQL code is executed: Begin     dbms_output.put_line(EmpSeq.NextVal); End; How many of the following statements are false: The anonymous block increments the sequence The anonymous block retrieves the next value from the sequence The anonymous block resets the sequence The anonymous block will not output anything
Please answer as soon as possible What's the contents of newNumbers after the following code is...
Please answer as soon as possible What's the contents of newNumbers after the following code is executed? val numbers = Array(2.5, 1, 3.2, 9.3, 2, 9, 1.5) val newNumbers = numbers.map(_.toInt)
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...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT