11.11Sriastrad/* $NetBSD: swab.S,v 1.11 2014/03/18 18:20:37 riastradh 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.10Smatt#ifdef __mcoldfire__ 141.10Smatt movb (%a0)+,1(%a1) 151.10Smatt movb (%a0)+,(%a1) 161.10Smatt addql #2,%a1 171.10Smatt#else 181.8Smatt movw (%a0)+,%d1 191.7Sthorpej rorw #8,%d1 201.8Smatt movw %d1,(%a1)+ 211.10Smatt#endif 221.7Sthorpej subql #1,%d0 231.5Sjtc jne swloop 241.1Smycroft 251.1Smycroftswdone: 261.1Smycroft rts 271.9SmattEND(swab) 28