Commit be5be9c9 authored by zygzagZ's avatar zygzagZ

error do lib

parent 50ebcb21
......@@ -6,3 +6,5 @@ t.e
/lat/
/latc
/tests/
hello
dist
......@@ -15,4 +15,4 @@ pushl $hello
call printStr
movl $0, %eax
pushl $0
call exit
call error
......@@ -2,6 +2,7 @@
// as --32 hello32.s -o hello32.o
// ld -m elf_i386 -L. -e main runtime.o hello32.o -lc
#include <stdio.h>
#include <stdlib.h>
int printInt(int a) {
printf("%d\n", a);
......@@ -39,3 +40,8 @@ int readInt () {
else
return result;
}
void error() {
puts("runtime error");
exit(1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment