flat assembler
Message board for the users of flat assembler.
Index
> Main > Reserve memory for multiple variables in one line. |
Author |
|
revolution 12 May 2023, 13:06
Unless you write a macro then fasm only supports one label per definition.
Code: macro multi_dd_define [var] { forward var dd ? } multi_dd_define r, g, b |
|||
12 May 2023, 13:06 |
|
macomics 12 May 2023, 13:20
or
Code: macro multi_dd_define val,[var] { forward var dd val } multi_dd_define 1.0, r, g, b |
|||
12 May 2023, 13:20 |
|
Tomasz Grysztar 12 May 2023, 13:38
Another option is IRP:
Code: irp var, r,g,b { var dd 0 } |
|||
12 May 2023, 13:38 |
|
AsmGuru62 12 May 2023, 16:53
These methods are good, but what to do if you develop an IDE with Intelli-Sense?
My IDE will parse a 'classic' definition from the post #1, but not these other weird macros. So, any time anyone invents a macro -- the IDE developer must adjust? I think it is too much to ask. |
|||
12 May 2023, 16:53 |
|
3D_FASM 12 May 2023, 18:14
Macros will probably confuse the code too much.
Is in FASM a system character that replaces a line break? For examle like this: Code: r dd 0 : g dd 0 : b dd 0 There is a \ but it's probably not suitable for this. |
|||
12 May 2023, 18:14 |
|
Tomasz Grysztar 12 May 2023, 18:33
There is a recent thread discussing this.
|
|||
12 May 2023, 18:33 |
|
bitRAKE 12 May 2023, 18:41
fasmg is over powered:
Code: calminstruction(name) dd? line& local first try: match first : line, line jno single arrange first, name =dd? first assemble first more: match first : line, line jno last arrange first, first assemble first jump more last: arrange line, line assemble line exit single: arrange line,name =dd? line assemble line end calminstruction ; dd? r dd 1 : g dd 2 : b dd 3 AsmGuru62 wrote: So, any time anyone invents a macro -- the IDE developer must adjust? |
|||
12 May 2023, 18:41 |
|
3D_FASM 12 May 2023, 19:28
I think it's a intrest trick:
https://board.flatassembler.net/topic.php?t=1938 Or i think is possible to use the character " :" if it is preceded by a space. But r,g,b dd 0 is the most understandable. But that probably can't be done. As I understand it, did not come to a consensus... |
|||
12 May 2023, 19:28 |
|
Tomasz Grysztar 12 May 2023, 20:01
3D_FASM wrote: But r,g,b dd 0 is the most understandable. But that probably can't be done. Code: calminstruction (name) ? tail& local next, statement match =,next tail, tail jyes multi arrange statement, name tail assemble statement done: exit multi: take name, next match =,next tail, tail jyes multi reverse: take next, name jyes reverse process: take name, next jno done arrange statement, name tail assemble statement jump process end calminstruction r,g,b dd 0 |
|||
12 May 2023, 20:01 |
|
3D_FASM 14 May 2023, 11:34
I got acquainted with FASMG, this is a really powerful tool, it can probably write a high-level language on it ) But for now I will not switch to it.
Thanks to all for interesting answers, I think these examples will be interesting for many users. I'll leave all as is or be use structs as a last resort. |
|||
14 May 2023, 11:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.