flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > invalid value in relativeto operator [solved] |
Author |
|
revolution 29 Jan 2015, 22:13
TFM wrote: With relativeto operator it is possible to check whether values of two expressions differ only by constant amount. The valid syntax is a numerical expression followed by relativeto and then another expression (possibly register-based). Labels that have no simple numerical value can be tested this way to determine what kind of operations may be possible with them. |
|||
29 Jan 2015, 22:13 |
|
CandyMan 30 Jan 2015, 15:19
I already advised myself.
Code: macro lea Dst,Src { local ..Word virtual at 0 mov eax,Src load ..Word word from 0 end virtual if Src eqtype [0] & ..Word=0x058B if Dst eq rax lea eax,Src else if Dst eq rbx lea ebx,Src else if Dst eq rcx lea ecx,Src else if Dst eq rdx lea edx,Src else if Dst eq rsi lea esi,Src else if Dst eq rdi lea edi,Src else if Dst eq rbp lea ebp,Src else if Dst eq rsp lea esp,Src else if Dst eq r8 lea r8d,Src else if Dst eq r9 lea r9d,Src else if Dst eq r10 lea r10d,Src else if Dst eq r11 lea r11d,Src else if Dst eq r12 lea r12d,Src else if Dst eq r13 lea r13d,Src else if Dst eq r14 lea r14d,Src else if Dst eq r15 lea r15d,Src else lea Dst,Src end if else lea Dst,Src end if } use64 lea rax,[Z] lea rax,[rdi+rcx*8] Z: _________________ smaller is better |
|||
30 Jan 2015, 15:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.