nesdev.com
http://forums.nesdev.com/

ASM6 array - Not a number
http://forums.nesdev.com/viewtopic.php?f=2&t=16219
Page 1 of 1

Author:  MartsINY [ Sun Jul 16, 2017 7:37 pm ]
Post subject:  ASM6 array - Not a number

I'm trying to make an array with variable. However I cannot find the correct structure:

ARR_Holo_Wpn_Delay_Shoot:
HEX 50 50 50 50 CST_A

OR

ARR_Holo_Wpn_Delay_Shoot:
HEX 50 50 50 50 #CST_A

return Not a number...

I know the problem is CST_A.

How do I write i?

Author:  tepples [ Sun Jul 16, 2017 7:40 pm ]
Post subject:  Re: ASM6 array - Not a number

can you do this?
Code:
ARR_Holo_Wpn_Delay_Shoot:
HEX 50 50 50 50
DB CST_A

Author:  MartsINY [ Sun Jul 16, 2017 7:45 pm ]
Post subject:  Re: ASM6 array - Not a number

tepples wrote:
can you do this?
Code:
ARR_Holo_Wpn_Delay_Shoot:
HEX 50 50 50 50
DB CST_A



Yes!! Thanks!! I guess DB has more ooptions from what I see in readme file!!

Author:  Pokun [ Mon Jul 17, 2017 2:01 am ]
Post subject:  Re: ASM6 array - Not a number

Is array the correct term here?
Isn't HEX and DB for hard-coded tables in ROM? For arrays in RAM I'd use the DSB directive.

Author:  tepples [ Mon Jul 17, 2017 9:39 am ]
Post subject:  Re: ASM6 array - Not a number

Pokun wrote:
Is array the correct term here?

Yes, in at least one familiar context. In C, a table in ROM is called a "const array".
Code:
const unsigned char ARR_Holo_Wpn_Delay_Shoot[] = {
  0x50, 0x50, 0x50, 0x50, CST_A
};


The HEX instruction in ASM6 is just a syntactic sugar for DB $whatever,$whatever,$whatever anyway.

Author:  Pokun [ Mon Jul 17, 2017 4:49 pm ]
Post subject:  Re: ASM6 array - Not a number

I see, makes sense.

Yeah HEX is just to make more compact tables than using DB.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/