Commit be5be9c9 authored by zygzagZ's avatar zygzagZ

error do lib

parent 50ebcb21
...@@ -6,3 +6,5 @@ t.e ...@@ -6,3 +6,5 @@ t.e
/lat/ /lat/
/latc /latc
/tests/ /tests/
hello
dist
...@@ -15,4 +15,4 @@ pushl $hello ...@@ -15,4 +15,4 @@ pushl $hello
call printStr call printStr
movl $0, %eax movl $0, %eax
pushl $0 pushl $0
call exit call error
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// as --32 hello32.s -o hello32.o // as --32 hello32.s -o hello32.o
// ld -m elf_i386 -L. -e main runtime.o hello32.o -lc // ld -m elf_i386 -L. -e main runtime.o hello32.o -lc
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
int printInt(int a) { int printInt(int a) {
printf("%d\n", a); printf("%d\n", a);
...@@ -39,3 +40,8 @@ int readInt () { ...@@ -39,3 +40,8 @@ int readInt () {
else else
return result; 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