Code: Select all
.macro my_macro source, dest, rega, regb
.if (!.blank({rega}) || !.blank({regb}))
...
Moderator: Moderators
Code: Select all
.macro my_macro source, dest, rega, regb
.if (!.blank({rega}) || !.blank({regb}))
...
Code: Select all
.if ((.blank(rega)) || (.blank(regb)))
Code: Select all
.if (!(.blank(rega)) || !(.blank(regb)))
Code: Select all
.if ((!(.blank(rega))) || (!(.blank(regb))))
Code: Select all
.if !(.blank({rega}) && .blank({regb}))
Code: Select all
foo = 1
bar = 1
xyzzy = !foo || !bar
; Equivalent to: .not foo .or .not bar
Code: Select all
foo = 1
bar = 1
xyzzy = !foo || (!bar)
; Equivalent to: .not foo .or (.not bar)
That seems somewhat common for ca65. Just one more weirdness we have to watch out for, then.thefox wrote:Looks like this extremely unintuitive behavior is by design
Yeah, I can tolerate many of the quirks (more so the ones where I know there's a good bit of implementation complexity), but there are quite a few quirks now that really annoy me, mainly the ones which just seem like bad design decisions. This is one of them. Another is the one where zeropage variables may get absolute addressing depending on whether they are scoped or not. Macro variables not being local to the macro by default is a third one. I'm sure there were a few others that I can't remember right now as well.tokumaru wrote:That seems somewhat common for ca65. Just one more weirdness we have to watch out for, then.thefox wrote:Looks like this extremely unintuitive behavior is by design