extern proc_nwln, proc_PutCh, proc_PutStr extern proc_GetStr, proc_GetCh extern proc_PutInt, proc_GetInt extern proc_PutLInt, proc_GetLInt ;;------------------------------------------------------------------- %macro .STACK 1 segment stack stack resb %1 stacktop: %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro .DATA 0 segment data %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro .UDATA 0 segment bss %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro .CODE 0 segment data segment bss segment text %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro .STARTUP 0 group dgroup data bss ..start: mov AX,dgroup mov DS,AX mov AX,stack mov SS,AX mov SP,stacktop %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro .EXIT 0 mov AX,0x4C00 int 0x21 %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro nwln 0 call proc_nwln %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro PutCh 1 push AX mov AL,%1 call proc_PutCh pop AX %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro PutStr 1 push AX mov AX,%1 call proc_PutStr pop AX %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro GetStr 1-2 81 push AX push CX push BX mov BX,%1 mov CX,%2 call proc_GetStr pop BX pop CX pop AX %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro GetCh 1 push SI xor SI,SI %ifidni %1,AL inc SI call proc_GetCh %elifidni %1,AH mov SI,2 call proc_GetCh %else push AX call proc_GetCh mov %1,AL pop AX %endif pop SI %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro PutInt 1 push AX mov AX,%1 call proc_PutInt pop AX %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro GetInt 1 %ifnidni %1,AX push AX call proc_GetInt mov %1,AX pop AX %else call proc_GetInt %endif %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro PutLInt 1 push EAX mov EAX,%1 call proc_PutLInt pop EAX %endmacro ;;------------------------------------------------------------------- ;;------------------------------------------------------------------- %macro GetLInt 1 %ifnidni %1,EAX push EAX call proc_GetLInt mov %1,EAX pop EAX %else call proc_GetLInt %endif %endmacro ;;-------------------------------------------------------------------