summaryrefslogtreecommitdiff
path: root/05/main.b
diff options
context:
space:
mode:
Diffstat (limited to '05/main.b')
-rw-r--r--05/main.b14
1 files changed, 12 insertions, 2 deletions
diff --git a/05/main.b b/05/main.b
index 4621a80..a35f3eb 100644
--- a/05/main.b
+++ b/05/main.b
@@ -1,3 +1,5 @@
+#define G_DEBUG 0
+
; add 24 + 16 = 40 to the stack pointer to put argc, argv in the right place
byte 0x48
byte 0x81
@@ -8,7 +10,6 @@ byte 0
byte 0
goto main
-
global object_macros_size
global function_macros_size
; these are allocated in main()
@@ -86,6 +87,15 @@ global functions_required_stack_space
#include parse.b
#include codegen.b
+function debug_puts
+ argument str
+ if G_DEBUG == 0 goto return_0
+ return puts(str)
+function debug_putsln
+ argument str
+ if G_DEBUG == 0 goto return_0
+ return putsln(str)
+
function types_init
argument _types
argument ptypes_bytes_used
@@ -208,7 +218,7 @@ function main
local i
local output_fd
local memory
-
+
memory = malloc(4000)
statement_datas = memory
statement_datas_ends = memory + 400