Annotation of 40BSD/cmd/px/08call.s, revision 1.1.1.1

1.1       root        1: #
                      2: # Copyright (c) 1979 Regents of the University of California
                      3: #
                      4: # char sccsid[] = "@(#)08call.s 4.1 10/10/80";
                      5: #
                      6: _CALL:
                      7:        cvtbl   (r10)+,r0       #entry level of new proc
                      8:        movl    (r10)+,r1       #new entry point
                      9:        pushr   $R11|R10|R9     #save lino, lc, dp
                     10:        addl2   ap,r1           #calc new entry point
                     11:        addl3   2(r1),ap,r10
                     12:        moval   _display(r0),r9 #set up new display pointer
                     13:        jmp     (r8)
                     14: 
                     15: _FCALL:
                     16:        cvtbl   (r10)+,r0       #r0 has number of bytes of arguments
                     17:        bneq    L0801
                     18:        movl    (r10)+,r0
                     19: L0801:
                     20:        movl    (sp)+,r6        #r6 points to formal call struct
                     21:        pushr   $R11|R10|R9     #save lino, lc, dp
                     22:        movl    (r6),r10        #set new entry point
                     23:        cmpl    6(r10),r0       #check arg count
                     24:        bneq    enargs
                     25:        addl3   $_display,4(r6),r9      #set up new display pointer
                     26:        movl    4(r6),r1        #save current display, restore formal display
                     27:        movc3   r1,_display+4,8(r6)[r1]
                     28:        movc3   4(r6),8(r6),_display+4
                     29:        jmp     (r8)
                     30: enargs:
                     31:        movw    $ENARGS,_perrno
                     32:        jbr     error
                     33: 
                     34: _FSAV:
                     35:        movl    (sp),r6         #r6 points to formal call struct
                     36:        cvtbl   (r10)+,4(r6)    #set block number
                     37:        addl3   (r10)+,ap,r0    #r0 pts to TRA4
                     38:        addl3   2(r0),ap,(r6)   #set entry address
                     39:        movc3   4(r6),_display+4,8(r6)  #save current display
                     40:        jmp     (r8)
                     41: 
                     42: _FRTN:
                     43:        cvtbl   (r10)+,r0       #r0 has size of returned object
                     44:        bneq    L0802
                     45:        movzwl  (r10)+,r0
                     46: L0802:
                     47:        addl3   r0,sp,r1        #r1 points to stack loc of formal call struct
                     48:        movl    (r1),r6         #r6 points to formal call struct
                     49:        movc3   r0,(sp),4(sp)   #move down the returned value
                     50:        addl2   $4,sp           #throw away leftover
                     51:        movl    4(r6),r1        #r1 has display size
                     52:        movc3   r1,8(r6)[r1],_display+4 #restore previous display
                     53:        jmp     (r8)
                     54: #
                     55: _NODUMP:
                     56:        moval   iloop,r8        #disable profiling
                     57:        incw    _nodump
                     58:        bicpsw  $0xe0           #disable overflow checks
                     59: 
                     60: _BEG:
                     61:        movzbl  (r10)+,r1       #r1 has name size
                     62:        movl    (r10)+,r0       #r0 has local variable size
                     63:        addl2   $4,r9           #enter local scope
                     64:        pushl   (r9)            #save old display value
                     65:        pushal  (r10)+          #pointer to entry info
                     66:        movzwl  (r10)+,r11      #set new lino
                     67:        addl2   r1,r10          #skip over name text
                     68:        pushl   r7              #save I/O info
                     69:        pushl   _file
                     70:        subl2   $4,sp           #space for top of frame pointer
                     71:        movl    sp,(r9)         #set new display pointer
                     72:        addl3   r0,sp,r3        #r3 points to new top of stack
                     73:        clrl    tempsize(r3)    #check for memory (fault => not available)
                     74:        movl    r3,(sp)         #set new top of stack pointer
                     75:        movl    r3,sp           #allocate local variables
                     76:        mnegl   r0,r6           #r6 has amount of space to alloc
                     77:        cmpl    r6,$65535       #check for out of character range
                     78:        bleq    L0804
                     79: L0803:
                     80:        movc5   $0,(r2),$0,$65535,(r3)  #continue zero of local variables
                     81:        acbl    $65536,$-65535,r6,L0803 #deduct amount zeroed and continue
                     82: L0804:
                     83:        movc5   $0,(r2),$0,r6,(r3)      #zero out local variables
                     84:        jmp     (r8)
                     85: 
                     86: _END:
                     87:        pushl   (r9)            #flush and close local files
                     88:        calls   $1,_pclose
                     89:        movl    (r9),sp         #deallocate local vars
                     90:        addl2   $4,sp           #pop TOS ptr
                     91:        movl    (sp)+,_file     #restore old I/O info
                     92:        movl    (sp)+,r7
                     93:        movzwl  *(sp)+,r0       #r0 has number of bytes of parameters
                     94:        movl    (sp)+,(r9)      #restore old display entry
                     95:        cmpl    r9,$_display+4  #exiting main proc ???
                     96:        beql    L0805
                     97:        popr    $R11|R10|R9     #restore lino, lc, dp
                     98:        addl2   r0,sp           #deallocate parameters
                     99:        jmp     (r8)
                    100: L0805:
                    101:        ret                     #end of interpretation

unix.superglobalmegacorp.com

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