Question
Assembly ... 1. The x86-64 processor has sixteen 64-bit registers (all but RBP and RSP are GPRs): RAX, RBX, RCX, RDX, RDI, RSI, RBP, RSP,
Assembly ...
1. The x86-64 processor has sixteen 64-bit registers (all but RBP and RSP are GPRs): RAX, RBX, RCX, RDX, RDI, RSI, RBP, RSP, R8, R9 , R10, R11, R12, R13, R14, R15. It is also possible to reference a chunk of a 64-bit register (i.e., a sub-register). For example, what does EAX refer to?
2. What is the difference between these two instructions?
mov rax, stuff mov eax, stuff
3. The second argument that you pass to scanf in rsi determines where the information read from the keyboard goes. Explain why, in the code below, to read in a string you use 'mov' and to read an int you use 'lea'.
;; read in a string mov rdi, dword str_fmt mov rsi, dword buffer call scanf ;; read in an integer mov rdi, dword num_fmt lea rsi, [rbp-8] call scanf
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started