flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > irpv how join all to one string ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 2041
Roman 10 Jan 2026, 19:12
fasmw 1.73
Code:
txteq equ "one,"
txteq equ "two,"
txteq equ "five."

irpv a,txteq { a }
    

I want get one string string1 "one,two,five."
Or one equ. newtxt equ "one,two,five."
Post 10 Jan 2026, 19:12
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1208
Location: Russia
macomics 10 Jan 2026, 21:22
Code:
txteq equ "one,"
txteq equ "two,"
txteq equ "five."

; string string1 "one,two,five", 0
string1: irpv a,txteq { db a } db 0

; newtxt equ "one,two,five"
newtxt equ
irpv a,txteq { match b,newtxt \{ newtxt equ b,a \} match ,newtxt \{ newtxt equ a \}}
string2 db newtxt, 0    
Post 10 Jan 2026, 21:22
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 2041
Roman 10 Jan 2026, 23:35
Thanks.
Post 10 Jan 2026, 23:35
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4346
Location: vpcmpistri
bitRAKE 11 Jan 2026, 18:57
Code:
; fasmg cats.g
;
; Assemble-time joining of strings ...
; https://board.flatassembler.net/topic.php?p=246886#246886

calminstruction result item
        display 10 bappend "string: " bappend item

        local i
        compute i,lengthof item
        arrange i,i
        stringify i
        display 10 bappend "length: " bappend i
end calminstruction

struc _cats items&
        iterate item, items
                . equ . bappend item
        end iterate
end struc

try equ ""
result try
try _cats "one,", "two,"
result try
try _cats "three,", "four,"
result try
try _cats "five."
result try    

_________________
¯\(°_o)/¯ AI may [not] have aided with the above reply.
Post 11 Jan 2026, 18:57
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.