flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
xRom
Please,anybody, how to do this:
a = 1 ;generate label name @1: a = a + 1 ;generate next label name @2: a = a + 1 ;...next @3: etc...? |
|||
![]() |
|
Overflowz
you mean something like this ?
Code: .data a dd ? .code mov [a],1 @1: inc [a] @2: inc [a] @3: .... |
|||
![]() |
|
Overflowz
Ohh, sorry I don't know macro language here..
![]() |
|||
![]() |
|
xRom
Overflowz wrote: Ohh, sorry I don't know macro language here.. And you need this? When I'll deal can put it here ![]() |
|||
![]() |
|
Overflowz
xRom
Hehe, I don't like macro things ![]() ![]() |
|||
![]() |
|
JohnFound
Creating loops this way is not a good idea for assembly language, because the code generated will be far from optimal and, worse, will prevent you from seeing better solutions.
If you really want to use loops this way - simply use Pascal or other HLL of choice. ![]() |
|||
![]() |
|
LocoDelAssembly
I don't understand much what are you trying to do, but to answer your first message maybe this helps:
Code: N equ 1 macro defLabel { match n, N\{ label\#n: \} rept 1 n:N+1\{N equ n\} } defLabel defLabel ; Just to check the labels are defined: jmp label1 jmp label2 |
|||
![]() |
|
typedef
He want's to generate the next label to be jumped at, given the current label he's at.
For example label_1: add size of opcodes that go in between and where they end is where the next label begins label_1: MOV EAX,2 So.... sizeof ( MOV EAX,2 ) + label_1 = label_2 I think that is what he want's to do. But I don't know why do that if you can just mark the labels..... ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.