flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > [solved] is it possible? |
Author |
|
ProMiNick 10 Aug 2024, 20:09
thanks to all, you are best. I know it and I know that request of help will inspire myself in first case.
Code: macro m2 { local _MAX,_SMAX,__LINK_A macro m1 a,b,C:1\{ \local next_a match =1,C \\{ if ~definite _MAX | _MAX<a _MAX = a end if display _SMAX+'0',",",a+'0',":" irpv linked_sym,__LINK_A \\\{ common __LINK_A = a \\\} restore __LINK_A __LINK_A equ next_a if defined next_a display 'next is ',next_a+'0'," " if a>next_a display 'diff is -',(a-next_a)+'0',13,10 else display 'diff is ',(next_a-a)+'0',13,10 end if else if ~definite _SMAX _SMAX=_MAX end if display 'this is a last one',13,10 end if \\} \} } m2 m1 3 m1 1 m1 4,,0 m1 3 m1 6 m1 5 m2 m1 3 m1 1 m1 4,,0 m1 3 m1 2 m1 5 output is: Code: 6,3:next is 1 diff is -2 6,1:next is 3 diff is 2 6,3:next is 6 diff is 3 6,6:next is 5 diff is -1 6,5:this is a last one 5,3:next is 1 diff is -2 5,1:next is 3 diff is 2 5,3:next is 2 diff is -1 5,2:next is 5 diff is 3 5,5:this is a last one I found answer just in text of question Quote: what m2 should do with _MAX or _SMAX symbol All my targets are resolved. However I still very appreciated for improvements like should m2 purge previous definition of m1 or not or something else. (preprocessor speed is pretty enought 220K of strings with continuously repeated m1 sequences breached with m2 compiled via 7.4 sec, algorithm complexity - 3 passes of assembler stage) _________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||
10 Aug 2024, 20:09 |
|
revolution 11 Aug 2024, 10:20
Sometimes trying to formulate a coherent enough question to ask someone else is enough to discover the answer.
Buy a toy animal and ask it all your questions. It won't respond, of course, but it doesn't need to, you will get the answers you seek. |
|||
11 Aug 2024, 10:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.