Category : OS/2 Files
Archive   : EMXLIB8F.ZIP
Filename : SWAB.S

 
Output of file : SWAB.S contained in archive : EMXLIB8F.ZIP
/ swab.s (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes

.globl _swab

/ void swab (const void *src, void *dst, size_t n)
/ {
/ char *s, *d;
/
/ if (n & 1) return;
/ while (n > 0)
/ {
/ d[0] = s[1];
/ d[1] = s[0];
/ d += 2; s += 2; n -= 2;
/ }
/ }

/ assumes ds=es!

.text

.align 2, 0x90

_swab:
pushl %esi
pushl %edi
movl 3*4(%esp), %esi / src
movl 4*4(%esp), %edi / dst
movl 5*4(%esp), %ecx / n
shrl $1, %ecx
jc 9f
.align 2, 0x90
1: lodsw
xchgb %al, %ah
stosw
loop 1b
9: popl %edi
popl %esi
ret


  3 Responses to “Category : OS/2 Files
Archive   : EMXLIB8F.ZIP
Filename : SWAB.S

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/