flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Match symbols for .if.QWORD macro |
Author |
|
revolution 15 Mar 2017, 14:05
For each symbol you need to place the equals before it.
Code: match =<, op ;match to "<" match ===<, op ;match to "=<" |
|||
15 Mar 2017, 14:05 |
|
alwaysnub 15 Mar 2017, 14:17
@revolution
I did as you suggested, however. I still end up with the same error. It appears that the equal symbol is getting split from the other symbol when the syntax is being matched: Code: match [MemQword] Op HiDword:LoDword, arg [ESI] >= 0:0x200000 gets matched as: MemQword = "ESI" Op = ">" HiDword = "=0" LoDword = "0x200000" |
|||
15 Mar 2017, 14:17 |
|
revolution 15 Mar 2017, 14:32
You need to change the order you do the matches. Match on the longest ops first then the shorter ops after.
|
|||
15 Mar 2017, 14:32 |
|
alwaysnub 15 Mar 2017, 16:35
revolution wrote: You need to change the order you do the matches. Match on the longest ops first then the shorter ops after. I did as suggested, still same error. Current macro code Code: macro JMP!COND.QWORD label,arg { DONE equ NO local ...ifcode __IFCODE equ ...ifcode match HiDword:LoDword Op [MemQword], arg \{ match =>==, Op \\{ CMP HiDword,DWORD [MemQword+4] JB label JA __IFCODE CMP LoDword,DWORD [MemQword] JBE label __IFCODE: DONE reequ YES \\} match =<==, Op \\{ CMP HiDword,DWORD [MemQword+4] JA label JB __IFCODE CMP LoDword,DWORD [MemQword] JAE label __IFCODE: DONE reequ YES \\} match =<=>, Op \\{ CMP HiDword,DWORD [MemQword+4] JB label JA __IFCODE CMP LoDword,DWORD [MemQword] JB label __IFCODE: DONE reequ YES \\} match =>, Op \\{ CMP HiDword,DWORD [MemQword+4] JA label JB __IFCODE CMP LoDword,DWORD [MemQword] JA label __IFCODE: DONE reequ YES \\} match =<, Op \\{ CMP LoDword,DWORD [MemQword] JNE __IFCODE CMP HiDword,DWORD [MemQword+4] JE label __IFCODE: DONE reequ YES \\} match ==, Op \\{ CMP HiDword,DWORD [MemQword+4] JNE label CMP LoDword,DWORD [MemQword] JNE label __IFCODE: DONE reequ YES \\} \} match [MemQword] Op HiDword:LoDword, arg \{ match =>==, Op \\{ CMP DWORD [MemQword+4],HiDword JB label JA __IFCODE CMP DWORD [MemQword],LoDword JBE label __IFCODE: DONE reequ YES \\} match =<==, Op \\{ CMP DWORD [MemQword+4],HiDword JA label JB __IFCODE CMP DWORD [MemQword],LoDword JAE label __IFCODE: DONE reequ YES \\} match =<=>, Op \\{ CMP DWORD [MemQword+4],HiDword JB label JA __IFCODE CMP DWORD [MemQword],LoDword JB label __IFCODE: DONE reequ YES \\} match =>, Op \\{ CMP DWORD [MemQword+4],HiDword JA label JB __IFCODE CMP DWORD [MemQword],LoDword JA label __IFCODE: DONE reequ YES \\} match =<, Op \\{ CMP DWORD [MemQword],LoDword JNE __IFCODE CMP DWORD [MemQword+4],HiDword JE label __IFCODE: DONE reequ YES \\} match ==, Op \\{ CMP DWORD [MemQword+4],HiDword JNE label CMP DWORD [MemQword],LoDword JNE label __IFCODE: DONE reequ YES \\} \} match =NO, DONE \{ err \} restore __IFCODE restore DONE } |
|||
15 Mar 2017, 16:35 |
|
revolution 15 Mar 2017, 16:48
Now expand each match explicitly without the sub-matches:
Code: match [MemQword] =>== HiDword=:LoDword, arg |
|||
15 Mar 2017, 16:48 |
|
alwaysnub 15 Mar 2017, 17:27
revolution wrote: Now expand each match explicitly without the sub-matches: Ok, i did that and was still getting the error but this time it was because it was also matching ">=" to ">" ... So i added another match to see if a match has already been done. Here is the macro code: (Should work now...) Thanks revolution! Code: macro JMP!COND.QWORD label,arg { DONE equ NO local ...ifcode __IFCODE equ ...ifcode match HiDword=:LoDword =>== [MemQword], arg \{ CMP HiDword,DWORD [MemQword+4] JB label JA __IFCODE CMP LoDword,DWORD [MemQword] JBE label __IFCODE: DONE reequ YES \} match HiDword=:LoDword =<== [MemQword], arg \{ CMP HiDword,DWORD [MemQword+4] JA label JB __IFCODE CMP LoDword,DWORD [MemQword] JAE label __IFCODE: DONE reequ YES \} match HiDword=:LoDword =<=> [MemQword], arg \{ CMP HiDword,DWORD [MemQword+4] JB label JA __IFCODE CMP LoDword,DWORD [MemQword] JB label __IFCODE: DONE reequ YES \} match =NO, DONE \{ match HiDword=:LoDword => [MemQword], arg \\{ CMP HiDword,DWORD [MemQword+4] JA label JB __IFCODE CMP LoDword,DWORD [MemQword] JA label __IFCODE: DONE reequ YES \\} match HiDword=:LoDword =< [MemQword], arg \\{ CMP LoDword,DWORD [MemQword] JNE __IFCODE CMP HiDword,DWORD [MemQword+4] JE label __IFCODE: DONE reequ YES \\} match HiDword=:LoDword == [MemQword], arg \\{ CMP HiDword,DWORD [MemQword+4] JNE label CMP LoDword,DWORD [MemQword] JNE label __IFCODE: DONE reequ YES \\} \} match [MemQword] =>== HiDword=:LoDword, arg \{ CMP DWORD [MemQword+4],HiDword JB label JA __IFCODE CMP DWORD [MemQword],LoDword JBE label __IFCODE: DONE reequ YES \} match [MemQword] =<== HiDword=:LoDword, arg \{ CMP DWORD [MemQword+4],HiDword JA label JB __IFCODE CMP DWORD [MemQword],LoDword JAE label __IFCODE: DONE reequ YES \} match [MemQword] =<=> HiDword=:LoDword, arg \{ CMP DWORD [MemQword+4],HiDword JB label JA __IFCODE CMP DWORD [MemQword],LoDword JB label __IFCODE: DONE reequ YES \} match =NO, DONE \{ match [MemQword] => HiDword=:LoDword, arg \\{ CMP DWORD [MemQword+4],HiDword JA label JB __IFCODE CMP DWORD [MemQword],LoDword JA label __IFCODE: DONE reequ YES \\} match [MemQword] =< HiDword=:LoDword, arg \\{ CMP DWORD [MemQword],LoDword JNE __IFCODE CMP DWORD [MemQword+4],HiDword JE label __IFCODE: DONE reequ YES \\} match [MemQword] == HiDword=:LoDword, arg \\{ CMP DWORD [MemQword+4],HiDword JNE label CMP DWORD [MemQword],LoDword JNE label __IFCODE: DONE reequ YES \\} \} match =NO, DONE \{ err \} restore __IFCODE restore DONE } |
|||
15 Mar 2017, 17:27 |
|
revolution 15 Mar 2017, 18:02
You might want to consider incorporating the DONE match into each stage.
Code: match =NO HiDword=:LoDword =<=> [MemQword], DONE arg |
|||
15 Mar 2017, 18:02 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.