ppfvy wrote
Thanks - that makes sense. I haven't thought about the context that this would be executed in - I was thinking of 'get the values from R0..R2' as a placeholder for now when later we'll presumably be getting the values from user input, other routines, etc.
Chapter 4 has the only complete assembly languages you need to write for this course.
In chapters 7 and 8 you will be writing snippets of assembly language code to perform the operations of the various commands in the VM language. Your VM Translator will combine these snippets as required to translate a complete VM language program to assembly language.
To write a complete, non-trivial, program in assembly language you want an assembler that generates relocatable object files, and a Linker that combines multiple object files into an executable. This is basically the same as the way the compilers combine multiple C++ or Python sources into a single program.
You can do this manually with the Hack Assembler by copying multiple smaller .asm files into a single giant .asm file and then assembling that single file, but it is quite tedious.
It's also rather limiting for assembly language programming that there is no hardware stack in the Hack Computer.
--Mark