mappum / DCPU-16

:floppy_disk: A javascript emulator for DCPU-16 (the computer system in Mojang's new game, 0x10c). Works in browsers and Node.
http://mappum.github.com/DCPU-16/
94 stars 18 forks source link

Compile labels to short literals where possible #44

Open Twisol opened 12 years ago

Twisol commented 12 years ago

This compiles to 7DC1 0002:

SET PC, loop
:loop

However, this compiles to 85C1:

SET PC, 1

They both do the same thing, but the latter uses one less word.

mappum commented 12 years ago

I know. I implemented the labels to always use another word. I've planned on fixing that, but since it doesn't affect functionality, it hasn't been the highest priority.

Twisol commented 12 years ago

Okay. I'm just adding things to the issue tracker as they come up.