flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3 Next |
Author |
|
Tomasz Grysztar 13 Mar 2005, 12:16
Good idea, though I think I would still prefer something like:
Code: breed [name,i] j line with the brackets-surrounded parameters being optional (i - first value, j - count of duplicates). Possible extended form: Code: breed [name,i,step] j line where step would be the value added to i after each duplicate. |
|||
![]() |
|
vid 13 Mar 2005, 22:54
looks good
|
|||
![]() |
|
MCD 14 Mar 2005, 19:10
looks good so far, but please, I really don't like the worg breed...
|
|||
![]() |
|
Tomasz Grysztar 14 Mar 2005, 20:14
Do you prefer "dupe"? For some reason do not.
![]() ![]() But seriously: "clone" is also a good alternative. Its meaning is quite similar in this context. I preferred "breed", because it sounds almost like an English phrase: "breed 5 instructions", etc. |
|||
![]() |
|
MCD 15 Mar 2005, 08:10
okay, this is only a question of taste. I think someone should start a poll on this.
|
|||
![]() |
|
revolution 18 Mar 2005, 06:23
Yes, the "breed" looks like a good idea.
But how about something similar to the way the assembler uses "repeat". Like this: Code: breed 20 call @f dd % @@: end breed And the normal arithmetic should allow using "(%-1)*4" type of coding to generate whatever range of values is needed. Regarding the name: Hmm, somehow breed does not seem appropriate. Basically it is a preprocessor type of repeat so how about "prepeat" or "pre-repeat" or "multiple-generate" or "mgen". I don't think that trying to find a suitable English word is necessary. Of course, the names suggested above are a little quirky, don't take them too seriously. But, instead is it possible to move "repeat" into the preprocessor stage? The % can still be replaced as usual and I think the code generated would not change but it would allow constructions just like I show above to work intuitively. |
|||
![]() |
|
Tomasz Grysztar 18 Mar 2005, 06:30
revolution wrote: But, instead is it possible to move "repeat" into the preprocessor stage? The % can still be replaced as usual and I think the code generated would not change but it would allow constructions just like I show above to work intuitively. No, it wouldn't be the same. Consider just: Code: repeat 1000-$ db % end repeat And "breed" is rather a preprocessor's "times" directive than preprocessor's "repeat". And since you can use macro inside a line, which you duplicate, there is no need to implement any "repeat" equivalent. |
|||
![]() |
|
Ancient One 19 Mar 2005, 07:51
Privalov wrote: Good idea, though I think I would still prefer something like: yeah, it looks good to me. i think the word 'breed' is a good name for this directive. |
|||
![]() |
|
vid 21 Mar 2005, 14:05
breed is allright
|
|||
![]() |
|
Tomasz Grysztar 10 May 2005, 11:30
Another new idea is to make something more similar to macro syntax, like:
Code: prerep 15 { ; source that will be repeated 15 times } prerep 15 counter { ; in this source "counter" will be replaced with number of repetition } and also: Code: preif symbol eq other_symbol { ; conditionally preprocessed code } The only problem it has that "breeed" has not is that using it within marcos would require fixing some symbols for the braces again (as with standard macros within macros). |
|||
![]() |
|
UCM 10 May 2005, 21:06
I think 'breed' is ok.
_________________ This calls for... Ultra CRUNCHY Man! Ta da!! *crunch* |
|||
![]() |
|
revolution 11 May 2005, 01:06
Privalov. I think your suggestion of using the braces is much better than the single line approach mentioned for breed.
|
|||
![]() |
|
MCD 11 May 2005, 09:36
revolution wrote: Privalov. I think your suggestion of using the braces is much better than the single line approach mentioned for breed. I can only agree with you, especially because preprocessor in fasm is not (completely) line based, but also block based. (stuff like macors, structures etc...) _________________ MCD - the inevitable return of the Mad Computer Doggy -||__/ .|+-~ .|| || |
|||
![]() |
|
vid 11 May 2005, 09:46
yes, i don't like declaring new macro for each repeated block.
about the problem: couldn't you add something like i mentioned you before - some symbol, let's say "@", which will be normal part of name like ".", but every symbol starting with "@" will have it removed when unrolling macro. Something like Code: macro declare_macro_XXX { macro XXX @{ asdas @} } declare_macro_XXX So "@" thingy will be kind of equivalent for fixes, but much easier to use, more readable, more comprehendable, will allow macros independent from particular fixes etc. i quess you would have to rewrite prepreprocessor a little not to separate @ and { symbol, please think if it could be done. |
|||
![]() |
|
Tomasz Grysztar 11 May 2005, 10:38
I think about something like:
Code: macro first { macro second { macro third { \\} \} } The backlash character is already treated specially by line splitter, so this wouldn't complicate anything. And there shouldn't be confusion with line concatenation operator, since only comments after it are allowed. |
|||
![]() |
|
JohnFound 11 May 2005, 11:04
Hm, I wonder, isn't it possible to make clear recurcive macro behaviour. I mean:
Code: macro first { macro second { macro third { } } } This will need only a counter that to be incremented on every "{" and decremented on every "}", so, if after decrement, the counter is 0, then the "}" character should be treated as an end of macro definition, else should be treated as a simple character. Regards |
|||
![]() |
|
Tomasz Grysztar 11 May 2005, 11:17
But what when you want to begin macro definition with one macro and end with another (like the current "struct" macro does)?
|
|||
![]() |
|
Tomasz Grysztar 11 May 2005, 11:26
Implementing such backslashes feature is quite simple - I'm attaching the modified preprocessor module that has it.
Attachment removed - now it's implemented in official releases Last edited by Tomasz Grysztar on 19 May 2005, 12:16; edited 1 time in total |
|||
![]() |
|
JohnFound 11 May 2005, 11:30
Privalov wrote: But what when you want to begin macro definition with one macro and end with another (like the current "struct" macro does)? Well, "fix" is still here. ![]() |
|||
![]() |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.