# SDL-1.2: added Watcom i386 inline asm for SDL\_Swap64()

**URL:** <https://discourse.libsdl.org/t/sdl-1-2-added-watcom-i386-inline-asm-for-sdl-swap64/28934>\
**Category:** SDL Commits\
**Created:** [February 23, 2021, 2:38pm UTC](https://discourse.libsdl.org/t/sdl-1-2-added-watcom-i386-inline-asm-for-sdl-swap64/28934 "2021-02-23T14:38:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [February 23, 2021, 2:38pm UTC](https://discourse.libsdl.org/t/sdl-1-2-added-watcom-i386-inline-asm-for-sdl-swap64/28934/1 "2021-02-23T14:38:02Z")

</div>

> <https://github.com/libsdl-org/SDL-1.2/commit/5dfe5127e52dbd78ec8dee59762fe0786ae40641>

```diff
From 5dfe5127e52dbd78ec8dee59762fe0786ae40641 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 23 Feb 2021 17:37:10 +0300
Subject: [PATCH] added Watcom i386 inline asm for SDL_Swap64()

---
 include/SDL_endian.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/SDL_endian.h b/include/SDL_endian.h
index 48ae0eea..48f7860d 100644
--- a/include/SDL_endian.h
+++ b/include/SDL_endian.h
@@ -195,6 +195,14 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x)
 	__asm__ ("bswapq %0" : "=r" (x) : "0" (x));
 	return x;
 }
+#elif defined( __WATCOMC__ ) && defined( __386__ )
+extern _inline Uint64 SDL_Swap64(Uint64);
+#pragma aux SDL_Swap64 = \
+	"bswap eax" \
+	"bswap edx" \
+	"xchg eax,edx" \
+	parm [eax edx] \
+	modify [eax edx];
 #else
 static __inline__ Uint64 SDL_Swap64(Uint64 x)
 {

```
