I´ve written my own version of the proc macro, but this was with the older version of the preprocessor. A little bit of the code is from this forum here, but I don´t really know what this code should do and this is also the code which now doesn´t work.
This is the code which doesn´t work:
;----------------------------
macro RestoreEx [name]
{
macro rstr#name _% RESTORE name %_
macro rstr _% %_
rstr#name
purge rstr,rstr#name
}
;----------------------------
;----------------------------
_% fix {
%_ fix }
restore fix RestoreEx
;----------------------------
And this is my proc, begin and end macro:
;----------------------------
macro proc name,[arg]
{
common
if used name
; prog_args fix arg
if ..OPEN > 0
display "ERROR: no endp before proc",13,10
..OPEN= 0
end if
..OPEN= ..OPEN+1
if ~ arg eq
virtual at ebp+8
forward
local ..arg
..arg dd ?
arg equ ..arg
common
end virtual
end if
..LOCALS= 0
align 16
name:
}
;----------------------------
;----------------------------
macro begin
{
if ..OPEN <> 1
display "ERROR: begin without proc",13,10
end if
push ebp
mov ebp,esp
if ..LOCALS > 0
sub esp,4*..LOCALS
end if
}
;----------------------------
;----------------------------
macro endp
{
..OPEN= ..OPEN-1
if ..OPEN <> 0
display "ERROR: endp without proc",13,10
end if
; restore proc_args
end if
}
;----------------------------
The commented code is not working anymore and what it should it do? Do I need this code or can I use these macros w/o them?