🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.masscomp
Article #38

Assembler version of bcopy -- take 2

#38
From: 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
Technical Details
Message-ID: <3137@soma.bcm.tmc.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-spam!mordor!lll-tis!ptsfa!hoptoad!academ!uhnix1!soma!masscomp

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-spam!mordor!lll-tis!ptsfa!hoptoad!academ!uhnix1!soma!masscomp
From: masscomp@soma.bcm.tmc.edu (Stan Barber, Moderator)
Newsgroups: comp.sys.masscomp
Subject: Assembler version of bcopy -- take 2
Message-ID: <3137@soma.bcm.tmc.edu>
Date: Thu, 18-Jun-87 18:33:12 EDT
Article-I.D.: soma.3137
Posted: Thu Jun 18 18:33:12 1987
Date-Received: Thu, 25-Jun-87 06:32:12 EDT
Organization: Masscomp Users' Society
Lines: 112
Keywords: masscomp 68000 assembler c-library bzero bcopy
Approved: masscomp@soma.bcm.tmc.edu
Summary: bcopy.s and bzero.s for your use