jj2007, the macro your posted is not what I was looking for but it has some elements that can be used
I will try to make of it what I need
this is what I want to accomplish:
somefunction PROC FRAME USES r12 r13 r14 r15 somevar:QWORD
mov [rsp+8], rbp ;these 4 registers could be stored
mov [rsp+16], rbx ;in a shadow space
mov [rsp+24], rdi ;if we need to use rcx, rdx, r8, r9
mov [rsp+32], rsi ;we can put them in rbp, rbx, rdi, rsi
push r12
push r13
push r14
push r15
sub rsp, 1040 ;locals + @ReservedStack
;some code here
;..............
;
add rsp, 1040
pop r15
pop r14
pop r13
pop r12
mov rbp, [rsp+8]
mov rbx, [rsp+16]
mov rdi, [rsp+24]
mov rsi, [rsp+32]
ret
somefunction ENDP
Now I need to set LOCALS so that compiler can calculate locations on the stack
the macro you posted calls "SetGlobals"
however it could be changed to do the job
it should probably create something like:
var1 EQU 128+24
var2 EQU 128+16
var3 EQU 128+8