flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Ancient One 01 Aug 2005, 01:45
repeat cannot be use to repeat preprocessor directive. use rept instead
|
|||
![]() |
|
Tomasz Grysztar 01 Aug 2005, 08:47
"repeat" is one of the control directives, that are processed after the preprocessing is already finished (you can read about it in the manual!). The preprocessor itself does only operations on the text symbols, and - as opposed to assembler - doesn't do any calculations. So you should do it rather this way:
Code: macro irp p,[plist] { reverse p equ plist } macro foo [plist] { common local .p irp .p,plist forward display .p+0x30 restore .p } foo 3,5,9 |
|||
![]() |
|
Nikolay Petrov 01 Aug 2005, 09:26
Thanks and sorry for my not very accurate question.
![]() My tasm program use this macro: Code: subm macro plist,subparam irp p,<plist> sub p,subparam endm endm .code ... subm <[var1],[var2],[var3]>,constant Code: macro subm subparam,[plist]{sub plist,subparam} ![]() Last edited by Nikolay Petrov on 01 Aug 2005, 09:44; edited 2 times in total |
|||
![]() |
|
Tomasz Grysztar 01 Aug 2005, 09:42
Why not like the "subm" sample? It does exactly what you need.
What you request looks, however, like the recently discussed FOR directive: http://board.flatassembler.net/topic.php?t=3823&postdays=0&postorder=asc&start=25#28033 (IRP was an old name for FOR in MASM). |
|||
![]() |
|
Nikolay Petrov 01 Aug 2005, 11:15
The discusion is interesting for me at this moment.
![]() |
|||
![]() |
|
Nikolay Petrov 01 Aug 2005, 15:07
I find a solution for my problem. It was under my eays.
Code: macro subp subparam,[params] {sub params,subparam} macro subm params,subparam {subp subparam,params} .code ... subm <eax,ebx,ecx>,edx ... Code: sub eax,edx sub ebx,edx sub ecx,edx To make it better - must checking params for it's type, equates and nonsenses. Thanks again |
|||
![]() |
|
Tomasz Grysztar 01 Aug 2005, 15:25
Oh, that was what was troubling you - I'm sorry, I did not understand what really your problem was. And you wanted just to convert the single parameter into multiple parameters (exactly what your solution does).
Anyway, I have just implemented the IRP in fasm, check out the 1.63.5 release when I upload it. |
|||
![]() |
|
Nikolay Petrov 01 Aug 2005, 15:54
great
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.