5.121 · exercise

Basic quiz: input and output

How printf, scanf and system calls move text in and out of a program: the addresses scanf needs, format specifiers, file descriptors, and the registers svc 0 reads.

0 of 6 correct

Multiple choice

A program reads one int with scanf into a .bss slot named age_n. What goes in x1 before bl scanf?

Multiple choice

Which file descriptor does a program write to when it sends a message to standard error?

Multiple choice

Before svc 0, which register holds the number that picks the system call?

Multiple choice

printf gets a 64-bit long in x1. Which conversion specifier prints all 64 bits?

Multiple choice

What does w0 hold when scanf("%d %d", ...) returns?

Multiple choice

A program calls printf, then sends a second line with the write system call, and its output goes to a file. Which line comes first in the file?