/*
* add N bytes to the stack pointer
* N is often negative
*
* return the new stack pointer.
* this doesn't work: it just confuses
* the compiler.
*/
TEXT addstack(SB), 1, $0
MOVL n+0(FP), CX
POPL BX /* grab return address */
MOVL SP, AX
ADDL CX, AX /* allocate stack space */
MOVL AX, SP
PUSHL BX /* put the return address back */
RET
/*
* jump somewhere, with
* the stack pointer set to something
*/
TEXT jumpstack(SB), 1, $0
MOVL addr+0(FP), BX
MOVL stack+4(FP), AX
MOVL AX, SP
JMP* BX
|