[A83] Getting a value from a data table


[Prev][Next][Index][Thread]

[A83] Getting a value from a data table



If I had a data table, and I wanted to load a value from it into any 
register, how would I do this?

datatable:
 .db  01,03,05,07,09       ; I'm including 0's so the table is aligned
 .db  02,04,06,08,10
 .db  11,13,15,17,19

For example, if I wanted to load the value at 4,3 into de, would I do 
something like:
ld   de,datatable*4+3       

so de is now 13, which was at 4,3 in the data table

Thanks,
Colin Hart   
Xempest@aol.com





Follow-Ups: