Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PutTile16x16 Pixels + Attributes
#11
boriel Wrote:
Code:
ld de, (SCREEN_ADDRESS)
         add hl, de  ;; Total T-States = 84 T-States
         ;; (implicit RET)  + 10 T-States = 94 T-States
end asm
END FUNCTION
So this function, adapted for a configurable screen address is 8 T-states faster than the original in ZX Basic (only 5 if the commented optimization is done) :?:

I haven't looked yet, but I will. Could the assembler/compiler optimize this by KNOWING if the screen address is changed ever? I would consider it unusual code to move it on the spectrum?
(I know, multi-platform). One optimization would be spectrum specific. If screen address=16384, then go short on the code :-)

Incidentally, I was looking at some asm:
Code:
poke Uinteger @ptDatapoint+3,value becomes:

ld hl, __LABEL__ptDataPoint
    inc hl
    inc hl
    inc hl

Can't the assembler deal with

Code:
ld hl, __LABEL__ptDataPoint+3

Being able to do that would reduce the code quite a lot, I would think - if the assembler could code the actual value there, instead of the base and then inc three times.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)