flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Fasm 1.73 How do in one EQU many EQU ? |
Author |
|
Tomasz Grysztar 22 Jan 2019, 08:41
I'm not sure if I understood what you mean, but here is something that comes to my mind:
Code: template.regstr EQU EBP template.z1 EQU [template.regstr+4] template.z2 EQU [template.regstr+8] template.z3 EQU [template.regstr+12] template.zg EQU mov eax,template.z1 template.zz EQU add eax,ebx template.zh EQU mov template.z2,eax template.zk EQU mov template.z3,eax macro apply [v] { define __applied v v equ template.#v } macro end.apply { irpv v,__applied \{ restore v restore __applied \} } apply zg,zz,zh zz end.apply apply zk zk end.apply |
|||
22 Jan 2019, 08:41 |
|
Roman 22 Jan 2019, 09:07
All ways i need do this in code ?
apply zg,zz,zh zz end.apply Need in code write simple apply. And not allways write: apply zg,zz,zh zz end.apply Because more then 40 EQUs. Some: apply namenewmacro,zg,zz,zh zz end.apply in code simple write namenewmacro. Code: ;create new macro. Lets say macroPut apply macroPut,zg,zz,zh zz end.apply ;create macro Put2 apply Put2 zg,zz,zz,zh end.apply ;And in code write macroPut Put2 |
|||
22 Jan 2019, 09:07 |
|
Roman 22 Jan 2019, 09:44
Tomasz i try in code:
Code: mydata dd 1,2,3,4,5 template.regstr EQU EBP template.z1 EQU [template.regstr+4] template.z2 EQU [template.regstr+8] template.z3 EQU [template.regstr+12] template.zg EQU mov eax,template.z1 template.zz EQU add eax,ebx template.zh EQU mov template.z2,eax template.zk EQU mov template.z3,eax mov template.regstr,mydata ;mov ebp,mydata apply zg,zh end.apply ;as I expected must change mydata dd 1,2,2,4,5 And after i print mydata. And get 1,2,3,4,5 but not 1,2,2,4,5 |
|||
22 Jan 2019, 09:44 |
|
Tomasz Grysztar 22 Jan 2019, 10:27
OK, then I most certainly misunderstood what you were trying to do. Can you explain it in more detail?
|
|||
22 Jan 2019, 10:27 |
|
Roman 23 Jan 2019, 06:15
Tomasz Grysztar you write me:
Code: template.regstr EQU EBP template.z1 EQU [template.regstr+4] template.z2 EQU [template.regstr+8] template.z3 EQU [template.regstr+12] template.zg EQU mov eax,template.z1 template.zz EQU add eax,ebx template.zh EQU mov template.z2,eax template.zk EQU mov template.z3,eax macro apply [v] { define __applied v v equ template.#v } macro end.apply { irpv v,__applied \{ restore v restore __applied \} } apply zg,zz,zh zz end.apply apply zk zk end.apply My question. What must do macro apply and end.apply ? How did its works ? And how right using this macro ? I write in my code: Code: mov template.regstr,zyt apply regstr,zg,zh end.apply Then i look in IDA Pro 7 asm code. And see only mov ebp,zyt But not see code from macro apply. |
|||
23 Jan 2019, 06:15 |
|
Furs 23 Jan 2019, 21:36
Roman wrote: I want do: Code: macro apply { zg zz zh } ;And write in some place of code apply .... macro applyB { apply zk } ;And write in some place of code applyB .... purge apply macro apply { zg zz zz zh zg zk } ;And write in some place of code apply |
|||
23 Jan 2019, 21:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.