It is currently Wed Dec 13, 2017 1:55 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Jul 16, 2017 7:37 pm 
Offline
User avatar

Joined: Sun Jun 11, 2017 5:39 pm
Posts: 39
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?


Top
 Profile  
 
PostPosted: Sun Jul 16, 2017 7:40 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19341
Location: NE Indiana, USA (NTSC)
can you do this?
Code:
ARR_Holo_Wpn_Delay_Shoot:
HEX 50 50 50 50
DB CST_A


Top
 Profile  
 
PostPosted: Sun Jul 16, 2017 7:45 pm 
Offline
User avatar

Joined: Sun Jun 11, 2017 5:39 pm
Posts: 39
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!!


Top
 Profile  
 
PostPosted: Mon Jul 17, 2017 2:01 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 926
Location: Sweden
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.


Top
 Profile  
 
PostPosted: Mon Jul 17, 2017 9:39 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19341
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
PostPosted: Mon Jul 17, 2017 4:49 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 926
Location: Sweden
I see, makes sense.

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group