%ifndef DEBUG_INC %define DEBUG_INC %ifndef ZSTRING_INC %include "zstring.inc" %endif %ifndef DTOS_INC %include "dtos.inc" %endif %ifndef MONAD_INC %include "monad.inc" %endif section .data m_make debug_register ;; TODO: Make print without newlineg %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 %macro REGD 0-2 rax,h section .text lea rax, [%1] m_return rel m_debug_register m_bind data_to_zstring_m%2 m_call print_zstring %endm %macro FLAGD 0-1 h pushfq pop rax REGD rax, %1 %endm %endif