Fix mdoc(7)/man(7) mix up.
[netbsd-mini2440.git] / lib / libc / arch / m68k / string / swab.S
blob5cdc6272e411af96a268b42cb2c3f687f1d00d03
1 /*      $NetBSD: swab.S,v 1.6 1997/01/04 03:26:29 jtc Exp $     */
3 #include <machine/asm.h>
5 ENTRY(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
12 swloop:
13         movw    %a0@+,%d1
14         rorw    #8,%d1
15         movw    %d1,%a1@+
16         subql   #1,%d0
17         jne     swloop
19 swdone:
20         rts