Question: Required I / O: F . Last is your first initial and last name. Hints: The format argument will be passed to printf in $
Required IO:
F Last is your first initial and last name.
Hints:
The format argument will be passed to printf in $ preserve $
The variable arguments will be passed to printf in the reverse order. For example:
format cstring", p p p
$a "format cstring"
stack:
high p
p
low
Set pointer to the first parameter:
Retrieve first parameter: $t
Get ready for the next parameter:
Retrieve second parameter: $
Get ready for the next parameter:
The caller is responsible for creating and removing the variable arguments on the stack.
MUST BE IN MIPS ASSEMBLY LANGUAGE :
Implement the procedure printf:
void printfcstring format, parameters...
format:
output
d output the next parameter as an integer syscall
s output the next parameter as a cstring syscall
This procedure is similar to Java System.out.printf or CC printf. For unknown code, printf will
output code and terminate. For example: "hello z there" will output:
hello z
Provide a test main that will call printf with different parameters.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
