Question

In: Computer Science

Understanding Assembly Language. For each problem, show the contents or setting of the requested items after...

Understanding Assembly Language. For each problem, show the contents or setting of the requested items after executing the instructions.

mov eax, 0FFFFFBFDh ; i.e., -1027

mov ebx, -16        ; i.e., FFFFFFF0h

mov edx, 0

idiv bl

Show the hexadecimal digits in eax:_______________

Show the hexadecimal digits in edx:_______________

mov eax, 0FFFFFBFDh ; i.e., -1027

mov ebx, -16        ; i.e., FFFFFFF0h

mov edx, 0

cwd

idiv bx

Show the hexadecimal digits in eax:_______________

Show the hexadecimal digits in edx:_______________

mov eax, 0FFFFFBFDh ; i.e., -1027

mov ebx, -16        ; i.e., FFFFFFF0h

mov edx, 0

cdq

idiv ebx

Show the hexadecimal digits in eax:_______________

Show the hexadecimal digits in edx:_______________

Solutions

Expert Solution

mov eax, 0FFFFFBFDh ; i.e., -1027 => eax = 0xFFFFFBFD => ax = 0xFBFD

mov ebx, -16; i.e., FFFFFFF0h => ebx = 0xFFFFFFF0 => bl = 0xF0

mov edx, 0 => edx = 0x00000000

idiv bl =>

=> al = ax/bl = 0xFBFD / 0xF0 = 0x40

=> ah = ax%bl = 0xFBFD % 0xF0 = 0x03

Show the hexadecimal digits in eax: 0xFFFF0340

Show the hexadecimal digits in edx: 0x00000000

mov eax, 0FFFFFBFDh ; i.e., -1027 => eax = 0xFFFFFBFD => ax = 0xFBFD

mov ebx, -16 ; i.e., FFFFFFF0h => ebx = 0xFFFFFFF0 => bx = 0xFFF0

mov edx, 0   => edx = 0x00000000

cwd => Sign Extend AX into DX => dx:ax = 0xFFFFFBFD

idiv bx =>

=> ax = dx:ax/bx = 0xFFFFFBFD / 0xFFF0 = 0x0040‬

=> dx = dx:ax%bx = 0xFFFFFBFD % 0xFFF0 = 0x0003

Show the hexadecimal digits in eax: 0xFFFF0040

Show the hexadecimal digits in edx: 0x00000003

mov eax, 0FFFFFBFDh ; i.e., -1027 => eax = 0xFFFFFBFD

mov ebx, -16; i.e., FFFFFFF0h  => ebx = 0xFFFFFFF0

mov edx, 0   => edx = 0x00000000

cdq => Sign Extend eax into edx => edx:eax = 0x00000000FFFFFBFD

idiv ebx =>

=> eax = edx:eax/ebx = 0x00000000FFFFFBFD / 0xFFFFFFF0 = 0x00000040‬

=> edx = edx:eax%ebx = 0x00000000FFFFFBFD % 0xFFFFFFF0 = 0x00000003

Show the hexadecimal digits in eax:  0x00000040‬

Show the hexadecimal digits in edx: 0x00000003


Related Solutions

How would you go about creating a subroutine in MARIE assembly language that swaps contents between...
How would you go about creating a subroutine in MARIE assembly language that swaps contents between two memory locations? In this instance the contents for each memory location are names
Show the contents of the array after the fourth iteration of selectionSort Your answer should be...
Show the contents of the array after the fourth iteration of selectionSort Your answer should be 4 lines The array values horizontally for iteration 1 The array values horizontally for iteration 2 The array values horizontally for iteration 3 The array values horizontally for iteration 4
Write a sequence of assembly language instructions to subtract each entry of an array A of...
Write a sequence of assembly language instructions to subtract each entry of an array A of five two’s complement 16-bit binary integers from the corresponding entry of an array B of five two’s complement 16-bit binary integers and construct a third array C of two’s complement 16-bit binary integers. i.e. C[i] = A[i] - B[i]. Use the following data for the arrays A and B. A: 10, -15, 20, 4, -5 B: 25, -5, -30, 6, 10 please answer in...
The language is Assembly Language. Thank you! Assignment 3: Run the following code. Record what each...
The language is Assembly Language. Thank you! Assignment 3: Run the following code. Record what each of the flag changes are for each command. INCLUDE Irvine32.inc .data .code main PROC mov al,255 add al,1 call DumpRegs sub al,1 call DumpRegs sub al,1 call DumpRegs exit main ENDP END main
Assembly Language 2. Suppose the processor is executing at the fix speed 755MHz. After how much...
Assembly Language 2. Suppose the processor is executing at the fix speed 755MHz. After how much time will the 32-bit counter overflow?   3. What exactly happens when “ret” (asm) or “return” (C++) executes? 4. What is the precise name of the greatest program ever built in assembly language?
Microsoft Visual C++ Assembly language Problem 3. Write a program that uses a loop to calculate...
Microsoft Visual C++ Assembly language Problem 3. Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 2, … Fib(n) = Fib(n-1) + Fib(n-2). Place each value in the EAX register and display it with a call DumpRegs statement inside the loop For example: Fib(1) = 1, Fib(2) = 2, Fib(3) = Fib(1) + Fib(2) = 3, Fib(4) = Fib(2) + Fib(3)...
Assembly Language Programming Exercise. Problem # 1: 1. Integer Expression Calculation( 5 pts ) Using the...
Assembly Language Programming Exercise. Problem # 1: 1. Integer Expression Calculation( 5 pts ) Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the following expression, using registers: A = (A + B) − (C + D). Assign integer values to the EAX, EBX, ECX, and EDX registers.
Using MIPS (MARS) - Assembly Language Assignment ( PLEASE USE COMMENTS TO DESCRIBE EACH STEP )...
Using MIPS (MARS) - Assembly Language Assignment ( PLEASE USE COMMENTS TO DESCRIBE EACH STEP ) Take input of name, the input of hours worked, and input of hourly wage, and use input of hourly wage and hours worked to calculate total paycheck and print Name, and paycheck.
Show your understanding of the unsolved mathematical below and present a description of the problem. Yang-Mills...
Show your understanding of the unsolved mathematical below and present a description of the problem. Yang-Mills Theory and the Mass Gap (mathematical physics)
What are the pseudo instructions commonly used in the MCS-51 assembly language? What effect does each...
What are the pseudo instructions commonly used in the MCS-51 assembly language? What effect does each directive have? 6. Provided data area from 1000H to 10FFH in external RAM, transfer the data to the area starting at 2500H in external RAM. Please write the program. 11. The crystal oscillator frequency of system is 12MHz. Write the delay subroutine with delay time of 50ms.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT