DCS     MACRO DCSTR,DCPOS,DCLEN
        MOV AX,1303H
        LEA BP,DCSTR
        MOV CX,DCLEN
        MOV BH,0
        MOV DX,DCPOS
        INT 10H
        ENDM

DCS2    MACRO STR,LEN,COLOR,POS
        IFNB <POS>
        MOV DX,POS
        ENDIF

        MOV AX,1301H
        LEA BP,STR
        MOV CX,LEN
        MOV BH,0
        MOV BL,COLOR
        INT 10H
        ENDM

DISPASCZ MACRO ASCZ,COLOR,POS
        IFNB <POS>
        MOV DX,POS
        ENDIF

        MOV AX,1225H
        LEA SI,ASCZ
        INT 2FH ;;GET ASCZ STRING LEN. CX=LEN (INCLUDE '0')

        MOV AX,1301H
        MOV BH,0
        MOV BL,COLOR
        MOV BP,SI
        INT 10H
        ENDM

DISPASCZ2 MACRO ASCZ,COLOR,POS
        IFNB <POS>
        MOV DX,POS
        ENDIF

        MOV SI,ASCZ ;;DIFFRENT FROM ABVOE
        MOV AX,1225H
        INT 2FH

        MOV BL,COLOR
        MOV BP,SI
        MOV BH,0
        MOV AX,1301H
        INT 10H
        ENDM


CLS     MACRO COLOR
        MOV AX,600H
        MOV BH,COLOR
        XOR CX,CX
        MOV DX,184FH
        INT 10H
        ENDM

WIN     MACRO X,Y,COLOR
        MOV BH,COLOR
        MOV CX,X
        MOV DX,Y
        MOV AX,600H
        INT 10H
        ENDM

VBK     MACRO COLOR
        MOV AX,1001H
        MOV BH,COLOR
        INT 10H
        ENDM

GETPOS  MACRO
        MOV AH,3
        MOV BH,0
        INT 10H
        ENDM

LOCATE  MACRO POS
        IFNB <POS>
        MOV DX,POS
        ENDIF

        MOV AH,2
        MOV BH,0
        INT 10H
        ENDM

DISPSTR MACRO STR
        IFNB <STR>
        LEA DX,STR
        ENDIF
        MOV AH,9
        INT 21H
        ENDM

DISPCHAR MACRO CHAR
        IFNB <CHAR>
        MOV AL,CHAR
        ENDIF
        MOV AH,14
        INT 10H
        ENDM

CRLF    MACRO
        MOV AX,0E0AH
        INT 10H
        MOV AX,0E0DH
        INT 10H
        ENDM

INPUT   MACRO KEYLEN,KEYBUF
        IFNB <KEYBUF>
        LEA DX,KEYBUF
        ENDIF
        MOV AH,3FH
        XOR BX,BX
        MOV CX,KEYLEN
        INT 21H
        ENDM

INKEY   MACRO
        MOV AH,0
        INT 16H
        ENDM

CHDIR   MACRO DIR
        IFNB <DIR>
        LEA DX,DIR
        ENDIF
        MOV AH,3BH
        INT 21H
        ENDM

GETDIR  MACRO DIRBUF,DRIVE
        MOV AH,47H
        LEA SI,DIRBUF
        MOV DL,DIRVE ;;0=DEFALUT,1=A,B=2,...Z=26
        INT 21H
        ENDM

GETDRV  MACRO
        MOV AH,19H
        INT 21H      ;; AL=DIRVE,0=A,1=B,...Z=25
        ENDM

SETDRV  MACRO DRIVE
        IFNB <DRIVE>
        MOV DL,DRIVE ;;A=0,B=1,...,Z=25
        ENDIF
        MOV AH,0EH
        INT 21H
        ENDM

BEEP    MACRO
        MOV AX,0E07H
        INT 10H
        ENDM

PUSHALL MACRO
        IRP REG,<AX,BX,CX,DX,DS,ES,SI,DI>
        PUSH REG
        ENDM
        ENDM

POPALL  MACRO
        IRP REG,<DI,SI,ES,DS,DX,CX,BX,AX>
        POP REG
        ENDM
        ENDM

ASCZLEN MACRO ASCZ
        MOV AX,1225H ;;GET ASCZ STRING (DS:SI) LENGTH. CX=LEN (INCLUDE 0)
        PUSH CS
        POP DS
        LEA SI,ASCZ
        INT 2FH
        ENDM

FLASH   MACRO YES_OR_NO
        MOV AX,1003H
        MOV BL,YES_OR_NO ;;BL=0 NO FLASH BL=1 FLASH
        INT 10H
        ENDM

CLEAN_KEY_BUF   MACRO
        PUSH ES
        PUSHF
        CLI
        MOV AX,40H
        MOV ES,AX
        MOV AX,ES:[80H]
        MOV DI,1AH
        STOSW
        STOSW
        POPF
        POP ES
        ENDM

MODE    MACRO M
        IFNB <M>
        MOV AX,M
        ELSE
        MOV AX,15
        ENDIF
        INT 10H
        ENDM

DEF_HZ  MACRO HZ_DOT,LEN
        IFNB <LEN>
        MOV CX,10
        ENDIF

        MOV AX,1100H
        MOV BX,1000H
        MOV DX,219
        LEA BP,HZ_DOT
        INT 10H
        ENDM
