05-02-2012, 10:02 AM
Not sure if this is a bug, per se - but it is certainly a bit ugly.
This even survived the peephole optimizer.
Input Basic:
IF myCurrentVector = %1000 then
Output assembly:
ld a, (ix+9)
sub 8
sub 1
jp nc, __LABEL56
Two subs in a row? And worse "Sub 1" instead of a dec?
It later tests:
IF myCurrentVector = %0001 then
as:
ld a, (ix+9)
dec a
sub 1
jp nc, __LABEL63
And I'm not even convinced that's the same test as "equal to x" Surely that's testing "If myCurrentVector>x" anyway?
This even survived the peephole optimizer.
Input Basic:
IF myCurrentVector = %1000 then
Output assembly:
ld a, (ix+9)
sub 8
sub 1
jp nc, __LABEL56
Two subs in a row? And worse "Sub 1" instead of a dec?
It later tests:
IF myCurrentVector = %0001 then
as:
ld a, (ix+9)
dec a
sub 1
jp nc, __LABEL63
And I'm not even convinced that's the same test as "equal to x" Surely that's testing "If myCurrentVector>x" anyway?