Chapter 7 Flashcards
What does the VM Translator do?
It turns virtual machine code into assembler code.
- At what memory location of the Hack’s RAM is the stack pointer saved?
- What is the stack’s base address in the Hack computer?
What is the translation of the virtual machine command:
“push constant 17”
in Hack assembly?
What is the logic for turning the VM code command:
“pop local 2”
int Hack machine code?
What gets stored in the following memory segments of the Hack’s RAM:
local
argument
this
that
?
What are the stages that make the result of a high level Jack program appear on the Hack screen?
What is the standard VM mapping on the Hack platform?
We want to write “pop local 2” in Hack assembly.
What is the first step?
What Hack code achieves this step?
The first step is to have a variable (D) that will hold the address to which we want to save the poped data.
//D = LCL + 2
@LCL
D=M
@2
D=D+A
- What is the minimal number of Hack commands for the VM code: Push constant i
- What are these commands?
- What is the minimal number of Hack commands for the VM code: Pop temp i
- What are these commands?
(Base address of temp is 5)