aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-08-03 15:16:08 +0100
committerGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-08-03 15:16:08 +0100
commit9853d19b4de3e66138da8b3e66ccdaea356ea35b (patch)
tree290d1444941e19f837f45a4c46e6fc066ca2b8d5 /src
parent3cce0e5621dc118b32c4143b42ced51c5328f7c7 (diff)
downloadsst-9853d19b4de3e66138da8b3e66ccdaea356ea35b.tar.gz
sst-9853d19b4de3e66138da8b3e66ccdaea356ea35b.zip
Switch to Intel assembly syntax
Diffstat (limited to 'src')
-rw-r--r--src/inputhud.c2
-rw-r--r--src/l4d1democompat.c12
-rw-r--r--src/wincrt.c2
3 files changed, 8 insertions, 8 deletions
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)
: