From: "Thomas Harte"

Surely set would only work if I had an unsigned offset from the beginning of a table? I'm using a signed offset from the middle of a table.

it works the same as ADD HL,HL ADD HL,BC the difference is
you store the table entries LSB,MSB so you need the ADD HL,HL
First you get the LSB from the table then INC L points to MSB

When you store LSB,LSB... for all table enties first and then  MSB,MSB...
you don't need to do the add as HL already points to table entries LSB to get the MSB
you add 2K to get to MSB

Or am I getting something wrong ?

Because you have your table at address 0 the following would do :

LD E,(HL)
set 3,H        ;Add 2K to point to MSB
LD D,(HL)

takes 24Ts :-)

Edwin

Reply via email to