Annotation of 41BSD/libc/sys/sbrk.s, revision 1.1

1.1     ! root        1: #old = sbrk(increment);
        !             2: #
        !             3: #sbrk gets increment more core, and returns a pointer
        !             4: #      to the beginning of the new core area
        !             5: #
        !             6:        .set    break,17
        !             7: .globl _sbrk
        !             8: .globl _end
        !             9: .globl  cerror
        !            10: 
        !            11:        .align  1
        !            12: _sbrk:
        !            13:        .word   0x0000
        !            14:        addl3   nd,4(ap),-(sp)
        !            15:        pushl   $1
        !            16:        movl    ap,r3
        !            17:        movl    sp,ap
        !            18:        chmk    $break
        !            19:        bcc     noerr1
        !            20:        jmp     cerror
        !            21: noerr1:
        !            22:        movl    nd,r0
        !            23:        addl2   4(r3),nd
        !            24:        ret
        !            25: 
        !            26: .globl _brk
        !            27: # brk(value)
        !            28: # as described in man2.
        !            29: # returns 0 for ok, -1 for error.
        !            30: 
        !            31: _brk:
        !            32:        .word   0x0000
        !            33:        chmk    $break
        !            34:        bcc     noerr2
        !            35:        jmp     cerror
        !            36: noerr2:
        !            37:        movl    4(ap),nd
        !            38:        clrl    r0
        !            39:        ret
        !            40: 
        !            41:        .data
        !            42: nd:    .long   _end

unix.superglobalmegacorp.com

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