Category : BBS Programs+Doors
Archive   : DND27A.ZIP
Filename : DNDUTIL.ASM

 
Output of file : DNDUTIL.ASM contained in archive : DND27A.ZIP

DATA SEGMENT WORD PUBLIC 'DATA'
SAVE_DTA_OFF DW ? ;ADDRESS OF CURRENT DISK TRANSFER AREA
SAVE_DTA_SEG DW ?
DNDDTA DB 30 DUP(?) ;WORKING DTA (NOT BASIC'S)
PATHFILE DB 64 DUP(?) ;PATH AND FILE NAME FOR SEARCH
STRG_LEN DW ?
VID_PAGE DB ?
C_R DB ?
C_C DB ?
CUR_C DB ?
CUR_L DB ?
MTASK DB ?
DATA ENDS
DGROUP GROUP DATA
STACK SEGMENT WORD STACK 'STACK'
DW 8 DUP(?)
STACK ENDS
DNDUTIL SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:DNDUTIL,DS:DGROUP
SCRN PROC FAR
PUBLIC SCRN
PUSH BP
MOV BP,SP
MOV SI,6[BP]
MOV BL,[SI+2]
MOV BH,[SI+3]
MOV AX,[SI]
ADD AX,BX
MOV STRG_LEN,AX
PUSH BX
MOV AH,15
INT 10H
MOV VID_PAGE,BH
POP BX
MOV AH,02
L1: MOV DL,[BX]
PUSH AX
PUSH BX
PUSH CX
PUSH DX
MOV AH,03
MOV BH,VID_PAGE
INT 10H
MOV C_R,DH
MOV C_C,DL
POP DX
POP CX
POP BX
POP AX
CMP C_R,17H
JL L4
CMP C_R,18H
JZ L4
CMP DL,0AH
JNZ L2
CALL L7
JMP L5
L2: CMP DL,0DH
JNZ L4
INC BX
MOV DX,[BX]
CMP DL,0AH
JNZ L3
CALL L7
JMP L5
L3: DEC BX
CALL L7
JMP L5
L4: INT 21H
L5: INC BX
CMP C_R,17H
JNZ L6
CMP C_C,4FH
JNZ L6
CALL L7
L6: CMP BX,STRG_LEN
JL L1
POP BP
RET 2
SCRN ENDP
L7: PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH BP
MOV AH,2
MOV DX,1700H
MOV BH,VID_PAGE
INT 10H
MOV AH,8
MOV BH,VID_PAGE
INT 10H
MOV BH,AH
MOV AH,6
MOV AL,1
MOV CX,0000H
MOV DX,174FH
INT 10H
MOV AH,2
MOV DX,1700H
MOV BH,VID_PAGE
INT 10H
POP BP
POP DX
POP CX
POP BX
POP AX
RET
GETCUR PROC FAR
PUBLIC GETCUR
PUSH BP
MOV BP,SP
MOV AH,15
INT 10H
MOV VID_PAGE,BH
MOV AH,03
MOV BH,VID_PAGE
INT 10H
MOV CUR_C,DL
MOV CUR_L,DH
POP BP
RET
GETCUR ENDP
PUTCUR PROC FAR
PUBLIC PUTCUR
PUSH BP
MOV BP,SP
MOV AH,2
MOV DL,CUR_C
MOV DH,CUR_L
MOV BH,VID_PAGE
INT 10H
POP BP
RET
PUTCUR ENDP
DNDFIND PROC FAR
PUBLIC DNDFIND
PUSH BP
MOV BP,SP
MOV BX,[BP+8]
MOV CX,[BX]
MOV SI,[BX+2]
PUSH DS
POP ES
LEA DI,PATHFILE
CLD
REP MOVSB
MOV BYTE PTR ES:[DI],0
MOV AH,2FH
INT 21H
JC FINISH
MOV SAVE_DTA_OFF,BX
MOV SAVE_DTA_SEG,ES
LEA DX,DNDDTA
MOV AH,1AH
INT 21H
JC FINISH
XOR CX,CX
LEA DX,PATHFILE
MOV AH,4EH
INT 21H
JC EXIT
XOR AX,AX
EXIT: PUSH AX
PUSH DS
MOV DX,SAVE_DTA_OFF
MOV DS,SAVE_DTA_SEG
MOV AH,1AH
INT 21H
POP DS
POP AX
FINISH: MOV DI,[BP+6]
MOV [DI],AX
POP BP
RET 4
DNDFIND ENDP
GIVEINIT PROC FAR
PUBLIC GIVEINIT
PUSH BP
MOV BP,SP
PUSH AX
PUSH BX
PUSH CX
PUSH DX
MOV MTASK,0
MOV AX,2B01H
MOV CX,'DE'
MOV DX,'SQ'
INT 21H
CMP AL,0FFH
JE EXIT2
MOV MTASK,1
EXIT2: POP DX
POP CX
POP BX
POP AX
POP BP
RET
GIVEINIT ENDP
GIVEBACK PROC FAR
PUBLIC GIVEBACK
PUSH BP
MOV BP,SP
CMP MTASK,1
JNZ EXIT3
PUSH AX
PUSH BX
MOV AX,101AH
MOV BX,1000H
INT 15H
MOV AX,BX
INT 15H
MOV AX,1025H
INT 15H
POP BX
POP AX
EXIT3: POP BP
RET
GIVEBACK ENDP
DNDUTIL ENDS
END