File:  [Atari MiNT] / MiNT / src / gas / quickzer.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:55:36 2018 UTC (8 years, 1 month ago) by root
Branches: mint, MAIN
CVS tags: mint095, HEAD
MiNT 0.95 pl13

|

| quickzero(char *place, long size): zero an area of memory. "size" is

| the number of 256 byte blocks in the area, and must be > 0.

| registers changed: d0 and a0

|

	.globl	_quickzero

_quickzero:

	movel	sp@(4), a0	| place to zero at

	movel	sp@(8), d0	| number of blocks

	moveml	d1-d7/a1, sp@-	| save registers

	clrl	d1		| zero them out

	movel	d1, d2

	movel	d1, d3

	movel	d1, d4

	movel	d1, d5

	movel	d1, d6

	movel	d1, d7

	movel	d1, a1

	subql	#1, d0		| adjust for dbra loop

loop:

	moveml	d1-d7/a1, a0@	| zero the memory, 32 bytes at a time

	moveml	d1-d7/a1, a0@(32)

	moveml	d1-d7/a1, a0@(64)

	moveml	d1-d7/a1, a0@(96)

	moveml	d1-d7/a1, a0@(128)

	moveml	d1-d7/a1, a0@(160)

	moveml	d1-d7/a1, a0@(192)

	moveml	d1-d7/a1, a0@(224)

	lea	a0@(256), a0

	dbra	d0, loop

|

	moveml	sp@+, d1-d7/a1	| restore regs

	rts			| and leave


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.