Annotation of researchv9/libc/csu/mcrt0.s, revision 1.1

1.1     ! root        1: # C runtime startoff including monitoring
        !             2: 
        !             3:        .set    exit,1
        !             4:        .set    cbufs,300
        !             5: 
        !             6: .globl start
        !             7: .globl _monitor
        !             8: .globl _sbrk
        !             9: .globl _main
        !            10: .globl _exit
        !            11: .globl _etext
        !            12: .globl _environ
        !            13: 
        !            14: 
        !            15: start:
        !            16:        .word   0x0000
        !            17:        subl2   $8,sp
        !            18:        movl    8(sp),(sp)  #  argc
        !            19:        movab   12(sp),r0
        !            20:        movl    r0,4(sp)  #  argv
        !            21: L1:
        !            22:        tstl    (r0)+  #  null args term ?
        !            23:        bneq    L1
        !            24:        cmpl    r0,*4(sp)  #  end of 'env' or 'argv' ?
        !            25:        blss    L2
        !            26:        tstl    -(r0)  # envp's are in list
        !            27: L2:
        !            28:        movl    r0,8(sp)  #  env
        !            29:        movl    r0,_environ  #  indir is 0 if no env ; not 0 if env
        !            30: 
        !            31:        subl3   $eprol,$_etext,r1
        !            32:        addl2   $7,r1
        !            33:        extzv   $3,$16,r1,r1
        !            34:        addl2   r1,r1           # tally size
        !            35:        addl2   $8*cbufs+12,r1          # entrance count plus header
        !            36:        pushl   $cbufs          # # entrance counters
        !            37:        pushl   r1              # bufsiz
        !            38:        pushl   r1              # for sbrk
        !            39:        calls   $1,_sbrk
        !            40:        cmpl    r0,$-1
        !            41:        beql    nospace
        !            42: # bandaid for sbrk not clearing memory (remove bandaid when fixed)
        !            43: #      addl3   (sp),(sp),r1
        !            44: #L100:
        !            45: #      clrb    -1(r0)[r1]
        !            46: #      sobgtr  r1,L100
        !            47: # end bandaid
        !            48:        pushl   r0
        !            49:        pushab  _etext
        !            50:        pushab  eprol
        !            51:        calls   $5,_monitor
        !            52:        calls   $3,_main
        !            53:        pushl   r0
        !            54:        calls   $1,_exit
        !            55:        chmk    $exit
        !            56: 
        !            57:        .data
        !            58: _environ:      .space  4
        !            59: emsg:
        !            60:        .byte   'N,'o,' ,'s,'p,'a,'c,'e,' ,'f,'o,'r,' 
        !            61:        .byte   'm,'o,'n,'i,'t,'o,'r,' ,'b,'u,'f,'f,'e,'r,0xa,0x0
        !            62: em1:
        !            63:        .text
        !            64: 
        !            65: nospace:
        !            66:        pushl   $em1-emsg
        !            67:        pushab  emsg
        !            68:        pushl   $2
        !            69:        calls   $3,_write
        !            70: eprol:

unix.superglobalmegacorp.com

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