Assuming that the data section is set up properly and variables are uninitialize
ID: 3798819 • Letter: A
Question
Assuming that the data section is set up properly and variables are uninitialized what is wrong with the logic of the code segment? Choose the answer is that you think are correct. Mov num 1.5 mov eax, num1. INVOKE printf, ADDR msg fmt, ADDR msg1, num2 mov num2, eax EAX is a volatile register, its value will be unknown after the printf call Printed num2 before its value was set Cannot move an immediate value to num1 should not have ADDR before msg1 (a string) Given the following MASM program, what will be the first line that is output to the screen? .386 .model flat, c .stack 100h printf PROTO arg1:Ptr Byte, printlst VARARG .data msg 1fmt byte "%s%d", 0 msg 2fmt byte "%s%d", 0Ah, 0Ah, 0Ah, 0 msg 3fmt byte "%s%d", 0Ah, 0 msg1 byte "x = ", 0 msg1 byte "y = ", 0 msg1 byte "z = ", 0 num1 sdword 1 num1 sdword 2 num1 sdword 3 .code main proc INVOKE print, ADDR msg1fmt. ADOR, msg1. num1 INVOKE printf ADDR msg21mt, ADDR msg2, num2 INVOKE printf. ADOR mvg3fmt, ADDR msg3, num3 ret main endo end _____Explanation / Answer
The output for question 3 is:
xb=b1byb=b2
blank line
blank line
z=3
The answer to question 2 is:
-Printed mun2 before its value is set
( the program is printing the value of num2 and the implementating mov num2,eax which is wrong).
-EAX is a volatile register, its value is unknown after a printf call.