diff options
-rw-r--r-- | debug.inc | 25 | ||||
-rw-r--r-- | main.asm | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/debug.inc b/debug.inc new file mode 100644 index 0000000..e401c1f --- /dev/null +++ b/debug.inc @@ -0,0 +1,25 @@ +%ifndef DEBUG_INC +%define DEBUG_INC +%ifndef ZSTRING_INC +%include "zstring.inc" +%endif +%ifndef DTOS_INC +%include "dtos.inc" +%endif + + ;; TODO: Make print without newline +%macro DEBUG_HERE 0-1 "" + section .data + make_zstring %%head, "Log: ", __?FILE?__,":" + make_zstring %%text, %1,10 + section .text + lea rax, [rel %%head] + call print_zstring + mov rax, __?LINE?__ + call data_to_zstring_md + mov rax, [rax] + call print_zstring + lea rax, [rel %%text] + call print_zstring +%endm +%endif @@ -6,6 +6,7 @@ %include "zstring.inc" %include "dtos.inc" %include "file.inc" +%include "debug.inc" section .data make_lstring test_lstring, "LString Test: Ok",10 |