Section Exercises
True or False
The following assembly code shows a correct usage of scanf:
False!
The first argument of scanf, stored in rdi, is the address of the string/format that it will read and the second argument, stored in rsi, is the location on the stack where the read value will be stored. Moreover, regarding calling conventions, the stack is misaligned as we only subtract 8 from rsp instead of 16 or a multiple of 16.
Multiple Choice
Which directive tells the assembler that a string should be placed in a text section as ASCII-encoded characters?
Which format specifiers indicate a signed long, a zero-terminated string and hexadecimal integer?
Last updated