Dear pals,i need 8086 codes. Thanks to the two below replies,i can use the stdcall well.
But is there any error in the codes ?
include '8086.inc'
include 'format/mz.inc'
macro stdcall proc,args&
iterate arg, args
indx 1+%%-%
mov bx,arg
push bx
end iterate
call proc
end macro
entry code:start ; program entry point
stack 100h ; stack size
segment code
start:
push cs
pop ds
call main
MOV AH,4CH
INT 21H
main:
push bp
mov bp,sp
sub sp,2
;
mov bx,[-2+bp]
mov byte[bx],10
mov byte[bx+1],'1'
mov byte[bx+2],'2'
mov byte[bx+3],10
mov byte[bx+4],'$'
stdcall ok,9,[-2+bp]
add sp,4
;
mov sp,bp
pop bp
ret
ok:
push bp
mov bp,sp
mov bx,[bp+6]
mov byte[bx+2],'h'
mov dx,bx
mov ah,9
int 21h
;
mov dx,[bp+4]
add dx,30h
mov ah,2
int 21h
;
mov sp,bp
pop bp
ret