flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Include from files blocks for macro |
Author |
|
Roman 13 Mar 2024, 07:29
Or this variant
Code: nameFile equ "MovX86.txt" ;in file MovX86.txt mov \{ mov p1,p2 mov [p2],11 \} ;mean end this block. One block could have many asm commands. Thousands. add \{ add p1,p2 \} ;end file MovX86.txt macro any c,p1,p2 { include nameFile from c } ;in code any mov,eax,ebx any add,eax,11 |
|||
13 Mar 2024, 07:29 |
|
macomics 13 Mar 2024, 08:10
MovX86.txt
Code: match =[=mov=], nameCmd { macro _mov p1, p2 \{ mov p1,p2 mov byte [p2],11 \} } match =[=add=], nameCmd { macro _add p1, p2 \{ add p1,p2 \} } main.asm Code: nameFile equ 'MovX86.txt' macro commands c,p1,p2 { if c eq mov nameCmd equ [mov] match name, nameFile \{ include name \} _mov p1,p2 purge _mov restore nameCmd end if } macro any c,p1,p2 { nameCmd equ [#c#] match name, nameFile \{ include name \} _#c p1,p2 purge _#c restore nameCmd } ;in code any mov,eax,ebx any add,eax,11 Code: $ fasm main.asm flat assembler version 1.73.32 (16384 kilobytes memory, x64) 1 passes, 11 bytes. $ hexdump -C main.bin 00000000 66 89 d8 67 c6 03 0b 66 83 c0 0b |f..g...f...| 0000000b Code: use16 66 89 d8: mov eax,ebx 67 c6 03 0b: mov byte [ebx],11 66 83 c0 0b: add eax,11 |
|||
13 Mar 2024, 08:10 |
|
Roman 13 Mar 2024, 10:01
macomics Thanks.
Awesome ! |
|||
13 Mar 2024, 10:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.