Years ago when I was trying to learn ARM ASM, I tried to use gcc as a learning tool. The ASM syntax generated by gcc was really weird so I gave up. Looking back, giving up on gcc may have been premature.
In the modern world, could clang to be used to learn and compile ASM? Preliminary testing indicates that the following works:
Makefile
test.c
I have never used x86 ASM, so I can not tell if the generated .s file is readable or not.
In the modern world, could clang to be used to learn and compile ASM? Preliminary testing indicates that the following works:
Makefile
Code:
test : test.s
clang -o test test.s
test.s : test.c
clang -S test.c
clean :
rm -f test.s test
test.c
Code:
#include "stdio.h"
int main(int argc, char **argv)
{
printf("Hello world!\n");
return 0;
}
I have never used x86 ASM, so I can not tell if the generated .s file is readable or not.