flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [solved] Macro for store text list. How do ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1815
Roman 24 Feb 2019, 08:31
Fasm 1.73
This code
Code:
jmp @f
                ListTxt dd px1,px2,px3,0
                px1 db "mov eax,ebx",0
                px2 db "mov ebx,eax",0
                px3 db "movss xmm1,",0
@@:
    


Place in macro TextList.
And get something like this:
Code:
TextList ListTxt,"mov eax,ebx","mov ebx,eax","movss xmm1,"
TextList ListTxt2,"t1","t2","t3","p1","p2","p3","p4","z1","z2","z3"
    
Post 24 Feb 2019, 08:31
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 24 Feb 2019, 09:02
One way is this:
Code:
macro TextList name,[text] {
    common
        local   ..skip
        jmp     ..skip
      name:
    forward
        local   ..name
        dd      ..name
    common
        dd      0
    forward
      ..name:   db text,0
    common
      ..skip:
}

TextList ListTxt,"mov eax,ebx","mov ebx,eax","movss xmm1,"
TextList ListTxt2,"t1","t2","t3","p1","p2","p3","p4","z1","z2","z3"

mov esi,ListTxt
mov esi,ListTxt2    
Post 24 Feb 2019, 09:02
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1815
Roman 24 Feb 2019, 09:22
revolution
Delightfully ! Thanks !
Post 24 Feb 2019, 09:22
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 24 Feb 2019, 09:27
There is even a very similar example in the manual, look for "macro strtbl".
Post 24 Feb 2019, 09:27
View user's profile Send private message Visit poster's website 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.