flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [solved] struc and rept, question

Author
Thread Post new topic Reply to topic
randall



Joined: 03 Dec 2011
Posts: 155
Location: Poland
randall 26 Feb 2016, 15:58
Hi,

rept used in struc works strange in my opinion.

I have:

Code:
struc scene1 {

; ...

rept 3 n \{
  .yyy#n dq 0 \}

}
    


And this causes errors because fasm tries to generate:

Code:
scene1:
scene1.yyyn dq 0
scene1.yyyn dq 0
scene1.yyyn dq 0
    


Why? Why isn't it:

Code:
scene1:
scene1.yyy1 dq 0
scene1.yyy2 dq 0
scene1.yyy3 dq 0
    


When rept is used outside struc I get what I want:

Code:
rept 3 n {
.yyy#n dq 0 }
    


Gives:

Code:
.yyy1 dq 0
.yyy2 dq 0
.yyy3 dq 0
    


Thanks,
Michal
Post 26 Feb 2016, 15:58
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19873
Location: In your JS exploiting you and your system
revolution 26 Feb 2016, 16:00
You have to use the backslash for the # also.
Code:
struc scene1 {

; ...

rept 3 n \{
  .yyy\#n dq 0 \}

}    
Post 26 Feb 2016, 16:00
View user's profile Send private message Visit poster's website Reply with quote
randall



Joined: 03 Dec 2011
Posts: 155
Location: Poland
randall 26 Feb 2016, 16:00
revolution wrote:
You have to use the backslash for the # also.
Code:
struc scene1 {

; ...

rept 3 n \{
  .yyy\#n dq 0 \}

}    


Great! Thanks a lot.
Post 26 Feb 2016, 16:00
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.