🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.masscomp
1 messages
1 total messages Started by Stan Barber, Moderator Thu, 18 Jun 1987 22:33
Assembler version of bcopy -- take 2
#38
Author: Stan Barber, Moderator
Date: Thu, 18 Jun 1987 22:33
112 lines
3617 bytes
Here are a revised version of bcopy with a version of bzero.
Please be sure to let me know if I have made a mistake in my
assembler!
Stan Barber

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	bcopy.s
#	bzero.s
# This archive created: Thu Jun 18 17:31:04 1987
# By:	Stan Barber, Moderator (Masscomp Users' Society)
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'bcopy.s'" '(714 characters)'
if test -f 'bcopy.s'
then
	echo shar: "will not over-write existing file 'bcopy.s'"
else
sed 's/^	X//' << \SHAR_EOF > 'bcopy.s'
	X| bcopy
	X| call from c just like the
	X| regular bcopy library routine.
	X| hopefully this one is much faster
	X|
	X| $Header: bcopy.s,v 1.3 87/06/18 17:24:38 sim Exp $
	X|
	X| $Log:	bcopy.s,v $
	X| Revision 1.3  87/06/18  17:24:38  sim
	X| cleaned up and commented
	X|
	X| By Stan Barber
	X| Copyright 1987 Stan Barber
	X| All Right Reserved. This code may be distributed freely
	X| as long as this copyright notice remains intact.
	X|
	X| 
	X|
	X|
	X	.text
	X				| bcopy.s
	X	.globl	_bcopy
	X_bcopy:	link.w	a6,#0
	X				|
	X	move.l	(8,a6),a0	| load first pointer into a0
	X	move.l	(12,a6),a1	| load second pointer into a1
	X	move.l	(16,a6),d0	| load counter into d0
	X	cmp.w	#1,d0
	X	blt	_bcp2
	X_bcp1:	move.b	(a0)+,(a1)+
	X	dbra	d0,_bcp1
	X_bcp2:	unlk	a6
	X	rts
	X	.data
	X	.bss
SHAR_EOF
if test 714 -ne "`wc -c < 'bcopy.s'`"
then
	echo shar: "error transmitting 'bcopy.s'" '(should have been 714 characters)'
fi
fi
echo shar: "extracting 'bzero.s'" '(824 characters)'
if test -f 'bzero.s'
then
	echo shar: "will not over-write existing file 'bzero.s'"
else
sed 's/^	X//' << \SHAR_EOF > 'bzero.s'
	X| bzero
	X| call from c just like the
	X| regular bzero library routine.
	X| hopefully this one is much faster
	X|
	X| $Header: bzero.s,v 1.2 87/06/18 17:24:24 sim Exp $
	X|
	X| $Log:	bzero.s,v $
	X| Revision 1.2  87/06/18  17:24:24  sim
	X| cleaned up and commented
	X| 
	X| Revision 1.1  87/06/18  17:19:45  sim
	X| Initial revision
	X| 
	X| By Stan Barber
	X| Copyright 1987 Stan Barber
	X| All Right Reserved. This code may be distributed freely
	X| as long as this copyright notice remains intact.
	X|
	X|
	X|
	X	.text
	X				| bzero.s
	X	.globl	_bzero
	X_bzero:	link.w	a6,#0
	X				|
	X	move.l	(8,a6),a0	| load first pointer into a0
	X	move.l	(12,a6),d0	| load counter into d0
	X	cmp.w	#1,d0		| is the counter less than 1?
	X	blt	_bzr2		| if yes, return
	X_bzr1:	clr.b	(a0)+		| clear each byte
	X	dbra	d0,_bzr1	| until the counter is zero
	X_bzr2:	unlk	a6		| return
	X	rts
	X	.data
	X	.bss
SHAR_EOF
if test 824 -ne "`wc -c < 'bzero.s'`"
then
	echo shar: "error transmitting 'bzero.s'" '(should have been 824 characters)'
fi
fi
exit 0
#	End of shell archive
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads