0 Members and 2 Guests are viewing this topic.
These will decrease size, but also slightly decrease speed. I believe that Quigibo prefers smaller sizes over slightly slower code.
The problem with a compile setting for size/speed is that generally, you want part of your code to be optimized for size and another part to be optimized for speed. This could be done with "speed-op" and "size-op" commands or perhaps a prefix for labels like "Lbl +LBL" indicates everything until the next label is optimized for speed and everything else by default is optimized for size. Any shared subroutines like multiplication are added in the second pass so if multiplication was flagged to be fast in one place, it would be fast everywhere else too since it has to add the huge routine to your code anyway, all the other calls should share it.It would make the parser a lot bigger, but it has room. I'm almost full on the first page, but I still have about 10KB of extra room on the second page. Commands are data in the Axe app so they would go on that page anyway.
;##### OLD #####p_Mul: ld b,h ld c,l ld hl,0 ld a,16__MulNext: add hl,hl rl e rl d jr nc,__MulSkip add hl,bc jr nc,__MulSkip inc de__MulSkip: dec a jr nz,__MulNext ret
;###### NEW ######p_Mul: ld c,h ld a,l ld hl,0 ld b,16__MulNext: add hl,hl rla rl c jr nc,__MulSkip add hl,de adc a,0 jr nc,__MulSkip inc c__MulSkip: djnz __MulNext ret