flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > How to define lists of labels/variables? |
Author |
|
JohnFound 11 Jan 2005, 11:22
What you actually want to achieve? (you can't simply define such labels arrays)
|
|||
11 Jan 2005, 11:22 |
|
MCD 11 Jan 2005, 11:33
I actually have to repeat a piece of code, but the code is slightly different in each repeat; so I use the % a lot. Furthermore, I must define labels like those stated above.
_________________ MCD - the inevitable return of the Mad Computer Doggy -||__/ .|+-~ .|| || |
|||
11 Jan 2005, 11:33 |
|
JohnFound 11 Jan 2005, 11:45
MCD wrote: I actually have to repeat a piece of code, but the code is slightly different in each repeat; so I use the % a lot. Furthermore, I must define labels like those stated above. You can't, because all the labels are defined during preprocessing while the repeat directive is executed during assembling when all labels are already defined. Try using @@: label with @f and @b references instead. (edit: No, you can't inside "repeat" because of the same reason...) Also, you can try to create the loop in the preprocessing stage, where you still can define labels: some macro with needed count of arguments and your code defined in "forward" section - inside the macroses you can use local labels as well. Regards. |
|||
11 Jan 2005, 11:45 |
|
MCD 11 Jan 2005, 11:49
Quote:
|
|||
11 Jan 2005, 11:49 |
|
Tomasz Grysztar 15 Jan 2005, 22:08
Some discussion about similar problem: http://board.flatassembler.net/topic.php?t=1111
|
|||
15 Jan 2005, 22:08 |
|
MCD 17 Jan 2005, 17:28
thanks, Privalov
|
|||
17 Jan 2005, 17:28 |
|
hopcode 21 Jul 2008, 16:16
Is this a solution ?
... Code: rept 10 mylabel { label L#mylabel ; create L1 bis L10 nop nop } display_decimal L1 ;4202496 display 13,10 display_decimal L2 ;4202498 display 13,10 display_decimal L3 ;4202500 display 13,10 display_decimal L4 ;4202502 display 13,10 nop nop nop nop nop ;----------And....when you need one of them ;----------use it after redefinition with equ ;----------because they ar label. foo: L4 equ foo display_decimal L4 ;4202521 ret ... Gruß hopcode[mrk] |
|||
21 Jul 2008, 16:16 |
|
Tomasz Grysztar 21 Jul 2008, 17:13
This is a very old thread - the REPT directive was not available at the time (it was introduced in version 1.62, 16 June 2005).
|
|||
21 Jul 2008, 17:13 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.