Re: A82: HELP!!!!! I Suck


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

Re: A82: HELP!!!!! I Suck




when you do this
.db $01, $02, $03
.db $04, $05, $05
it is stored in memory like this
.db $01, $02, $03, $04, $05
so all you have to do is this to get the values
say you have this
label:
.db 1, 2, 3, 4, 5, 6
then all you do is this...
ld hl, label             ;hl now points to 1
inc hl                    ; hl points to 2
et cetera...
so if you want to acess a specific row and column directly, all you have to do
is multiply the length of the column by the column number minus one and add
the row number....i.e.
(COLUMN * (COLUMN_LENGTH-1))+ROW
will give you the address in memmory the element is at.
Correct me if I am wrong