mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 17:04:19 +00:00
Upload
Digital Research
This commit is contained in:
17
CPM OPERATING SYSTEMS/CPM 68K/1.0X SOURCES/v102a/clib/swab.c
Normal file
17
CPM OPERATING SYSTEMS/CPM 68K/1.0X SOURCES/v102a/clib/swab.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/* swab - swap (hi/lo) bytes in an area of memory */
|
||||
/* constructed to allow in-place swabs (fr==to) */
|
||||
#include <portab.h>
|
||||
|
||||
WORD swab(fr,to,num) /* CLEAR FUNCTION ***********/
|
||||
REG BYTE *fr;
|
||||
REG BYTE *to;
|
||||
REG WORD num;
|
||||
{
|
||||
REG BYTE t;
|
||||
for( ; num>0; num -= 2, fr += 2, to += 2) {
|
||||
t = fr[0];
|
||||
to[0] = fr[1];
|
||||
to[1] = t;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user