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

Need help with 1,2,3,5. Thank you in advance Question 1 Indicate whether the fol

ID: 3840825 • Letter: N

Question

Need help with 1,2,3,5. Thank you in advance

Question 1 Indicate whether the following statements are both syntactically and semantically correct. msg2fmt byte OAh,0Ah, %s',0Ah,0Ah,0 V INVOKE printf, ADDR msg1fmt, ADDR number msg 1fmt byte "In%s%d n", V printf PROTO arg1:Ptr Byte, printlist:VARARG Question 2 Assuming that the .data section is set up properly and variables are uninitialized, what is wrong with the logic of the following code segment? Choose the answer(s) that you think are correct. mov num1,5 mov eax,num1 INVOKE printf, ADDR msg1fmt, ADDR msg1, num2 mov num2,eax Cannot move an immediate value to num1 Should not have ADDR before msg1 (a string) Printed num2 before its value was set EAX is a volatile register, its value will be unknown after the printf call

Explanation / Answer

Question 1:

Indicate whether the following segments are both syntatically and semantically correct.

Ans:
INVOKE printf, ADDR msg1fmt, ADDR member
Printf PROTO arg1:Ptr Byte, printlist:VARARG

These are the only two segments are both syntatically and semantically correct.

Assuming the .data section is setup properly and variables are uninitiakized


mov num1,5
mov eax,num1
INVOKE printf,ADDR msg1fmt, ADDR msg1,num2
mov num2,eax


Ans:

can not move an immediate value ti num1. This only te problem wit given logic.