sprintf working! (but not snprintf ...)

This commit is contained in:
pommicket 2022-02-13 22:12:44 -05:00
parent 2fef698195
commit b9fd2a2b9c
7 changed files with 1724 additions and 65 deletions

View file

@ -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