flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > double < and >

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 09 Dec 2015, 11:38
Code:
macro l21 [args] {
  irp cmd, args \{
    cmd
  \}
}
l21 inc ax, dec ax
l21 <<mov ax, bx>>, <<mov cx, dx>>       

How to make me able to use
Code:
l21 <mov ax, bx>, <mov cx, dx>    
while using macro and irp(sometimes that is necessary)
Post 09 Dec 2015, 11:38
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 09 Dec 2015, 14:41
Instead of "macro l21 [args]" use "macro l21 args&" construction.
Post 09 Dec 2015, 14:41
View user's profile Send private message Visit poster's website Reply with quote
Devel99



Joined: 26 Oct 2015
Posts: 30
Devel99 09 Dec 2015, 15:00
its impossible with nested IRP. The only thing you can do is just to unify L21 calling convention as L21 <<>>, <<>>, <<>>, ...
otherwise you'll lose information about each command boudaries
Code:
l21 <<inc ax>>, <<dec ax>>
l21 <<inc ax>>, <<dec ax>>, <<int 3>>, <<movss xmm0,dword [esi]>>, <<mov ax, bx>>, <<mov cx, dx>>, <<cvtsi2ss xmm0,eax>>
l21 <<mov ax, bx>>, <<mov cx, dx>>
    
Post 09 Dec 2015, 15:00
View user's profile Send private message Reply with quote
Devel99



Joined: 26 Oct 2015
Posts: 30
Devel99 09 Dec 2015, 15:04
Tomasz Grysztar

Amazing. That works perfectly!!! Smile
Code:
macro l21 args&
{
  irp cmd, args \{
    cmd
  \}
}

l21 inc ax, dec ax
l21 inc ax, dec ax, int 3, <movss xmm0,dword [esi]>, <mov ax, bx>, <mov cx, dx>, <cvtsi2ss xmm0,eax>

    
Post 09 Dec 2015, 15:04
View user's profile Send private message Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 17 Apr 2016, 15:17
Seems that on some old fasm you should
Code:
macro l21 [args] {
  common
  irp cmd, args \{ 
    cmd 
  \} 
} 
l21 inc ax, dec ax 
l21 <mov ax, bx>, <mov cx, dx>       
Post 17 Apr 2016, 15:17
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.