flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > How get number from equ value?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1821
Roman 25 Mar 2023, 09:18
Fasmw 1.73
rept 2 n:2 { mov V2#n, n} fasm get error undefined V22
Code:
V1 equ eax
V2 equ ebx
.. 
V6 equ esi

Macro Get v {..}

Get V2 ;do match and split to V and 2. I want do rept from V2 to V4
    

Or some way store V2 name in onother equ?
Post 25 Mar 2023, 09:18
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1004
Location: Russia
macomics 25 Mar 2023, 10:35
Code:
V1 equ eax
V2 equ ecx
V3 equ edx
V4 equ ebx
V5 equ esp
V6 equ ebp
V7 equ esi
V8 equ edi
rept 2 n:2 { mov V#n, n }    
In your rept, mov has an extra 2 in the name of the constant
Post 25 Mar 2023, 10:35
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1821
Roman 25 Mar 2023, 10:41
This is I know.

But I want write macro run.
Code:
 
Run V2, 3 ;do rept 3 from V2 to V5
    


I know variant. Its work, but I not like this variant.
Run V, 2,3 ;do rept 3 n:2 {V#n}
;sometimes I forgot what mean 2 and 3
Post 25 Mar 2023, 10:41
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.