DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦2ea336818⟧ TextFile

    Length: 492 (0x1ec)
    Types: TextFile
    Notes: UNIX file
    Names: »setjmp.s«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »libc/gen/setjmp.s« 

TextFile

/ Segmented Z8001 C Library
/ Setjmp and longjmp -- non local goto.
/
/ #include <setjmp.h>
/ 
/ setjmp(env);
/ jmp_buf env;
/
/ longjmp(env, val)
/ jmp_buf env;
/

	.globl	setjmp_
	.globl	longjmp_

setjmp_:
	popl	rr4, (rr14)	/ Return PC
	ldl	rr2, (rr14)	/ Address of the environment
	ldm	(rr2), r4, $12	/ Save PC, r6-r15
	sub	r1, r1
	jp	(rr4)

longjmp_:
	ldl	rr2, rr14(4)	/ Get address of the environment
	ld	r1, rr14(8)	/ Get return value
	ldm	r4, (rr2), $12	/ Restore PC, r6-r15
	jp	(rr4)