Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 2 --- CAN YOU PRIVIDE EXPLANATIONS HOW TO DO THIS PROBLEM, NOT JUST AN

ID: 3564779 • Letter: Q

Question

Question 2 --- CAN YOU PRIVIDE EXPLANATIONS HOW TO DO THIS PROBLEM, NOT JUST AN ANSWER

The following data segment starts at memory address 0x1900 (hexadecimal)
.data
printString BYTE "MASM is fun",0
moreBytes BYTE 38 DUP(0)
dateIssued DWORD ?
dueDate DWORD ?
elapsedTime WORD ?

What is the hexadecimal address of dueDate?

0x1936

0x1932

0x190C

0x1954

Question 6

Select the pseudo-code that most closely corresponds to the following assembly code. Assume that the variables a, b, c, and d are initialized elsewhere in the program. Pay close attention to the conditional jumps, the corresponding pseudo code may surprise you!

.data
; General purpose variables
a      DWORD     ?
b      DWORD     ?
c      BYTE      ?
d      BYTE      ?
upperLevel   DWORD     18
lowerLevel   DWORD      3
; Strings
yes    BYTE     "Yes",0
no     BYTE     "No",0
maybe BYTE     "Maybe",0

.code
   main PROC
   mov   eax, a
   cmp   eax, b
   jle option1
   je    option2
   jmp   option3
option1:
   mov   edx, OFFSET yes
   call WriteString
   jmp   endOfProgram
option2:
   mov   edx, OFFSET no
   call WriteString
   jmp   endOfProgram
option3:
   mov   edx, OFFSET maybe
   call WriteString
endOfProgram:
   exit
main ENDP
END main

if (a > b)
   print (yes);
else if (a == b)
   print (no);
else
   print (maybe);

if (a > b) OR (a == b)
   print (yes);
else
   print (maybe);

if (a < b)
   print (yes);
else if (a == b)
   print (no);
else
   print (maybe);

if (a < b) OR (a == b)
   print (yes);
else
   print (maybe);

Question 8 The following data segment starts at memory address 0x1600 (hexadecimal) .data printString BYTE "Assembly is fun",0 moreBytes BYTE 23 DUP(0) dateIssued DWORD ? dueDate DWORD ? elapsedTime WORD ? What is the hexadecimal address of dueDate?

a. 0x1627

b. 0x162B

c. 0x1610

d. 0x1643

Question 1

The following data segment starts at memory address 0x2300 (hexadecimal)
.data
printString BYTE "Do not add decimal to hex",0
someBytes WORD 42 DUP(0)
moreBytes BYTE 10, 20, 30, 40, 50, 60, 70, 80, 90
questionAddr DWORD ?
ignoreMe WORD ?

What is the hexadecimal address of questionAddr?

0x2377

0x231A

0x236E

0x2419

a.

0x1936

b.

0x1932

c.

0x190C

d.

0x1954

Explanation / Answer

Q2.

printString BYTE "MASM is fun",0
moreBytes BYTE 38 DUP(0)
dateIssued DWORD ?
dueDate DWORD ?
elapsedTime WORD ?

0x1900 start of printString

size of printString = 12

size of morebytes = 38

size of DWORD (dateIssued ) = 4

So dueDate starts at 0x1900hex + 54dec = 0x1936h

Question 1

printString BYTE "Do not add decimal to hex",0
someBytes WORD 42 DUP(0)
moreBytes BYTE 10, 20, 30, 40, 50, 60, 70, 80, 90
questionAddr DWORD ?
ignoreMe WORD ?

0x2300 start of printString

size of printString = 26

size of someBytes = 42

size of morebytes = 9

address of questionAddr = 0x2300h + 77dec = 0x234D

question6

jle option1 -> jump if less than or equal to option1
   je    option2 ->jump if equal to option2 -> this is not possible
   jmp   option3 -> else jump to option3

so the possible code will be

if (a < b) OR (a == b)
   print (yes);
else
   print (maybe);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote