Created
January 31, 2024 19:07
-
-
Save MEhrn00/3110b390fed9606503831af653437e6f to your computer and use it in GitHub Desktop.
Clang inline assembly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // clang -target x86_64-pc-windows-gnu --sysroot=/usr/x86_64-w64-mingw32 -fuse-ld=lld main_asm.c -o main.exe -L/usr/lib/gcc/x86_64-w64-mingw32/13.2.0/ -static | |
| #include <windows.h> | |
| int main() { | |
| asm volatile(".intel_syntax noprefix;" | |
| "mov rax, 8;" | |
| ".att_syntax;"); | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // clang -target x86_64-pc-windows-gnu --sysroot=/usr/x86_64-w64-mingw32 -fasm-blocks -fuse-ld=lld main_msvc.c -o main.exe -L/usr/lib/gcc/x86_64-w64-mingw32/13.2.0/ -static | |
| #include <windows.h> | |
| int main() { | |
| __asm { | |
| mov rax, 8; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment