flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 29 Nov 2006, 15:33
unfortunatelly, no.
only with some very dirty tricks, and i am not sure about it. |
|||
![]() |
|
revolution 29 Nov 2006, 17:47
Macros cannot be forward referenced, not ever, never, no chance, not possible. Except if you rewrite fasm.
|
|||
![]() |
|
vid 29 Nov 2006, 18:00
but you can store data in variables and forward reference variables... that's what i meant with "very dirty tricks"
|
|||
![]() |
|
Tomasz Grysztar 29 Nov 2006, 18:28
This "dirty trick" is closely related to this problem: http://board.flatassembler.net/topic.php?t=5934
|
|||
![]() |
|
Plue 29 Nov 2006, 19:17
revolution wrote: Macros cannot be forward referenced, not ever, never, no chance, not possible. Except if you rewrite fasm. It looks like what I want to do is actually possible by forward-referencing a variable from a macro and then generating the instructions from that macro. But I managed to do it some other way by buffering up all the code in between, writing the simple list of instructions without going through the buffer, and then writing the buffer. (I am writing a compiler.) _________________ Roses are red Violets are blue Some poems rhyme And some don't. |
|||
![]() |
|
revolution 29 Nov 2006, 20:39
Plue wrote: As I said, I don't need full macro functionality, only a simple list of instructions. Plue wrote: I am writing a compiler. |
|||
![]() |
|
Plue 29 Nov 2006, 21:44
revolution wrote:
Macro SymbolName { Simple list of instructions < Here!!! ![]() .. } Quote:
_________________ Roses are red Violets are blue Some poems rhyme And some don't. |
|||
![]() |
|
Goplat 30 Nov 2006, 00:41
revolution wrote: Macros cannot be forward referenced, not ever, never, no chance, not possible. ![]() Code: match =1,second { mymacro } match =second,second { macro mymacro \{ db "blah" \} second equ 1 include 'fwdmac.asm' } |
|||
![]() |
|
vid 30 Nov 2006, 08:03
Goplat:
![]() |
|||
![]() |
|
revolution 30 Nov 2006, 11:16
Goplat wrote: Sounds like a challenge Okay, I change my statement a little. How about this: Macros cannot be forward referenced in a useful way, not ever, never, no chance, not possible. Hehe, now the challenge is to make it useful ... ![]() |
|||
![]() |
|
Mr_Silent 30 Nov 2006, 15:44
2 revolution: What is your meaning of "useful"?
Code: .maincode fix _main macro _main { macro tag_main { } ;------------------------------------------------------------------------------ .postdef fix } _post macro _post { macro tag_post { } ;------------------------------------------------------------------------------ .end fix } _end macro _end { tag_post tag_main } ;////////////////////////////////////////////////////////////////////////////// .maincode zb sb1,'a','b','z','x' zd sd1,'a','b','z','x' .postdef macro zd p1,[p2] \{ \common label p1 \forward dd p2 \common dd 0 \} macro zb p1,[p2] \{ \common label p1 \forward db p2 \common db 0 \} .end |
|||
![]() |
|
revolution 30 Nov 2006, 22:45
Mr_Silent: I think your code does not address the problem of defining the macros after you instantiate it. You code defines a few macros but does not use any of them until the final ".end" statement.
Goplat posted a nice example of reassembling the same file again that simulates defining macros after they are used, but I think it is not useful in any real program. It was all in good fun and my challenge was not anything serious. I would be delighted to see a real-world working example of Goplat's idea given above. |
|||
![]() |
|
Mr_Silent 01 Dec 2006, 06:40
revolution wrote: I think your code does not address the problem of defining the macros after you instantiate it. Of course, it doesn't ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|||
![]() |
|
revolution 01 Dec 2006, 12:31
Mr_Silent wrote: Or did you want the community to find some critical bu... err... feature which will allow normal fwd-ref ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.