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...
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?
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.
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.
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)
Be thorough in your answers to show your understanding of the concepts. Each student is expected...
Be thorough in your answers to show your understanding of the concepts. Each student is expected to do their own work, this is not a group exam. Ethical behavior is expected of all marketing students. Professionally present your work! Part of the grade is professional presentation, depth of thought, application of key concepts and clarity of your work. What are the various levels of needs that Apple is addressing with the i-Phone. Apply the concepts in Table 1.1 on page...
Assembly Language Visual Studio. Problem 1 College Registration Using the College Registration example from Section 6.7.3...
Assembly Language Visual Studio. Problem 1 College Registration Using the College Registration example from Section 6.7.3 (textbook) as a starting point, do the following: 1. Recode the logic using CMP and conditional jump instructions (instead of the .IF and .ELSEIF directives). 2. Perform range checking on the credits value; it cannot be less than 1 or greater than 30. If an invalid entry is discovered, display an appropriate error message. 3. Prompt the user for the grade average and credits...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT