Error handler, makefile optimisation
This commit is contained in:
+17
-3
@@ -8,9 +8,14 @@ extrn print.str
|
||||
extrn print.nl
|
||||
extrn exit
|
||||
|
||||
macro nl {
|
||||
call print.nl
|
||||
}
|
||||
|
||||
|
||||
section '.strtab'
|
||||
filename db "makefile", 0
|
||||
error db "An error occurred while opening the file", 0
|
||||
|
||||
|
||||
section '.bss' writeable
|
||||
@@ -22,17 +27,26 @@ _start:
|
||||
push filename
|
||||
call file.open
|
||||
pop eax
|
||||
|
||||
cmp eax, 0
|
||||
jne @f
|
||||
push error
|
||||
call print.str
|
||||
nl
|
||||
call exit
|
||||
|
||||
@@:
|
||||
mov [file_], eax
|
||||
|
||||
push dword [file_]
|
||||
call print.str
|
||||
call print.nl
|
||||
call print.nl
|
||||
nl
|
||||
nl
|
||||
|
||||
push dword [file_]
|
||||
call file.content
|
||||
call print.str
|
||||
call print.nl
|
||||
nl
|
||||
|
||||
push dword [file_]
|
||||
call file.close
|
||||
|
||||
Reference in New Issue
Block a user