flat assembler
Message board for the users of flat assembler.

flat assembler > Main > register alias

Author
Thread Post new topic Reply to topic
swdv



Joined: 28 Mar 2018
Posts: 2
Is it possible to define a temporary alias for a register? Say I use it for a counter, would it be possible to refer to it as `counter`? Basically I'm looking for `virtual` but for a register. A temporary macro would also be great, but I don't think it is possible to delete a macro, is it?

Thanks in advance!
Post 28 Mar 2018, 21:32
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16054
Location: 112 Ocean Avenue, Amityville
Use equ
Code:
counter equ eax
inc counter
mov ebx,counter
add ecx,counter
add counter,0x12345    
Post 28 Mar 2018, 21:38
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 419
Location: Belarus
revolution already gave you a solution. I’ll just say that the answer to the question…
swdv wrote:
A temporary macro would also be great, but I don't think it is possible to delete a macro, is it?

… is yes. It is possible. Both for macros and for equs. purge does the magic for macros, restore works for symbolic constants defined with equ.
Post 29 Mar 2018, 09:54
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16054
Location: 112 Ocean Avenue, Amityville
Thanks for the follow-up. Also restruc for structures defined with struc.
Post 29 Mar 2018, 10:28
View user's profile Send private message Visit poster's website Reply with quote
swdv



Joined: 28 Mar 2018
Posts: 2
Wow thanks all! These are really helpful! I'm relatively new to assembly & FASM but I quite like it so far Smile
Post 29 Mar 2018, 19:25
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-2018, Tomasz Grysztar.

Powered by rwasa.