Index: trunk/minix/lib/i86/em/em_adi.s
===================================================================
--- trunk/minix/lib/i86/em/em_adi.s	(revision 9)
+++ 	(revision )
@@ -1,24 +1,0 @@
-.define .adi
-
-	.text
-.adi:
-	pop     bx 
-	cmp     cx,#2
-	jne     1f
-	pop     cx
-	add     ax,cx
-	jmp     (bx)
-1:
-	cmp     cx,#4
-	jne     9f
-	pop     dx
-	pop     cx
-	add     ax,cx
-	pop     cx
-	adc     dx,cx
-	push    dx
-	jmp     (bx)
-9:
-.extern .trpilin
-	push	bx
-	jmp     .trpilin
Index: trunk/minix/lib/i86/em/em_and.s
===================================================================
--- trunk/minix/lib/i86/em/em_and.s	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-.define	.and
-
-	! #bytes in cx
-	! save di; it might be a register variable
-
-	.text
-.and:
-	pop	bx		! return address
-	mov	dx,di
-	mov	di,sp
-	add	di,cx
-	sar	cx,#1
-1:
-	pop	ax
-	and	ax,(di)
-	stos
-	loop	1b
-	mov	di,dx
-	jmp	(bx)
Index: trunk/minix/lib/i86/em/em_blm.s
===================================================================
--- trunk/minix/lib/i86/em/em_blm.s	(revision 9)
+++ 	(revision )
@@ -1,15 +1,0 @@
-.define .blm
-.text
-
-	! cx: count in words
-.blm:
-	mov	bx,sp
-	mov	ax,si
-	mov	dx,di
-	mov	di,2(bx)
-	mov	si,4(bx)
-	rep
-	mov
-	mov	si,ax
-	mov	di,dx
-	ret	4
Index: trunk/minix/lib/i86/em/em_cii.s
===================================================================
--- trunk/minix/lib/i86/em/em_cii.s	(revision 9)
+++ 	(revision )
@@ -1,37 +1,0 @@
-.define .cii
-
-.text
-.cii:
-	pop     bx              ! return address
-				! pop     cx, dest. size
-				! pop     dx, src. size
-				! ax is first word of source
-	cmp	dx,#1
-	jne	2f
-	cbw
-	mov	dx,#2
-2:
-	cmp     dx,cx
-	je      8f
-	cmp     dx,#2
-	je      1f
-	cmp     dx,#4
-	jne     9f
-	cmp     cx,#2
-	jne     9f
-	pop     dx
-8:
-	jmp     (bx)
-1:
-	cmp     cx,#4
-	jne     9f
-	cwd
-	push    dx
-	jmp     (bx)
-9:
-	push    ax              ! push low source
-EILLINS = 18
-.extern .fat
-	mov     ax,#EILLINS
-	push    ax
-	jmp     .fat
Index: trunk/minix/lib/i86/em/em_cmi4.s
===================================================================
--- trunk/minix/lib/i86/em/em_cmi4.s	(revision 9)
+++ 	(revision )
@@ -1,27 +1,0 @@
-.define .cmi4
-
-.text
-.cmi4:
-	pop     bx              ! return address
-	pop     cx
-	pop     dx
-	pop     ax
-	push	si
-	mov	si,sp
-	xchg	bx,2(si)
-	pop	si
-	cmp     bx,dx
-	jg      1f
-	jl      2f
-	cmp     ax,cx
-	ja      1f
-	je      3f
-2:
-	mov	ax,#-1
-	ret
-3:
-	xor	ax,ax
-	ret
-1:
-	mov	ax,#1
-	ret
Index: trunk/minix/lib/i86/em/em_cms.s
===================================================================
--- trunk/minix/lib/i86/em/em_cms.s	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-.define .cms
-
-	! #bytes in cx
-	.text
-.cms:
-	pop     bx              ! return address
-	mov     dx,sp
-	push	si
-	push	di
-	mov     si,dx
-	add     dx,cx
-	mov     di,dx
-	add     dx,cx
-	sar     cx,#1
-	repe
-	cmp
-	je      1f
-	inc     cx
-1:
-	pop	di
-	pop	si
-	mov     sp,dx
-	jmp     (bx)
Index: trunk/minix/lib/i86/em/em_cmu4.s
===================================================================
--- trunk/minix/lib/i86/em/em_cmu4.s	(revision 9)
+++ 	(revision )
@@ -1,27 +1,0 @@
-.define .cmu4
-
-.text
-.cmu4:
-	pop     bx              ! return address
-	pop     cx
-	pop     dx
-	pop     ax
-	push	si
-	mov	si,sp
-	xchg	bx,2(si)
-	pop	si
-	cmp     bx,dx
-	ja      1f
-	jb      2f
-	cmp     ax,cx
-	ja      1f
-	je      3f
-2:
-	mov	ax,#-1
-	ret
-3:
-	xor	ax,ax
-	ret
-1:
-	mov	ax,#1
-	ret
Index: trunk/minix/lib/i86/em/em_com.s
===================================================================
--- trunk/minix/lib/i86/em/em_com.s	(revision 9)
+++ 	(revision )
@@ -1,15 +1,0 @@
-.define	.com
-
-	! #bytes in cx
-	.text
-.com:
-	mov	bx,sp
-	inc	bx
-	inc	bx
-	sar	cx,#1
-1:
-	not	(bx)
-	inc	bx
-	inc	bx
-	loop	1b
-	ret
Index: trunk/minix/lib/i86/em/em_csa2.s
===================================================================
--- trunk/minix/lib/i86/em/em_csa2.s	(revision 9)
+++ 	(revision )
@@ -1,26 +1,0 @@
-.define .csa2
-
-.text
-.csa2:
-				! bx, descriptor address
-				! ax, index
-	mov     dx,(bx)         ! default
-	sub     ax,2(bx)
-	cmp     ax,4(bx)
-	ja      1f
-	sal     ax,#1
-	add	bx,ax
-	mov     bx,6(bx)
-	test    bx,bx
-	jnz     2f
-1:
-	mov     bx,dx
-	test    bx,bx
-	jnz     2f
-ECASE = 20
-.extern .fat
-	mov     ax,#ECASE
-	push    ax
-	jmp     .fat
-2:
-	jmp     (bx)
Index: trunk/minix/lib/i86/em/em_csa4.s
===================================================================
--- trunk/minix/lib/i86/em/em_csa4.s	(revision 9)
+++ 	(revision )
@@ -1,30 +1,0 @@
-.sect .text; .sect .rom; .sect .data; .sect .bss
-.define .csa4
-
-.sect .text
-.csa4:
-				! bx, descriptor address
-				! ax, dx: index
-	mov	cx,(bx)         ! default
-	sub     ax,2(bx)
-				! ignore high order word; if non-zero, the
-				! case descriptor would not fit anyway
-	cmp	ax,6(bx)
-	ja	1f
-2:
-	sal     ax,#1
-	add	bx,ax
-	mov     bx,10(bx)
-	test    bx,bx
-	jnz     2f
-1:
-	mov	bx,cx
-	test    bx,bx
-	jnz     2f
-ECASE = 20
-.extern .fat
-	mov     ax,#ECASE
-	push    ax
-	jmp     .fat
-2:
-	jmp     (bx)
Index: trunk/minix/lib/i86/em/em_csb2.s
===================================================================
--- trunk/minix/lib/i86/em/em_csb2.s	(revision 9)
+++ 	(revision )
@@ -1,28 +1,0 @@
-.define .csb2
-
-.text
-.csb2:
-				!bx, descriptor address
-				!ax,  index
-	mov	dx,(bx)
-	mov	cx,2(bx)
-1:
-	add	bx,#4
-	dec     cx
-	jl      4f
-	cmp     ax,(bx)
-	jne     1b
-	mov	bx,2(bx)
-2:
-	test    bx,bx
-	jnz     3f
-ECASE = 20
-.extern .fat
-	mov     ax,#ECASE
-	push    ax
-	jmp     .fat
-3:
-	jmp     (bx)
-4:
-	mov	bx,dx
-	jmp	2b
Index: trunk/minix/lib/i86/em/em_csb4.s
===================================================================
--- trunk/minix/lib/i86/em/em_csb4.s	(revision 9)
+++ 	(revision )
@@ -1,33 +1,0 @@
-.sect .text; .sect .rom; .sect .data; .sect .bss
-.define .csb4
-
-.sect .text
-.csb4:
-				!bx: descriptor address
-				!ax, dx:  index
-	push	(bx)		! default
-	mov	cx,2(bx)	! count (ignore high order word, the descriptor
-				! would not fit anyway)
-1:
-	add	bx,#6
-	dec     cx
-	jl      4f
-	cmp     ax,(bx)
-	jne     1b
-	cmp	dx,2(bx)
-	jne     1b
-	pop	bx
-	mov	bx,4(bx)
-2:
-	test    bx,bx
-	jnz     3f
-ECASE = 20
-.extern .fat
-	mov     ax,#ECASE
-	push    ax
-	jmp     .fat
-3:
-	jmp	(bx)
-4:
-	pop	bx
-	jmp	2b
Index: trunk/minix/lib/i86/em/em_cuu.s
===================================================================
--- trunk/minix/lib/i86/em/em_cuu.s	(revision 9)
+++ 	(revision )
@@ -1,36 +1,0 @@
-.define .ciu
-.define .cui
-.define .cuu
-
-.text
-.ciu:
-.cui:
-.cuu:
-	pop     bx              ! return address
-				! pop     cx, dest. size
-				! pop     dx, source size
-				! ax is low word of source
-	cmp     dx,cx
-	je      8f
-	cmp     dx,#2
-	je      1f
-	cmp     dx,#4
-	jne     9f
-	cmp     cx,#2
-	jne     9f
-	pop     dx
-8:
-	jmp     (bx)
-1:
-	cmp     cx,#4
-	jne     9f
-	xor     dx,dx
-	push    dx
-	jmp     (bx)
-9:
-	push    ax              ! to help debugging ?
-EILLINS = 18
-.extern .fat
-	mov     ax,#EILLINS
-	push    ax
-	jmp     .fat
Index: trunk/minix/lib/i86/em/em_dup.s
===================================================================
--- trunk/minix/lib/i86/em/em_dup.s	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-.define	.dup
-
-	! #bytes in cx
-	.text
-.dup:
-	pop	bx		! return address
-	mov	ax,si
-	mov	dx,di
-	mov	si,sp
-	sub	sp,cx
-	mov	di,sp
-	sar	cx,#1
-	rep
-	mov
-	mov	si,ax
-	mov	di,dx
-	jmp	(bx)
Index: trunk/minix/lib/i86/em/em_dvi4.s
===================================================================
--- trunk/minix/lib/i86/em/em_dvi4.s	(revision 9)
+++ 	(revision )
@@ -1,90 +1,0 @@
-.define .dvi4
-
-yl=6
-yh=8
-xl=10
-xh=12
-
-.text
-.dvi4:
-	push	si
-	push	di
-	mov     si,sp           ! copy of sp
-	mov     bx,yl(si)
-	mov     ax,yh(si)
-	cwd
-	mov     di,dx
-	cmp     dx,ax
-	jne     7f
-	and     dx,dx
-	jge     1f
-	neg     bx
-	je      7f
-1:
-	xor     dx,dx
-	mov     cx,xl(si)
-	mov     ax,xh(si)
-	and     ax,ax
-	jge     2f
-	neg     ax
-	neg     cx
-	sbb     ax,dx
-	not     di
-2:
-	div     bx
-	xchg    ax,cx
-	div     bx              ! cx = high abs(result), ax=low abs(result)
-9:
-	and     di,di
-	jge     1f
-	neg     cx
-	neg     ax
-	sbb     cx,#0
-1:
-			! cx is high order result
-			! ax is low order result
-	mov	dx,cx
-	pop	di
-	pop	si
-	ret	8	! result in ax/dx
-
-7:
-	push    dx              ! sign of y
-	mov     di,ax
-	xor     bx,bx
-	and     di,di
-	jge     1f
-	neg     di
-	neg     yl(si)
-	sbb     di,bx
-1:
-	mov     ax,xl(si)
-	mov     dx,xh(si)
-	and     dx,dx
-	jge     1f
-	neg     dx
-	neg     ax
-	sbb     dx,bx
-	not     -2(si)
-1:
-	mov     cx,#16
-1:
-	shl     ax,#1
-	rcl     dx,#1
-	rcl     bx,#1
-	cmp     di,bx
-	ja      3f
-	jb      2f
-	cmp     yl(si),dx
-	jbe     2f
-3:
-	loop    1b
-	jmp     1f
-2:
-	sub     dx,yl(si)
-	sbb     bx,di
-	inc     ax
-	loop    1b
-1:
-	pop     di              ! di=sign of result,ax= result
-	jmp     9b
Index: trunk/minix/lib/i86/em/em_dvu4.s
===================================================================
--- trunk/minix/lib/i86/em/em_dvu4.s	(revision 9)
+++ 	(revision )
@@ -1,54 +1,0 @@
-.define .dvu4
-
-yl=6
-yh=8
-xl=10
-xh=12
-
-.text
-.dvu4:
-	push	si
-	push	di
-	mov     si,sp           ! copy of sp
-	mov     bx,yl(si)
-	mov     ax,yh(si)
-	or      ax,ax
-	jne     7f
-	xor     dx,dx
-	mov     cx,xl(si)
-	mov     ax,xh(si)
-	div     bx
-	xchg    ax,cx
-	div     bx
-9:
-			! cx is high order result
-			! ax is low order result
-	mov	dx,cx
-	pop	di
-	pop	si
-	ret	8	! result in ax/dx
-
-7:
-	mov     di,ax
-	xor     bx,bx
-	mov     ax,xl(si)
-	mov     dx,xh(si)
-	mov     cx,#16
-1:
-	shl     ax,#1
-	rcl     dx,#1
-	rcl     bx,#1
-	cmp     di,bx
-	ja      3f
-	jb      2f
-	cmp     yl(si),dx
-	jbe     2f
-3:
-	loop    1b
-	jmp     9b
-2:
-	sub     dx,yl(si)
-	sbb     bx,di
-	inc     ax
-	loop    1b
-	jmp     9b
Index: trunk/minix/lib/i86/em/em_error.s
===================================================================
--- trunk/minix/lib/i86/em/em_error.s	(revision 9)
+++ 	(revision )
@@ -1,41 +1,0 @@
-.define .error
-.define .Xtrp
-
-	! ax is trap number
-	! all registers must be saved
-	! because return is possible
-	! May only be called with error no's <16
-.text
-.error:
-	push bp
-	push si
-	push di
-	push dx
-	push cx
-	push bx
-	push ax
-	mov  cx,ax
-	mov  bx,#1
-	sal  bx,cl
-.extern .ignmask
-.extern .trp
-	test bx,.ignmask
-	jne  2f
-	call    .trp
-2:
-	pop  ax
-	pop  bx
-	pop  cx
-	pop  dx
-	pop  di
-	pop  si
-	pop  bp
-	ret
-
-.Xtrp:
-	cmp	ax,#16
-	jge	1f
-	call	.error
-	ret
-1:
-	jmp	.trp
Index: trunk/minix/lib/i86/em/em_exg.s
===================================================================
--- trunk/minix/lib/i86/em/em_exg.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-.define .exg
-
-	! #bytes in cx
-.text
-.exg:
-	push	di
-	mov	sp,di
-	add	di,#4
-	mov	bx,di
-	add	bx,cx
-	sar     cx,#1
-1:
-	mov	ax,(bx)
-	xchg	ax,(di)
-	mov	(bx),ax
-	add	di,#2
-	add	bx,#2
-	loop	1b
-2:
-	pop	di
-	ret
Index: trunk/minix/lib/i86/em/em_fat.s
===================================================================
--- trunk/minix/lib/i86/em/em_fat.s	(revision 9)
+++ 	(revision )
@@ -1,9 +1,0 @@
-.define .fat
-.text
-
-.fat:
-.extern .trp
-.extern .stop
-	call    .trp
-	call    .stop
-	! no return
Index: trunk/minix/lib/i86/em/em_fp8087.s
===================================================================
--- trunk/minix/lib/i86/em/em_fp8087.s	(revision 9)
+++ 	(revision )
@@ -1,615 +1,0 @@
-.define .adf4, .adf8, .sbf4, .sbf8, .mlf4, .mlf8, .dvf4, .dvf8
-.define .ngf4, .ngf8, .fif4, .fif8, .fef4, .fef8
-.define .cif4, .cif8, .cuf4, .cuf8, .cfi, .cfu, .cff4, .cff8
-.define .cmf4, .cmf8
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-!	$Header: /cvsup/minix/src/lib/i86/em/em_fp8087.s,v 1.1.1.1 2005/04/21 14:56:13 beng Exp $
-
-!	Implement interface to floating point package for Intel 8087
-
-	.sect .rom
-one:
-	.data2	1
-two:
-	.data2	2
-bigmin:
-	.data2	0, -32768
-
-	.sect .text
-.adf4:
-	mov	bx,sp
-	wait
-	flds	2(bx)
-	wait
-	fadds	6(bx)
-	wait
-	fstps	6(bx)
-	wait
-	ret
-.adf8:
-	mov	bx,sp
-	wait
-	fldd	2(bx)
-	wait
-	faddd	10(bx)
-	wait
-	fstpd	10(bx)
-	wait
-	ret
-
-.sbf4:
-	mov	bx,sp
-	wait
-	flds	6(bx)
-	wait
-	fsubs	2(bx)
-	wait
-	fstps	6(bx)
-	wait
-	ret
-
-.sbf8:
-	mov	bx,sp
-	wait
-	fldd	10(bx)
-	wait
-	fsubd	2(bx)
-	wait
-	fstpd	10(bx)
-	wait
-	ret
-
-.mlf4:
-	mov	bx,sp
-	wait
-	flds	2(bx)
-	wait
-	fmuls	6(bx)
-	wait
-	fstps	6(bx)
-	wait
-	ret
-.mlf8:
-	mov	bx,sp
-	wait
-	fldd	2(bx)
-	wait
-	fmuld	10(bx)
-	wait
-	fstpd	10(bx)
-	wait
-	ret
-
-.dvf4:
-	mov	bx,sp
-	wait
-	flds	6(bx)
-	wait
-	fdivs	2(bx)
-	wait
-	fstps	6(bx)
-	wait
-	ret
-
-.dvf8:
-	mov	bx,sp
-	wait
-	fldd	10(bx)
-	wait
-	fdivd	2(bx)
-	wait
-	fstpd	10(bx)
-	wait
-	ret
-
-.ngf4:
-	mov	bx,sp
-	wait
-	flds	2(bx)
-	wait
-	fchs
-	wait
-	fstps	2(bx)
-	wait
-	ret
-
-.ngf8:
-	mov	bx,sp
-	wait
-	fldd	2(bx)
-	wait
-	fchs
-	wait
-	fstpd	2(bx)
-	wait
-	ret
-
-.fif4:
-	mov	bx,sp
-	push	bx		! make room for FP status word
-	wait
-	flds	4(bx)
-	wait
-	fmuls	8(bx)		! multiply
-	wait
-	fld	st		! copy result
-	wait
-	ftst			! test sign; handle negative separately
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf			! result of test in condition codes
-	jb	1f
-	frndint			! this one rounds (?)
-	wait
-	fcom	st(1)		! compare with original; if <=, then OK
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf
-	jbe	2f
-	fisubs	one		! else subtract 1
-	wait
-	jmp	2f
-1:				! here, negative case
-	frndint			! this one rounds (?)
-	wait
-	fcom	st(1)		! compare with original; if >=, then OK
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf
-	jae	2f
-	fiadds	one		! else add 1
-	wait
-2:
-	fsub	st(1),st	! subtract integer part
-	wait
-	mov	bx,2(bx)
-	fstps	(bx)
-	wait
-	fstps	4(bx)
-	wait
-	pop	bx
-	ret
-
-.fif8:
-	mov	bx,sp
-	push	bx		! make room for FP status word
-	wait
-	fldd	4(bx)
-	wait
-	fmuld	12(bx)		! multiply
-	wait
-	fld	st		! and copy result
-	wait
-	ftst			! test sign; handle negative separately
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf			! result of test in condition codes
-	jb	1f
-	frndint			! this one rounds (?)
-	wait
-	fcom	st(1)		! compare with original; if <=, then OK
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf
-	jbe	2f
-	fisubs	one		! else subtract 1
-	wait
-	jmp	2f
-1:				! here, negative case
-	frndint			! this one rounds (?)
-	wait
-	fcom	st(1)		! compare with original; if >=, then OK
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf
-	jae	2f
-	fiadds	one		! else add 1
-	wait
-2:
-	fsub	st(1),st	! subtract integer part
-	mov	bx,2(bx)
-	fstpd	(bx)
-	wait
-	fstpd	8(bx)
-	wait
-	pop	bx
-	ret
-
-.fef4:
-				! this could be simpler, if only the
-				! fxtract instruction was emulated properly
-	mov	bx,sp
-	mov	ax,6(bx)
-	and	ax,#077600
-	je	1f		! zero exponent
-	mov	cx,#7
-	shr	ax,cl
-	sub	ax,#126
-	mov	cx,ax		! exponent in cx
-	mov	ax,6(bx)
-	and	ax,#0100177
-	or	ax,#0037400	! load -1 exponent
-	mov	dx,4(bx)
-	mov	bx,2(bx)
-	mov	4(bx),ax
-	mov	2(bx),dx
-	mov	(bx),cx
-	ret
-1:				! we get here on zero exp
-	mov	ax,6(bx)
-	and	ax,#0177
-	or	ax,4(bx)
-	jne	1f		! zero result
-	xor	ax,ax
-	mov	bx,2(bx)
-	mov	(bx),ax
-	mov	2(bx),ax
-	mov	4(bx),ax
-	ret
-1:				! otherwise unnormalized number
-	mov	cx,6(bx)
-	and	cx,#0100177
-	mov	dx,cx
-	and	cx,#0x8000
-	mov	ax,#-125
-2:
-	test	dx,#0x80
-	jne	1f
-	dec	ax
-	shl	4(bx),#1
-	rcl	dx,#1
-	or	dx,cx
-	jmp	2b
-1:
-	mov	cx,4(bx)
-	mov	bx,2(bx)
-	mov	(bx),ax
-	mov	2(bx),cx
-	and	dx,#0100177
-	or	dx,#0037400	! load -1 exponent
-	mov	4(bx),dx
-	ret
-
-.fef8:
-				! this could be simpler, if only the
-				! fxtract instruction was emulated properly
-	mov	bx,sp
-	mov	ax,10(bx)
-	and	ax,#077760
-	je	1f		! zero exponent
-	mov	cx,#4
-	shr	ax,cl
-	sub	ax,#1022
-	mov	cx,ax		! exponent in cx
-	mov	ax,10(bx)
-	and	ax,#0100017
-	or	ax,#0037740	! load -1 exponent
-	push	8(bx)
-	push	6(bx)
-	push	4(bx)
-	mov	bx,2(bx)
-	pop	2(bx)
-	pop	4(bx)
-	pop	6(bx)
-	mov	8(bx),ax
-	mov	(bx),cx
-	ret
-1:				! we get here on zero exp
-	mov	ax,10(bx)
-	and	ax,#017
-	or	ax,8(bx)
-	or	ax,6(bx)
-	or	ax,4(bx)
-	jne	1f		! zero result
-	xor	ax,ax
-	mov	bx,2(bx)
-	mov	(bx),ax
-	mov	2(bx),ax
-	mov	4(bx),ax
-	mov	6(bx),ax
-	mov	8(bx),ax
-	ret
-1:				! otherwise unnormalized number
-	mov	cx,10(bx)
-	and	cx,#0100017
-	mov	dx,cx
-	and	cx,#0x8000
-	mov	ax,#-1021
-2:
-	test	dx,#0x10
-	jne	1f
-	dec	ax
-	shl	4(bx),#1
-	rcl	6(bx),#1
-	rcl	8(bx),#1
-	rcl	dx,#1
-	or	dx,cx
-	jmp	2b
-1:
-	and	dx,#0100017
-	or	dx,#0037740	! load -1 exponent
-	mov	cx,8(bx)
-	push	6(bx)
-	push	4(bx)
-	mov	bx,2(bx)
-	mov	(bx),ax
-	mov	8(bx),dx
-	mov	6(bx),cx
-	pop	2(bx)
-	pop	4(bx)
-	ret
-
-.cif4:
-	mov	bx,sp
-	cmp	2(bx),#2
-	jne	1f
-	wait
-	filds	4(bx)
-	wait
-	fstps	2(bx)
-	wait
-	ret
-1:
-	wait
-	fildl	4(bx)
-	wait
-	fstps	4(bx)
-	wait
-	ret
-
-.cif8:
-	mov	bx,sp
-	cmp	2(bx),#2
-	jne	1f
-	wait
-	filds	4(bx)
-	wait
-	fstpd	2(bx)
-	wait
-	ret
-1:
-	wait
-	fildl	4(bx)
-	wait
-	fstpd	2(bx)
-	wait
-	ret
-
-.cuf4:
-	mov	bx,sp
-	cmp	2(bx),#2
-	jne	1f
-	mov	ax,4(bx)
-	mov	2(bx),ax
-	mov	4(bx),#0
-	wait
-	fildl	2(bx)
-	wait
-	fstps	2(bx)
-	wait
-	ret
-1:
-	wait
-	fildl	4(bx)
-	wait
-	cmp	6(bx),#0
-	jge	1f
-2:
-	wait
-	fisubl	bigmin
-	wait
-	fisubl	bigmin
-1:
-	wait
-	fstps	4(bx)
-	wait
-	ret
-
-.cuf8:
-	mov	bx,sp
-	cmp	2(bx),#2
-	jne	1f
-	mov	6(bx),#0
-1:
-	wait
-	fildl	4(bx)
-	wait
-	cmp	6(bx),#0
-	jge	1f
-2:
-	wait
-	fisubl	bigmin
-	wait
-	fisubl	bigmin
-1:
-	wait
-	fstpd	2(bx)
-	wait
-	ret
-
-.cfi:
-	mov	bx,sp
-	push	bx
-	wait
-	fstcw	-2(bx)
-	wait
-	mov	dx,-2(bx)
-	or	-2(bx),#0xc00	! truncating mode
-	wait
-	fldcw	-2(bx)
-	pop	ax
-	cmp	4(bx),#4
-	jne	2f
-				! loc 4 loc ? cfi
-	wait
-	flds	6(bx)
-	wait
-	fistpl	6(bx)
-	wait
-	cmp	2(bx),#2
-	jne	1f
-	mov	ax,6(bx)
-1:
-	mov	4(bx),dx
-	wait
-	fldcw	4(bx)
-	wait
-	ret
-2:
-				! loc 8 loc ? cfi
-	wait
-	fldd	6(bx)
-	wait
-	fistpl	10(bx)
-	wait
-	cmp	2(bx),#2
-	jne	1b
-	mov	ax,10(bx)
-	jmp	1b
-
-.cfu:
-	mov	bx,sp
-	push	bx
-	wait
-	fstcw	-2(bx)
-	wait
-	mov	dx,-2(bx)
-	and	-2(bx),#0xf3ff
-	or	-2(bx),#0x400	! to -infinity
-	wait
-	fldcw	-2(bx)
-	wait
-	pop	ax
-	cmp	4(bx),#4
-	jne	2f
-				! loc 4 loc ? cfu
-	flds	6(bx)
-	wait
-	fabs			! ???
-	wait
-	fiaddl	bigmin
-	fistpl	6(bx)
-	wait
-	mov	ax,8(bx)
-	sub	ax,bigmin+2
-	mov	8(bx),ax
-	cmp	2(bx),#2
-	jne	1f
-	mov	ax,6(bx)
-1:
-	mov	4(bx),dx
-	wait
-	fldcw	4(bx)
-	wait
-	ret
-2:
-	wait
-				! loc 8 loc ? cfu
-	fldd	6(bx)
-	wait
-	fabs			! ???
-	wait
-	fiaddl	bigmin
-	fistpl	10(bx)
-	wait
-	mov	ax,12(bx)
-	sub	ax,bigmin+2
-	mov	12(bx),ax
-	cmp	2(bx),#2
-	jne	1b
-	mov	ax,10(bx)
-	jmp	1b
-
-.cff4:
-	mov	bx,sp
-	wait
-	fldd	2(bx)
-	wait
-	fstcw	2(bx)
-	wait
-	mov	dx,2(bx)
-	and	2(bx),#0xf3ff	! set to rounding mode
-	wait
-	fldcw	2(bx)
-	wait
-	fstps	6(bx)
-	mov	2(bx),dx
-	wait
-	fldcw	2(bx)
-	wait
-	ret
-
-.cff8:
-	mov	bx,sp
-	wait
-	flds	2(bx)
-	wait
-	fstpd	2(bx)
-	wait
-	ret
-
-.cmf4:
-	mov	bx,sp
-	push	bx		! room for 8087 status word
-	xor	cx,cx
-	wait
-	flds	6(bx)
-	wait
-	flds	2(bx)
-	wait
-	fcompp			! compare and pop operands
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf
-	je	1f
-	jb	2f
-	dec	cx
-	jmp	1f
-2:
-	inc	cx
-1:
-	mov	ax,cx
-	pop	bx
-	ret
-
-
-.cmf8:
-	mov	bx,sp
-	push	bx		! room for 8087 status word
-	xor	cx,cx
-	wait
-	fldd	10(bx)
-	wait
-	fldd	2(bx)
-	wait
-	fcompp			! compare and pop operands
-	wait
-	fstsw	-2(bx)
-	wait
-	mov	ax,-2(bx)
-	sahf
-	je	1f
-	jb	2f
-	dec	cx
-	jmp	1f
-2:
-	inc	cx
-1:
-	mov	ax,cx
-	pop	bx
-	ret
Index: trunk/minix/lib/i86/em/em_gto.s
===================================================================
--- trunk/minix/lib/i86/em/em_gto.s	(revision 9)
+++ 	(revision )
@@ -1,7 +1,0 @@
-.define .gto
-.text
-
-.gto:
-	mov     bp,4(bx)
-	mov     sp,2(bx)
-	jmp     @(bx)
Index: trunk/minix/lib/i86/em/em_hol0.s
===================================================================
--- trunk/minix/lib/i86/em/em_hol0.s	(revision 9)
+++ 	(revision )
@@ -1,5 +1,0 @@
-.define hol0
-.data
-hol0:
-	.data2	0, 0
-	.data2	0, 0
Index: trunk/minix/lib/i86/em/em_iaar.s
===================================================================
--- trunk/minix/lib/i86/em/em_iaar.s	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-.define .iaar
-.text
-
-.iaar:
-	pop     cx
-	pop     dx
-	cmp     dx,#2
-.extern .unknown
-	jne     .unknown
-	pop     bx      ! descriptor address
-	pop     ax      ! index
-	sub     ax,(bx)
-	mul     4(bx)
-	pop     bx      ! array base
-	add     bx,ax
-	push	cx
-	ret
Index: trunk/minix/lib/i86/em/em_ilar.s
===================================================================
--- trunk/minix/lib/i86/em/em_ilar.s	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-.define .ilar
-.text
-
-.ilar:
-	pop     cx
-	pop     dx
-.extern .unknown
-	cmp     dx,#2
-	jne     .unknown
-	pop     bx      ! descriptor address
-	pop     ax      ! index
-	push    cx
-.extern .lar2
-	jmp    .lar2
Index: trunk/minix/lib/i86/em/em_inn.s
===================================================================
--- trunk/minix/lib/i86/em/em_inn.s	(revision 9)
+++ 	(revision )
@@ -1,31 +1,0 @@
-.define .inn
-.text
-
-	! #bytes in cx
-	! bit # in ax
-.inn:
-	xor     dx,dx
-	mov     bx,#8
-	div     bx
-	mov     bx,sp
-	add	bx,#2
-	add     bx,ax
-	cmp     ax,cx
-	jae     1f
-	movb	al,(bx)
-	mov	bx,dx
-	testb   al,bits(bx)
-	jz      1f
-	mov	ax,#1
-	jmp	2f
-1:
-	xor	ax,ax
-2:
-	pop	bx
-	add     sp,cx
-	! ax is result
-	jmp     (bx)
-
-	.data
-bits:
-	.data1 1,2,4,8,16,32,64,128
Index: trunk/minix/lib/i86/em/em_ior.s
===================================================================
--- trunk/minix/lib/i86/em/em_ior.s	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-.define	.ior
-.text
-
-	! #bytes in cx
-.ior:
-	pop	bx		! return address
-	mov	dx,di
-	mov	di,sp
-	add	di,cx
-	sar	cx,#1
-1:
-	pop	ax
-	or	ax,(di)
-	stos
-	loop	1b
-	mov	di,dx
-	jmp	(bx)
Index: trunk/minix/lib/i86/em/em_isar.s
===================================================================
--- trunk/minix/lib/i86/em/em_isar.s	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-.define .isar
-.text
-
-.isar:
-	pop     cx
-	pop     ax
-	cmp     ax,#2
-.extern .unknown
-	jne     .unknown
-	pop     bx      ! descriptor address
-	pop     ax      ! index
-	push    cx
-.extern .sar2
-	jmp    .sar2
Index: trunk/minix/lib/i86/em/em_lar2.s
===================================================================
--- trunk/minix/lib/i86/em/em_lar2.s	(revision 9)
+++ 	(revision )
@@ -1,35 +1,0 @@
-.define .lar2
-.text
-
-.lar2:
-				! bx, descriptor address
-				! ax, index
-	pop	cx
-	pop	dx		! base address
-	push	cx
-	push	si
-	mov	si,dx
-	sub     ax,(bx)
-	mov     cx,4(bx)
-	imul    cx
-	add     si,ax
-	sar     cx,#1
-	jnb     1f
-	xorb    ah,ah
-	lodsb
-	pop	si
-	pop	bx
-	push    ax
-	jmp     (bx)
-1:
-	pop	dx		! saved si
-	mov	ax,4(bx)
-	pop	bx		! return address
-	sub     sp,ax
-	mov	ax,di		! save di
-	mov     di,sp
-	rep
-	mov
-	mov	di,ax
-	mov	si,dx
-	jmp     (bx)
Index: trunk/minix/lib/i86/em/em_lfr6.s
===================================================================
--- trunk/minix/lib/i86/em/em_lfr6.s	(revision 9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-.define .lfr6
-.text
-.extern .retarea
-
-.lfr6:
-	pop	bx
-	push	.retarea+4
-	push	.retarea+2
-	push	.retarea
-	jmp	(bx)
Index: trunk/minix/lib/i86/em/em_lfr8.s
===================================================================
--- trunk/minix/lib/i86/em/em_lfr8.s	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-.define .lfr8
-.text
-.extern .retarea
-
-.lfr8:
-	pop	bx
-	push	.retarea+6
-	push	.retarea+4
-	push	.retarea+2
-	push	.retarea
-	jmp	(bx)
Index: trunk/minix/lib/i86/em/em_loi.s
===================================================================
--- trunk/minix/lib/i86/em/em_loi.s	(revision 9)
+++ 	(revision )
@@ -1,38 +1,0 @@
-.define .loi
-.define .los
-.text
-
-	! #bytes in cx
-	! address in bx
-	! save si/di. they might be register variables
-.los:
-	mov	dx,si
-	mov	si,bx
-	pop	bx
-	mov	ax,cx
-	sar	cx,#1
-	jnb	1f
-	xorb	ah,ah
-	lodsb
-	mov	si,dx
-	push	ax
-	jmp	(bx)
-1:
-	sub	sp,ax
-	jmp	1f
-
-.loi:
-	! only called with size > 4
-	mov	dx,si
-	mov	si,bx
-	pop     bx
-	sub     sp,cx
-	sar     cx,#1
-1:
-	mov	ax,di
-	mov     di,sp
-	rep
-	mov
-	mov	si,dx
-	mov	di,ax
-	jmp     (bx)
Index: trunk/minix/lib/i86/em/em_mli4.s
===================================================================
--- trunk/minix/lib/i86/em/em_mli4.s	(revision 9)
+++ 	(revision )
@@ -1,25 +1,0 @@
-.define .mli4
-.text
-
-yl=2
-yh=4
-	! x * y
-	! xl in ax
-	! xh in dx
-
-.mli4:
-	mov	bx,sp
-	push	dx
-	mov	cx,ax
-	mul	yh(bx)           ! xl*yh
-	pop	dx
-	push	ax
-	mov	ax,dx
-	mul	yl(bx)		! xh * yl
-	pop	dx
-	add     dx,ax           ! xh*yl+xl*yh
-	mov     ax,cx
-	mov	cx,dx
-	mul     yl(bx)           ! xl*yl
-	add     dx,cx
-	ret	4
Index: trunk/minix/lib/i86/em/em_mon.s
===================================================================
--- trunk/minix/lib/i86/em/em_mon.s	(revision 9)
+++ 	(revision )
@@ -1,6 +1,0 @@
-.define .mon
-.text
-
-.mon:
-.extern .stop
-	call    .stop
Index: trunk/minix/lib/i86/em/em_nop.s
===================================================================
--- trunk/minix/lib/i86/em/em_nop.s	(revision 9)
+++ 	(revision )
@@ -1,4 +1,0 @@
-.define .nop
-.text
-.nop:
-	ret
Index: trunk/minix/lib/i86/em/em_rck.s
===================================================================
--- trunk/minix/lib/i86/em/em_rck.s	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-.define .rck
-.text
-
-	! descriptor address in bx
-	! value in ax, must be left there
-.rck:
-	cmp     ax,(bx)
-	jl      2f
-	cmp     ax,2(bx)
-	jg      2f
-	ret
-2:
-	push    ax
-ERANGE = 1
-.extern .error
-	mov     ax,#ERANGE
-	call    .error
-	pop     ax
-	ret
Index: trunk/minix/lib/i86/em/em_ret6.s
===================================================================
--- trunk/minix/lib/i86/em/em_ret6.s	(revision 9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-.define .ret6
-.text
-.extern .retarea
-
-.ret6:
-	pop	bx
-	pop	.retarea
-	pop	.retarea+2
-	pop	.retarea+4
-	jmp	(bx)
Index: trunk/minix/lib/i86/em/em_ret8.s
===================================================================
--- trunk/minix/lib/i86/em/em_ret8.s	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-.define .ret8
-.text
-.extern .retarea
-
-.ret8:
-	pop	bx
-	pop	.retarea
-	pop	.retarea+2
-	pop	.retarea+4
-	pop	.retarea+6
-	jmp	(bx)
Index: trunk/minix/lib/i86/em/em_retarea.s
===================================================================
--- trunk/minix/lib/i86/em/em_retarea.s	(revision 9)
+++ 	(revision )
@@ -1,5 +1,0 @@
-.define .retarea
-
-.bss
-.retarea:
-	.zerow 8/2
Index: trunk/minix/lib/i86/em/em_return.s
===================================================================
--- trunk/minix/lib/i86/em/em_return.s	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-.define .sdret, .dsret, .sret, .dret, .cret 
-.text
-
-.dsret:
-	pop	di
-.sret:
-	pop	si
-.cret:
-	mov	sp,bp
-	pop	bp
-	ret
-
-.sdret:
-	pop	si
-.dret:
-	pop	di
-	jmp	.cret
Index: trunk/minix/lib/i86/em/em_rmi4.s
===================================================================
--- trunk/minix/lib/i86/em/em_rmi4.s	(revision 9)
+++ 	(revision )
@@ -1,89 +1,0 @@
-.define .rmi4
-.text
-
-yl=6
-yh=8
-xl=10
-xh=12
-
-.rmi4:
-	push	si
-	push	di
-	mov     si,sp           ! copy of sp
-	mov     bx,yl(si)
-	mov     ax,yh(si)
-	cwd
-	cmp     dx,ax
-	jne     7f
-	and     dx,dx
-	jge     1f
-	neg     bx
-	je      7f
-1:
-	xor     dx,dx
-	mov     cx,xl(si)
-	mov     ax,xh(si)
-	and     ax,ax
-	jge     2f
-	neg     ax
-	neg     cx
-	sbb     ax,dx
-2:
-	div     bx
-	xchg    ax,cx
-	div     bx              ! dx= result(low), 0=result(high)
-	xor     bx,bx
-9:
-	cmp     xh(si),#0
-	jge     1f
-	neg     bx
-	neg     dx
-	sbb     bx,#0
-1:
-			! bx is high order result
-			! dx is low order result
-	mov	ax,dx
-	mov	dx,bx	! result in ax/dx
-	pop	di
-	pop	si
-	ret	8
-
-7:
-	mov     di,ax
-	xor     bx,bx
-	and     di,di
-	jge     1f
-	neg     di
-	neg     yl(si)
-	sbb     di,bx
-1:
-	mov     ax,xl(si)
-	mov     dx,xh(si)
-	and     dx,dx
-	jge     1f
-	neg     dx
-	neg     ax
-	sbb     dx,bx
-1:
-	mov     cx,#16
-1:
-	shl     ax,#1
-	rcl     dx,#1
-	rcl     bx,#1
-	cmp     di,bx
-	ja      3f
-	jb      2f
-	cmp     yl(si),dx
-	jbe     2f
-3:
-	loop    1b
-		! dx=result(low), bx=result(high)
-	jmp     9b
-2:
-	sub     dx,yl(si)
-	sbb     bx,di
-	inc     ax
-	loop    1b
-1:
-		! dx=result(low), bx=result(high)
-	jmp     9b
Index: trunk/minix/lib/i86/em/em_rmu4.s
===================================================================
--- trunk/minix/lib/i86/em/em_rmu4.s	(revision 9)
+++ 	(revision )
@@ -1,61 +1,0 @@
-.define .rmu4
-.text
-
-yl=6
-yh=8
-xl=10
-xh=12
-
-.rmu4:
-	push	si
-	push	di
-	mov     si,sp           ! copy of sp
-	mov     bx,yl(si)
-	mov     ax,yh(si)
-	or      ax,ax
-	jne     7f
-1:
-	xor     dx,dx
-	mov     cx,xl(si)
-	mov     ax,xh(si)
-2:
-	div     bx
-	xchg    ax,cx
-	div     bx
-	xor     bx,bx
-9:
-			! bx is high order result
-			! dx is low order result
-	mov	ax,dx
-	mov	dx,bx
-	pop	di
-	pop	si
-	ret	8	! result in ax/dx
-
-7:
-	mov     di,ax
-	xor     bx,bx
-	mov     ax,xl(si)
-	mov     dx,xh(si)
-	mov     cx,#16
-1:
-	shl     ax,#1
-	rcl     dx,#1
-	rcl     bx,#1
-	cmp     di,bx
-	ja      3f
-	jb      2f
-	cmp     yl(si),dx
-	jbe     2f
-3:
-	loop    1b
-		! dx=result(low), bx=result(high)
-	jmp     9b
-2:
-	sub     dx,yl(si)
-	sbb     bx,di
-	inc     ax
-	loop    1b
-1:
-		! dx=result(low), bx=result(high)
-	jmp     9b
Index: trunk/minix/lib/i86/em/em_sar2.s
===================================================================
--- trunk/minix/lib/i86/em/em_sar2.s	(revision 9)
+++ 	(revision )
@@ -1,33 +1,0 @@
-.define .sar2
-.text
-
-.sar2:
-				! bx, descriptor address
-				! ax, index
-	pop	cx
-	pop	dx		! base address
-	push	cx
-	xchg	di,dx		! di = base address, dx is saved di
-	sub     ax,(bx)
-	mov     cx,4(bx)
-	push	dx
-	imul    cx
-	pop	dx
-	add     di,ax
-	sar     cx,#1
-	jnb     1f
-	pop	bx
-	pop     ax
-	stosb
-	mov	di,dx
-	jmp     (bx)
-1:
-	pop	bx
-	mov	ax,si
-	mov     si,sp
-	rep
-	mov
-	mov     sp,si
-	mov	si,ax
-	mov	di,dx
-	jmp     (bx)
Index: trunk/minix/lib/i86/em/em_sbi.s
===================================================================
--- trunk/minix/lib/i86/em/em_sbi.s	(revision 9)
+++ 	(revision )
@@ -1,27 +1,0 @@
-.define .sbi
-.text
-
-	! #bytes in cx , top of stack in ax
-.sbi:
-	pop     bx              ! return subress
-	cmp     cx,#2
-	jne     1f
-	pop     cx
-	sub     ax,cx
-	neg     ax
-	jmp     (bx)
-1:
-	cmp     cx,#4
-	jne     9f
-	pop     dx
-	pop     cx
-	sub     cx,ax
-	mov     ax,cx
-	pop     cx
-	sbb     cx,dx
-	push    cx
-	jmp     (bx)
-9:
-.extern .trpilin
-	push    bx
-	jmp     .trpilin
Index: trunk/minix/lib/i86/em/em_set.s
===================================================================
--- trunk/minix/lib/i86/em/em_set.s	(revision 9)
+++ 	(revision )
@@ -1,43 +1,0 @@
-.define .set
-.text
-
-	! #bytes in cx
-	! bit # in ax
-.set:
-	pop     bx              ! return address
-	xor     dx,dx
-!ifdef create set
-	sub	sp,cx
-	push	bx
-	push	di
-	mov     bx,sp
-	xor	di,di
-	sar	cx,#1
-1:
-	mov     4(bx)(di),dx
-	inc	di
-	inc	di
-	loop	1b
-!endif
-	mov     bx,#8
-	div     bx
-	cmp     ax,di
-	jae     2f
-	mov	di,dx
-	movb	dl,bits(di)
-	mov     di,sp
-	add     di,ax
-	orb     4(di),dl
-	pop	di
-	ret
-2:
-ESET = 2
-.extern .error
-	pop	di
-	mov     ax,#ESET
-	call	.error
-	ret
-
-	.data
-bits:
-	.data1   1,2,4,8,16,32,64,128
Index: trunk/minix/lib/i86/em/em_stb.s
===================================================================
--- trunk/minix/lib/i86/em/em_stb.s	(revision 9)
+++ 	(revision )
@@ -1,16 +1,0 @@
-.define ___stb
-.text
-
-	! Routine for copying structs.
-___stb:
-	mov	bx,sp
-	push	si
-	push	di
-	mov	cx,2(bx)
-	mov	si,4(bx)
-	mov	di,6(bx)
-	rep
-	movb
-	pop	di
-	pop	si
-	ret
Index: trunk/minix/lib/i86/em/em_sti.s
===================================================================
--- trunk/minix/lib/i86/em/em_sti.s	(revision 9)
+++ 	(revision )
@@ -1,32 +1,0 @@
-.define .sti
-.define .sts
-.text
-
-	! #bytes in cx
-	! address in bx
-	! save di/si. they might be register variables
-.sts:
-	mov	dx,di		! save di
-	mov	di,bx
-	pop     bx              ! return address
-	sar     cx,#1
-	jnb     1f
-	pop     ax
-	stosb
-	mov	di,dx
-	jmp     (bx)
-.sti:
-	! only called with count > 4
-	mov	dx,di
-	mov	di,bx
-	pop	bx
-	sar	cx,#1
-1:
-	mov	ax,si
-	mov     si,sp
-	rep
-	mov
-	mov     sp,si
-	mov	di,dx
-	mov	si,ax
-	jmp     (bx)
Index: trunk/minix/lib/i86/em/em_stop.s
===================================================================
--- trunk/minix/lib/i86/em/em_stop.s	(revision 9)
+++ 	(revision )
@@ -1,4 +1,0 @@
-.define .stop
-.text
-.stop:
-	call	__exit
Index: trunk/minix/lib/i86/em/em_trp.s
===================================================================
--- trunk/minix/lib/i86/em/em_trp.s	(revision 9)
+++ 	(revision )
@@ -1,138 +1,0 @@
-.define .trpdivz
-.define .trpilin
-.define .trpcase
-.define .trprang
-.define .trpset
-.define .trpnofp
-.define .trpheap
-.define .trp
-
-.bss
-.M: .zerow 24/2
-
-.text
-.extern .trpdivz
-.extern .trpilin
-.extern .trpcase
-.extern .trprang
-.extern .trpset
-.extern .trpnofp
-.extern .trpheap
-.extern .trp
-
-.trpdivz:
-mov ax,#6
-mov dx,#.Mdivz
-jmp .Trp
-.trpilin:
-mov ax,#18
-mov dx,#.Milin
-jmp .Trp
-.trpcase:
-mov ax,#20
-mov dx,#.Mcase
-jmp .Trp
-.trprang:
-mov ax,#1
-mov dx,#.Mrang
-jmp .Trp
-.trpset:
-mov ax,#2
-mov dx,#.Mset
-jmp .Trp
-.trpnofp:
-mov ax,#18
-mov dx,#.Mnofp
-jmp .Trp
-.trpheap:
-mov ax,#17
-mov dx,#.Mheap
-jmp .Trp
-
-.Trp:
-xor     bx,bx
-.extern .trppc
-xchg    bx,.trppc
-test    bx,bx
-jz      2f
-push    ax
-call    (bx)
-pop     ax
-ret
-2:
-mov bx,#22
-push bx
-push dx
-mov ax,#2
-push ax
-call .Write
-call __exit
-
-.trp:
-mov dx,ax
-cmp dx,#21
-jae 1f
-sal dx,#1
-mov bx,#.Mtable
-add bx,dx
-mov bx,(bx)
-test bx,bx
-jz 1f
-mov dx,bx
-jmp 2f
-1:
-mov bx,#.Mtrp+14
-mov cx,#6
-mov dx,ax
-1:
-and dx,#7
-add dx,'0'
-movb (bx),dl
-dec bx
-sar dx,#1
-sar dx,#1
-sar dx,#1
-loop 1b
-mov dx,#.Mtrp
-2:
-jmp .Trp
-
-.Write:
-push bp
-mov bp,sp
-mov .M+2,#4
-mov bx,4(bp)
-mov .M+4,bx
-mov bx,8(bp)
-mov .M+6,bx
-mov bx,6(bp)
-mov .M+10,bx
-mov ax,#.M
-push ax
-mov ax,#1
-push ax
-
-mov ax,#1
-mov bx,#.M
-mov cx,#3
-int 32
-mov sp,bp
-pop bp
-ret
-
-
-.data
-.Mtable:
-	.data2 0,	.Mrang,	.Mset,	0,	0,	0,	.Mdivz,	0
-	.data2 0,	0,	0,	0,	0,	0,	0,	0
-	.data2 0,	.Mheap,	.Milin,	.Milin,	.Mcase
-
-.Mdivz: .asciz "Error: Division by 0 \n"
-.Milin: .asciz "Illegal EM instruct'n\n"
-.Mcase: .asciz "Err in EM case instr \n"
-.Mrang: .asciz "Variable out of range\n"
-.Mset:  .asciz "Err in EM set instr  \n"
-.Mnofp: .asciz "Floating pt not impl.\n"
-.Mheap: .asciz "Heap overflow        \n"
-
-.Mtrp:	.asciz "EM trap 0000000 octal\n"
Index: trunk/minix/lib/i86/em/em_unknown.s
===================================================================
--- trunk/minix/lib/i86/em/em_unknown.s	(revision 9)
+++ 	(revision )
@@ -1,9 +1,0 @@
-.define .unknown
-.text
-.extern .fat
-EILLINS = 18
-
-.unknown:
-	mov  ax,#EILLINS
-	push ax
-	jmp  .fat
Index: trunk/minix/lib/i86/em/em_vars.s
===================================================================
--- trunk/minix/lib/i86/em/em_vars.s	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-.define .reghp, .limhp, .ignmask, .trppc
-.extern .reghp, .limhp, .ignmask, .trppc
-
-.data
-.reghp:
-	.data2   endbss
-.limhp:
-	.data2   endbss
-.ignmask:
-	.data2   1336
-.trppc:
-	.data2   0
Index: trunk/minix/lib/i86/em/em_xor.s
===================================================================
--- trunk/minix/lib/i86/em/em_xor.s	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-.define	.xor
-.text
-
-	! #bytes in cx
-.xor:
-	pop	bx		! return address
-	mov	dx,di
-	mov	di,sp
-	add	di,cx
-	sar	cx,#1
-1:
-	pop	ax
-	xor	ax,(di)
-	stos
-	loop	1b
-	mov	di,dx
-	jmp	(bx)
Index: trunk/minix/lib/i86/int64/add64.s
===================================================================
--- trunk/minix/lib/i86/int64/add64.s	(revision 9)
+++ 	(revision )
@@ -1,24 +1,0 @@
-!	add64() - 64 bit addition			Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _add64
-
-_add64:				! u64_t add64(u64_t i, u64_t j);
-	push	bp
-	mov	bp, sp
-	mov	bx, 4(bp)
-	mov	ax, 6(bp)
-	add	ax, 14(bp)
-	mov	(bx), ax
-	mov	ax, 8(bp)
-	adc	ax, 16(bp)
-	mov	2(bx), ax
-	mov	ax, 10(bp)
-	adc	ax, 18(bp)
-	mov	4(bx), ax
-	mov	ax, 12(bp)
-	adc	ax, 20(bp)
-	mov	6(bx), ax
-	mov	ax, bx
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/int64/add64u.s
===================================================================
--- trunk/minix/lib/i86/int64/add64u.s	(revision 9)
+++ 	(revision )
@@ -1,30 +1,0 @@
-!	add64u() - unsigned to 64 bit addition		Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _add64u, _add64ul
-
-_add64u:			! u64_t add64u(u64_t i, unsigned j);
-	push	bp
-	mov	bp, sp
-	xor	cx, cx
-	jmp	0f
-_add64ul:			! u64_t add64ul(u64_t i, unsigned long j);
-	push	bp
-	mov	bp, sp
-	mov	cx, 16(bp)
-0:	mov	bx, 4(bp)
-	mov	ax, 6(bp)
-	add	ax, 14(bp)
-	mov	(bx), ax
-	mov	ax, 8(bp)
-	adc	ax, cx
-	mov	2(bx), ax
-	mov	ax, 10(bp)
-	adc	ax, #0
-	mov	4(bx), ax
-	mov	ax, 12(bp)
-	adc	ax, #0
-	mov	6(bx), ax
-	mov	ax, bx
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/int64/cmp64.s
===================================================================
--- trunk/minix/lib/i86/int64/cmp64.s	(revision 9)
+++ 	(revision )
@@ -1,52 +1,0 @@
-!	cmp64*() - 64 bit compare			Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _cmp64, _cmp64u, _cmp64ul
-
-_cmp64:				! int cmp64(u64_t i, u64_t j);
-	mov	bx, sp
-cmp64:	xor	ax, ax
-	mov	dx, 2(bx)
-	sub	dx, 10(bx)
-	mov	dx, 4(bx)
-	sbb	dx, 12(bx)
-	mov	dx, 6(bx)
-	sbb	dx, 14(bx)
-	mov	dx, 8(bx)
-	sbb	dx, 16(bx)
-	sbb	ax, ax			! ax = - (i < j)
-	mov	dx, 10(bx)
-	sub	dx, 2(bx)
-	mov	dx, 12(bx)
-	sbb	dx, 4(bx)
-	mov	dx, 14(bx)
-	sbb	dx, 6(bx)
-	mov	dx, 16(bx)
-	sbb	dx, 8(bx)
-	adc	ax, #0			! ax = (i > j) - (i < j)
-	ret
-
-_cmp64u:			! int cmp64u(u64_t i, unsigned j);
-	mov	bx, sp
-	push	16(bx)
-	mov	16(bx), #0
-	push	14(bx)
-	mov	14(bx), #0
-	push	12(bx)
-	mov	12(bx), #0
-	call	cmp64
-	pop	12(bx)
-	pop	14(bx)
-	pop	16(bx)
-	ret
-
-_cmp64ul:			! int cmp64ul(u64_t i, unsigned long j);
-	mov	bx, sp
-	push	14(bx)
-	mov	14(bx), #0
-	push	12(bx)
-	mov	12(bx), #0
-	call	cmp64
-	pop	12(bx)
-	pop	14(bx)
-	ret
Index: trunk/minix/lib/i86/int64/cv64u.s
===================================================================
--- trunk/minix/lib/i86/int64/cv64u.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	cv64u() - 64 bit converted to unsigned		Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _cv64u, _cv64ul
-
-_cv64u:				! unsigned cv64u(u64_t i);
-	mov	bx, sp
-	mov	cx, 4(bx)
-	jmp	0f
-
-_cv64ul:			! unsigned long cv64ul(u64_t i);
-	mov	bx, sp
-	xor	cx, cx
-0:	mov	ax, 2(bx)
-	mov	dx, 4(bx)
-	or	cx, 6(bx)
-	or	cx, 8(bx)		! return UINT/ULONG_MAX if really big
-	jz	0f
-	mov	ax, #-1
-	mov	dx, ax
-0:	ret
Index: trunk/minix/lib/i86/int64/cvu64.s
===================================================================
--- trunk/minix/lib/i86/int64/cvu64.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	cvu64() - unsigned converted to 64 bit		Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _cvu64, _cvul64
-
-_cvu64:				! u64_t cvu64(unsigned i);
-	mov	bx, sp
-	xor	dx, dx
-	jmp	0f
-
-_cvul64:			! u64_t cvul64(unsigned long i);
-	mov	bx, sp
-	mov	dx, 6(bx)
-0:	mov	ax, 4(bx)
-	mov	bx, 2(bx)
-	mov	(bx), ax
-	mov	2(bx), dx
-	mov	4(bx), #0
-	mov	6(bx), #0
-	mov	ax, bx
-	ret
Index: trunk/minix/lib/i86/int64/diff64.s
===================================================================
--- trunk/minix/lib/i86/int64/diff64.s	(revision 9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-!	diff64() - 64 bit subtraction giving unsigned 	Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _diff64
-
-_diff64:			! unsigned diff64(u64_t i, u64_t j);
-	mov	bx, sp
-	mov	ax, 2(bx)
-	sub	ax, 10(bx)
-	ret
Index: trunk/minix/lib/i86/int64/div64u.s
===================================================================
--- trunk/minix/lib/i86/int64/div64u.s	(revision 9)
+++ 	(revision )
@@ -1,26 +1,0 @@
-!	div64u() - 64 bit divided by unsigned giving unsigned long
-!							Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _div64u, _rem64u
-
-_div64u:			! unsigned long div64u(u64_t i, unsigned j);
-	mov	bx, sp
-div64u:	xor	dx, dx
-	mov	ax, 8(bx)
-	div	10(bx)
-	mov	ax, 6(bx)
-	div	10(bx)
-	mov	ax, 4(bx)
-	div	10(bx)			! division bits 16-31
-	mov	cx, ax
-	mov	ax, 2(bx)
-	div	10(bx)			! division bits 0-15
-	xchg	dx, cx			! division in dx:ax, remainder in cx
-	ret
-
-_rem64u:			! unsigned rem64u(u64_t i, unsigned j);
-	mov	bx, sp
-	call	div64u
-	mov	ax, cx
-	ret
Index: trunk/minix/lib/i86/int64/ex64.s
===================================================================
--- trunk/minix/lib/i86/int64/ex64.s	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-!	ex64*() - extract low or high 32 bits of a 64 bit number
-!							Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _ex64lo, _ex64hi
-
-_ex64lo:			! unsigned long ex64lo(u64_t i);
-	mov	bx, sp
-	mov	ax, 2(bx)
-	mov	dx, 4(bx)
-	ret
-
-_ex64hi:			! unsigned long ex64hi(u64_t i);
-	mov	bx, sp
-	mov	ax, 6(bx)
-	mov	dx, 8(bx)
-	ret
Index: trunk/minix/lib/i86/int64/make64.s
===================================================================
--- trunk/minix/lib/i86/int64/make64.s	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-!	make64() - make a 64 bit number from two 32 bit halves
-!							Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _make64
-
-_make64:		    ! u64_t make64(unsigned long lo, unsigned long hi);
-	mov	bx, sp
-	mov	ax, 4(bx)
-	mov	dx, 6(bx)
-	mov	cx, 8(bx)
-	push	10(bx)
-	mov	bx, 2(bx)
-	mov	(bx), ax
-	mov	2(bx), dx
-	mov	4(bx), cx
-	pop	6(bx)
-	mov	ax, bx
-	ret
Index: trunk/minix/lib/i86/int64/mul64u.s
===================================================================
--- trunk/minix/lib/i86/int64/mul64u.s	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-!	mul64u() - unsigned long by unsigned multiply giving 64 bit result
-!							Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _mul64u
-
-_mul64u:			! u64_t mul64u(unsigned long i, unsigned j);
-	push	bp
-	mov	bp, sp
-	mov	bx, 4(bp)
-	mov	ax, 6(bp)
-	mul	10(bp)
-	mov	(bx), ax
-	mov	2(bx), dx
-	mov	ax, 8(bp)
-	mul	10(bp)
-	add	2(bx), ax
-	adc	dx, #0
-	mov	4(bx), dx
-	mov	6(bx), #0
-	mov	ax, bx
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/int64/sub64.s
===================================================================
--- trunk/minix/lib/i86/int64/sub64.s	(revision 9)
+++ 	(revision )
@@ -1,24 +1,0 @@
-!	sub64() - 64 bit subtraction			Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _sub64
-
-_sub64:				! u64_t sub64(u64_t i, u64_t j);
-	push	bp
-	mov	bp, sp
-	mov	bx, 4(bp)
-	mov	ax, 6(bp)
-	sub	ax, 14(bp)
-	mov	(bx), ax
-	mov	ax, 8(bp)
-	sbb	ax, 16(bp)
-	mov	2(bx), ax
-	mov	ax, 10(bp)
-	sbb	ax, 18(bp)
-	mov	4(bx), ax
-	mov	ax, 12(bp)
-	sbb	ax, 20(bp)
-	mov	6(bx), ax
-	mov	ax, bx
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/int64/sub64u.s
===================================================================
--- trunk/minix/lib/i86/int64/sub64u.s	(revision 9)
+++ 	(revision )
@@ -1,30 +1,0 @@
-!	sub64u() - unsigned from 64 bit subtraction	Author: Kees J. Bot
-!								24 Dec 1995
-.sect .text
-.define _sub64u, _sub64ul
-
-_sub64u:			! u64_t sub64u(u64_t i, unsigned j);
-	push	bp
-	mov	bp, sp
-	xor	cx, cx
-	jmp	0f
-_sub64ul:			! u64_t sub64ul(u64_t i, unsigned long j);
-	push	bp
-	mov	bp, sp
-	mov	cx, 16(bp)
-0:	mov	bx, 4(bp)
-	mov	ax, 6(bp)
-	sub	ax, 14(bp)
-	mov	(bx), ax
-	mov	ax, 8(bp)
-	sbb	ax, cx
-	mov	2(bx), ax
-	mov	ax, 10(bp)
-	sbb	ax, #0
-	mov	4(bx), ax
-	mov	ax, 12(bp)
-	sbb	ax, #0
-	mov	6(bx), ax
-	mov	ax, bx
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/alloca.s
===================================================================
--- trunk/minix/lib/i86/misc/alloca.s	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#
-!	alloca() - allocate space on the stack		Author: Kees J. Bot
-!								26 Jan 1994
-
-#if __ACK__	/* BCC can't do alloca(), register saving is wrong. */
-
-.text
-.define _alloca
-_alloca:
-	pop	cx		! Return address
-	pop	ax		! Bytes to allocate
-	add	ax, #2*2+1	! Add space for two saved register variables
-	andb	al, #0xFE	! Align
-	mov	bx, sp		! Keep current sp
-	sub	sp, ax		! Lower stack
-	mov	ax, sp		! Return value
-	push	2(bx)		! Push what is probably the saved si
-	push	(bx)		! Saved di
-				! Now ACK can still do:
-				!	pop di; pop si; mov sp, bp; pop bp; ret
-	push	ax		! Dummy argument
-	jmp	(cx)
-#endif
Index: trunk/minix/lib/i86/misc/get_bp.s
===================================================================
--- trunk/minix/lib/i86/misc/get_bp.s	(revision 9)
+++ 	(revision )
@@ -1,15 +1,0 @@
-! get_bp.s
-!
-! return BP in AX
-!
-! Created:	Sep 7, 1992 by Philip Homburg
-
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-.sect .text
-.define _get_bp
-_get_bp:
-	mov	ax, bp
-	ret
-
-! $PchId: get_bp.ack.s,v 1.3 1996/02/23 08:27:48 philip Exp $
Index: trunk/minix/lib/i86/misc/getprocessor.s
===================================================================
--- trunk/minix/lib/i86/misc/getprocessor.s	(revision 9)
+++ 	(revision )
@@ -1,92 +1,0 @@
-!	getprocessor() - determine processor type	Author: Kees J. Bot
-!								26 Jan 1994
-
-.text
-
-	o32 = 0x66		! 32 bit operand size prefix
-
-! int getprocessor(void);
-!	Return 86, 186, 286, 386, 486, 586, ...
-
-.define	_getprocessor
-
-_getprocessor:
-	push	bp
-	mov	bp, sp
-	push	sp		! see if pushed sp == sp
-	pop	ax
-	cmp	ax, sp
-	jz	new_processor
-	mov	cx, #0x0120	! see if shifts are mod 32
-	shlb	ch, cl		! zero tells if 86
-	mov	ax, #86
-	jz	got_processor
-	mov	ax, #186
-	jmp	got_processor
-
-new_processor:			! see if high bits are set in saved IDT
-	sub	sp, #6		! space for IDT ptr
-	sidt	-6(bp)		! save 3 word IDT ptr
-	cmpb	-1(bp), #0xFF	! top byte of IDT ptr is always FF on 286
-	mov	ax, #286
-	je	got_processor
-
-! 386, 486, 586
-	and	sp, #0xFFFC	! Align stack to avoid AC fault (needed?)
-	mov	cx, #0x0004	! Try to flip the AC bit introduced on the 486
-	call	flip
-	mov	ax, #386	! 386 if it didn't react to "flipping"
-	jz	got_processor
-	mov	cx, #0x0020	! Try to flip the ID bit introduced on the 586
-	call	flip
-	mov	ax, #486	! 486 if it didn't react
-	jz	got_processor
-	.data1	o32
-	pushf
-	.data1	o32
-	pusha			! Save the world
-	.data1	o32
-	xor	ax, ax
-	inc	ax		! eax = 1
-	.data1	0x0F, 0xA2	! CPUID instruction tells the processor type
-	andb	ah, #0x0F	! Extract the family (5, 6, ...)
-	movb	al, ah
-	movb	ah, #100
-	mulb	ah		! 500, 600, ...
-	add	ax, #86		! 586, 686, ...
-	mov	bx, sp
-	mov	7*4(bx), ax	! Pass ax through
-	.data1	o32
-	popa
-	.data1	o32
-	popf
-
-got_processor:
-	mov	sp, bp
-	pop	bp
-	ret
-
-flip:
-	push	bx		! Save bx and realign stack to multiple of 4
-	.data1	o32		! About to operate on a 32 bit object
-	pushf			! Push eflags
-	pop	ax
-	pop	dx		! dx:ax = eflags
-	mov	bx, dx		! Save original eflags (high word only)
-	xor	dx, cx		! Flip the bit to test
-	push	dx
-	push	ax		! Push modified eflags value
-	.data1	o32
-	popf			! Load modified eflags register
-	.data1	o32
-	pushf
-	pop	ax
-	pop	dx		! Get it again
-	push	bx
-	push	ax
-	.data1	o32
-	popf			! Restore original eflags register
-	xor	dx, bx		! See if the bit changed
-	test	dx, cx
-	pop	bx		! Restore bx
-	ret
Index: trunk/minix/lib/i86/misc/hton86.s
===================================================================
--- trunk/minix/lib/i86/misc/hton86.s	(revision 9)
+++ 	(revision )
@@ -1,25 +1,0 @@
-!	htonX(), ntohX() - Host to network byte order conversion
-!							Author: Kees J. Bot
-!								7 Jan 1997
-!
-! This is a little endian 8086, so we swap bytes to/from the big endian network
-! order.  The normal <net/hton.h> macros are not used, they give lousy code.
-
-.text
-.define _htons, _ntohs
-_htons:
-_ntohs:
-	mov	bx, sp
-	movb	ah, 2(bx)	! Load bytes into ax in reverse order
-	movb	al, 3(bx)
-	ret
-
-.define _htonl, _ntohl
-_htonl:
-_ntohl:
-	mov	bx, sp
-	movb	dh, 2(bx)	! Load bytes into dx:ax in reverse order
-	movb	dl, 3(bx)
-	movb	ah, 4(bx)
-	movb	al, 5(bx)
-	ret
Index: trunk/minix/lib/i86/misc/io_inb.s
===================================================================
--- trunk/minix/lib/i86/misc/io_inb.s	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!	inb() - Input one byte				Author: Kees J. Bot
-!								18 Mar 1996
-!	unsigned inb(U16_t port);
-
-.sect .text
-.define _inb
-_inb:
-	push	bp
-	mov	bp, sp
-	mov	dx, 4(bp)		! port
-	inb	dx			! read 1 byte
-	xorb	ah, ah
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_inl.s
===================================================================
--- trunk/minix/lib/i86/misc/io_inl.s	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-!	inl() - Input one dword				Author: Kees J. Bot
-!								18 Mar 1996
-!	unsigned inl(U16_t port);
-
-	o32 = 0x66
-
-.sect .text
-.define _inl
-_inl:
-	push	bp
-	mov	bp, sp
-	pushf
-	cli				! eax is not interrupt safe
-	mov	dx, 4(bp)		! port
-	.data1	o32
-	in	dx			! read 1 dword
-	.data1	o32
-	push	ax			! push eax
-	pop	ax
-	pop	dx			! dx:ax = eax
-	popf
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_insb.s
===================================================================
--- trunk/minix/lib/i86/misc/io_insb.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	insb() - Input a byte array			Author: Kees J. Bot
-!								18 Mar 1996
-!	void insb(U16_t port, void *buf, size_t count);
-
-.sect .text
-.define _insb
-_insb:
-	push	bp
-	mov	bp, sp
-	cld
-	push	di
-	mov	dx, 4(bp)		! port
-	mov	di, 6(bp)		! buf
-	mov	cx, 8(bp)		! byte count
-	jcxz	1f
-0:	inb	dx			! input 1 byte
-	stosb				! write 1 byte
-	loop	0b			! many times
-1:	pop	di
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_insl.s
===================================================================
--- trunk/minix/lib/i86/misc/io_insl.s	(revision 9)
+++ 	(revision )
@@ -1,22 +1,0 @@
-!	insl() - Input a dword array			Author: Kees J. Bot
-!								18 Mar 1996
-!	void insl(U16_t port, void *buf, size_t count);
-
-	o32 = 0x66
-
-.sect .text
-.define _insl
-_insl:
-	push	bp
-	mov	bp, sp
-	cld
-	push	di
-	mov	dx, 4(bp)		! port
-	mov	di, 6(bp)		! buf
-	mov	cx, 8(bp)		! byte count
-	shr	cx, #2			! dword count
-	.data1	o32
-   rep	ins				! input many dwords
-	pop	di
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_insw.s
===================================================================
--- trunk/minix/lib/i86/misc/io_insw.s	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-!	insw() - Input a word array			Author: Kees J. Bot
-!								18 Mar 1996
-!	void insw(U16_t port, void *buf, size_t count);
-
-.sect .text
-.define _insw
-_insw:
-	push	bp
-	mov	bp, sp
-	cld
-	push	di
-	mov	dx, 4(bp)		! port
-	mov	di, 6(bp)		! buf
-	mov	cx, 8(bp)		! byte count
-	shr	cx, #1			! word count
-   rep	ins				! input many words
-	pop	di
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_intr.s
===================================================================
--- trunk/minix/lib/i86/misc/io_intr.s	(revision 9)
+++ 	(revision )
@@ -1,16 +1,0 @@
-!	intr_disable(), intr_enable - Disable/Enable hardware interrupts.
-!							Author: Kees J. Bot
-!								18 Mar 1996
-!	void intr_disable(void);
-!	void intr_enable(void);
-
-.sect .text
-.define _intr_disable
-_intr_disable:
-	cli
-	ret
-
-.define _intr_enable
-_intr_enable:
-	sti
-	ret
Index: trunk/minix/lib/i86/misc/io_inw.s
===================================================================
--- trunk/minix/lib/i86/misc/io_inw.s	(revision 9)
+++ 	(revision )
@@ -1,13 +1,0 @@
-!	inw() - Input one word				Author: Kees J. Bot
-!								18 Mar 1996
-!	unsigned inw(U16_t port);
-
-.sect .text
-.define _inw
-_inw:
-	push	bp
-	mov	bp, sp
-	mov	dx, 4(bp)		! port
-	in	dx			! read 1 word
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_outb.s
===================================================================
--- trunk/minix/lib/i86/misc/io_outb.s	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!	outb() - Output one byte			Author: Kees J. Bot
-!								18 Mar 1996
-!	void outb(U16_t port, U8_t value);
-
-.sect .text
-.define _outb
-_outb:
-	push	bp
-	mov	bp, sp
-	mov	dx, 4(bp)		! port
-	mov	ax, 4+2(bp)		! value
-	outb	dx			! output 1 byte
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_outl.s
===================================================================
--- trunk/minix/lib/i86/misc/io_outl.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	outl() - Output one dword			Author: Kees J. Bot
-!								18 Mar 1996
-!	void outl(U16_t port, u32_t value);
-
-	o32 = 0x66
-
-.sect .text
-.define _outl
-_outl:
-	push	bp
-	mov	bp, sp
-	pushf
-	cli				! eax is not interrupt safe
-	mov	dx, 4(bp)		! port
-	.data1	o32
-	mov	ax, 4+2(bp)		! value
-	.data1	o32
-	out	dx			! output 1 dword
-	popf
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_outsb.s
===================================================================
--- trunk/minix/lib/i86/misc/io_outsb.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	outsb() - Output a byte array		Author: Kees J. Bot
-!								18 Mar 1996
-!	void outsb(U16_t port, void *buf, size_t count);
-
-.sect .text
-.define _outsb
-_outsb:
-	push	bp
-	mov	bp, sp
-	cld
-	push	si
-	mov	dx, 4(bp)		! port
-	mov	si, 6(bp)		! buf
-	mov	cx, 8(bp)		! byte count
-	jcxz	1f
-0:	lodsb				! read 1 byte
-	outb	dx			! output 1 byte
-	loop	0b			! many times
-1:	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_outsl.s
===================================================================
--- trunk/minix/lib/i86/misc/io_outsl.s	(revision 9)
+++ 	(revision )
@@ -1,22 +1,0 @@
-!	outsl() - Output a dword array		Author: Kees J. Bot
-!								18 Mar 1996
-!	void outsl(U16_t port, void *buf, size_t count);
-
-	o32 = 0x66
-
-.sect .text
-.define _outsl
-_outsl:
-	push	bp
-	mov	bp, sp
-	cld
-	push	si
-	mov	dx, 4(bp)		! port
-	mov	si, 6(bp)		! buf
-	mov	cx, 8(bp)		! byte count
-	shr	cx, #2			! dword count
-	.data1	o32
-   rep	outs				! output many dwords
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_outsw.s
===================================================================
--- trunk/minix/lib/i86/misc/io_outsw.s	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-!	outsw() - Output a word array		Author: Kees J. Bot
-!								18 Mar 1996
-!	void outsw(U16_t port, void *buf, size_t count);
-
-.sect .text
-.define _outsw
-_outsw:
-	push	bp
-	mov	bp, sp
-	cld
-	push	si
-	mov	dx, 4(bp)		! port
-	mov	si, 6(bp)		! buf
-	mov	cx, 8(bp)		! byte count
-	shr	cx, #1			! word count
-   rep	outs				! output many words
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/io_outw.s
===================================================================
--- trunk/minix/lib/i86/misc/io_outw.s	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!	outw() - Output one word			Author: Kees J. Bot
-!								18 Mar 1996
-!	void outw(U16_t port, U16_t value);
-
-.sect .text
-.define _outw
-_outw:
-	push	bp
-	mov	bp, sp
-	mov	dx, 4(bp)		! port
-	mov	ax, 4+2(bp)		! value
-	out	dx			! output 1 word
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/misc/oneC_sum.s
===================================================================
--- trunk/minix/lib/i86/misc/oneC_sum.s	(revision 9)
+++ 	(revision )
@@ -1,68 +1,0 @@
-!	oneC_sum() - One complement`s checksum		Author: Kees J. Bot
-!								23 May 1998
-! See RFC 1071, "Computing the Internet checksum"
-! See also the C version of this code.
-
-.text
-
-.define _oneC_sum
-	.align	4
-_oneC_sum:
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	mov	ax, 4(bp)		! Checksum of previous block
-	mov	si, 6(bp)		! Data to compute checksum over
-	mov	di, 8(bp)		! Number of bytes
-
-	xor	dx, dx
-	xorb	cl, cl
-align:	test	si, #1			! Is the data aligned?
-	jz	aligned
-	test	di, di
-	jz	0f
-	movb	dh, (si)		! First unaligned byte in high half of
-	dec	di			! the dx register, i.e. rotate 8 bits
-0:	inc	si
-	movb	cl, #8			! Number of bits "rotated"
-	ror	ax, cl			! Rotate the checksum likewise
-aligned:add	ax, dx			! Summate the unaligned byte
-	adc	ax, #0			! Add carry back in for one`s complement
-
-	jmp	add6test
-	.align	4
-add6:	add	ax, (si)		! Six times unrolled loop, see below
-	adc	ax, 2(si)
-	adc	ax, 4(si)
-	adc	ax, 6(si)
-	adc	ax, 8(si)
-	adc	ax, 10(si)
-	adc	ax, #0
-	add	si, #12
-add6test:
-	sub	di, #12
-	jae	add6
-	add	di, #12
-
-	jmp	add1test
-	.align	4
-add1:	add	ax, (si)		! while ((di -= 2) >= 0)
-	adc	ax, #0			!	ax += *si++;
-	add	si, #2			! di += 2;
-add1test:
-	sub	di, #2
-	jae	add1
-	add	di, #2
-
-	jz	done			! Is there an extra byte?
-	movb	dl, (si)		! Load extra byte in word
-	xorb	dh, dh
-	add	ax, dx			! Add in the last bits
-	adc	ax, #0
-done:
-	rol	ax, cl			! Undo the rotation at the beginning
-	pop	di
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/rts/__sigreturn.s
===================================================================
--- trunk/minix/lib/i86/rts/__sigreturn.s	(revision 9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-! This routine is the low-level code for returning from signals.  
-! It calls __sigreturn, which is the normal "system call" routine.
-! Both ___sigreturn and __sigreturn are needed.
-.sect .text; .sect .rom; .sect .data; .sect .bss
-.sect .text
-.define ___sigreturn
-.extern __sigreturn
-___sigreturn:
-	add sp, #8
-	jmp __sigreturn
Index: trunk/minix/lib/i86/rts/_sendrec.s
===================================================================
--- trunk/minix/lib/i86/rts/_sendrec.s	(revision 9)
+++ 	(revision )
@@ -1,32 +1,0 @@
-.define __send, __receive, __sendrec
-
-! See ../h/com.h for C definitions
-SEND = 1
-RECEIVE = 2
-BOTH = 3
-SYSVEC = 32
-
-!*========================================================================*
-!                           _send and _receive                            *
-!*========================================================================*
-! _send(), _receive(), _sendrec() all save bp, but destroy ax, bx, and cx.
-.extern __send, __receive, __sendrec
-__send:	mov cx,*SEND		! _send(dest, ptr)
-	jmp L0
-
-__receive:
-	mov cx,*RECEIVE		! _receive(src, ptr)
-	jmp L0
-
-__sendrec:
-	mov cx,*BOTH		! _sendrec(srcdest, ptr)
-	jmp L0
-
-  L0:	push bp			! save bp
-	mov bp,sp		! can't index off sp
-	mov ax,4(bp)		! ax = dest-src
-	mov bx,6(bp)		! bx = message pointer
-	int SYSVEC		! trap to the kernel
-	pop bp			! restore bp
-	ret			! return
-
Index: trunk/minix/lib/i86/rts/brksize.s
===================================================================
--- trunk/minix/lib/i86/rts/brksize.s	(revision 9)
+++ 	(revision )
@@ -1,4 +1,0 @@
-.define __brksize
-.data
-.extern endbss, __brksize
-__brksize: .data2 endbss
Index: trunk/minix/lib/i86/rts/ncrtso.s
===================================================================
--- trunk/minix/lib/i86/rts/ncrtso.s	(revision 9)
+++ 	(revision )
@@ -1,54 +1,0 @@
-! This is the C run-time start-off routine.  It's job is to take the
-! arguments as put on the stack by EXEC, and to parse them and set them up the
-! way _main expects them.
-! It also initializes _environ when this variable isn't defined by the
-! programmer.  The detection of whether _environ belong to us is rather
-! simplistic.  We simply check for some magic value, but there is no other
-! way.
-
-.extern _main, _exit, crtso, __penviron, __penvp
-.extern begtext, begdata, begbss, endtext, enddata, endbss
-.text
-begtext:
-crtso:
-	xor	bp, bp			! clear for backtrace of core files
-	mov	bx, sp
-	mov	ax, (bx)		! argc
-	lea	dx, 2(bx)		! argv
-	lea	cx, 4(bx)
-	add	cx, ax
-	add	cx, ax			! envp
-
-	! Test if environ is in the initialized data area and is set to our
-	! magic number.  If so then it is not redefined by the user.
-	mov	bx, #_environ
-	cmp	bx, #__edata		! within initialized data?
-	jae	0f
-	testb	bl, #1			! aligned?
-	jnz	0f
-	cmp	(bx), #0x5353		! is it our environ?
-	jne	0f
-	mov	__penviron, bx		! _penviron = &environ;
-0:	mov	bx, __penviron
-	mov	(bx), cx		! *_penviron = envp;
-
-	push	cx			! push envp
-	push	dx			! push argv
-	push	ax			! push argc
-
-	call	_main			! main(argc, argv, envp)
-
-	push	ax			! push exit status
-	call	_exit
-
-	hlt				! force a trap if exit fails
-
-.data
-begdata:
-	.data2	0			! for sep I&D: *NULL == 0
-__penviron:
-	.data2	__penvp			! Pointer to environ, or hidden pointer
-
-.bss
-begbss:
-	.comm	__penvp, 2		! Hidden environment vector
Index: trunk/minix/lib/i86/rts/nm2rtso.s
===================================================================
--- trunk/minix/lib/i86/rts/nm2rtso.s	(revision 9)
+++ 	(revision )
@@ -1,50 +1,0 @@
-! This is the Modula-2 run-time start-off routine.  It's job is to take the
-! arguments as put on the stack by EXEC, and to parse them and set them up the
-! way _m_a_i_n expects them.
-
-.extern __m_a_i_n, _exit, m2rtso, hol0, __penvp
-.extern begtext, begdata, begbss, endtext, enddata, endbss
-.text
-begtext:
-m2rtso:
-	xor	bp, bp			! clear for backtrace of core files
-	mov	bx, sp
-	mov	ax, (bx)		! argc
-	lea	dx, 2(bx)		! argv
-	lea	cx, 4(bx)
-	add	cx, ax
-	add	cx, ax			! envp
-
-	! Test if environ is in the initialized data area and is set to our
-	! magic number.  If so then it is not redefined by the user.
-	mov	bx, #_environ
-	cmp	bx, #__edata		! within initialized data?
-	jae	0f
-	testb	bl, #1			! aligned?
-	jnz	0f
-	cmp	(bx), #0x5353		! is it our environ?
-	jne	0f
-	mov	__penviron, bx		! _penviron = &environ;
-0:	mov	bx, __penviron
-	mov	(bx), cx		! *_penviron = envp;
-
-	push	cx			! push envp
-	push	dx			! push argv
-	push	ax			! push argc
-
-	call	__m_a_i_n		! run Modula-2 program
-
-	push	ax			! push exit status
-	call	__exit
-
-	hlt				! force a trap if exit fails
-
-.data
-begdata:
-	.data2	0			! for sep I&D: *NULL == 0
-__penviron:
-	.data2	__penvp			! Pointer to environ, or hidden pointer
-
-.bss
-begbss:
-	.comm	__penvp, 2		! Hidden environment vector
Index: trunk/minix/lib/i86/rts/nprtso.s
===================================================================
--- trunk/minix/lib/i86/rts/nprtso.s	(revision 9)
+++ 	(revision )
@@ -1,52 +1,0 @@
-! This is the Pascal run-time start-off routine.  It's job is to take the
-! arguments as put on the stack by EXEC, and to parse them and set them up the
-! way _m_a_i_n expects them.
-
-.extern __m_a_i_n, _exit, prtso, hol0, __penvp
-.extern begtext, begdata, begbss, endtext, enddata, endbss
-.text
-begtext:
-prtso:
-	xor	bp, bp			! clear for backtrace of core files
-	mov	bx, sp
-	mov	ax, (bx)		! argc
-	lea	dx, 2(bx)		! argv
-	lea	cx, 4(bx)
-	add	cx, ax
-	add	cx, ax			! envp
-
-	! Test if environ is in the initialized data area and is set to our
-	! magic number.  If so then it is not redefined by the user.
-	mov	bx, #_environ
-	cmp	bx, #__edata		! within initialized data?
-	jae	0f
-	testb	bl, #1			! aligned?
-	jnz	0f
-	cmp	(bx), #0x5353		! is it our environ?
-	jne	0f
-	mov	__penviron, bx		! _penviron = &environ;
-0:	mov	bx, __penviron
-	mov	(bx), cx		! *_penviron = envp;
-
-	push	cx			! push envp
-	push	dx			! push argv
-	push	ax			! push argc
-
-	mov	.ignmask, #56
-
-	call	__m_a_i_n		! run Pascal program
-
-	push	ax			! push exit status
-	call	__exit
-
-	hlt				! force a trap if exit fails
-
-.data
-begdata:
-	.data2	0			! for sep I&D: *NULL == 0
-__penviron:
-	.data2	__penvp			! Pointer to environ, or hidden pointer
-
-.bss
-begbss:
-	.comm	__penvp, 2		! Hidden environment vector
Index: trunk/minix/lib/i86/string/README
===================================================================
--- trunk/minix/lib/i86/string/README	(revision 9)
+++ 	(revision )
@@ -1,5 +1,0 @@
-Notes on i8086 string assembly routines.		Author: Kees J. Bot
-								27 Jan 1994
-
-These routines are simply translations of the 386 code, so all comments
-to that code apply here.
Index: trunk/minix/lib/i86/string/_memmove.s
===================================================================
--- trunk/minix/lib/i86/string/_memmove.s	(revision 9)
+++ 	(revision )
@@ -1,50 +1,0 @@
-!	_memmove()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! void *_memmove(void *s1, const void *s2, size_t n)
-!	Copy a chunk of memory.  Handle overlap.
-!
-.sect .text
-.define __memmove, __memcpy
-__memmove:
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	mov	di, 4(bp)	! String s1
-	mov	si, 6(bp)	! String s2
-	mov	cx, 8(bp)	! Length
-	mov	ax, di
-	sub	ax, si
-	cmp	ax, cx
-	jb	downwards	! if (s2 - s1) < n then copy downwards
-__memcpy:
-	cld			! Clear direction bit: upwards
-	cmp	cx, #16
-	jb	upbyte		! Don't bother being smart with short arrays
-	mov	ax, si
-	or	ax, di
-	testb	al, #1
-	jnz	upbyte		! Bit 0 set, use byte copy
-upword:	shr	cx, #1
-    rep	movs			! Copy words
-	adc	cx, cx		! One more byte?
-upbyte:
-    rep	movsb			! Copy bytes
-done:	mov	ax, 4(bp)	! Absolutely noone cares about this value
-	pop	di
-	pop	si
-	pop	bp
-	ret
-
-! Handle bad overlap by copying downwards, don't bother to do word copies.
-downwards:
-	std			! Set direction bit: downwards
-	add	si, cx
-	dec	si
-	add	di, cx
-	dec	di
-    rep	movsb			! Copy bytes
-	cld
-	jmp	done
Index: trunk/minix/lib/i86/string/_strncat.s
===================================================================
--- trunk/minix/lib/i86/string/_strncat.s	(revision 9)
+++ 	(revision )
@@ -1,37 +1,0 @@
-!	_strncat()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *_strncat(char *s1, const char *s2, size_t dx)
-!	Append string s2 to s1.
-!
-.sect .text
-.define __strncat
-__strncat:
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	mov	di, 4(bp)	! String s1
-	mov	cx, #-1
-	xorb	al, al		! Null byte
-	cld
-  repne	scasb			! Look for the zero byte in s1
-	dec	di		! Back one up (and clear 'Z' flag)
-	push	di		! Save end of s1
-	mov	di, 6(bp)	! di = string s2
-	mov	cx, dx		! Maximum count
-  repne	scasb			! Look for the end of s2
-	jne	no0
-	inc	cx		! Exclude null byte
-no0:	sub	dx, cx		! Number of bytes in s2
-	mov	cx, dx
-	mov	si, 6(bp)	! si = string s2
-	pop	di		! di = end of string s1
-    rep	movsb			! Copy bytes
-	stosb			! Add a terminating null
-	mov	ax, 4(bp)	! Return s1
-	pop	di
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/_strncmp.s
===================================================================
--- trunk/minix/lib/i86/string/_strncmp.s	(revision 9)
+++ 	(revision )
@@ -1,36 +1,0 @@
-!	strncmp()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! int strncmp(const char *s1, const char *s2, size_t cx)
-!	Compare two strings.
-!
-.sect .text
-.define __strncmp
-__strncmp:
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	xor	ax, ax		! Prepare return value
-	test	cx, cx		! Max length is zero?
-	je	equal
-	mov	si, 4(bp)	! si = string s1
-	mov	di, 6(bp)	! di = string s2
-	cld
-compare:
-	cmpsb			! Compare two bytes
-	jne	unequal
-	cmpb	-1(si), #0	! End of string?
-	je	equal
-	dec	cx		! Length limit reached?
-	jne	compare
-	jmp	equal
-unequal:
-	ja	after
-	sub	ax, #2		! if (s1 < s2) ax -= 2;
-after:	inc	ax		! ax++, now it's -1 or 1
-equal:	pop	di
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/_strncpy.s
===================================================================
--- trunk/minix/lib/i86/string/_strncpy.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	_strncpy()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *_strncpy(char *s1, const char *s2, size_t cx)
-!	Copy string s2 to s1.
-!
-.sect .text
-.define __strncpy
-__strncpy:
-	mov	di, 6(bp)	! di = string s2
-	xorb	al, al		! Look for a zero byte
-	mov	dx, cx		! Save maximum count
-	cld
-  repne	scasb			! Look for end of s2
-	sub	dx, cx		! Number of bytes in s2 including null
-	xchg	cx, dx
-	mov	si, 6(bp)	! si = string s2
-	mov	di, 4(bp)	! di = string s1
-    rep	movsb			! Copy bytes
-	ret
Index: trunk/minix/lib/i86/string/_strnlen.s
===================================================================
--- trunk/minix/lib/i86/string/_strnlen.s	(revision 9)
+++ 	(revision )
@@ -1,26 +1,0 @@
-!	_strnlen()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! size_t _strnlen(const char *s, size_t cx)
-!	Return the length of a string.
-!
-.sect .text
-.define __strnlen
-__strnlen:
-	push	bp
-	mov	bp, sp
-	push	di
-	mov	di, 4(bp)	! di = string
-	xorb	al, al		! Look for a zero byte
-	mov	dx, cx		! Save maximum count
-	cmpb	cl, #1		! 'Z' bit must be clear if cx = 0
-	cld
-  repne	scasb			! Look for zero
-	jne	no0
-	inc	cx		! Don't count zero byte
-no0:	mov	ax, dx
-	sub	ax, cx		! Compute bytes scanned
-	pop	di
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/bcmp.s
===================================================================
--- trunk/minix/lib/i86/string/bcmp.s	(revision 9)
+++ 	(revision )
@@ -1,28 +1,0 @@
-!	bcmp()						Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! int bcmp(const void *s1, const void *s2, size_t n)
-!	Compare two chunks of memory.
-!	This is a BSD routine that escaped from the kernel.  Don't use.
-!	(Alas it is not without some use, it reports the number of bytes
-!	after the bytes that are equal.  So it can't be simply replaced.)
-!
-.sect .text
-.define _bcmp
-_bcmp:
-	push	bp
-	mov	bp, sp
-	push	8(bp)
-	push	6(bp)
-	push	4(bp)
-	call	_memcmp		! Let memcmp do the work
-	mov	sp, bp
-	test	ax, ax
-	jz	equal
-	sub	dx, 4(bp)	! Memcmp was nice enough to leave "si" in dx
-	dec	dx		! Number of bytes that are equal
-	mov	ax, 8(bp)
-	sub	ax, dx		! Number of bytes that are unequal
-equal:	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/bcopy.s
===================================================================
--- trunk/minix/lib/i86/string/bcopy.s	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-!	bcopy()						Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! void bcopy(const void *s1, void *s2, size_t n)
-!	Copy a chunk of memory.  Handle overlap.
-!	This is a BSD routine that escaped from the kernel.  Don't use.
-!
-.sect .text
-.define _bcopy
-.extern __memmove
-_bcopy:
-	pop	cx
-	pop	ax
-	pop	dx		! Pop return address and arguments
-	push	ax
-	push	dx		! Arguments reversed
-	push	cx
-	jmp	__memmove	! Call the proper routine
Index: trunk/minix/lib/i86/string/bzero.s
===================================================================
--- trunk/minix/lib/i86/string/bzero.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	bzero()						Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! void bzero(void *s, size_t n)
-!	Set a chunk of memory to zero.
-!	This is a BSD routine that escaped from the kernel.  Don't use.
-!
-.sect .text
-.define _bzero
-_bzero:
-	push	bp
-	mov	bp, sp
-	push	6(bp)		! Size
-	xor	ax, ax
-	push	ax		! Zero
-	push	4(bp)		! String
-	call	_memset		! Call the proper routine
-	mov	sp, bp
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/index.s
===================================================================
--- trunk/minix/lib/i86/string/index.s	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-!	index()						Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *index(const char *s, int c)
-!	Look for a character in a string.  Has suffered from a hostile
-!	takeover by strchr().
-!
-.sect .text
-.define _index
-_index:
-	jmp	_strchr
Index: trunk/minix/lib/i86/string/memchr.s
===================================================================
--- trunk/minix/lib/i86/string/memchr.s	(revision 9)
+++ 	(revision )
@@ -1,28 +1,0 @@
-!	memchr()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! void *memchr(const void *s, int c, size_t n)
-!	Look for a character in a chunk of memory.
-!
-.sect .text
-.define _memchr
-_memchr:
-	push	bp
-	mov	bp, sp
-	push	di
-	mov	di, 4(bp)	! di = string
-	movb	al, 6(bp)	! The character to look for
-	mov	cx, 8(bp)	! Length
-	cmpb	cl, #1		! 'Z' bit must be clear if cx = 0
-	cld
-  repne	scasb
-	jne	failure
-	lea	ax, -1(di)	! Found
-	pop	di
-	pop	bp
-	ret
-failure:xor	ax, ax
-	pop	di
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/memcmp.s
===================================================================
--- trunk/minix/lib/i86/string/memcmp.s	(revision 9)
+++ 	(revision )
@@ -1,44 +1,0 @@
-!	memcmp()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! int memcmp(const void *s1, const void *s2, size_t n)
-!	Compare two chunks of memory.
-!
-.sect .text
-.define _memcmp
-_memcmp:
-	cld
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	xor	ax, ax		! Prepare return value
-	mov	si, 4(bp)	! String s1
-	mov	di, 6(bp)	! String s2
-	mov	cx, 8(bp)	! Length
-	cmp	cx, #16
-	jb	cbyte		! Don't bother being smart with short arrays
-	mov	dx, si
-	or	dx, di
-	andb	dl, #1
-	jnz	cbyte		! Bit 0 set, use byte compare
-cword:	sar	cx, #1
-	adcb	dl, dl		! Save carry
-   repe	cmps			! Compare words
-	mov	cx, #2		! Recompare the last word
-	sub	si, cx
-	sub	di, cx
-	addb	cl, dl		! One more byte?
-cbyte:	test	cx, cx		! Set 'Z' flag if cx = 0
-last:
-   repe	cmpsb			! Look for the first differing byte
-	je	equal
-	ja	after
-	sub	ax, #2		! if (s1 < s2) ax -= 2;
-after:	inc	ax		! ax++, now it's -1 or 1
-equal:	mov	dx, si		! For bcmp() to play with
-	pop	di
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/memcpy.s
===================================================================
--- trunk/minix/lib/i86/string/memcpy.s	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-!	memcpy()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! void *memcpy(void *s1, const void *s2, size_t n)
-!	Copy a chunk of memory.
-!	This routine need not handle overlap, so it does not handle overlap.
-!	One could simply call __memmove, the cost of the overlap check is
-!	negligible, but you are dealing with a programmer who believes that
-!	if anything can go wrong, it should go wrong.
-!
-.sect .text
-.define _memcpy
-_memcpy:
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	mov	di, 4(bp)	! String s1
-	mov	si, 6(bp)	! String s2
-	mov	cx, 8(bp)	! Length
-	! No overlap check here
-	jmp	__memcpy	! Call the part of __memmove that copies up
Index: trunk/minix/lib/i86/string/memmove.s
===================================================================
--- trunk/minix/lib/i86/string/memmove.s	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-!	memmove()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! void *memmove(void *s1, const void *s2, size_t n)
-!	Copy a chunk of memory.  Handle overlap.
-!
-.sect .text
-.define _memmove
-_memmove:
-	jmp	__memmove	! Call common code
Index: trunk/minix/lib/i86/string/memset.s
===================================================================
--- trunk/minix/lib/i86/string/memset.s	(revision 9)
+++ 	(revision )
@@ -1,31 +1,0 @@
-!	memset()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! void *memset(void *s, int c, size_t n)
-!	Set a chunk of memory to the same byte value.
-!
-.sect .text
-.define _memset
-_memset:
-	push	bp
-	mov	bp, sp
-	push	di
-	mov	di, 4(bp)	! The string
-	movb	al, 6(bp)	! The fill byte
-	mov	cx, 8(bp)	! Length
-	cld
-	cmp	cx, #16
-	jb	sbyte		! Don't bother being smart with short arrays
-	test	di, #1
-	jnz	sbyte		! Bit 0 set, use byte store
-sword:	movb	ah, al		! One byte to two bytes
-	sar	cx, #1
-    rep	stos			! Store words
-    	adc	cx, cx		! One more byte?
-sbyte:
-    rep	stosb			! Store bytes
-done:	mov	ax, 4(bp)	! Return some value you have no need for
-	pop	di
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/rindex.s
===================================================================
--- trunk/minix/lib/i86/string/rindex.s	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-!	rindex()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *rindex(const char *s, int c)
-!	Look for the last occurrence a character in a string.  Has suffered
-!	from a hostile takeover by strrchr().
-!
-.sect .text
-.define _rindex
-_rindex:
-	jmp	_strrchr
Index: trunk/minix/lib/i86/string/strcat.s
===================================================================
--- trunk/minix/lib/i86/string/strcat.s	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-!	strcat()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *strcat(char *s1, const char *s2)
-!	Append string s2 to s1.
-!
-.sect .text
-.define _strcat
-_strcat:
-	mov	dx, #-1		! Unlimited length
-	jmp	__strncat	! Common code
Index: trunk/minix/lib/i86/string/strchr.s
===================================================================
--- trunk/minix/lib/i86/string/strchr.s	(revision 9)
+++ 	(revision )
@@ -1,38 +1,0 @@
-!	strchr()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *strchr(const char *s, int c)
-!	Look for a character in a string.
-!
-.sect .text
-.define _strchr
-_strchr:
-	push	bp
-	mov	bp, sp
-	push	di
-	cld
-	mov	di, 4(bp)	! di = string
-	mov	dx, #16		! Look at small chunks of the string
-next:	shl	dx, #1		! Chunks become bigger each time
-	mov	cx, dx
-	xorb	al, al		! Look for the zero at the end
-  repne	scasb
-	pushf			! Remember the flags
-	sub	cx, dx
-	neg	cx		! Some or all of the chunk
-	sub	di, cx		! Step back
-	movb	al, 6(bp)	! The character to look for
-  repne	scasb
-	je	found
-	popf			! Did we find the end of string earlier?
-	jne	next		! No, try again
-	xor	ax, ax		! Return NULL
-	pop	di
-	pop	bp
-	ret
-found:	pop	ax		! Get rid of those flags
-	lea	ax, -1(di)	! Address of byte found
-	pop	di
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/strcmp.s
===================================================================
--- trunk/minix/lib/i86/string/strcmp.s	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-!	strcmp()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! int strcmp(const char *s1, const char *s2)
-!	Compare two strings.
-!
-.sect .text
-.define _strcmp
-_strcmp:
-	mov	cx, #-1		! Unlimited length
-	jmp	__strncmp	! Common code
Index: trunk/minix/lib/i86/string/strcpy.s
===================================================================
--- trunk/minix/lib/i86/string/strcpy.s	(revision 9)
+++ 	(revision )
@@ -1,21 +1,0 @@
-!	strcpy()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *strcpy(char *s1, const char *s2)
-!	Copy string s2 to s1.
-!
-.sect .text
-.define _strcpy
-_strcpy:
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	mov	cx, #-1		! Unlimited length
-	call	__strncpy	! Common code
-	mov	ax, 4(bp)	! Return s1
-	pop	di
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/strlen.s
===================================================================
--- trunk/minix/lib/i86/string/strlen.s	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-!	strlen()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! size_t strlen(const char *s)
-!	Return the length of a string.
-!
-.sect .text
-.define _strlen
-_strlen:
-	mov	cx, #-1		! Unlimited length
-	jmp	__strnlen	! Common code
Index: trunk/minix/lib/i86/string/strncat.s
===================================================================
--- trunk/minix/lib/i86/string/strncat.s	(revision 9)
+++ 	(revision )
@@ -1,13 +1,0 @@
-!	strncat()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! size_t strncat(char *s1, const char *s2, size_t n)
-!	Append string s2 to s1.
-!
-.sect .text
-.define _strncat
-_strncat:
-	mov	bx, sp
-	mov	dx, 6(bx)	! Maximum length
-	jmp	__strncat	! Common code
Index: trunk/minix/lib/i86/string/strncmp.s
===================================================================
--- trunk/minix/lib/i86/string/strncmp.s	(revision 9)
+++ 	(revision )
@@ -1,13 +1,0 @@
-!	strncmp()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! int strncmp(const char *s1, const char *s2, size_t n)
-!	Compare two strings.
-!
-.sect .text
-.define _strncmp
-_strncmp:
-	mov	bx, sp
-	mov	cx, 6(bx)	! Maximum length
-	jmp	__strncmp	! Common code
Index: trunk/minix/lib/i86/string/strncpy.s
===================================================================
--- trunk/minix/lib/i86/string/strncpy.s	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-!	strncpy()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *strncpy(char *s1, const char *s2, size_t n)
-!	Copy string s2 to s1.
-!
-.sect .text
-.define _strncpy
-_strncpy:
-	push	bp
-	mov	bp, sp
-	push	si
-	push	di
-	mov	cx, 8(bp)	! Maximum length
-	call	__strncpy	! Common code
-	mov	cx, dx		! Number of bytes not copied
-    rep	stosb			! strncpy always copies n bytes by null padding
-	mov	ax, 4(bp)	! Return s1
-	pop	di
-	pop	si
-	pop	bp
-	ret
Index: trunk/minix/lib/i86/string/strnlen.s
===================================================================
--- trunk/minix/lib/i86/string/strnlen.s	(revision 9)
+++ 	(revision )
@@ -1,13 +1,0 @@
-!	strnlen()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! size_t strnlen(const char *s, size_t n)
-!	Return the length of a string.
-!
-.sect .text
-.define _strnlen
-_strnlen:
-	mov	bx, sp
-	mov	cx, 4(bx)	! Maximum length
-	jmp	__strnlen	! Common code
Index: trunk/minix/lib/i86/string/strrchr.s
===================================================================
--- trunk/minix/lib/i86/string/strrchr.s	(revision 9)
+++ 	(revision )
@@ -1,33 +1,0 @@
-!	strrchr()					Author: Kees J. Bot
-!								27 Jan 1994
-.sect .text; .sect .rom; .sect .data; .sect .bss
-
-! char *strrchr(const char *s, int c)
-!	Look for the last occurrence a character in a string.
-!
-.sect .text
-.define _strrchr
-_strrchr:
-	push	bp
-	mov	bp, sp
-	push	di
-	mov	di, 4(bp)	! di = string
-	mov	cx, #-1
-	xorb	al, al
-	cld
-  repne	scasb			! Look for the end of the string
-	not	cx		! -1 - cx = Length of the string + null
-	dec	di		! Put di back on the zero byte
-	movb	al, 6(bp)	! The character to look for
-	std			! Downwards search
-  repne	scasb
-	cld			! Direction bit back to default
-	jne	failure
-	lea	ax, 1(di)	! Found it
-	pop	di
-	pop	bp
-	ret
-failure:xor	ax, ax		! Not there
-	pop	di
-	pop	bp
-	ret
