Annotation of researchv9/libc/nsys/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:        break = 17
                      7: .globl _sbrk
                      8: .globl _end
                      9: .globl  cerror
                     10: 
                     11: _sbrk:
                     12:        linkw   a6,#0
                     13:        addql   #3,sp@(8)
                     14:        andl    #0xfffffffc,sp@(8)
                     15:        movl    nd,d0
                     16:        addl    sp@(8),d0
                     17:        movl    d0,sp@-
                     18:        jsr     1f
                     19:        bcc     noerr1
                     20:        addql   #4,sp
                     21:        jmp     cerror2
                     22: noerr1:
                     23:        addql   #4,sp
                     24:        movl    nd,d0
                     25:        movl    sp@(8),d1
                     26:        addl    d1,nd
                     27:        movl    d0,a0
                     28:        unlk    a6
                     29:        rts
                     30: 1:
                     31:        linkw   a6,#0
                     32:        pea     break
                     33:        trap    #0
                     34:        unlk    a6
                     35:        rts
                     36: 
                     37: .globl _brk
                     38: # brk(value)
                     39: # as described in man2.
                     40: # returns 0 for ok, -1 for error.
                     41: 
                     42: _brk:
                     43:        linkw   a6,#0
                     44:        pea     break
                     45:        trap    #0
                     46:        bcc     noerr2
                     47:        jmp     cerror2
                     48: noerr2:
                     49:        movl    sp@(8),nd
                     50:        clrl    d0
                     51:        lea     0,a0
                     52:        unlk    a6
                     53:        rts
                     54: 
                     55:        .data
                     56: 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.