🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.masscomp
2 messages
2 total messages Started by masscomp-request Sun, 07 Jun 1987 19:20
assembler routine for bcopy
#35
Author: masscomp-request
Date: Sun, 07 Jun 1987 19:20
36 lines
1492 bytes
Here is an assembler routine to use in place of bcopy().

If you have assembler routines you'd like to share, please
send them to masscomp@soma.uucp.

Stan Barber
--------------------------------------------------------
| bcopy
| call from c just like the
| regular bcopy library routine.
| hopefully this one is much faster
|
| $Header: bcopy.s,v 1.1 87/06/06 17:35:10 sim Exp $
|
| By Stan Barber
| Copyright 1987 Stan Barber
| All Right Reserved. This code may be distributed freely
| as long as this copyright notice remains intact.
|
	.text
				| bcopy.c
	.globl	_bcopy
_bcopy:	link.w	a6,#0
				|
	move.l	(8,a6),a0	| load first pointer into a0
	move.l	(12,a6),a1	| load second pointer into a1
	move.l	(16,a6),d0	| load counter into d0
_bcp1:	move.b	(a0)+,(a1)+	| copy a byte from on to the other
				| and increment the pointer
	dbra	d0,_bcp1	| decrement the count and test
				| if still greater than zero 
				| branch back to the label
	unlk	a6
	rts
	.data
	.bss
Re: assembler routine for bcopy
#37
Author: Joe Buck
Date: Mon, 15 Jun 1987 09:20
14 lines
1280 bytes
In article <3130@soma.bcm.tmc.edu>, sob@soma.bcm.tmc.edu (Stan Barber) writes:
> Here is an assembler routine to use in place of bcopy().

It's fine as long as the number of bytes to copy is greater than
zero.  If given a zero length argument, it will copy 2^32 bytes!
The fix is easy: add a conditional branch after copying the
length argument to d0.
-- 
- Joe Buck    jbuck@epimass.EPI.COM  (in the brave new world of domains!)
		{seismo,ucbvax,sun,decwrl,<smart-site>}!epimass.epi.com!jbuck

[ARRGH! Thanks Joe. I forgot that....It has been a long time since I
write assembly... sigh-- sob]
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