Category : Batch File Utilities - mostly for DOS
Archive   : BATTUTOR.ZIP
Filename : Q_CMDS.INC
; q_cmds.inc
;
;
; This INCLUDE file provides the tables and table-driven code
; to implement a set of slash commands in command lines given
; to QUERY, FUNKY, and other utilities.
;
; To add a new command, increase the CMD_TOTAL param by one,
; add the two characters that identify the command (usually
; upper and lower case of a letter character) to the CMD_LETTERS
; table, and add the entry point to the command execute procedure
; to the CMD_OFFSETS table.
;
;
CMD_TOTAL DW 3 ;total commands defined
;
CMD_LETTERS DB 'B','b' ;"beep" command
DB 'L','l' ;"skip line" command
DB 'D','d' ;"delimiter line" command
;
CMD_OFFSETS DW BEEP ;"beep" procedure
DW SKIP ;"skip line" procedure
DW DELIM_LINE ;"delimiter line" procedure
;
; equates for procedures
;
BORDER_CHAR EQU 0CDH ;"double line" graphics char
;
; data for procedures
;
NEW_LINE DB CR,LF,'$'
;
; procedure code
;
BEEP PROC NEAR
MOV DL,BEL_CHAR ;ascii bell char code
MOV AH,2 ;"display one char" DOS call
INT 21H ;call DOS
RET ;done
BEEP ENDP
;
SKIP PROC NEAR
MOV DX,OFFSET NEW_LINE ;offset of CR, LF
MOV AH,9 ;"display string" DOS call
INT 21H ;call DOS
RET ;done
SKIP ENDP
;
DELIM_LINE PROC NEAR
MOV AH,15 ;"get current page" BIOS call
INT 10H ;call BIOS video
PUSH AX ;save number of cols in AH
MOV AH,8 ;"get current attribute" call
INT 10H ;call BIOS video
MOV BL,AH ;attribute into BL
POP AX ;number cols restored in AH
SUB CH,CH ;zero CH
MOV CL,AH ;move number of cols to CL
MOV AL,BORDER_CHAR ;character code into AL
MOV AH,9 ;"display char/attrib" BIOS call
INT 10H ;call BIOS video
MOV DX,OFFSET NEW_LINE ;skip line
MOV AH,9 ;"display string" DOS call
INT 21H ;call DOS
RET ;done
DELIM_LINE ENDP
;
; -------- end of q_cmds.inc --------
;
cmd2. s
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/