Build a table for a (x+1)-bit number and their signed values in binary/decimal var a = [], x=4; var zpad = (new Array(x+1)).join("0"), pad = (new Array(x+1)).join(" "); for(var i=0;i<2< 2. For n parameters, do a PUSH. The last parameter is the first on the stack 3. Call subroutine (BRS: PUSH return address on stack and BRanch Always) (after call when returned:) 4. Remove parameters from the stack: ADD SP n 5. Result is in R0 6. (perhaps a CMP R0 0 or LOAD R0 R0 if in expression context?) Callee: 1. push R5 (base pointer "BP" in stack for local variables and parameters) 2. Store current stack pointer in R5 (LOAD R5 SP). [R5] now contains the return address, [R5+i+1] the i-th parameter and [R5+-i] the i-th local var. Param i is at R5 + i + 1 because BP was pushed too 3. Grow stack for local variables (by SUB SP n) if necessary 4. 5. LOAD SP R5 (clear local vars) 5. PULL R5 (restore the "BP" of the caller) 6. RTS (go back to caller) parameter access (i-th parameter): LOAD R0 [R5+i+1] local variable access (i-th local var) LOAD R0 [R5+-i] global variable access LOAD R0 [GB+name] Initially, the stack size on the PP2 is 240 words, but it can be adjusted with: @STACKSIZE newsize The constant 'stacksize' (lowercase) contains the previous stack size