Annotation of researchv10dc/cmd/icon/setup/pc_xenix_smm/rswitch.s, revision 1.1

1.1     ! root        1: 
        !             2: ;      Static Name Aliases
        !             3: ;
        !             4: 
        !             5: ; code copied from assembler output generated by cc -- as doesn't like it
        !             6: ;
        !             7: ; DGROUP       GROUP   CONST,  _BSS,   _DATA
        !             8: ;      ASSUME  CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
        !             9: 
        !            10: ASSUME CS: _TEXT, DS: _DATA, SS: _DATA, ES: _DATA
        !            11: 
        !            12: PUBLIC _coswitch
        !            13: EXTRN  _syserr:NEAR
        !            14: EXTRN   _interp:NEAR
        !            15: 
        !            16: _DATA  SEGMENT WORD PUBLIC     'DATA'
        !            17: $1     DB      'interp() returned in coswitch', 00H
        !            18:        EVEN
        !            19: _DATA  ENDS
        !            20: 
        !            21: _TEXT  SEGMENT WORD PUBLIC     'CODE'
        !            22: 
        !            23:        PUBLIC  _coswitch
        !            24: _coswitch      PROC NEAR
        !            25:                        ; coswitch(old_cs, new_cs, first)
        !            26:                        ; int *old_cs, *new_cs;
        !            27:                        ; int first;
        !            28:        push bp
        !            29:        mov bp,sp
        !            30:        push di
        !            31:        push si
        !            32: 
        !            33:        push bp
        !            34:        mov bx, 4[bp]
        !            35:        mov [bx], sp
        !            36:        mov bx, 6[bp]
        !            37: 
        !            38:                        ; if (first == 0) set up a new stack
        !            39:        mov ax, 8[bp]
        !            40:        or ax,ax
        !            41:        jnz not_first
        !            42: 
        !            43:        mov sp, [bx]
        !            44:        sub ax,ax
        !            45:        push ax
        !            46:        push ax
        !            47:        call _interp
        !            48:        pop ax          ; clear args from stack
        !            49:        pop ax
        !            50:        mov ax, offset $1
        !            51:        push ax
        !            52: ;      push "interp() returned in costart"
        !            53:        call _syserr
        !            54: 
        !            55: not_first:
        !            56:        mov sp, [bx]
        !            57:        pop bp
        !            58: 
        !            59:        pop si
        !            60:        pop di
        !            61:        pop bp
        !            62:        ret
        !            63: _coswitch      ENDP
        !            64: 
        !            65: _TEXT  ENDS
        !            66: END
        !            67: 

unix.superglobalmegacorp.com

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