File:  [Research Unix] / researchv10no / cmd / PDP11 / 11crt0.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

/ C runtime startoff

.globl  _exit, _environ
.globl  start
.globl  _main
exit = 1.

start:
        setd
        mov     2(sp),r0
        clr     -2(r0)
        mov     sp,r0
        sub     $4,sp
        mov     4(sp),(sp)
        tst     (r0)+
        mov     r0,2(sp)
1:
        tst     (r0)+
        bne     1b
        cmp     r0,*2(sp)
        blo     1f
        tst     -(r0)
1:
        mov     r0,4(sp)
        mov     r0,_environ
        jsr     pc,_main
        cmp     (sp)+,(sp)+
        mov     r0,(sp)
        jsr     pc,*$_exit
	sys	exit

.bss
_environ:
        .=.+2
.data
        .=.+2           / loc 0 for I/D; null ptr points here.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.