flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > How fix rept in match ? |
Author |
|
revolution 05 Apr 2023, 08:06
The outer match sees "p#n" and does nothing to it.
The inner rept sees p1 and correctly tells you p1 is undefined. BTW: If you ever find yourself using fix then you are probably doing something wrong. But no matter, here it makes no difference, the problem you have here has nothing to do with fix at all. |
|||
05 Apr 2023, 08:06 |
|
Roman 05 Apr 2023, 08:17
This not work too.
Code: match p1=, p2=, pout1=, pout2 , edx,ecx,edi,ebp { rept 2 n:1 \{ mov al,[p\#n] ;fasm error undefined p1 mov [pout\#n],al ;fasm error undefined pout1 \} } |
|||
05 Apr 2023, 08:17 |
|
revolution 05 Apr 2023, 08:50
Use irp. You can use pairs of values for each iteration.
|
|||
05 Apr 2023, 08:50 |
|
Roman 05 Apr 2023, 09:33
Not work if I using equ.
Code: pupz equ edx,ecx,edi,ebp ;i want this variant irp t, pupz { mov al,[t] } ;fasm error mov al,[edx,ecx,edi,ebp] This work Code: irp t, edx,ecx,edi,ebp { mov al,[t] display #`t,13,10 } You say fix is wrong. But what can I do ? Only using fix Code: pupza fix edx,ecx,edi,ebp irp t, pupza { mov al,[t] display #`v,13,10 } Bad irp not get many params. Like this Code: irp t1 t2, ecx,edx esi,edi { mov al,[t1] ;t1=ecx than edx mov [t2],al ;t2=esi than edi } |
|||
05 Apr 2023, 09:33 |
|
revolution 05 Apr 2023, 10:29
Use irp with angle brackets around each pair, then match to separate the pairs into values.
|
|||
05 Apr 2023, 10:29 |
|
Tomasz Grysztar 05 Apr 2023, 11:19
Roman wrote: Bad irp not get many params. Like this Code: include 'cpu/x64.inc' use32 include 'listing.inc' irp <t1,t2>, ecx,esi, edx,edi mov al,[t1] mov [t2],al end irp Code: [0000000000000000] 00000000: 8A 01 mov al,[ecx] [0000000000000002] 00000002: 88 06 mov [esi],al [0000000000000004] 00000004: 8A 02 mov al,[edx] [0000000000000006] 00000006: 88 07 mov [edi],al |
|||
05 Apr 2023, 11:19 |
|
Roman 05 Apr 2023, 15:10
revolution
Use irp with angle brackets around each pair, then match to separate the pairs into values. Code: irp t1, ecx:esi,edx:edi { match t2=: x, t1 \{ mov al,[\t2] mov [\x],al \} } |
|||
05 Apr 2023, 15:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.