swab.S revision 1.9
11.9Smatt/* $NetBSD: swab.S,v 1.9 2013/07/16 21:46:42 matt Exp $ */ 21.4Sthorpej 31.6Sjtc#include <machine/asm.h> 41.1Smycroft 51.1SmycroftENTRY(swab) 61.8Smatt movl 4(%sp),%a0 | source 71.8Smatt movl 8(%sp),%a1 | destination 81.8Smatt movl 12(%sp),%d0 | count 91.7Sthorpej lsrl #1,%d0 | count is in bytes; we need words 101.5Sjtc jeq swdone 111.1Smycroft 121.1Smycroftswloop: 131.8Smatt movw (%a0)+,%d1 141.7Sthorpej rorw #8,%d1 151.8Smatt movw %d1,(%a1)+ 161.7Sthorpej subql #1,%d0 171.5Sjtc jne swloop 181.1Smycroft 191.1Smycroftswdone: 201.1Smycroft rts 211.9SmattEND(swab) 22