Annotation of researchv10no/cmd/udemon/reset.s, revision 1.1.1.1

1.1       root        1: / C library -- reset, setexit
                      2: 
                      3: /      reset(x)
                      4: / will generate a "return" from
                      5: / the last call to
                      6: /      setexit()
                      7: / by restoring sp, r5
                      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: 
                     16: .globl _setexit
                     17: .globl _reset
                     18: .globl csv, cret
                     19: 
                     20: _setexit:
                     21:        mov     r5,sr5
                     22:        mov     (sp),spc
                     23:        mov     sp,ssp
                     24:        clr     r0
                     25:        rts     pc
                     26: 
                     27: _reset:
                     28:        jsr     r5,csv
                     29:        mov     4(r5),r0
                     30: 1:
                     31:        cmp     (r5),sr5
                     32:        beq     1f
                     33:        mov     (r5),r5
                     34:        bne     1b
                     35: / panic -- r2-r4 lost
                     36:        mov     ssp,sp
                     37:        mov     sr5,r5
                     38:        mov     spc,(sp)
                     39:        rts     pc
                     40: 1:
                     41:        mov     spc,2(r5)
                     42:        jmp     cret
                     43: 
                     44: .bss
                     45: sr5:   .=.+2
                     46: spc:   .=.+2
                     47: ssp:   .=.+2

unix.superglobalmegacorp.com

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