flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Roman
I write display \`Mi\`
And display 'Mi' Not work. How do this? |
|||
![]() |
|
revolution
Code: display "'Mi'" |
|||
![]() |
|
Roman
revolution
display "'Mi'" You code not work. You compiling you code? Work but print Mi. |
|||
![]() |
|
revolution
Oh I misread what you want. You can use match.
Code: Mi equ 2+3/2(2-2) match x,Mi { irps z,x \{ display \`z \} } |
|||
![]() |
|
Roman
How to make with match, i know
Quote:
|
|||
![]() |
|
baldr
Roman,
Code: Mi EQU 2+3/2(2-2) Mj EQU (2-2) match _Mj, Mj { match _Mi _Mj, Mi \{ restore Mi Mi equ _Mi \} } ; Test match _Mi, Mi { irps s, _Mi \{ display \`s \} } |
|||
![]() |
|
Roman
baldr
Thanks. But I say that I know how do using match. |
|||
![]() |
|
Roman
baldr
Write this, and get wrong result ! Code: Mi EQU 2+3/2(2-2)+5 Mj EQU (2-2) match _Mj, Mj { match _Mi _Mj, Mi \{ restore Mi Mi equ _Mi \} } ; Test match _Mi, Mi { irps s, _Mi \{ display \`s \} } As I said a new feature like Cut need ! |
|||
![]() |
|
Roman
My code:
Quote:
But if we write Mi EQU 2+3/2(2-2) then my code not work. I'm trying to prove the limitation of match |
|||
![]() |
|
Roman
My macro:
Quote:
We can write Mi EQU 2+3/2-(2-2) Mj fix (2-2) Cut Mi,Mj and get Mi = 2+3/2- |
|||
![]() |
|
Roman
But my Cut its macro. Not new function. And for this reason, my Cut has limitations
|
|||
![]() |
|
baldr
Roman,
There is "Edit" button at the bottom right of your posts, use it to add something to already submitted post. Otherwise it looks like that you're arguing with yourself. Roman wrote: And new another question. Actually, your Cut macro does some extra modification to its first argument: ' ' trailer (i.e. quoted string consisting of single space) is appended to it, so after Cut Mi,Mj value of Mi will be «2+3/2-5.2/2 ' '» (space before string literal is added only to separate it from preceding digit 2, because 2' is a valid preprocessor symbol). Multiple invocations with the same symbolic constant name for arg will append more (in case of match, naturally). Indeed, proper macro could be written even for general case (that is, replace one subsequence of symbols with another, perhaps empty, for particular, I mean first/n-th/last, occurrence or all of them), probably with some restrictions. The question is, will result justify the needed efforts? What are you trying to achieve using this cut operation? If you speak Russian better, send me PM to assure that nothing is lost in translation. ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.