; NASM original macros

%unimacro stripangles 2.nolist
%assign ?stackdepth 0

%imacro stripangles 2.nolist
%defstr %%param %2
%rep 16
 %substr %%opening %%param 1
 %ifidn %%opening, '<'
  %substr %%param %%param 2,-1
 %endif
%endrep
%rep 16
 %strlen %%length %%param
 %substr %%closing %%param %%length
 %ifidn %%closing, '>'
  %substr %%param %%param 1,-2
 %endif
%endrep
%deftok %%token %%param
%1 %%token
%endmacro

;BREAK <SaveReg - save a set of registers>

%imacro SaveReg 0-*.nolist                 ;; push those registers
 %rep %0
	%assign ?stackdepth ?stackdepth + 1
	stripangles push, %1
	%rotate 1
 %endrep
%endmacro
;.xcref  SaveReg

;BREAK <RestoreReg - unsave some registers>

%imacro RestoreReg 0-*.nolist             ;; pop those registers
 %rep %0
	%assign ?stackdepth ?stackdepth - 1
	stripangles pop, %1
	%rotate 1
 %endrep
%endmacro
;.xcref  RestoreReg
