Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
output ASM
#6
Bump!

I noticed this still happens in latest ZX BASIC version:

britlion Wrote:Input Basic:

IF myCurrentVector = %1000 then

Output assembly:

ld a, (ix+9)
sub 8
sub 1
jp nc, __LABEL56

Notice that "and a / jp nz" works exactly like "sub 1 / jp nc" but it's shorter and faster. Unless you really need flag C to indicate expression result?

Also if you keep track if "sub 8" was the last instruction that affected flags, then your optimizer should be able to remove "and a" in most cases afterwards.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)