ASSEMBLY - AT110.ZIP - SCRNWORK.MAC

 
Output of file : SCRNWORK.MAC contained in archive : AT110.ZIP

SFIELD MACRO @NA,@NEXT,@MAXLEN,@OPT,@ATTR,@ROW,@COL,@DATA
LOCAL B1
LOCAL B2
@NA LABEL BYTE
DW @NEXT ;NEXT ENTRY
IFDIF <@MAXLEN>,<>
DB @MAXLEN ;MAX PARAMETER LENGTH
ELSE
DB B2 ;MAX PARAMETER LENGTH
ENDIF
DB @OPT ;PROCESSING OPTIONS
DB @ATTR ;ATTRIBUTE
DB @ROW ;STARTING ROW
DB @COL ;STARTING COL
B1 LABEL BYTE
IFDIF <@MAXLEN>,<>
DB @MAXLEN DUP(' ') ;DATA FIELD
ENDIF
IFDIF <@DATA>,<>
ORG B1
DB @DATA
B2 = $-B1
ORG B1+B2
ENDIF
ENDM
;
CLS MACRO @ATTR,@SROW,@SCOL,@EROW,@ECOL
PUSH AX ;SAVE AX
PUSH BX ;SAVE BX
PUSH CX ;SAVE CX
MOV AH,03H ;CLEAR SCREEN FUNCTION
MOV AL,@ATTR ;DATA ATTRIBUTE BYTE
IFDIF <@SROW>,<>
MOV BH,@SROW ;STARTING ROW
ELSE
MOV BH,00H ;STARTING ROW
ENDIF
IFDIF <@SCOL>,<>
MOV BL,@SCOL ;STARTING COLUMN
ELSE
MOV BL,00H ;STARTING COLUMN
ENDIF
IFDIF <@EROW>,<>
MOV CH,@EROW ;ENDING ROW
ELSE
MOV CH,24 ;ENDING ROW
ENDIF
IFDIF <@ECOL>,<>
MOV CL,@ECOL ;ENDING COLUMN
ELSE
MOV CL,79 ;ENDING COLUMN
ENDIF
CALL SCRMGR ;CLEAR THE SCREEN
POP CX ;RESTORE CX
POP BX ;RESTORE BX
POP AX ;RESTORE AX
ENDM
SCROLL MACRO @ATTR,@SROW,@SCOL,@EROW,@ECOL
PUSH AX ;SAVE AX
PUSH BX ;SAVE BX
PUSH CX ;SAVE CX
MOV AH,04H ;SCROLL UP FUNCTION
MOV AL,@ATTR ;DATA ATTRIBUTE BYTE
IFDIF <@SROW>,<>
MOV BH,@SROW ;STARTING ROW
ELSE
MOV BH,00H ;STARTING ROW
ENDIF
IFDIF <@SCOL>,<>
MOV BL,@SCOL ;STARTING COLUMN
ELSE
MOV BL,00H ;STARTING COLUMN
ENDIF
IFDIF <@EROW>,<>
MOV CH,@EROW ;ENDING ROW
ELSE
MOV CH,24 ;ENDING ROW
ENDIF
IFDIF <@ECOL>,<>
MOV CL,@ECOL ;ENDING COLUMN
ELSE
MOV CL,79 ;ENDING COLUMN
ENDIF
CALL SCRMGR ;CLEAR THE SCREEN
POP CX ;RESTORE CX
POP BX ;RESTORE BX
POP AX ;RESTORE AX
ENDM
;
WRITEC MACRO @CHAR,@ATTR,@ROW,@COL,@COUNT
MOV AH,05H ;WRITE CHARACTER FUNCTION
MOV AL,@ATTR ;ATTRIBUTE
MOV BH,@ROW ;ROW
MOV BL,@COL ;COLUMN
MOV CH,@CHAR ;CHARACTRE
MOV CL,@COUNT ;COUNT
CALL SCRMGR ;WRITE THE SCREEN
ENDM
;
WRITE MACRO @NAME
MOV AH,00H ;WRITE FUNCTION
PUSH DS ;ESTABLISH
POP ES ; SEGMENT
LEA BX,@NAME ; AND OFFSET
CALL SCRMGR ;WRITE THE SCREEN
ENDM
;
READ MACRO @NAME
MOV AH,01H ;READ FUNCTION
PUSH DS ;ESTABLISH
POP ES ; SEGMENT
LEA BX,@NAME ; AND OFFSET
CALL SCRMGR ;WRITE THE SCREEN
ENDM
;
WRITER MACRO @REG
MOV AH,00H ;WRITE FUNCTION
PUSH DS ;ESTABLISH
POP ES ; SEGMENT
MOV BX,@REG ; AND OFFSET
CALL SCRMGR ;WRITE THE SCREEN
ENDM
;
READR MACRO @REG
MOV AH,01H ;READ FUNCTION
PUSH DS ;ESTABLISH
POP ES ; SEGMENT
MOV BX,@REG ; AND OFFSET
CALL SCRMGR ;WRITE THE SCREEN
ENDM