From 29defd705dcaf25d4a080f7db8f76e8787fca146 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 30 Apr 2017 11:28:11 -0400 Subject: back to AT&T syntax for assembly this reverts 5c04730534ea7933855429c5fc5dc7b22eba7bc2. sadly the quality of the intel dialect in llvm's assembly parser has many frustrating bugs, and generally has unfortunate syntax. the plan is to use AT&T for now since it at least works, and eventually zig will have its own assembly parser for x86 and it will be as close to NASM as possible. --- std/special/bootstrap.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'std/special/bootstrap.zig') diff --git a/std/special/bootstrap.zig b/std/special/bootstrap.zig index f7e6a35c88..00010bf0c9 100644 --- a/std/special/bootstrap.zig +++ b/std/special/bootstrap.zig @@ -19,10 +19,10 @@ export nakedcc fn _start() -> noreturn { switch (@compileVar("arch")) { Arch.x86_64 => { - argc_ptr = asm("lea %[argc], [rsp]": [argc] "=r" (-> &usize)); + argc_ptr = asm("lea (%%rsp), %[argc]": [argc] "=r" (-> &usize)); }, Arch.i386 => { - argc_ptr = asm("lea %[argc], [esp]": [argc] "=r" (-> &usize)); + argc_ptr = asm("lea (%%esp), %[argc]": [argc] "=r" (-> &usize)); }, else => @compileError("unsupported arch"), } -- cgit v1.2.3