aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcompile4
-rw-r--r--compile.bat4
-rw-r--r--src/inputhud.c2
-rw-r--r--src/l4d1democompat.c12
-rw-r--r--src/wincrt.c2
5 files changed, 12 insertions, 12 deletions
diff --git a/compile b/compile
index a15605b..5345cd3 100755
--- a/compile
+++ b/compile
@@ -25,10 +25,10 @@ stdflags="-std=c2x -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64"
dbg=0
if [ "$dbg" = 1 ]; then
- cflags="-O0 -g3 -fsanitize-trap=undefined -DSST_DBG"
+ cflags="-O0 -g3 -masm=intel -fsanitize-trap=undefined -DSST_DBG"
ldflags="-O0 -g3"
else
- cflags="-O2 -fvisibility=hidden"
+ cflags="-O2 -fvisibility=hidden -masm=intel"
ldflags="-O2 -s"
fi
diff --git a/compile.bat b/compile.bat
index a9ccf44..e1e2a32 100644
--- a/compile.bat
+++ b/compile.bat
@@ -26,10 +26,10 @@ set dbg=0
:: XXX: -Og would be nice but apparently a bunch of stuff still gets inlined
:: which can be somewhat annoying so -O0 it is.
if "%dbg%"=="1" (
- set cflags=-O0 -g3 -fsanitize-trap=undefined -DSST_DBG
+ set cflags=-O0 -g3 -masm=intel -fsanitize-trap=undefined -DSST_DBG
set ldflags=-O0 -g3
) else (
- set cflags=-O2
+ set cflags=-O2 -masm=intel
set ldflags=-O2
)
diff --git a/src/inputhud.c b/src/inputhud.c
index b93e9d8..2620f3c 100644
--- a/src/inputhud.c
+++ b/src/inputhud.c
@@ -152,7 +152,7 @@ static inline int bsf(uint x) {
int ret = 0;
#if defined(__GNUC__) || defined(__clang__)
__asm__ volatile (
- "bsfl %1, %0\n"
+ "bsf %0, %1\n"
: "+r" (ret)
: "r" (x)
);
diff --git a/src/l4d1democompat.c b/src/l4d1democompat.c
index 105b812..1d27984 100644
--- a/src/l4d1democompat.c
+++ b/src/l4d1democompat.c
@@ -123,12 +123,12 @@ __attribute__((naked))
#endif
static int hook_midpoint() {
__asm__ volatile (
- "pushl %%eax\n"
- "movl %1, %%eax\n"
- "movl (%%eax), %%eax\n" // dereference this_protocol
- "movl %%eax, %0\n" // store in demoversion
- "popl %%eax\n"
- "jmpl *%2\n"
+ "push eax\n"
+ "mov eax, %1\n"
+ "mov eax, [eax]\n" // dereference this_protocol
+ "mov %0, eax\n" // store in demoversion
+ "pop eax\n"
+ "jmp dword ptr %2\n"
: "=m" (demoversion)
: "m" (this_protocol), "m" (ReadDemoHeader_midpoint)
);
diff --git a/src/wincrt.c b/src/wincrt.c
index d8111ba..566b272 100644
--- a/src/wincrt.c
+++ b/src/wincrt.c
@@ -14,7 +14,7 @@ int memcmp(const void *restrict x, const void *restrict y, unsigned int sz) {
#if defined(__GNUC__) || defined(__clang__)
int a, b;
__asm__ volatile (
- "xor %%eax, %%eax\n"
+ "xor eax, eax\n"
"repz cmpsb\n"
: "+D" (x), "+S" (y), "+c" (sz), "=@cca"(a), "=@ccb"(b)
: