; If name isn't yet defined, defines it with value .macro SET_DEFAULT name,value .ifndef name name=value .endif .endmacro ; Sets name to 1 if value is non-zero, 0 otherwise .macro SET_FLAG name,value .if value name=1 .else name=0 .endif .endmacro .macro PRINT_FLAG flag .if flag .error "true" .else .error "false" .endif .end .endmacro ; jxx equivalents to bxx .macpack longbranch ; blt, bge equivalents to bcc, bcs .macro blt Target bcc Target .endmacro .macro bge Target bcs Target .endmacro .macro jge Target jcs Target .endmacro .macro jlt Target jcc Target .endmacro ; Generates string in RODATA and inserts address in code .macro str_addr text .local Addr .rodata Addr: .ifnblank text .byte text .endif .byte 0 .code .word Addr .endmacro ; Simplified declaration of variable in RAM ; Reserves size bytes in zeropage for name .macro zp_res name,size .zeropage name: .res size .code .endmacro ; Reserves size bytes in bss for name .macro bss_res name,size .bss name: .res size .code .endmacro ; Reserves size bytes in zeropage or bss .macro ram_res name,size .zeropage name: .res size .code .endmacro ; Reserves byte in zeropage for name .macro zp_byte name zp_res name,1 .endmacro