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
