NetBSD/lib/libc/arch/m68k/string/swab.S

21 lines
346 B
ArmAsm
Raw Normal View History

1999-10-26 03:48:07 +04:00
/* $NetBSD: swab.S,v 1.7 1999/10/25 23:48:16 thorpej Exp $ */
#include <machine/asm.h>
1993-12-07 02:16:05 +03:00
ENTRY(swab)
1999-10-26 03:48:07 +04: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
jeq swdone
1993-12-07 02:16:05 +03:00
swloop:
1999-10-26 03:48:07 +04:00
movw %a0@+,%d1
rorw #8,%d1
movw %d1,%a1@+
subql #1,%d0
jne swloop
1993-12-07 02:16:05 +03:00
swdone:
rts