Question: 1. Given the number 456789ABh, list out its byte values in little-endian order. Do this by placing that value in a memory location and inspecting

1. Given the number 456789ABh, list out its byte values in little-endian order. Do this by placing that value in a memory location and inspecting the memory location values.

2. Declare an array of 120 uninitialized unsigned doubleword values.

3. Declare an array of bytes and initialize it to the first 5 letters of the alphabet.

4. Declare a 32-bit signed integer variable and initialize it with the smallest possible negative decimal value. In memory, what are the hexadecimal values that are shown.

5. Declare a 32-bit signed integer variable and initialize it with the value 234 (base 10). In memory, what are the hexadecimal values shown?

6. Declare an uninitialized array of 50 signed doublewords nameddArray.

8. Declare an array of 20 unsigned bytes namedbArrayand initialize all elements to zero.

9. Show the order of individual bytes in memory (lowest to highest) for the following doubleword variable: val1 DWORD 87654321h

10. 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. Set memory values that require support for signed and unsigned values. Verify your work by calculating by hand the result. Show how the result you obtained matches the result obtained through your assembly program.

TITLE Add and Subtract, Version 2

; This program adds and subtracts 32-bit integers ; and stores the sum in a variable.

INCLUDE Irvine32.inc

.data val1 dword 10000h val2 dword 40000h val3 dword 20000h finalVal dword ? myval1 SBYTE -51 myval2 SBYTE -66

.code main PROC

mov eax,val1 ; start with 10000h add eax,val2 ; add 40000h sub eax,val3 ; subtract 20000h mov finalVal,eax ; store the result (30000h) call DumpRegs ; display the registers

exit main ENDP END main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!