640K ought to be enough for anybody

master
Joey Hines 2019-04-26 18:48:12 -05:00
commit 2ab26948f4
2 changed files with 34 additions and 0 deletions

5
README.md 100644
View File

@ -0,0 +1,5 @@
# fucky wucky
## Build
for now build with this
gcc -m32 -nostdlib -nostdinc -static -Wall -O2 main.c -o out

29
main.c 100644
View File

@ -0,0 +1,29 @@
#define owo main
#define whatsdis return
#define touches asm
#define yoursyscall volatile
//TODO make this safe
int size_of(void * in) {
void * tmp = in;
while(*(char *)in != 0) {
in = in+1;
}
whatsdis in - tmp;
}
int owo() {
char tmp1[] = "Hello world\n";
int temp1;
touches yoursyscall ("int $0x80":
"=a" (temp1):
"a" (4), "b" (1), "c" (tmp1), "d" (size_of(tmp1))
: "memory");
asm volatile ("int $0x80" : : "a" (1), "b" (0));
whatsdis temp1;
}