The handwritten assembly is located where commented and with less indentation levels(lines 40-80).
The idea is to have a reliable push where the stack pointer $r1
remains unchanged.
On this proposal, the $r10
is used as the pointer to the top of the stack and it'll be initialized by having the same address as the stack pointer $r1
:
mr 10, 1
Push will be accomplished with 1 instructions: