flat assembler
Message board for the users of flat assembler.

Index > Main > how do times and % work together?

Author
Thread Post new topic Reply to topic
ntos



Joined: 06 Jul 2023
Posts: 18
ntos 02 Aug 2023, 04:18
Hi,

The manual says that times 3 times % db % produces 1, 1, 2, 1, 2, 3 but how does that work? What is the order of evaluation?

Thank you.
Post 02 Aug 2023, 04:18
View user's profile Send private message Reply with quote
ntos



Joined: 06 Jul 2023
Posts: 18
ntos 02 Aug 2023, 07:27
I have figured it out. Thank you.
Post 02 Aug 2023, 07:27
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1815
Roman 02 Aug 2023, 09:19
Code:
text: times 3 times % db %+48,";" ;section data
db 0

;in code
invoke MessageBox,0,text,0,0

;out text: 1;1;2;1;2;3;
;I expected: 1;1;2;1;2;3;1;2;3 
;rept 3 n:1 { rept n c:1 \{ db c+48 \} } like as times 3 times % db %+48
    

And you'll see what look data.

times 3 times %(% mean counter 3 times, because first times =3)
Post 02 Aug 2023, 09:19
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.