Last active
December 22, 2015 01:39
-
-
Save romac/6397977 to your computer and use it in GitHub Desktop.
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
BITS 64 | |
global _foo | |
_foo: | |
mov rax, 42 | |
ret |
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
#include <stdio.h> | |
int foo( void ); | |
int main( void ) | |
{ | |
printf( "%d\n", foo() ); | |
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
foo: main.o foo.o | |
clang -o $@ $^ | |
%.o: %.c | |
clang -o $@ -c $^ | |
%.o: %.s | |
yasm -f macho64 -o $@ $^ | |
clean: | |
rm foo | |
rm ./*.o | |
.PHONY: clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment