Question

In: Computer Science

Assignment 3C: Answer the following questions Question 1. a. Declare a 32-bit signed integer variable and...

Assignment 3C: Answer the following questions

Question 1.

a. Declare a 32-bit signed integer variable and initialize it with the smallest possible negative decimal value.

b. Declare an uninitialized array of 100 16-bit unsigned integers.

c. Declare a string variable containing the word “DVC” repeated 20 times, and terminated with the null char.

Question 2

For the following declarations, assuming that the address of I is 404000h

What are the addresses of J, K, and L?

What is the total number of allocated bytes?

Show the content of the individual bytes allocated in memory in hexadecimal

.DATA

I SBYTE 1, -1

J SWORD 10FFh, -256

K DWORD 23456h

L BYTE 'DVC'

Question 3

Given the following definitions:

.DATA

wval LABEL WORD

barray BYTE 10h, 20h, 30h, 6 DUP (0Ah)

ALIGN 4

warray WORD 5 DUP (1000h)

pressKey EQU <"Press any key to continue ...", 0>

darray DWORD 5 DUP (56789ABh), 7 DUP (12345678h)

dval LABEL DWORD

prompt BYTE pressKey

What will be the value of EAX, AX, and AL after executing each of the following instructions? Assume that the address of barray is 404000h.

a. mov eax, TYPE warray

b. mov eax, LENGTHOF barray

c. mov eax, SIZEOF darray

d. mov eax, OFFSET warray

e. mov eax, OFFSET darray

f. mov eax, OFFSET prompt

g. mov eax, DWORD PTR barray

h. mov al, BYTE PTR darray

i. mov ax, wval

j. mov eax, dval

Solutions

Expert Solution

Answer:-----------

1)

a). var SDWORD - 2147483648

b). array WORD100 DUP(?)

c). string BYTE 20 DUP(“DVC”),0

2)

a).
J: 404002h
K: 404006h
L: 40400Ah

b). 1X2 + 2X2 + 4X1 + 1X3 = 13

c).
404000h: 01
404001h: FF
404002h: 10
404003h: FF
404004h: FF
404005h: 00
404006h: 00
404007h: 56
404008h: 34
404009h: 02
40400Ah: 43
40400Bh: 56
40400Ch: 44.
.DATA
I SBYTE 1, -1
J SWORD 10FFh, -256K
DWORD 23456h
L BYTE 'DVC'

3).
warray WORD 5 DUP (1000h) ------------------------ 5*2 = 10bytes
pressKey EQU <"Press any key to continue ...", 0> ---------------- allocate no spaced
array DWORD 5 DUP (56789ABh), 7 DUP (12345678h) ------------------ 5*4 bytes + 7*4 bytes = 48 bytes
dval LABEL DWORD ------------------------ allocate no spaces
prompt BYTE pressKey
30 bytes for (“Press any key to continue…”,0)
Assume that the address of barray is 404000h.
a. mov eax, TYPE warray;eax=2
b. mov eax, LENGTHOF barray;eax=9
c. mov eax, SIZEOF darray;eax=30
d. mov eax, OFFSET warray;eax=0040400Ch
e. mov eax, OFFSET darray;eax=00404016h
f. mov eax, OFFSET prompt;eax=00404046h
g. mov eax, DWORD PTR barray;eax=0A302010h
h. mov al, BYTE PTR darray;eax=ABh
i. mov ax, wval;AX=2010h
j. mov eax, dval;EAX=73657250h


Related Solutions

Questions: 1) // declare integer variable sum equal to zero // declare variable integer i //...
Questions: 1) // declare integer variable sum equal to zero // declare variable integer i // declare while loop condition where i is less then 25 // inside of brackets calculate the sum of i (addition) // increment i // outside the loop print the sum of values ============================================= 2) Create a sentinel value example if I press number 0 it will display the sum of data // create a scanner // prompt the user to to enter the numbers...
7.What is the hexadecimal equivalent of the 16-bit signed integer -32,760 ? *Note: answer in two's...
7.What is the hexadecimal equivalent of the 16-bit signed integer -32,760 ? *Note: answer in two's complement*
Encode 32-bit INTEGER 12 in TLV format?
Encode 32-bit INTEGER 12 in TLV format?
Update the function playScratchOffs to do the following Declare an integer variable to store the type...
Update the function playScratchOffs to do the following Declare an integer variable to store the type of scratch off (i.e. type) Declare an integer variable to store the number of scratch off (i.e. count) Declare an integer variable for loop control (i.e. c) Declare a variable of data type struct OneDollar (i.e. oneSO) Declare a variable of data type struct TwoDollar (i.e. twoSO) Declare a variable of data type struct FiveDollar (i.e. fiveSO) Write a series of printf statements to...
JAVASCRIPT: /* Assignment 03: Complete this javascript */ // 1) Declare a variable named myValue //...
JAVASCRIPT: /* Assignment 03: Complete this javascript */ // 1) Declare a variable named myValue // Assign myValue the value of "Hello, how's it going?" // Print the value of myValue to the console // 2) Use the charAt() method to display the letter t // from the variable myValue in the console // 3) Use the indexOf() method to display the position of "going" // from the variable myValue in the console // 4) Use the slice() method to...
Multiply the following 16 bit signed binary number together Provide a 32bit signed binary answer 0000...
Multiply the following 16 bit signed binary number together Provide a 32bit signed binary answer 0000 0001 0001 0001 1111 1111 1000 0000
Question 1: Group by and Aggregates: Write SQL statements to answer the following questions using Assignment...
Question 1: Group by and Aggregates: Write SQL statements to answer the following questions using Assignment 4’s schema (Customer-Invoice-Line-Product-Vendor). Make sure that your SQL script runs without any errors. Submit your answers in a .SQL file. 1 (2 Points) - Find the count of distinctvendors thatsupplied products that are priced lowerthan 185? 2 (2 Points) - For each vendor, find their product that has the lowest product quantity. Your output should include vendor code, vendor name, product description and product...
C++ Program 1. Declare an integer static array a[ ] with 100 elements. 2. Declare an...
C++ Program 1. Declare an integer static array a[ ] with 100 elements. 2. Declare an integer pointer p. 3. Let p pointing to the array a[ ]. 4. Use p (you have to use p) to put 0 into the first element of this array, 2 into the second element, 4 into the 3rd element, 6 into the 4th element, ... 198 into the 100th element of this array. 5. Use a (you have to use a) to display...
Assembly Language Define a 64-bit constant signed integer in Flash. Then, Write a subroutine count_1s that...
Assembly Language Define a 64-bit constant signed integer in Flash. Then, Write a subroutine count_1s that would count the number of 1s in a byte. The subroutine will receive the input parameter in A and return the result back in A. Use this subroutine to write a program that would count the number of 1s inside the 64-bit constant signed integer. Define a variable that would hold the total count of 1s. (Application of Shift/Rotate instructions) (No specific Architecture)
Question 1: The following table to answer the following questions.
Question 1: The following table to answer the following questions.  a. Sketch the aggregate supply(s) and aggregate demand diagram(s). b. What is the equilibrium output and price level? c. If aggregate demand shifts right, what is long-run equilibrium output? d. If aggregate demand shifts left, what is equilibrium long-run output? e. For an economy at long-run equilibrium, would you suggest using aggregate demand to alter the level of output or to control any inflationary increases in the price level? Why?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT