flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > repeat and "already defined" |
Author |
|
crc 28 Nov 2004, 20:08
Code: macro timing INNER_LOOP_COUNT { ... local a ; a is a local label label a ; this is where it's used times INNER_LOOP_COUNT add eax, ebx loop a ; loop to a ... } Try that and see if it works. @@: probably doesn't work within macros. |
|||
28 Nov 2004, 20:08 |
|
omega_red 28 Nov 2004, 21:24
Code: label outer_loop
error: symbol already defined. Weird... |
|||
28 Nov 2004, 21:24 |
|
crc 28 Nov 2004, 21:58
Maybe doing this:
Code: macro timing INNER_LOOP_COUNT { ... local a ; a is a local label a: ; this is where it's used times INNER_LOOP_COUNT add eax, ebx loop a ; loop to a ... } would work? |
|||
28 Nov 2004, 21:58 |
|
omega_red 29 Nov 2004, 01:32
I've tried it earlier - with the same result..
|
|||
29 Nov 2004, 01:32 |
|
crc 29 Nov 2004, 02:09
Code: macro timing INNER_LOOP_COUNT { local a a: times INNER_LOOP_COUNT add eax, ebx loop a } main: timing 22 timing 23 ret That compiles without fail for me. Can you paste more of the code that's causing the problem? |
|||
29 Nov 2004, 02:09 |
|
omega_red 29 Nov 2004, 11:03
Yeah, thats exactly ok. But this fail:
Code: main: repeat 2 timing % end repeat ret |
|||
29 Nov 2004, 11:03 |
|
crc 29 Nov 2004, 11:06
What does the % imply?
|
|||
29 Nov 2004, 11:06 |
|
omega_red 29 Nov 2004, 13:36
Quote: Second is "%", which is the number of current repeat in parts of code My goal is to shorten Code: timing 1 timing 2 timing 3 timing 4 timing 5 timing 6 timing 7 timing 8 ... with repeat construction. Maybe there is another way to do it? _________________ Vulnerant omnes, ultima necat |
|||
29 Nov 2004, 13:36 |
|
vid 29 Nov 2004, 15:02
try this:
Code: local here here = $ ;not "here:", because that way it cannot be redefined times SOME_CONSTANT add eax,ebx loop here If it won't work, than you can hardcode lenght of jump: Code: times SOME_CONSTANT add eax,ebx loop $-(SOMECONSTANT*2) ;i quess size of "add eax,ebx" is 2, easy to hceck |
|||
29 Nov 2004, 15:02 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.