1/* $NetBSD: swab.S,v 1.6 1997/01/04 03:26:29 jtc Exp $ */ 2 3#include <machine/asm.h> 4 5ENTRY(swab) 6 movl sp@(4),a0 | source 7 movl sp@(8),a1 | destination 8 movl sp@(12),d0 | count 9 lsrl #1,d0 | count is in bytes; we need words 10 jeq swdone 11 12swloop: 13 movw a0@+,d1 14 rorw #8,d1 15 movw d1,a1@+ 16 subql #1,d0 17 jne swloop 18 19swdone: 20 rts 21