flat assembler
Message board for the users of flat assembler.

Index > Programming Language Design > [fasmg] Inline macros. Why not?

Goto page Previous  1, 2, 3

Do you like the idea of inline macros?
Yes, I like
80%
 80%  [ 8 ]
No, I don't
10%
 10%  [ 1 ]
Don't care
10%
 10%  [ 1 ]
Total Votes : 10

Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 18 Mar 2020, 09:25
bitRAKE wrote:
Just changing to Freelist__Get!/Freelist__Put! works and the bytes just disappear. Very Happy
(Discussed at the top of the page.) Embarassed
Oh, yes, that's another option. This way you make the Freelist__Get/Freelist__Put macros unrolled before the inline macros processing happens.

BTW, in this specific case I would probably prefer a simpler approach without need for inline macros:
Code:
iterate reg, ax,cx,dx,bx,sp,bp,si,di
        define reg32.r#reg? e#reg
end iterate

repeat 8, i:8
        define reg32.r#i? r#i#d
end repeat


macro Freelist__Get item,list
        mov reg32.item,reg32.list
        mov reg32.list,[list]
end macro

macro Freelist__Put list,item
        mov [list],reg32.item
        mov reg32.list,reg32.item
end macro    
Post 18 Mar 2020, 09:25
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:  
Goto page Previous  1, 2, 3

< 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.