flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Roman 13 Jul 2013, 14:30
I write display \`Mi\`
And display 'Mi' Not work. How do this? |
|||
![]() |
|
revolution 13 Jul 2013, 14:44
Code: display "'Mi'" |
|||
![]() |
|
Roman 13 Jul 2013, 14:49
revolution
display "'Mi'" You code not work. You compiling you code? Work but print Mi. |
|||
![]() |
|
revolution 13 Jul 2013, 14:58
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 13 Jul 2013, 15:20
How to make with match, i know
Quote:
|
|||
![]() |
|
baldr 13 Jul 2013, 17:06
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 13 Jul 2013, 18:15
baldr
Thanks. But I say that I know how do using match. |
|||
![]() |
|
Roman 13 Jul 2013, 18:51
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 13 Jul 2013, 19:16
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 13 Jul 2013, 19:42
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 13 Jul 2013, 19:57
But my Cut its macro. Not new function. And for this reason, my Cut has limitations
|
|||
![]() |
|
baldr 14 Jul 2013, 06:49
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.