06-04-2010, 11:41 AM
britlion Wrote:Straight to assembler, without O3 -And it's OK:
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
POKE Expr1, Expr2 could be something like:
Code:
POKE 10, 2
Code:
POKE SIN(EXP(3*LN 52)) / RND * 72, RND *45 + USR "a" OR 1
Optimization in the backend stage (pipeline, -O3) knows this (to some extent).
Britlion Wrote:With O3, it does certainly see the optimization, showing that the optimizer module is very impressive!;-) thx!
Britlion Wrote: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.I'll answer that in the other topic, BTW, moved to Whislist forum.