Annotation of researchv10no/libc/sys/sbrk.s, revision 1.1.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:        addl2   $3,4(ap)
                     15:        bicl2   $3,4(ap)
                     16:        addl3   nd,4(ap),-(sp)
                     17:        pushl   $1
                     18:        movl    ap,r3
                     19:        movl    sp,ap
                     20:        chmk    $break
                     21:        bcc     noerr1
                     22:        jmp     cerror
                     23: noerr1:
                     24:        movl    nd,r0
                     25:        addl2   4(r3),nd
                     26:        ret
                     27: 
                     28: .globl _brk
                     29: # brk(value)
                     30: # as described in man2.
                     31: # returns 0 for ok, -1 for error.
                     32: 
                     33: _brk:
                     34:        .word   0x0000
                     35:        chmk    $break
                     36:        bcc     noerr2
                     37:        jmp     cerror
                     38: noerr2:
                     39:        movl    4(ap),nd
                     40:        clrl    r0
                     41:        ret
                     42: 
                     43:        .data
                     44: 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.