jkotlinski / durexforth

Modern C64 Forth
Other
230 stars 28 forks source link

Optimize EXIT, C!, C@ and 0= #436

Closed KarolS closed 2 years ago

KarolS commented 2 years ago

Hi!

I found few places where I could squeeze some more bytes or cycles.

EXIT: 2 bytes, 1 cycle saved.

C!:

3 bytes, 3 cycles saved.

C@:

3 bytes, 3 cycles saved.

0= For numbers 1-$ff, 6 cycles saved. For numbers $100, $200,... $ff00, 6 cycles more. Since the former are much more common than the latter, it's statistically a net saving. Other numbers unaffected.

jkotlinski commented 2 years ago

Looks great! Thank you for the contribution!