flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Macroinstructions > Get values from rept 0 | 
| Author | 
 | 
| revolution 15 Mar 2023, 12:53 Make a separate macro for each line.     Code: macro Get_1 v { v equ Print a } macro Get_2 v { v equ Write b, 2 } Get_1 a1 Get_2 a2 | |||
|  15 Mar 2023, 12:53 | 
 | 
| Roman 15 Mar 2023, 12:56 This is cheating macros. Not for my case.
 Code: ;this macros no needed any rept data. macro Get_1 v { v equ Print a } macro Get_2 v { v equ Write b, 2 } Get_1 a1 Get_2 a2 | |||
|  15 Mar 2023, 12:56 | 
 | 
| revolution 15 Mar 2023, 13:05 Then use match     Code: macro Get v, line { match =1, line \{ v equ Print a \} match =2, line \{ v equ Write b, 2 \} } | |||
|  15 Mar 2023, 13:05 | 
 | 
| Roman 15 Mar 2023, 13:10 Nice. If I put in rept other text.
 I must write new macro. Code: .lb1: rept 0 { Set a,4 Read buffer1, 20 } .lb2: rept 0 { ;like obj 3d model data vrtx 5.5,4,6 vrtx 1.5,2,5.2 faces 0,1,0,1 } Its bad idea. | |||
|  15 Mar 2023, 13:10 | 
 | 
| revolution 15 Mar 2023, 13:52 Roman wrote: Its bad idea.  | |||
|  15 Mar 2023, 13:52 | 
 | 
| Roman 15 Mar 2023, 14:06 Nice if fasm have mechanism store text.
 Like text Container. Code: Container A { ;ignored for compiler, but store text. And mechanism get this text in the macro. Any text. Or include text from file. } Container B { } Container C { } | |||
|  15 Mar 2023, 14:06 | 
 | 
| Overclick 15 Mar 2023, 18:51 Roman wrote: Nice if fasm have mechanism store text. Hmm... Code: include <file> Example of conditional include you can find at Multisections theme Code: virtual at 0 file 'a.txt':10h,1 load char from 0 end virtual loads the single byte from offset 10h in file a.txt into the char constant. The magic of load/store needs more explanations and examples I think. Espesially what sort of stage is possible to use with that kind of data | |||
|  15 Mar 2023, 18:51 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.