Code: Select all
.macro assert_branch_page label_
.assert >(label_) = >*, error, "Page crossing detected!"
.endmacro
test:
beq :+
assert_branch_page :+ ; .assert will happen if this would cross a page
nop
:
rts
Moderator: Moderators
Code: Select all
.macro assert_branch_page label_
.assert >(label_) = >*, error, "Page crossing detected!"
.endmacro
test:
beq :+
assert_branch_page :+ ; .assert will happen if this would cross a page
nop
:
rts
That sure would be nice.thefox wrote:Maybe new builtin functions (e.g., .strleft, .strright and .strmid) should be added to complement .left, .right and .mid.
Yeah, that's why I was wondering if anyone had thought of a better way to do this.The macro you gave might expand to quite inefficient code (not exactly sure when ca65 evaluates certain parts of it).