06-04-2010, 11:17 AM
Straight to assembler, without O3 -
Turns the relevant part into:
With O3, it does certainly see the optimization, showing that the optimizer module is very impressive!:
The other thing that I'm curious about (as I noted in the other post, with this code in it), is that it doesn't load HL with [@label+1] - it loads it with @label, and then does inc HL. This isn't optimized by -O3.
Code:
SUB pokethis(value as uByte)
poke @label+1,value
return
label:
asm
LD A,0 ; This will be poked.
end asm
END SUB
Turns the relevant part into:
Code:
_pokethis:
push ix
ld ix, 0
add ix, sp
ld hl, __LABEL__label
inc hl
push hl
ld a, (ix+5)
pop hl
ld (hl), a
jp _pokethis__leave
__LABEL__label:
#line 6
LD A,00
With O3, it does certainly see the optimization, showing that the optimizer module is very impressive!:
Code:
_pokethis:
push ix
ld ix, 0
add ix, sp
ld hl, __LABEL__label
inc hl
ld a, (ix+5)
ld (hl), a
jp _pokethis__leave
The other thing that I'm curious about (as I noted in the other post, with this code in it), is that it doesn't load HL with [@label+1] - it loads it with @label, and then does inc HL. This isn't optimized by -O3.