How about this Peter:
Implementing Functions in Assembler
long a=1,b=2,c=3,d=4
jmp fwd over
fun: 'procedure without signature
'================================
mov eax,[esp+4]
add eax,[esp+8]
add eax,[esp+12]
ret 12
'
over:
d=call fun a,b,c,d 'UNCHECKED
print d
declare function fun(byval a as long, byval b as long, byval c as long) as long
jmp fwd over
fun#long#long#long: 'procedure with signature
'============================================
mov eax,[esp+4]
add eax,[esp+8]
add eax,[esp+12]
ret 12
'
over:
d=fun a,b,c 'CHECKED
print d
declare function fun(byval a as long, byval b as long, byval c as long) as long
jmp fwd over
fun#long#long#long: 'procedure with signature
'============================================
(
'
'DEFINE LOCAL VARIABLES
'
def aa [esp+4]
def bb [esp+8]
def cc [esp+12]
'
mov eax,aa
add eax,bb
add eax,cc
ret 12
)
over:
d=fun a,b,c 'CHECKED
print d
Charles