Annotation of 40BSD/cmd/lisp/reset.s, revision 1.1

1.1     ! root        1:        .asciz  "@(#)reset.s    34.1    10/3/80"
        !             2: # C library -- reset, setexit
        !             3: #      reset(x)
        !             4: # will generate a "return" from
        !             5: # the last call to
        !             6: #      setexit()
        !             7: # by restoring r6 - r12, ap, fp
        !             8: # and doing a return.
        !             9: # The returned value is x; on the original
        !            10: # call the returned value is 0.
        !            11: #
        !            12: # useful for going back to the main loop
        !            13: # after a horrible error in a lowlevel
        !            14: # routine.
        !            15: # Changed by M. Marcus (4/4/80) to chain saved frames.  Should be rewritten
        !            16: # to only use the stack, avoiding need for resexit and getexit.
        !            17: # Setexit works as before, but getexit adds pointer
        !            18: # to the saved block when it pushes saved state onto stack. 
        !            19: # resexit restores this link by moving back extra word.
        !            20: # getexit and setexit are to be thought of as an (almost) unitary action.
        !            21: .globl _setexit
        !            22: .globl _getexit
        !            23: .globl _reset
        !            24: .globl _resexit
        !            25: .globl _setsav
        !            26: .globl _exitlnk
        !            27: .globl _svkludg
        !            28: 
        !            29: _setexit:
        !            30:        .word   0x0000
        !            31:        movab   _setsav,r0
        !            32:        movq    r6,(r0)+
        !            33:        movq    r8,(r0)+
        !            34:        movq    r10,(r0)+
        !            35:        movq    8(fp),(r0)+             # ap, fp
        !            36:        movab   4(ap),(r0)+             # sp
        !            37:        movl    16(fp),(r0)             # pc
        !            38:        clrl    r0
        !            39:        ret
        !            40: 
        !            41: _reset:
        !            42:        .word   0x0000
        !            43:        movl    4(ap),r0        # returned value
        !            44:        movab   _setsav,r1
        !            45:        movq    (r1)+,r6
        !            46:        movq    (r1)+,r8
        !            47:        movq    (r1)+,r10
        !            48:        movq    (r1)+,r12
        !            49:        movl    (r1)+,sp
        !            50:        jmp     *(r1)
        !            51: 
        !            52: _resexit:
        !            53:        .word   0x0000
        !            54:        movc3   $44,*4(ap),_setsav
        !            55:        ret
        !            56: _svkludg:
        !            57:        movl    (sp)+,out
        !            58:        movq    r0,myregs
        !            59:        movq    r2,myregs+8
        !            60:        movq    r4,myregs+16
        !            61:        subl2   $44,sp
        !            62:        movc3   $44,_setsav,(sp)
        !            63:        movq    myregs,r0
        !            64:        movq    myregs+8,r2
        !            65:        movq    myregs+16,r4
        !            66:        jmp     *out
        !            67: 
        !            68: _getexit:
        !            69:        .word   0x0000
        !            70:        movc3   $44,_setsav,*4(ap)
        !            71:        movl    4(ap), _exitlnk
        !            72:        ret
        !            73: 
        !            74: #exitlnk is to be thought of as the last word of the setsav area (11 longs long)
        !            75:        .data
        !            76: _setsav:.space 10*4
        !            77: _exitlnk:.space 4
        !            78: out:   .space  4
        !            79: myregs:        .space  6*4
        !            80: 

unix.superglobalmegacorp.com

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