2 ; Ullrich von Bassewitz, 06.06.1998
4 ; void longjmp (jmp_buf buf, int retval);
9 .importzp sp, ptr1, ptr2
12 sta ptr2 ; Save retval
14 ora ptr2+1 ; Check for 0
16 lda #1 ; 0 is illegal according to the standard...
17 sta ptr2 ; ... and must be replaced by 1
18 @L1: jsr popax ; get buf
23 ; Get the old parameter stack
32 ; Get the old stack pointer
39 ; Get the return address and push it on the stack
47 ; Load the return value and return to the caller