File:  [Research Unix] / researchv10dc / cmd / icon / setup / pc_xenix_smm / rswitch.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross


;	Static Name Aliases
;

; code copied from assembler output generated by cc -- as doesn't like it
;
; DGROUP	GROUP	CONST,	_BSS,	_DATA
;	ASSUME	CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP

ASSUME CS: _TEXT, DS: _DATA, SS: _DATA, ES: _DATA

PUBLIC	_coswitch
EXTRN	_syserr:NEAR
EXTRN   _interp:NEAR

_DATA	SEGMENT WORD PUBLIC	'DATA'
$1	DB	'interp() returned in coswitch', 00H
	EVEN
_DATA	ENDS

_TEXT	SEGMENT WORD PUBLIC	'CODE'

	PUBLIC	_coswitch
_coswitch	PROC NEAR
			; coswitch(old_cs, new_cs, first)
			; int *old_cs, *new_cs;
			; int first;
 	push bp
	mov bp,sp
	push di
	push si

	push bp
	mov bx, 4[bp]
	mov [bx], sp
	mov bx, 6[bp]

			; if (first == 0) set up a new stack
	mov ax, 8[bp]
	or ax,ax
	jnz not_first

	mov sp, [bx]
	sub ax,ax
	push ax
	push ax
	call _interp
	pop ax		; clear args from stack
	pop ax
	mov ax, offset $1
	push ax
;	push "interp() returned in costart"
	call _syserr

not_first:
	mov sp, [bx]
	pop bp

	pop si
	pop di
	pop bp
	ret
_coswitch	ENDP

_TEXT	ENDS
END


unix.superglobalmegacorp.com

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