X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=asminc%2Fcbm.mac;h=6d7ac7e8ddb00bc6d793ceed98571d42e08a7c29;hb=HEAD;hp=b2bfe5992420fc422b65c268cbbdef3a67e333ab;hpb=662aef4efaf01cadbe7b690266466c1c0fc9fbf8;p=cc65 diff --git a/asminc/cbm.mac b/asminc/cbm.mac index b2bfe5992..6d7ac7e8d 100644 --- a/asminc/cbm.mac +++ b/asminc/cbm.mac @@ -1,9 +1,13 @@ ; Convert characters to screen codes -; Helper macro that converts and outputs one character +; Macro that converts one character. +; scrbyte() can be used as an instruction operand +.define scrbyte(code) (<(.strat ("h@dbdlhh", code >> 5) << 4) ^ code) + +; Helper macro that stores one character .macro _scrcode char .if (char < 256) - .byte <(.strat ("h@dbdlhh", char >> 5) << 4) ^ char + .byte scrbyte {char} .else .error "scrcode: Character constant out of range" .endif @@ -38,13 +42,9 @@ ; Anything else is an error .else - .error "scrcode: invalid argument type" - .endif ; Call the macro recursively with the remaining args scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 .endmacro - -