1%imacro export 1+.nolist 2[export %1] 3%endmacro 4 5; Raw exception handling operations 6%imacro proc_frame 1+.nolist 7%1: 8[proc_frame %1] 9%endmacro 10 11; Disable these as they're too closely named to the macroized ones. 12; MASM needs a preceding . to use these, so it seems reasonable for 13; us to similarly require the []. 14; 15;%imacro pushreg 1.nolist 16;[pushreg %1] 17;%endmacro 18; 19;%imacro setframe 1-2.nolist 20;[setframe %1 %2] 21;%endmacro 22; 23;%imacro allocstack 1.nolist 24;[allocstack %1] 25;%endmacro 26; 27;%imacro savereg 2.nolist 28;[savereg %1 %2] 29;%endmacro 30; 31;%imacro savexmm128 2.nolist 32;[savexmm128 %1 %2] 33;%endmacro 34; 35;%imacro pushframe 0-1.nolist 36;[pushframe %1] 37;%endmacro 38; 39;%imacro endprolog 0.nolist 40;[endprolog] 41;%endmacro 42; 43 44%imacro endproc_frame 0.nolist 45[endproc_frame] 46%endmacro 47 48; Complex (macro) exception handling operations 49; Mimics many macros provided by MASM's macamd64.inc 50%imacro push_reg 1 51push %1 52[pushreg %1] 53%endmacro 54 55%imacro rex_push_reg 1 56db 0x48 57push %1 58[pushreg %1] 59%endmacro 60 61%imacro push_eflags 0 62pushfq 63[allocstack 8] 64%endmacro 65 66%imacro rex_push_eflags 0 67db 0x48 68pushfq 69[allocstack 8] 70%endmacro 71 72%imacro alloc_stack 1 73sub rsp, %1 74[allocstack %1] 75%endmacro 76 77%imacro save_reg 2 78mov [rsp+%2], %1 79[savereg %1 %2] 80%endmacro 81 82%imacro save_xmm128 2 83movdqa [rsp+%2], %1 84[savexmm128 %1 %2] 85%endmacro 86 87%imacro push_frame 0-1.nolist 88[pushframe %1] 89%endmacro 90 91%imacro set_frame 1-2 92%if %0==1 93mov %1, rsp 94%else 95lea %1, [rsp+%2] 96%endif 97[setframe %1 %2] 98%endmacro 99 100%imacro end_prolog 0.nolist 101[endprolog] 102%endmacro 103 104%imacro end_prologue 0.nolist 105[endprolog] 106%endmacro 107