1997-01-04 06:26:18 +03:00
|
|
|
/* $NetBSD: swab.S,v 1.6 1997/01/04 03:26:29 jtc Exp $ */
|
1995-11-17 23:21:10 +03:00
|
|
|
|
1997-01-04 06:26:18 +03:00
|
|
|
#include <machine/asm.h>
|
1993-12-07 02:16:05 +03:00
|
|
|
|
|
|
|
ENTRY(swab)
|
1995-02-08 21:33:12 +03:00
|
|
|
movl sp@(4),a0 | source
|
|
|
|
movl sp@(8),a1 | destination
|
|
|
|
movl sp@(12),d0 | count
|
|
|
|
lsrl #1,d0 | count is in bytes; we need words
|
1997-01-04 06:21:11 +03:00
|
|
|
jeq swdone
|
1993-12-07 02:16:05 +03:00
|
|
|
|
|
|
|
swloop:
|
|
|
|
movw a0@+,d1
|
|
|
|
rorw #8,d1
|
|
|
|
movw d1,a1@+
|
|
|
|
subql #1,d0
|
1997-01-04 06:21:11 +03:00
|
|
|
jne swloop
|
1993-12-07 02:16:05 +03:00
|
|
|
|
|
|
|
swdone:
|
|
|
|
rts
|