I Think for Writing recursive coding, you need to use macros like this for your favourite registers you wanna code with,its for 32bit but can be customized for 64bit to what register usage you need to push/pop or customized to make use of virtual stack for general 64bit regs
its from unfinished try to make procedurally generated tree in masm,inspired by fluxus script
fluxus is what makes all that patterns in your mediaplayer
.data?
statestack dd 0 dup (65536)
dd 0 dup (65536)
.data
ALIGN 16
vectconst0 REAL4 0.0,0.0,0.0,0.0 ;room for constanst used in fluxusprogram
vectconst1 REAL4 0.0,0.0,0.0,0.0
vectconst2 REAL4 0.0,0.0,0.0,0.0
vectconst3 REAL4 0.0,0.0,0.0,0.0
vectconst4 REAL4 0.0,0.0,0.0,0.0
vectconst5 REAL4 0.0,0.0,0.0,0.0
vectconst6 REAL4 0.0,0.0,0.0,0.0
vectconst7 REAL4 0.0,0.0,0.0,0.0
vectconst8 REAL4 0.0,0.0,0.0,0.0
tmpxmm0 REAL4 0.0,0.0,0.0,0.0 ;temporary storage
tmpxmm1 REAL4 0.0,0.0,0.0,0.0
tmpxmm2 REAL4 0.0,0.0,0.0,0.0
tmpxmm3 REAL4 0.0,0.0,0.0,0.0
tmpxmm4 REAL4 0.0,0.0,0.0,0.0
tmpxmm5 REAL4 0.0,0.0,0.0,0.0
tmpxmm6 REAL4 0.0,0.0,0.0,0.0
tmpxmm7 REAL4 0.0,0.0,0.0,0.0
tmpf0 REAL4 0.0,0.0,0.0,0.0
tmpf1 REAL4 0.0,0.0,0.0,0.0
tmpf2 REAL4 0.0,0.0,0.0,0.0
X equ 0
Y equ 4
Z equ 8
.code
; #########################################################################
PUSHSTATE MACRO
FXSAVE [ebx]
add ebx,512
ENDM
POPSTATE MACRO
sub ebx,512
FXRSTOR [ebx]
ENDM
TRANSLATE MACRO vectconst
addps XMM0,vectconst
addps XMM1,vectconst
addps XMM2,vectconst
addps XMM3,vectconst
addps XMM4,vectconst
addps XMM5,vectconst
addps XMM6,vectconst
addps XMM7,vectconst
ENDM
SCALE MACRO vectconst
mulps XMM0,vectconst
mulps XMM1,vectconst
mulps XMM2,vectconst
mulps XMM3,vectconst
mulps XMM4,vectconst
mulps XMM5,vectconst
mulps XMM6,vectconst
mulps XMM7,vectconst
ENDM