flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
xRom 26 Apr 2011, 19:20
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 26 Apr 2011, 19:23
you mean something like this ?
Code: .data a dd ? .code mov [a],1 @1: inc [a] @2: inc [a] @3: .... |
|||
![]() |
|
Overflowz 26 Apr 2011, 20:22
Ohh, sorry I don't know macro language here..
![]() |
|||
![]() |
|
xRom 26 Apr 2011, 20:52
Overflowz wrote: Ohh, sorry I don't know macro language here.. And you need this? When I'll deal can put it here ![]() |
|||
![]() |
|
Overflowz 26 Apr 2011, 23:11
xRom
Hehe, I don't like macro things ![]() ![]() |
|||
![]() |
|
JohnFound 27 Apr 2011, 06:50
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 27 Apr 2011, 20:17
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 27 Apr 2011, 21:43
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.