jbloggz wrote
You also mentioned there not being stack instructions in the CPU. Does this mean the HACK computer doesn't have a call stack, or cannot handle recursion? How difficult a task would it be adding this to the computer?
The Hack computer can handle recursion. You will learn how to implement a stack with software in chapters 7 and 8.
It would not be too hard to add push and pop instructions using a dedicated SP register. There will also need to be instructions to manage the SP register.
It would be much harder to add hardware call and return because these instructions generally require multiple memory access cycles.
--Mark