├── cleantree ├── Makefile ├── v11object ├── ART.BAS ├── SYS.COM ├── BALL.BAS ├── BASIC.COM ├── BASICA.COM ├── CHKDSK.COM ├── CIRCLE.BAS ├── COMM.BAS ├── COMP.COM ├── DEBUG.COM ├── DONKEY.BAS ├── EDLIN.COM ├── FORMAT.COM ├── LINK.EXE ├── MODE.COM ├── MUSIC.BAS ├── SPACE.BAS ├── CALENDAR.BAS ├── COLORBAR.BAS ├── COMMAND.COM ├── DISKCOMP.COM ├── DISKCOPY.COM ├── EXE2BIN.EXE ├── MORTGAGE.BAS ├── PIECHART.BAS ├── SAMPLES.BAS └── SETCLOCK.COM ├── v20object ├── FC.EXE ├── SYS.COM ├── CHKDSK.COM ├── CREF.EXE ├── DEBUG.COM ├── EDLIN.COM ├── FIND.EXE ├── FORMAT.OBJ ├── FORMES.OBJ ├── LINK.EXE ├── MASM.EXE ├── MORE.COM ├── MSDOS.SYS ├── PRINT.COM ├── PROFIL.OBJ ├── PROHST.EXE ├── SORT.EXE ├── COMMAND.COM ├── DISKCOPY.COM ├── EXE2BIN.EXE ├── RECOVER.COM ├── SYSIMES.OBJ ├── SYSINIT.OBJ ├── DOSPATCH.TXT ├── INCOMP.DOC ├── SYSINIT.DOC ├── CONFIG.DOC ├── QUICK.DOC ├── PROFILE.DOC ├── INT24.DOC ├── FILBP.PAS └── ANSI.DOC ├── v20source ├── TDATA.ASM ├── WSBAUD.BAS ├── WSMSGS.OVR ├── WSOVLY1.OVR ├── COMLINK ├── DOSLINK ├── MSDOS.ASM ├── STDPROC.ASM ├── STDFCB.ASM ├── STDIO.ASM ├── STDBUF.ASM ├── STDCALL.ASM ├── STDCTRLC.ASM ├── IFEQU.ASM ├── MOREMES.ASM ├── DOSSEG.ASM ├── COMSW.ASM ├── SYSIMES.ASM ├── EXEMES.ASM ├── COMSEG.ASM ├── UINIT.ASM ├── COMEQU.ASM ├── DEBEQU.ASM ├── STDSW.ASM ├── SYSMES.ASM ├── FINDMES.ASM ├── PROHST.HLP ├── FCMES.ASM ├── DEVSYM.ASM ├── INCOMP.txt ├── SORTMES.ASM ├── DEBDATA.ASM ├── SYSINIT.txt ├── PCLOCK.ASM ├── EDLMES.ASM ├── CONFIG.txt ├── PROC.ASM ├── QUICK.txt ├── PROFILE.txt ├── MORE.ASM ├── INT24.txt ├── GENFOR.ASM ├── FORMES.ASM ├── TSPC.ASM ├── DOSMAC_v211.ASM ├── DEBMES.ASM ├── RECMES.ASM ├── RDATA.ASM ├── ANSI.txt ├── RUCODE.ASM ├── DISKCOPY.ASM ├── TIME.ASM ├── DOSMAC.ASM └── TUCODE.ASM ├── v11source ├── Tim_Paterson_16Dec2013_email.txt ├── STDDOS.ASM └── HEX2BIN.ASM ├── git-update-all ├── git-push-to-github.sh ├── git-update-all-wo-push ├── README.TXT └── git-source-pickup.pl /cleantree: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find -name \*~ -delete 3 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | 3 | clean: 4 | 5 | distclean: 6 | 7 | -------------------------------------------------------------------------------- /v11object/ART.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/ART.BAS -------------------------------------------------------------------------------- /v11object/SYS.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/SYS.COM -------------------------------------------------------------------------------- /v20object/FC.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/FC.EXE -------------------------------------------------------------------------------- /v20object/SYS.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/SYS.COM -------------------------------------------------------------------------------- /v11object/BALL.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/BALL.BAS -------------------------------------------------------------------------------- /v11object/BASIC.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/BASIC.COM -------------------------------------------------------------------------------- /v11object/BASICA.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/BASICA.COM -------------------------------------------------------------------------------- /v11object/CHKDSK.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/CHKDSK.COM -------------------------------------------------------------------------------- /v11object/CIRCLE.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/CIRCLE.BAS -------------------------------------------------------------------------------- /v11object/COMM.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/COMM.BAS -------------------------------------------------------------------------------- /v11object/COMP.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/COMP.COM -------------------------------------------------------------------------------- /v11object/DEBUG.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/DEBUG.COM -------------------------------------------------------------------------------- /v11object/DONKEY.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/DONKEY.BAS -------------------------------------------------------------------------------- /v11object/EDLIN.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/EDLIN.COM -------------------------------------------------------------------------------- /v11object/FORMAT.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/FORMAT.COM -------------------------------------------------------------------------------- /v11object/LINK.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/LINK.EXE -------------------------------------------------------------------------------- /v11object/MODE.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/MODE.COM -------------------------------------------------------------------------------- /v11object/MUSIC.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/MUSIC.BAS -------------------------------------------------------------------------------- /v11object/SPACE.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/SPACE.BAS -------------------------------------------------------------------------------- /v20object/CHKDSK.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/CHKDSK.COM -------------------------------------------------------------------------------- /v20object/CREF.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/CREF.EXE -------------------------------------------------------------------------------- /v20object/DEBUG.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/DEBUG.COM -------------------------------------------------------------------------------- /v20object/EDLIN.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/EDLIN.COM -------------------------------------------------------------------------------- /v20object/FIND.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/FIND.EXE -------------------------------------------------------------------------------- /v20object/FORMAT.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/FORMAT.OBJ -------------------------------------------------------------------------------- /v20object/FORMES.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/FORMES.OBJ -------------------------------------------------------------------------------- /v20object/LINK.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/LINK.EXE -------------------------------------------------------------------------------- /v20object/MASM.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/MASM.EXE -------------------------------------------------------------------------------- /v20object/MORE.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/MORE.COM -------------------------------------------------------------------------------- /v20object/MSDOS.SYS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/MSDOS.SYS -------------------------------------------------------------------------------- /v20object/PRINT.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/PRINT.COM -------------------------------------------------------------------------------- /v20object/PROFIL.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/PROFIL.OBJ -------------------------------------------------------------------------------- /v20object/PROHST.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/PROHST.EXE -------------------------------------------------------------------------------- /v20object/SORT.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/SORT.EXE -------------------------------------------------------------------------------- /v20source/TDATA.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20source/TDATA.ASM -------------------------------------------------------------------------------- /v20source/WSBAUD.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20source/WSBAUD.BAS -------------------------------------------------------------------------------- /v20source/WSMSGS.OVR: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20source/WSMSGS.OVR -------------------------------------------------------------------------------- /v11object/CALENDAR.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/CALENDAR.BAS -------------------------------------------------------------------------------- /v11object/COLORBAR.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/COLORBAR.BAS -------------------------------------------------------------------------------- /v11object/COMMAND.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/COMMAND.COM -------------------------------------------------------------------------------- /v11object/DISKCOMP.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/DISKCOMP.COM -------------------------------------------------------------------------------- /v11object/DISKCOPY.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/DISKCOPY.COM -------------------------------------------------------------------------------- /v11object/EXE2BIN.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/EXE2BIN.EXE -------------------------------------------------------------------------------- /v11object/MORTGAGE.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/MORTGAGE.BAS -------------------------------------------------------------------------------- /v11object/PIECHART.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/PIECHART.BAS -------------------------------------------------------------------------------- /v11object/SAMPLES.BAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/SAMPLES.BAS -------------------------------------------------------------------------------- /v11object/SETCLOCK.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11object/SETCLOCK.COM -------------------------------------------------------------------------------- /v20object/COMMAND.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/COMMAND.COM -------------------------------------------------------------------------------- /v20object/DISKCOPY.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/DISKCOPY.COM -------------------------------------------------------------------------------- /v20object/EXE2BIN.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/EXE2BIN.EXE -------------------------------------------------------------------------------- /v20object/RECOVER.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/RECOVER.COM -------------------------------------------------------------------------------- /v20object/SYSIMES.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/SYSIMES.OBJ -------------------------------------------------------------------------------- /v20object/SYSINIT.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20object/SYSINIT.OBJ -------------------------------------------------------------------------------- /v20source/WSOVLY1.OVR: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v20source/WSOVLY1.OVR -------------------------------------------------------------------------------- /v11source/Tim_Paterson_16Dec2013_email.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joncampbell123/msdos11-oss-style/HEAD/v11source/Tim_Paterson_16Dec2013_email.txt -------------------------------------------------------------------------------- /v20source/COMLINK: -------------------------------------------------------------------------------- 1 | command rucode rdata init uinit tcode tcode2 tcode3 + 2 | tcode4 tcode5 tucode copy copyproc cparse tdata tspc; 3 | -------------------------------------------------------------------------------- /v20source/DOSLINK: -------------------------------------------------------------------------------- 1 | msdos mscode dosmes misc getset dircall alloc dev dir + 2 | disk fat rom stdbuf stdcall stdctrlc stdfcb stdproc + 3 | stdio time xenix xenix2; 4 | 5 |  -------------------------------------------------------------------------------- /v20source/MSDOS.ASM: -------------------------------------------------------------------------------- 1 | TITLE Standard MSDOS 2 | NAME MSDOS_2 3 | 4 | ; Number of disk I/O buffers 5 | 6 | INCLUDE STDSW.ASM 7 | INCLUDE MSHEAD.ASM 8 | INCLUDE MSDATA.ASM 9 | 10 | END 11 | 12 |  -------------------------------------------------------------------------------- /git-update-all: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # sort of like svn-update-all 3 | ./cleantree 2>/dev/null 4 | ./cleanup.sh 2>/dev/null 5 | for i in \* \*/\* \*/\*/\*; do git add $i 2>/dev/null; done 6 | git commit -a 7 | ./cleantree 2>/dev/null 8 | git push 9 | git pull 10 | 11 | -------------------------------------------------------------------------------- /v20source/STDPROC.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Pseudo EXEC system call for MSDOS 3 | ; 4 | 5 | .xlist 6 | .xcref 7 | INCLUDE STDSW.ASM 8 | .cref 9 | .list 10 | 11 | TITLE STDPROC - process maintenance for MSDOS 12 | NAME STDPROC 13 | 14 | INCLUDE PROC.ASM 15 | 16 |  -------------------------------------------------------------------------------- /git-push-to-github.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git remote add github https://joncampbell123@github.com/joncampbell123/msdos11-oss-style.git # might fail 3 | git remote set-url github https://joncampbell123@github.com/joncampbell123/msdos11-oss-style.git # might fail 4 | git push github master 5 | 6 | -------------------------------------------------------------------------------- /v20source/STDFCB.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Standard FCB calls for MSDOS (first 12 function calls) 3 | ; 4 | 5 | .xlist 6 | .xcref 7 | INCLUDE STDSW.ASM 8 | .cref 9 | .list 10 | 11 | TITLE STDFCB - FCB calls for MSDOS 12 | NAME STDFCB 13 | 14 | INCLUDE FCB.ASM 15 | 16 |  -------------------------------------------------------------------------------- /git-update-all-wo-push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # sort of like svn-update-all 3 | make clean 2>/dev/null 4 | make distclean 2>/dev/null 5 | ./cleantree 2>/dev/null 6 | ./cleanup.sh 2>/dev/null 7 | for i in \* \*/\* \*/\*/\*; do git add $i 2>/dev/null; done 8 | git commit -a 9 | ./cleantree 2>/dev/null 10 | 11 | -------------------------------------------------------------------------------- /v20source/STDIO.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Standard device IO for MSDOS (first 12 function calls) 3 | ; 4 | 5 | .xlist 6 | .xcref 7 | INCLUDE STDSW.ASM 8 | INCLUDE DOSSEG.ASM 9 | .cref 10 | .list 11 | 12 | TITLE STDIO - device IO for MSDOS 13 | NAME STDIO 14 | 15 | INCLUDE IO.ASM 16 | 17 |  -------------------------------------------------------------------------------- /v20source/STDBUF.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Standard buffer management for MSDOS 3 | ; 4 | 5 | .xlist 6 | .xcref 7 | INCLUDE STDSW.ASM 8 | .cref 9 | .list 10 | 11 | TITLE STDBUF - MSDOS buffer management 12 | NAME STDBUF 13 | 14 | INCLUDE BUF.ASM 15 | -------------------------------------------------------------------------------- /v20source/STDCALL.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Standard system calls for MSDOS 3 | ; 4 | 5 | .xlist 6 | .xcref 7 | INCLUDE STDSW.ASM 8 | .cref 9 | .list 10 | 11 | TITLE STDCALL - system calls for MSDOS 12 | NAME STDCALL 13 | 14 | INCLUDE SYSCALL.ASM 15 | -------------------------------------------------------------------------------- /v20source/STDCTRLC.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; ^C and error handler for MSDOS 3 | ; 4 | 5 | .xlist 6 | .xcref 7 | INCLUDE STDSW.ASM 8 | .cref 9 | .list 10 | 11 | TITLE STDCTRLC - error handler for MSDOS 12 | NAME STDCTRLC 13 | 14 | INCLUDE CTRLC.ASM 15 | -------------------------------------------------------------------------------- /v20source/IFEQU.ASM: -------------------------------------------------------------------------------- 1 | ;************************************* 2 | ; COMMAND EQUs which are switch dependant 3 | 4 | IF1 5 | IF IBM 6 | %OUT IBM version 7 | ELSE 8 | %OUT Normal version 9 | ENDIF 10 | 11 | IF HIGHMEM 12 | %OUT Highmem version 13 | ENDIF 14 | 15 | IF KANJI 16 | %OUT Kanji version 17 | ENDIF 18 | ENDIF 19 | -------------------------------------------------------------------------------- /v20source/MOREMES.ASM: -------------------------------------------------------------------------------- 1 | TITLE MORE Messages 2 | 3 | CODE SEGMENT PUBLIC 4 | PUBLIC MORETXT,BADVER,CRLFTXT,BUFFER 5 | 6 | MORETXT DB 13,"-- More --$" 7 | BADVER DB "MORE: Incorrect DOS version" 8 | CRLFTXT DB 13,10,"$" 9 | ; 10 | ; THIS VARIABLE MUST BE DEFINED LAST! 11 | ; 12 | BUFFER DB 4098 DUP (?) 13 | 14 | CODE ENDS 15 | END 16 | 17 |  -------------------------------------------------------------------------------- /v20source/DOSSEG.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; segment ordering for MSDOS 3 | ; 4 | 5 | CONSTANTS SEGMENT BYTE PUBLIC 'CONST' 6 | CONSTANTS ENDS 7 | 8 | DATA SEGMENT BYTE PUBLIC 'DATA' 9 | DATA ENDS 10 | 11 | CODE SEGMENT BYTE PUBLIC 'CODE' 12 | CODE ENDS 13 | 14 | LAST SEGMENT BYTE PUBLIC 'LAST' 15 | LAST ENDS 16 | 17 | DOSGROUP GROUP CODE,CONSTANTS,DATA,LAST 18 | -------------------------------------------------------------------------------- /v20source/COMSW.ASM: -------------------------------------------------------------------------------- 1 | ; Use the following booleans to set assembly flags 2 | FALSE EQU 0 3 | TRUE EQU NOT FALSE 4 | 5 | IBMVER EQU true ; Switch to build IBM version of Command 6 | IBM EQU IBMVER 7 | MSVER EQU false ; Switch to build MS-DOS version of Command 8 | 9 | HIGHMEM EQU FALSE ; Run resident part above transient (high memory) 10 | KANJI EQU false ; Support for dual byte Microsoft KANJI standard 11 | IBMJAPAN EQU FALSE ;MUST BE TRUE (along with IBM and KANJI) 12 | 13 |  -------------------------------------------------------------------------------- /v20source/SYSIMES.ASM: -------------------------------------------------------------------------------- 1 | SYSINITSEG SEGMENT PUBLIC BYTE 'SYSTEM_INIT' 2 | 3 | PUBLIC BADOPM,CRLFM,BADSIZ,BADLD,BADCOM,SYSSIZE 4 | 5 | BADOPM DB 13,10,"Unrecognized command in CONFIG.SYS" 6 | CRLFM DB 13,10,'$' 7 | 8 | BADSIZ DB 13,10,"Sector size too large in file $" 9 | 10 | BADLD DB 13,10,"Bad or missing $" 11 | 12 | BADCOM DB "Command Interpreter",0 13 | 14 | SYSSIZE LABEL BYTE 15 | 16 | SYSINITSEG ENDS 17 | END 18 | -------------------------------------------------------------------------------- /v11source/STDDOS.ASM: -------------------------------------------------------------------------------- 1 | TITLE MS-DOS version 1.25 by Tim Paterson March 3, 1982 2 | PAGE 60,132 3 | ; Use the following booleans to set the switches 4 | FALSE EQU 0 5 | TRUE EQU NOT FALSE 6 | 7 | ; Use the switches below to produce the standard Microsoft version of the IBM 8 | ; version of the operating system 9 | MSVER EQU TRUE 10 | IBM EQU FALSE 11 | 12 | ; Set this switch to cause DOS to move itself to the end of memory 13 | HIGHMEM EQU FALSE 14 | 15 | ; Turn on switch below to allow testing disk code with DEBUG. It sets 16 | ; up a different stack for disk I/O (functions > 11) than that used for 17 | ; character I/O which effectively makes the DOS re-entrant. 18 | 19 | DSKTEST EQU FALSE 20 | 21 | INCLUDE MSDOS.ASM 22 | 23 |  -------------------------------------------------------------------------------- /v20source/EXEMES.ASM: -------------------------------------------------------------------------------- 1 | title LOCATE (EXE2BIN) Messages 2 | 3 | FALSE EQU 0 4 | TRUE EQU NOT FALSE 5 | 6 | DATA SEGMENT PUBLIC BYTE 7 | 8 | PUBLIC bad_vers_err,NOTFND,NOROOM,DIRFULL,FULL,PROMPT,CRLF 9 | PUBLIC CANTFIX,RDBAD 10 | 11 | bad_vers_err db "Incorrect DOS version$" 12 | NOTFND DB "File not found$" 13 | NOROOM DB "Insufficient memory$" 14 | DIRFULL DB "File creation error$" 15 | FULL DB "Insufficient disk space$" 16 | PROMPT DB "Fix-ups needed - base segment (hex): $" 17 | CRLF DB 13,10,"$" 18 | CANTFIX DB "File cannot be converted$" 19 | RDBAD DB "WARNING - Read error on EXE file." 20 | DB 13,10," Amount read less than size in header.",13,10,"$" 21 | 22 | 23 | DATA ENDS 24 | END 25 | -------------------------------------------------------------------------------- /README.TXT: -------------------------------------------------------------------------------- 1 | MS-DOS v1.1 and MS-DOS v2.0 source code. 2 | 3 | This is *NOT* the original source files released by the 4 | computer museum. For those files, please visit: 5 | 6 | http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/ 7 | 8 | This copy of the source code is a "fork" that attempts to translate the 9 | assembly language and object files into something that can be assembled 10 | and built using open source tools instead of the Microsoft assembler 11 | and linker, while producing binary exact or functionally equivalent 12 | output. Any functional changes or added features will be clearly marked 13 | and kept separate from the original code. 14 | 15 | It is hoped that by doing so, the MS-DOS source code can become more 16 | "hackable" and a better historical study guide, as being able to compile 17 | from source and run the result is far better than just having source 18 | code. 19 | 20 | -------------------------------------------------------------------------------- /v20source/COMSEG.ASM: -------------------------------------------------------------------------------- 1 | ; The following are all of the segments used in the load order 2 | 3 | CODERES SEGMENT PUBLIC 4 | CODERES ENDS 5 | 6 | DATARES SEGMENT PUBLIC 7 | DATARES ENDS 8 | 9 | ENVIRONMENT SEGMENT PUBLIC 10 | ENVIRONMENT ENDS 11 | 12 | INIT SEGMENT PUBLIC 13 | INIT ENDS 14 | 15 | TAIL SEGMENT PUBLIC 16 | TAIL ENDS 17 | 18 | TRANCODE SEGMENT PUBLIC 19 | TRANCODE ENDS 20 | 21 | TRANDATA SEGMENT PUBLIC 22 | TRANDATA ENDS 23 | 24 | TRANSPACE SEGMENT PUBLIC 25 | TRANSPACE ENDS 26 | 27 | TRANTAIL SEGMENT PUBLIC 28 | TRANTAIL ENDS 29 | 30 | ZEXEC_CODE SEGMENT PUBLIC 31 | ZEXEC_CODE ENDS 32 | 33 | ZEXEC_DATA SEGMENT PUBLIC 34 | ZEXEC_DATA ENDS 35 | 36 | RESGROUP GROUP CODERES,DATARES,ENVIRONMENT,INIT,TAIL 37 | TRANGROUP GROUP TRANCODE,TRANDATA,TRANSPACE,TRANTAIL 38 | EGROUP GROUP ZEXEC_CODE,ZEXEC_DATA 39 | -------------------------------------------------------------------------------- /v20source/UINIT.ASM: -------------------------------------------------------------------------------- 1 | TITLE COMMAND Initialization messages 2 | 3 | INCLUDE COMSW.ASM 4 | 5 | INCLUDE IFEQU.ASM 6 | 7 | INIT SEGMENT PUBLIC BYTE 8 | 9 | PUBLIC BADCOMLKMES 10 | 11 | PUBLIC HEADER 12 | IF NOT IBM 13 | HEADER DB 13,10,"Command v. 2.11" 14 | IF HIGHMEM 15 | DB "H" 16 | ENDIF 17 | DB 13,10,"$" 18 | ENDIF 19 | IF IBM 20 | HEADER DB 13,10,13,10,"TeleVideo Personal Computer DOS Vers. 2.11",13,10 21 | DB "(C) Copyright TeleVideo Systems, Inc. 1983",13,10 22 | DB "(C) Copyright Microsoft Corp. 1981, 1982, 1983",13,10,"$" 23 | ENDIF 24 | 25 | BADCOMLKMES DB "Specified COMMAND search directory bad",13,10,"$" 26 | 27 | INIT ENDS 28 | 29 | END 30 |  -------------------------------------------------------------------------------- /v20source/COMEQU.ASM: -------------------------------------------------------------------------------- 1 | ;************************************* 2 | ; COMMAND EQUs which are not switch dependant 3 | 4 | IFDEF IBM 5 | INCLUDE IFEQU.ASM 6 | ENDIF 7 | 8 | 9 | SYM EQU ">" 10 | 11 | LINPERPAG EQU 23 12 | NORMPERLIN EQU 1 13 | WIDEPERLIN EQU 5 14 | COMBUFLEN EQU 128 ; Length of commmand buffer 15 | 16 | DRVCHAR EQU ":" 17 | 18 | FCB EQU 5CH 19 | 20 | VARSTRUC STRUC 21 | ISDIR DB ? 22 | SIZ DB ? 23 | TTAIL DW ? 24 | INFO DB ? 25 | BUF DB DIRSTRLEN + 20 DUP (?) 26 | VARSTRUC ENDS 27 | 28 | WSWITCH EQU 1 ; Wide display during DIR 29 | PSWITCH EQU 2 ; Pause (or Page) mode during DIR 30 | ASWITCH EQU 4 ; ASCII mode during COPY 31 | BSWITCH EQU 8 ; Binary mode during COPY 32 | VSWITCH EQU 10H ; Verify switch 33 | GOTSWITCH EQU 8000H ; Meta switch set if switch character encountered 34 | -------------------------------------------------------------------------------- /v20source/DEBEQU.ASM: -------------------------------------------------------------------------------- 1 | FALSE EQU 0 2 | TRUE EQU NOT FALSE 3 | 4 | IBMVER EQU true ; Set conditional switches 5 | MSVER EQU false 6 | 7 | SYSVER EQU FALSE ; if true, i/o direct to bios 8 | ; so DOS can be debugged 9 | IBMJAPAN EQU FALSE 10 | 11 | SETCNTC EQU TRUE ; If this is FALSE, DEBUG will not set 12 | ; the Control C int vector 13 | 14 | ZIBO EQU TRUE ; true if P traces over interrupts 15 | ; and calls and dump looks pretty 16 | PROMPT EQU "-" 17 | FCB EQU 5CH 18 | EXEFCB EQU FCB 19 | BUFLEN EQU 80 ; Maximum length of line input buffer 20 | BPMAX EQU 10 ; Maximum number of breakpoints 21 | BPLEN EQU 5*BPMAX ; Length of breakpoint table 22 | REGTABLEN EQU 14 ; Number of registers 23 | SEGDIF EQU 0 24 | BUFSIZ EQU 512 25 | 26 | BXREG EQU "B"+5800H ; "BX" 27 | BPREG EQU "B"+5000H ; "BP" 28 | SIREG EQU "S"+4900H ; "SI" 29 | DIREG EQU "D"+4900H ; "DI" 30 | COMMA EQU 2C00H 31 | OPBUFLEN EQU 35 32 |  -------------------------------------------------------------------------------- /v20source/STDSW.ASM: -------------------------------------------------------------------------------- 1 | TRUE EQU 0FFFFH 2 | FALSE EQU NOT TRUE 3 | 4 | ; Use the switches below to produce the standard Microsoft version or the IBM 5 | ; version of the operating system 6 | MSVER EQU false 7 | IBM EQU true 8 | WANG EQU FALSE 9 | ALTVECT EQU FALSE 10 | 11 | ; Set this switch to cause DOS to move itself to the end of memory 12 | HIGHMEM EQU FALSE 13 | 14 | IF IBM 15 | ESCCH EQU 0 ; character to begin escape seq. 16 | CANCEL EQU 27 17 | TOGLINS EQU TRUE ;One key toggles insert mode 18 | TOGLPRN EQU TRUE ;One key toggles printer echo 19 | ZEROEXT EQU TRUE 20 | ELSE 21 | IF WANG ;Are we assembling for WANG? 22 | ESCCH EQU 1FH ;Yes. Use 1FH for escape character 23 | ELSE 24 | ESCCH EQU 1BH 25 | ENDIF 26 | CANCEL EQU "X"-"@" ;Cancel with Ctrl-X 27 | TOGLINS EQU WANG ;Separate keys for insert mode on 28 | ;and off if not WANG 29 | TOGLPRN EQU FALSE ;Separate keys for printer echo on 30 | ;and off 31 | ZEROEXT EQU TRUE 32 | ENDIF 33 | 34 |  -------------------------------------------------------------------------------- /v20source/SYSMES.ASM: -------------------------------------------------------------------------------- 1 | TITLE Message file for MS-DOS SYS Program 2 | 3 | FALSE EQU 0 4 | TRUE EQU NOT FALSE 5 | 6 | INCLUDE DOSSYM.ASM 7 | 8 | Message MACRO label,text 9 | PUBLIC label,label&Len 10 | label DB text 11 | label&Len DW $-label 12 | ENDM 13 | 14 | 15 | IBMJAPVER EQU FALSE 16 | 17 | CONST SEGMENT PUBLIC BYTE 18 | 19 | ; only this message must be terminated with a $ 20 | PUBLIC BadVer 21 | BADVER DB "Incorrect DOS version",13,10,"$" 22 | 23 | IF IBMJAPVER 24 | Message BadDisk,<"Destination disk cannot be booted"> 25 | ENDIF 26 | 27 | Message BadDrv,<"Invalid drive specification"> 28 | Message BadParm,<"Invalid parameter"> 29 | Message NoDest,<"No room for system on destination disk"> 30 | Message BadSiz,<"Incompatible system size"> 31 | Message Done,<"System transferred"> 32 | 33 | PUBLIC GetSys,SysDrv,GetSysLen 34 | GETSYS DB "Insert system disk in drive " 35 | SYSDRV DB "A",13,10 36 | DB "and strike any key when ready",13,10 37 | GetSysLen DW GetSysLen-GetSys 38 | 39 | CONST ENDS 40 | 41 | DATA SEGMENT BYTE PUBLIC 42 | DATA ENDS 43 | 44 | CODE SEGMENT 45 | DG GROUP CODE,CONST,DATA 46 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG 47 | 48 | CODE ENDS 49 | END 50 | 51 |  -------------------------------------------------------------------------------- /v20source/FINDMES.ASM: -------------------------------------------------------------------------------- 1 | title FIND Messages 2 | 3 | 4 | CR equ 0dh ;A Carriage Return 5 | LF equ 0ah ;A Line Feed 6 | 7 | code segment public 8 | 9 | PUBLIC bad_vers,crlf,errmsg1,errlen1,errmsg2,errlen2 10 | PUBLIC errmsg3_pre,errlen3_pre,errmsg4_pre,errlen4_pre 11 | PUBLIC errmsg3_post,errlen3_post,errmsg4_post,errlen4_post 12 | PUBLIC errmsg5,errlen5,errmsg5_opt 13 | PUBLIC heading,heading_len 14 | 15 | bad_vers db "Incorrect DOS version$" 16 | crlf db CR,LF 17 | 18 | errmsg1 db "FIND: Invalid number of parameters",CR,LF 19 | errlen1 db $ - errmsg1 20 | 21 | errmsg2 db "FIND: Syntax error",CR,LF 22 | errlen2 db $ - errmsg2 23 | 24 | ;"errmsg3_preerrmsg3_post" 25 | errmsg3_pre db "FIND: File not found " 26 | errlen3_pre db $ - errmsg3_pre 27 | errmsg3_post db CR,LF 28 | errlen3_post db $ - errmsg3_post 29 | 30 | ;"errmsg4_preerrmsg4_post" 31 | errmsg4_pre db "FIND: Read error in " 32 | errlen4_pre db $ - errmsg4_pre 33 | errmsg4_post db CR,LF 34 | errlen4_post db $ - errmsg4_post 35 | 36 | errmsg5 db "FIND: Invalid Parameter " 37 | errmsg5_opt db ? 38 | errlen5 db $ - errmsg5 39 | 40 | heading db CR,LF,"---------- " 41 | heading_len db $ - heading 42 | 43 | code ends 44 | end 45 | -------------------------------------------------------------------------------- /v20source/PROHST.HLP: -------------------------------------------------------------------------------- 1 | PROHST is a preliminary version of a utility to process the profile 2 | file produced by the PROFIL utility of MSDOS. 3 | Those of you familiar with MS-Pascal or MS-Fortran will have little 4 | difficulty in understanding how the parameters work. There are three, 5 | the .PRF filename, an optional histogram file (default extension .HST, 6 | default name same as the .PRF file) and an optional link map. If the 7 | link map was produced with the line number options PROHST will try 8 | and relate buckets to line numbers. Otherwise, it will relate it to 9 | module offsets. If you specify no map file (the default), addresses 10 | relative to the start of the program will be used. The default extension 11 | for the map file is .MAP. 12 | 13 | a:prohst f; 14 | 15 | this will produce a histogram for the file f.prf in f.hst and no map file 16 | will be assumed. 17 | 18 | a:prohst f,,; 19 | 20 | this will produce a histogram for f.prf in f.hst and expects a f.map file. 21 | 22 | a:prohst f,g,k 23 | 24 | this produces a histogram for f.prf in g.hst and expects a map file k.map. 25 | 26 | Note that if you select the map option with line numbers, the program will 27 | appear to be looping. Never fear, go and have lunch or some other time 28 | consuming pastime, and you will be suprised how long it took to produce 29 | such a small file. Also, some of the line number/bucket correspondances are 30 | not what they might be. Future version shoudl fix this. If you make a better 31 | version, be sure to let me have a copy. 32 | 33 | David Jones. 34 | 35 |  -------------------------------------------------------------------------------- /git-source-pickup.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | $project = `git config --get remote.origin.url | sed -e 's/\\/\$//' | sed -e 's/^.*\\///'`; 4 | chomp $project; 5 | die if $project eq ""; 6 | 7 | $branch = `git branch | grep '^\*' | sed -e 's/^\* //'`; chomp $branch; 8 | $branchfname = "-branch-$branch" if $branch ne ""; 9 | print "Current branch: $branch\n"; 10 | 11 | print "Ensuring the build tree is clean...\n"; 12 | $x = system("./git-update-all-wo-push"); 13 | die unless $x == 0; 14 | 15 | if (!open(S,"git --no-pager log --max-count=1 |")) { exit 1; } 16 | my $lcommit = "x"; 17 | my $i,$lcdate = "unknown"; 18 | foreach my $line () { 19 | chomp $line; 20 | 21 | if ($line =~ m/^commit +/) { 22 | $lcommit = lc($'); 23 | $lcommit =~ s/ +$//; 24 | } 25 | else { 26 | my @nv = split(/: +/,$line); 27 | my $value = $nv[1]; 28 | my $name = $nv[0]; 29 | 30 | if ($name =~ m/^Date$/i) { 31 | # Fri Apr 15 08:51:32 2011 -0700 32 | # 0 1 2 3 4 5 33 | my @b = split(/ +/,$value); 34 | 35 | $mon = lc($b[1]); 36 | $day = $b[2]; 37 | $time = $b[3]; 38 | $year = $b[4]; 39 | $mon = 1 if $mon eq "jan"; 40 | $mon = 2 if $mon eq "feb"; 41 | $mon = 3 if $mon eq "mar"; 42 | $mon = 4 if $mon eq "apr"; 43 | $mon = 5 if $mon eq "may"; 44 | $mon = 6 if $mon eq "jun"; 45 | $mon = 7 if $mon eq "jul"; 46 | $mon = 8 if $mon eq "aug"; 47 | $mon = 9 if $mon eq "sep"; 48 | $mon = 10 if $mon eq "oct"; 49 | $mon = 11 if $mon eq "nov"; 50 | $mon = 12 if $mon eq "dec"; 51 | $mon = $mon+0; 52 | $date = sprintf("%04u%02u%02u",$year+0,$mon,$day+0); 53 | $time =~ s/://g; 54 | $lcdate = $date."-".$time; 55 | } 56 | } 57 | } 58 | close(S); 59 | 60 | #my $filename = $project."-rev-".sprintf("%08u",$lcrev)."-src.tar.bz2"; 61 | my $pwd = `pwd`; chomp $pwd; 62 | my $filename = "../".($as ne "" ? $as : $project)."-$lcdate-commit-$lcommit-src$branchfname.tar"; 63 | if (!( -f "$filename.xz" )) { 64 | print "Packing source (all build files except LIB,OBJ,etc.)\n"; 65 | print " to: $filename\n"; 66 | 67 | $x = system("tar -C .. -cvf $filename $project"); # --exclude=.git 68 | die unless $x == 0; 69 | print "Packing to XZ\n"; 70 | $x = system("xz -6e $filename"); 71 | die unless $x == 0; 72 | } 73 | 74 | -------------------------------------------------------------------------------- /v20source/FCMES.ASM: -------------------------------------------------------------------------------- 1 | title File Compare Routine for MSDOS 2.0 2 | 3 | CR equ 0dh 4 | LF equ 0ah 5 | 6 | FALSE equ 0 7 | TRUE equ 0ffh 8 | 9 | 10 | const segment public byte 11 | 12 | PUBLIC vers_err,opt_err,opt_e,crlf,opt_err_len 13 | PUBLIC found_err_pre,found_err_pre_len,found_err_post 14 | PUBLIC found_err_post_len,read_err_pre,read_err_pre_len 15 | PUBLIC read_err_post,read_err_post_len,file_err,file_err_len 16 | PUBLIC bf1ne,bf1ne_len,bf2ne,bf2ne_len,bhead,bhead_len 17 | PUBLIC int_err,int_err_len,dif_err,dif_err_len,diff_sep,diff_sep_len 18 | PUBLIC args_err,args_err_len,fname_sep,fname_sep_len 19 | 20 | vers_err db "Incorrect DOS version$" 21 | 22 | opt_err db "Invalid parameter:" 23 | opt_e db 0 24 | crlf db CR,LF 25 | opt_err_len db $ - opt_err 26 | 27 | ;"found_err_prefound_err_post" 28 | found_err_pre db "File not found:" 29 | found_err_pre_len db $ - found_err_pre 30 | found_err_post label byte 31 | found_err_post_len db $ - found_err_post 32 | 33 | ;"read_err_preread_err_post" 34 | read_err_pre db "Read error in:" 35 | read_err_pre_len db $ - read_err_pre 36 | read_err_post label byte 37 | read_err_post_len db $ - read_err_post 38 | 39 | file_err db "Bad file" 40 | file_err_len db $ - file_err 41 | 42 | int_err db "Internal Error" 43 | int_err_len db $ - int_err 44 | 45 | dif_err db "*** Files are different ***" 46 | dif_err_len db $ - dif_err 47 | 48 | args_err db "Invalid number of parameters" 49 | args_err_len db $ - args_err 50 | 51 | fname_sep db CR,LF,"----------" 52 | fname_sep_len db $ - fname_sep 53 | 54 | diff_sep db CR,LF,"-----------------------------------------------",CR,LF 55 | diff_sep_len db $ - diff_sep 56 | 57 | bf1ne db CR,LF,"*** Data left in F1 ***",CR,LF 58 | bf1ne_len db $ - bf1ne 59 | 60 | bf2ne db CR,LF,"*** Data left in F2 ***",CR,LF 61 | bf2ne_len db $ - bf2ne 62 | 63 | bhead db CR,LF,'--ADDRS----F1---F2-',CR,LF 64 | bhead_len db $ - bhead 65 | 66 | const ends 67 | end 68 | -------------------------------------------------------------------------------- /v20object/DOSPATCH.TXT: -------------------------------------------------------------------------------- 1 | There are three locations in the DOS where OEMs may want to 2 | patch in information specific to their installation. 3 | 4 | 5 | The first is the location of the default switch character. 6 | This character is one byte at DEBUG location 1E5, and is 7 | set to '/'. To change it to '-' (XENIX compatible) 8 | do: 9 | 10 | DEBUG MSDOS.SYS 11 | 12 | >e1e5 13 | XXXX:01E5 2F. 16 | >w 17 | Writing YYYY Bytes 18 | >q 19 | 20 | If the byte at 1E5 is not 2F, look around in the immediate 21 | vacinity (do d1e0) for it. It is the only 2F in that area. 22 | 23 | 24 | The second is the location of the 24 bit user number and the 25 | 8 bit OEM number. These values are returned by the GET_VERSION 26 | system call. 27 | The user number is 3 bytes starting at 28 | debug location 683, The OEM number is one byte at debug location 29 | 686. The user number is initialized to 0, the OEM number to -1 30 | and they immediatly follow the Microsoft Copyright message. If these 31 | bytes are not zero, look for the four bytes following the 32 | Copyright message which should be in the vacinity of 683. 33 | OEMs should request an OEM number from Microsoft if they 34 | want one of their very own, this prevents selecting one someone 35 | else already has. 36 | 37 | 38 | The third is the location of the editing template definitions. 39 | This is a table which defines the two byte edit function keys 40 | for system call 10 and for EDLIN. This table is at debug location 41 | 33EA, and should start with a 1B. If the byte at 33EA is not 42 | 1B, look around in the immediate vacinity. Here is what the 43 | default table looks like. It is a definition for the Zenith 44 | Z-19 terminal: 45 | 46 | ESCCHAR DB 1BH ;The Escape character, Nul (0) on IBM 47 | ESCTAB: 48 | DB "Z" ;5AH Put a ^Z in the template, F6 on IBM 49 | DB "S" ;53H Copy one char, --> on IBM 50 | DB "V" ;56H Skip one char, DEL on IBM 51 | DB "T" ;54H Copy to char, F2 on IBM 52 | DB "W" ;57H Skip to char, F4 on IBM 53 | DB "U" ;55H Copy line, F3 on IBM 54 | DB "E" ;45H Kill line, Not used on IBM 55 | DB "J" ;4AH Reedit line, F5 on IBM 56 | DB "D" ;44H Backspace, <-- on IBM 57 | DB "P" ;50H Toggle insert mode, INS on IBM 58 | DB "Q" ;51H Toggle insert mode, INS on IBM 59 | DB "R" ;52H Escape char, F7 on IBM 60 | DB "R" ;52H End of table, must be same as previos character 61 | 62 |  -------------------------------------------------------------------------------- /v20source/DEVSYM.ASM: -------------------------------------------------------------------------------- 1 | SUBTTL DEVICE TABLE AND SRH DEFINITION 2 | PAGE 3 | ; The device table list has the form: 4 | SYSDEV STRUC 5 | SDEVNEXT DD ? ;Pointer to next device header 6 | SDEVATT DW ? ;Attributes of the device 7 | SDEVSTRAT DW ? ;Strategy entry point 8 | SDEVINT DW ? ;Interrupt entry point 9 | SDEVNAME DB 8 DUP (?) ;Name of device (only first byte used for block) 10 | SYSDEV ENDS 11 | 12 | ;Attribute bit masks 13 | DEVTYP EQU 8000H ;Bit 15 - 1 if Char, 0 if block 14 | DEVIOCTL EQU 4000H ;Bit 14 - CONTROL mode bit 15 | ISFATBYDEV EQU 2000H ;Bit 13 - Device uses FAT ID bytes, comp media. 16 | ISCIN EQU 0001H ;Bit 0 - This device is the console input. 17 | ISCOUT EQU 0002H ;Bit 1 - This device is the console output. 18 | ISNULL EQU 0004H ;Bit 2 - This device is the null device. 19 | ISCLOCK EQU 0008H ;Bit 3 - This device is the clock device. 20 | ISIBM EQU 0010H ;Bit 4 - This device is special 21 | 22 | ;Static Reguest Header 23 | SRHEAD STRUC 24 | REQLEN DB ? ;Length in bytes of request block 25 | REQUNIT DB ? ;Device unit number 26 | REQFUNC DB ? ;Type of request 27 | REQSTAT DW ? ;Status Word 28 | DB 8 DUP(?) ;Reserved for queue links 29 | SRHEAD ENDS 30 | 31 | ;Status word masks 32 | STERR EQU 8000H ;Bit 15 - Error 33 | STBUI EQU 0200H ;Bit 9 - Buisy 34 | STDON EQU 0100H ;Bit 8 - Done 35 | STECODE EQU 00FFH ;Error code 36 | WRECODE EQU 0 37 | 38 | ;Function codes 39 | DEVINIT EQU 0 ;Initialization 40 | DINITHL EQU 26 ;Size of init header 41 | DEVMDCH EQU 1 ;Media check 42 | DMEDHL EQU 15 ;Size of media check header 43 | DEVBPB EQU 2 ;Get BPB 44 | DEVRDIOCTL EQU 3 ;IOCTL read 45 | DBPBHL EQU 22 ;Size of Get BPB header 46 | DEVRD EQU 4 ;Read 47 | DRDWRHL EQU 22 ;Size of RD/WR header 48 | DEVRDND EQU 5 ;Non destructive read no wait (character devs) 49 | DRDNDHL EQU 14 ;Size of non destructive read header 50 | DEVIST EQU 6 ;Input status 51 | DSTATHL EQU 13 ;Size of status header 52 | DEVIFL EQU 7 ;Input flush 53 | DFLSHL EQU 15 ;Size of flush header 54 | DEVWRT EQU 8 ;Write 55 | DEVWRTV EQU 9 ;Write with verify 56 | DEVOST EQU 10 ;Output status 57 | DEVOFL EQU 11 ;Output flush 58 | DEVWRIOCTL EQU 12 ;IOCTL write 59 | -------------------------------------------------------------------------------- /v20object/INCOMP.DOC: -------------------------------------------------------------------------------- 1 | 2 | Areas where 2.0 is not compatible with previous versions of 3 | the DOS. 4 | 5 | + Direct calls to the BIOS 6 | Any program which jumped directly to the BIOS by way 7 | of the jump table at 40:0 will no longer work. 8 | 9 | + FAT pointer calls 10 | Programs which used system calls 27 and 28 to get a 11 | pointer to the FAT will no longer work. Because the 12 | FAT is now cached with other disk resources, there is 13 | no fixed location in memory to pass the address of. 14 | The calls still exist, however, and have the same 15 | format. THEY CAN ONLY BE USED TO GET THE FAT ID BYTE. 16 | On return ES:BX points to a FAT ID BYTE for the Drive. 17 | Doing anything except READing this ONE byte will 18 | probably crash the system. In order to get at the 19 | FAT, programs will first call DSKRESET (call 13) to 20 | flush out any dirty buffers, and then make a GETDPB 21 | call (call 31 or 50) to find out which sector on the 22 | disk the FAT starts at, how big it is, and how many 23 | copies of it there are. Then INT 25H and INT 26H can 24 | be used to transfer the FAT in and out of the programs 25 | memory space. 26 | 27 | + INT 25H and INT 26H 28 | In order for the above to work, and in order to 29 | maintain some order in the world of multi-surface 30 | disks, it is required that INT 25H and 26H use the 31 | MSDOS sector mapping rather than some rather arbitrary 32 | head-cylinder-sector mapping. 33 | 34 | The following subroutine will read the fat into the area of 35 | memory specified by DS:BX. DL contains the drive number, DL=0 36 | means read the fat from the default drive, DL=1 indicates read 37 | from drive A:, and so on. 38 | 39 | getfat: 40 | push bx ; save pointer to fat area 41 | push ds 42 | mov ah,50 ; request the dpb 43 | int 21h 44 | mov cx,[bx+15] ; get fat sector count 45 | mov dx,[bx+6] ; first sector of fat 46 | pop ds ; restore fat area pointer 47 | pop bx 48 | mov al,dl ; is it the default drive? 49 | or al,al 50 | jnz driveok ; if not, load fat 51 | 52 | mov ah,19h ; ask for default drive 53 | int 21h ; get the default drive 54 | inc al ; map a=0 to a=1 55 | driveok: 56 | dec al ; map a=1 to a=0 57 | int 25h ; read the fat into DS:BX 58 | pop ax ; clean up the stack 59 | ret 60 | -------------------------------------------------------------------------------- /v20source/INCOMP.txt: -------------------------------------------------------------------------------- 1 | 2 | Areas where 2.0 is not compatible with previous versions of 3 | the DOS. 4 | 5 | + Direct calls to the BIOS 6 | Any program which jumped directly to the BIOS by way 7 | of the jump table at 40:0 will no longer work. 8 | 9 | + FAT pointer calls 10 | Programs which used system calls 27 and 28 to get a 11 | pointer to the FAT will no longer work. Because the 12 | FAT is now cached with other disk resources, there is 13 | no fixed location in memory to pass the address of. 14 | The calls still exist, however, and have the same 15 | format. THEY CAN ONLY BE USED TO GET THE FAT ID BYTE. 16 | On return ES:BX points to a FAT ID BYTE for the Drive. 17 | Doing anything except READing this ONE byte will 18 | probably crash the system. In order to get at the 19 | FAT, programs will first call DSKRESET (call 13) to 20 | flush out any dirty buffers, and then make a GETDPB 21 | call (call 31 or 50) to find out which sector on the 22 | disk the FAT starts at, how big it is, and how many 23 | copies of it there are. Then INT 25H and INT 26H can 24 | be used to transfer the FAT in and out of the programs 25 | memory space. 26 | 27 | + INT 25H and INT 26H 28 | In order for the above to work, and in order to 29 | maintain some order in the world of multi-surface 30 | disks, it is required that INT 25H and 26H use the 31 | MSDOS sector mapping rather than some rather arbitrary 32 | head-cylinder-sector mapping. 33 | 34 | The following subroutine will read the fat into the area of 35 | memory specified by DS:BX. DL contains the drive number, DL=0 36 | means read the fat from the default drive, DL=1 indicates read 37 | from drive A:, and so on. 38 | 39 | getfat: 40 | push bx ; save pointer to fat area 41 | push ds 42 | mov ah,50 ; request the dpb 43 | int 21h 44 | mov cx,[bx+15] ; get fat sector count 45 | mov dx,[bx+6] ; first sector of fat 46 | pop ds ; restore fat area pointer 47 | pop bx 48 | mov al,dl ; is it the default drive? 49 | or al,al 50 | jnz driveok ; if not, load fat 51 | 52 | mov ah,19h ; ask for default drive 53 | int 21h ; get the default drive 54 | inc al ; map a=0 to a=1 55 | driveok: 56 | dec al ; map a=1 to a=0 57 | int 25h ; read the fat into DS:BX 58 | pop ax ; clean up the stack 59 | ret 60 | -------------------------------------------------------------------------------- /v20source/SORTMES.ASM: -------------------------------------------------------------------------------- 1 | TITLE SORT Messages 2 | 3 | false equ 0 4 | true equ not false 5 | msver equ false 6 | ibm equ true 7 | internat equ true 8 | 9 | CONST SEGMENT PUBLIC BYTE 10 | 11 | PUBLIC BADVER,ERRMSG,ERRMSG2 12 | 13 | BADVER DB "SORT: Incorrect DOS version",13,10,"$" 14 | 15 | ERRMSG DW ERRMSG2 - MSG1TXT 16 | MSG1TXT DB "SORT: Insufficient memory",13,10 17 | 18 | ERRMSG2 DW ENDTEXT - MSG2TXT 19 | MSG2TXT DB "SORT: Insufficient disk space",13,10 20 | 21 | if internat 22 | public table 23 | ;This table defibes the coalating sequence to be used for 24 | ;international characters. This table also equates 25 | ;lower case character to upper case unlike a straight ASCII sort. 26 | ;If your character set is like the IBM PC simply turn 27 | ;on the IBM conditional. If it is different simply modify the 28 | ;table appropriately. Note: to insert a foreign language character 29 | ;between two ASCII characters it will be necessary to 30 | ;"shift" all the ASCII characters to make room for a new character. 31 | ;If this is done be sure to equate the foreign characters to the new 32 | ;values instead of the old values which have been set here to the 33 | ;upper case ASCII values. 34 | 35 | table db 0,1,2,3,4,5,6,7 36 | db 8,9,10,11,12,13,14,15 37 | db 16,17,18,19,20,21,22,23 38 | db 24,25,26,27,28,29,30,31 39 | db " ","!",'"',"#","$","%","&","'" 40 | db "(",")","*","+",",","-",".","/" 41 | db "0","1","2","3","4","5","6","7" 42 | db "8","9",":",";","<","=",">","?" 43 | db "@","A","B","C","D","E","F","G" 44 | db "H","I","J","K","L","M","N","O" 45 | db "P","Q","R","S","T","U","V","W" 46 | db "X","Y","Z","[","\","]","^","_" 47 | db "`","A","B","C","D","E","F","G" 48 | db "H","I","J","K","L","M","N","O" 49 | db "P","Q","R","S","T","U","V","W" 50 | db "X","Y","Z","{","|","}","~",127 51 | if msver 52 | db 128,129,130,131,132,133,134,135 53 | db 136,137,138,139,140,141,142,143 54 | db 144,145,146,147,148,149,150,151 55 | db 152,153,154,155,156,157,158,159 56 | db 160,161,162,163,164,165,166,167 57 | db 168,169,170,171,172,173,174,175 58 | endif 59 | if ibm 60 | db "C","U","E","A","A","A","A","C" 61 | db "E","E","E","I","I","I","A","A" 62 | db "E","A","A","O","O","O","U","U" 63 | db "Y","O","U","$","$","$","$","$" 64 | db "A","I","O","U","N","N",166,167 65 | db "?",169,170,171,172,"!",'"','"' 66 | endif 67 | db 176,177,178,179,180,181,182,183 68 | db 184,185,186,187,188,189,190,191 69 | db 192,193,194,195,196,197,198,199 70 | db 200,201,202,203,204,205,206,207 71 | db 208,209,210,211,212,213,214,215 72 | db 216,217,218,219,220,221,222,223 73 | if ibm 74 | db 224,"S" 75 | endif 76 | if msver 77 | db 224,225 78 | endif 79 | db 226,227,228,229,230,231 80 | db 232,233,234,235,236,237,238,239 81 | db 240,241,242,243,244,245,246,247 82 | db 248,249,250,251,252,253,254,255 83 | endif 84 | ENDTEXT EQU $ 85 | 86 | CONST ENDS 87 | END 88 | -------------------------------------------------------------------------------- /v20source/DEBDATA.ASM: -------------------------------------------------------------------------------- 1 | .xlist 2 | .xcref 3 | INCLUDE debequ.asm 4 | INCLUDE dossym.asm 5 | .list 6 | .cref 7 | 8 | CODE SEGMENT PUBLIC BYTE 'CODE' 9 | CODE ENDS 10 | 11 | CONST SEGMENT PUBLIC BYTE 12 | CONST ENDS 13 | 14 | DATA SEGMENT PUBLIC BYTE 15 | DATA ENDS 16 | 17 | DG GROUP CODE,CONST,DATA 18 | 19 | DATA SEGMENT PUBLIC BYTE 20 | 21 | 22 | PUBLIC ParityFlag,XNXOPT,XNXCMD,SWITCHAR,EXTPTR,HANDLE,TRANSADD 23 | PUBLIC PARSERR,ASMADD,DISADD,DISCNT,ASMSP,INDEX,DEFDUMP,DEFLEN 24 | PUBLIC REGSAVE,SEGSAVE,OFFSAVE,TEMP,BUFFER,BYTCNT,OPCODE,AWORD 25 | PUBLIC REGMEM,MIDFLD,MODE,NSEG,OPBUF,BRKCNT,TCOUNT,ASSEM_CNT 26 | PUBLIC ASSEM1,ASSEM2,ASSEM3,ASSEM4,ASSEM5,ASSEM6,BYTEBUF,BPTAB 27 | PUBLIC DIFLG,SIFLG,BXFLG,BPFLG,NEGFLG,NUMFLG,MEMFLG,REGFLG 28 | PUBLIC MOVFLG,TSTFLG,SEGFLG,LOWNUM,HINUM,F8087,DIRFLG,DATAEND 29 | 30 | 31 | ParityFlag DB 0 32 | XNXOPT DB ? ; AL OPTION FOR DOS COMMAND 33 | XNXCMD DB ? ; DOS COMMAND FOR OPEN_A_FILE TO PERFORM 34 | SWITCHAR DB ? ; CURRENT SWITCH CHARACTER 35 | EXTPTR DW ? ; POINTER TO FILE EXTENSION 36 | HANDLE DW ? ; CURRENT HANDLE 37 | TRANSADD DD ? ; TRANSFER ADDRESS 38 | 39 | PARSERR DB ? 40 | ASMADD DB 4 DUP (?) 41 | DISADD DB 4 DUP (?) 42 | DISCNT DW ? 43 | ASMSP DW ? ; SP AT ENTRY TO ASM 44 | INDEX DW ? 45 | DEFDUMP DB 4 DUP (?) 46 | DEFLEN DW ? 47 | REGSAVE DW ? 48 | SEGSAVE DW ? 49 | OFFSAVE DW ? 50 | 51 | ; The following data areas are destroyed during hex file read 52 | TEMP DB 4 DUP(?) 53 | BUFFER LABEL BYTE 54 | BYTCNT DB ? 55 | OPCODE DW ? 56 | AWORD DB ? 57 | REGMEM DB ? 58 | MIDFLD DB ? 59 | MODE DB ? 60 | NSEG DW ? 61 | OPBUF DB OPBUFLEN DUP (?) 62 | BRKCNT DW ? ; Number of breakpoints 63 | TCOUNT DW ? ; Number of steps to trace 64 | ASSEM_CNT DB ? ; preserve order of assem_cnt and assem1 65 | ASSEM1 DB ? 66 | ASSEM2 DB ? 67 | ASSEM3 DB ? 68 | ASSEM4 DB ? 69 | ASSEM5 DB ? 70 | ASSEM6 DB ? ; preserve order of assemx and bytebuf 71 | BYTEBUF DB BUFLEN DUP (?) ; Table used by LIST 72 | BPTAB DB BPLEN DUP (?) ; Breakpoint table 73 | DIFLG DB ? 74 | SIFLG DB ? 75 | BXFLG DB ? 76 | BPFLG DB ? 77 | NEGFLG DB ? 78 | NUMFLG DB ? ; ZERO MEANS NO NUMBER SEEN 79 | MEMFLG DB ? 80 | REGFLG DB ? 81 | MOVFLG DB ? 82 | TSTFLG DB ? 83 | SEGFLG DB ? 84 | LOWNUM DW ? 85 | HINUM DW ? 86 | F8087 DB ? 87 | DIRFLG DB ? 88 | DB BUFFER+BUFSIZ-$ DUP (?) 89 | 90 | DATAEND LABEL WORD 91 | 92 | DATA ENDS 93 | END 94 | -------------------------------------------------------------------------------- /v20object/SYSINIT.DOC: -------------------------------------------------------------------------------- 1 | SYSINIT is a module linked behind the OEM bios. It takes 2 | over the system initialization after the OEM bios has 3 | performed any initialization it needs to do. Control is 4 | transfered with a long jump to the external variable SYSINIT 5 | 6 | 7 | The OEM has the following variables declared external: 8 | 9 | CURRENT_DOS_LOCATION WORD 10 | 11 | This word contains the segment number of the DOS before it 12 | is relocated. The OEM bios must set this value. 13 | 14 | FINAL_DOS_LOCATION WORD 15 | 16 | This word contains the segment number of the DOS after SYSINIT 17 | moves it. The OEM bios must set this value. 18 | 19 | DEVICE_LIST DWORD 20 | 21 | This double word pointer points to the linked list of 22 | character and block device drivers. The OEM must set this 23 | value. 24 | 25 | MEMORY_SIZE WORD 26 | 27 | This word contains the number of RAM paragraphs. If the 28 | bios doesn't set this variable SYSINIT will automatically 29 | calculate it. NOTE: systems with PARITY checked memory must 30 | size memory in the BIOS. SYSINITs method is to write memory 31 | and read it back until it gets a mismatch. 32 | 33 | DEFAULT_DRIVE BYTE 34 | 35 | This is the initial default drive when the system first comes 36 | up. drive a=0, drive b=1, etc. If the bios doesn't set 37 | it then drive a is assumed. 38 | 39 | BUFFERS BYTE 40 | 41 | This is the default number of buffers for the system. This 42 | value may be overridden by the user in the CONFIG.SYS file. 43 | It is DBed to 2 in SYSINIT it should be greater than 1. 44 | 45 | FILES BYTE 46 | 47 | This is the default number of files for the system. This 48 | value may be overridden by the user in the CONFIG.SYS file. 49 | It is DBed to 8 in SYSINIT, values less than 5 are ignored. 50 | 51 | SYSINIT FAR 52 | 53 | The entry point of the SYSINIT module. OEM BIOS jumps to 54 | this label at the end of its INIT code. 55 | 56 | The OEM has the following variables declared public: 57 | 58 | RE_INIT FAR 59 | 60 | This is an entry point which allows the BIOS to do some INIT 61 | work after the DOS is initialized. ALL REGISTERS MUST BE 62 | PRESERVED. On entry DS points to the first available memory 63 | (after the DOS). DS:0 points to a 100H byte program header 64 | prefix which represents the "program" currently running. 65 | This program should be thought of as the OEM BIOS and 66 | SYSINIT taken together. This is not a normal program in 67 | that no memory is allocated to it, it is running in free 68 | memory. 69 | NOTES: 70 | At the time this routine is called SYSINIT occupies the 71 | highest 10K of memory ("highest" is determined by the value 72 | of the MEMORY_SIZE variable), DO NOT DO WRITES THERE. 73 | Since this is called AFTER DOS is initialized, you can 74 | make system calls. This also implies that the code for this 75 | routine CANNOT be thrown away by use of the 76 | FINAL_DOS_LOCATION since the DOS has already been moved. 77 | If you don't want anything done just set this to point 78 | at a FAR RET instruction. 79 | -------------------------------------------------------------------------------- /v20source/SYSINIT.txt: -------------------------------------------------------------------------------- 1 | SYSINIT is a module linked behind the OEM bios. It takes 2 | over the system initialization after the OEM bios has 3 | performed any initialization it needs to do. Control is 4 | transfered with a long jump to the external variable SYSINIT 5 | 6 | 7 | The OEM has the following variables declared external: 8 | 9 | CURRENT_DOS_LOCATION WORD 10 | 11 | This word contains the segment number of the DOS before it 12 | is relocated. The OEM bios must set this value. 13 | 14 | FINAL_DOS_LOCATION WORD 15 | 16 | This word contains the segment number of the DOS after SYSINIT 17 | moves it. The OEM bios must set this value. 18 | 19 | DEVICE_LIST DWORD 20 | 21 | This double word pointer points to the linked list of 22 | character and block device drivers. The OEM must set this 23 | value. 24 | 25 | MEMORY_SIZE WORD 26 | 27 | This word contains the number of RAM paragraphs. If the 28 | bios doesn't set this variable SYSINIT will automatically 29 | calculate it. NOTE: systems with PARITY checked memory must 30 | size memory in the BIOS. SYSINITs method is to write memory 31 | and read it back until it gets a mismatch. 32 | 33 | DEFAULT_DRIVE BYTE 34 | 35 | This is the initial default drive when the system first comes 36 | up. drive a=0, drive b=1, etc. If the bios doesn't set 37 | it then drive a is assumed. 38 | 39 | BUFFERS BYTE 40 | 41 | This is the default number of buffers for the system. This 42 | value may be overridden by the user in the CONFIG.SYS file. 43 | It is DBed to 2 in SYSINIT it should be greater than 1. 44 | 45 | FILES BYTE 46 | 47 | This is the default number of files for the system. This 48 | value may be overridden by the user in the CONFIG.SYS file. 49 | It is DBed to 8 in SYSINIT, values less than 5 are ignored. 50 | 51 | SYSINIT FAR 52 | 53 | The entry point of the SYSINIT module. OEM BIOS jumps to 54 | this label at the end of its INIT code. 55 | 56 | The OEM has the following variables declared public: 57 | 58 | RE_INIT FAR 59 | 60 | This is an entry point which allows the BIOS to do some INIT 61 | work after the DOS is initialized. ALL REGISTERS MUST BE 62 | PRESERVED. On entry DS points to the first available memory 63 | (after the DOS). DS:0 points to a 100H byte program header 64 | prefix which represents the "program" currently running. 65 | This program should be thought of as the OEM BIOS and 66 | SYSINIT taken together. This is not a normal program in 67 | that no memory is allocated to it, it is running in free 68 | memory. 69 | NOTES: 70 | At the time this routine is called SYSINIT occupies the 71 | highest 10K of memory ("highest" is determined by the value 72 | of the MEMORY_SIZE variable), DO NOT DO WRITES THERE. 73 | Since this is called AFTER DOS is initialized, you can 74 | make system calls. This also implies that the code for this 75 | routine CANNOT be thrown away by use of the 76 | FINAL_DOS_LOCATION since the DOS has already been moved. 77 | If you don't want anything done just set this to point 78 | at a FAR RET instruction. 79 | -------------------------------------------------------------------------------- /v20source/PCLOCK.ASM: -------------------------------------------------------------------------------- 1 | TITLE CLOCK - Enable/disable clock interrupts 2 | 3 | ; "CLOCK" module for MS-DOS profile program. This implements the 4 | ; PROFIL program on the Seattle Computer Products 8086 system 5 | 6 | INTSEG SEGMENT AT 0 7 | ORG 60H+7*4 8 | INTVECTOR LABEL WORD 9 | INTSEG ENDS 10 | 11 | CODE SEGMENT BYTE PUBLIC 12 | 13 | PUBLIC CLOCKON,CLOCKOFF,LEAVE_INT 14 | 15 | EXTRN CLK_INTER:NEAR 16 | 17 | ASSUME CS:CODE, DS:CODE, ES:CODE 18 | 19 | BASE= 0F0H 20 | STCSTAT= BASE+5 21 | STCDATA= BASE+4 22 | STCCOMND= BASE+5 23 | SLAVECOM= BASE+2 24 | MASTCOM= BASE+0 25 | SLAVEMASK= BASE+3 26 | 27 | ;The following mode selects F2 as counter source (400 KHz), reload from 28 | ;load, count up once in binary with TC toggle. 29 | MODE= 0C02H 30 | 31 | ;************************************************ 32 | ;Enable clock and start generating clock interrupt. 33 | ; Clock interval in micro seconds passed in DX 34 | CLOCKON PROC NEAR 35 | MOV AL,4 ;Set pointer to mode register 4 36 | OUT STCCOMND,AL 37 | MOV AL,MODE AND 0FFH ;Low byte of mode 38 | OUT STCDATA,AL 39 | MOV AL,MODE/100H ;High byte of mode 40 | OUT STCDATA,AL 41 | MOV AL,0CH ;Counter 4 load register 42 | OUT STCCOMND,AL 43 | XCHG AX,DX ;Count in microseconds 44 | XOR DX,DX 45 | SHL AX,1 46 | RCL DX,1 ;Count in DX:AX times 2 47 | MOV BX,5 48 | DIV BX ;AX=Count/2.5 49 | OUT STCDATA,AL 50 | MOV AL,AH 51 | OUT STCDATA,AL ;Set the load register 52 | MOV AL,0E4H ;Clear output 4 53 | OUT STCCOMND,AL 54 | 55 | ASSUME DS:INTSEG 56 | 57 | PUSH DS 58 | XOR AX,AX 59 | MOV DS,AX 60 | ;Set the clock interrupt 61 | MOV INTVECTOR,OFFSET CLK_INTER 62 | MOV INTVECTOR+2,CS 63 | POP DS 64 | 65 | ASSUME DS:CODE 66 | 67 | IN AL,SLAVEMASK 68 | AND AL,7FH ;Enable counter 4 interrupt 69 | OUT SLAVEMASK,AL 70 | MOV AL,68H ;Load and arm counter 4 71 | OUT STCCOMND,AL ;Let her rip! 72 | RET 73 | CLOCKON ENDP 74 | 75 | ;************************************************ 76 | ;Disable clock and clock interrupt 77 | CLOCKOFF PROC NEAR 78 | IN AL,SLAVEMASK 79 | OR AL,80H ;Turn off counter 4 interrupt 80 | OUT SLAVEMASK,AL 81 | RET 82 | CLOCKOFF ENDP 83 | 84 | 85 | ;************************************************ 86 | ;This routine is jumped to from the CLK_INTER 87 | ; routine to perform and steps to reset the interrupt 88 | LEAVE_INT: 89 | PUSH AX 90 | MOV AL,0E4H ;Clear output 4 91 | OUT STCCOMND,AL 92 | MOV AL,20H ;End-of-interrupt command 93 | OUT SLAVECOM,AL 94 | OUT MASTCOM,AL 95 | MOV AL,68H ;Load and arm counter 4 96 | OUT STCCOMND,AL 97 | POP AX 98 | IRET 99 | 100 | CODE ENDS 101 | END 102 | -------------------------------------------------------------------------------- /v20source/EDLMES.ASM: -------------------------------------------------------------------------------- 1 | title EDLIN Messages 2 | 3 | ;-----------------------------------------------------------------------; 4 | ; ; 5 | ; Done for Vers 2.00 (rev 9) by Aaron Reynolds ; 6 | ; Update for rev. 11 by M.A. Ulloa ; 7 | ; ; 8 | ;-----------------------------------------------------------------------; 9 | 10 | FALSE EQU 0 11 | TRUE EQU NOT FALSE 12 | 13 | 14 | .xlist 15 | INCLUDE DOSSYM.ASM 16 | .list 17 | 18 | 19 | CODE SEGMENT PUBLIC BYTE 20 | CODE ENDS 21 | 22 | CONST SEGMENT PUBLIC BYTE 23 | CONST ENDS 24 | 25 | DATA SEGMENT PUBLIC BYTE 26 | EXTRN QFLG:BYTE,FCB2:BYTE 27 | DATA ENDS 28 | 29 | DG GROUP CODE,CONST,DATA 30 | 31 | CODE SEGMENT PUBLIC BYTE 32 | 33 | ASSUME CS:DG,DS:DG,SS:DG,ES:DG 34 | 35 | PUBLIC QUIT,QUERY 36 | EXTRN rest_dir:NEAR,CRLF:NEAR 37 | 38 | QUIT: 39 | MOV DX,OFFSET DG:QMES 40 | MOV AH,STD_CON_STRING_OUTPUT 41 | INT 21H 42 | MOV AX,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT 43 | INT 21H ;Really quit? 44 | AND AL,5FH 45 | CMP AL,"Y" 46 | JZ NOCRLF 47 | JMP CRLF 48 | NOCRLF: 49 | MOV DX,OFFSET DG:FCB2 50 | MOV AH,FCB_CLOSE 51 | INT 21H 52 | MOV AH,FCB_DELETE 53 | INT 21H 54 | call rest_dir ;restore directory if needed 55 | INT 20H 56 | 57 | QUERY: 58 | TEST BYTE PTR [QFLG],-1 59 | JZ RET9 60 | MOV DX,OFFSET DG:ASK 61 | MOV AH,STD_CON_STRING_OUTPUT 62 | INT 21H 63 | MOV AX,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT 64 | INT 21H 65 | PUSH AX 66 | CALL CRLF 67 | POP AX 68 | CMP AL,13 ;Carriage return means yes 69 | JZ RET9 70 | CMP AL,"Y" 71 | JZ RET9 72 | CMP AL,"y" 73 | RET9: RET 74 | 75 | CODE ENDS 76 | 77 | CONST SEGMENT PUBLIC BYTE 78 | 79 | PUBLIC BADDRV,NDNAME,bad_vers_err,opt_err,NOBAK 80 | PUBLIC NODIR,DSKFUL,MEMFUL,FILENM,BADCOM,NEWFIL 81 | PUBLIC NOSUCH,TOOLNG,EOF,DEST,MRGERR,ro_err,bcreat 82 | 83 | BADDRV DB "Invalid drive or file name$" 84 | NDNAME DB "File name must be specified$" 85 | 86 | bad_vers_err db "Incorrect DOS version$" 87 | opt_err db "Invalid Parameter$" 88 | ro_err db "Invalid operation: R/O file",13,10,"$" 89 | bcreat db "File Creation Error",13,10,"$" 90 | 91 | NOBAK DB "Cannot edit .BAK file--rename file$" 92 | NODIR DB "No room in directory for file$" 93 | DSKFUL DB "Disk full-- write not completed$" 94 | MEMFUL DB 13,10,"Insufficient memory",13,10,"$" 95 | FILENM DB "File not found",13,10,"$" 96 | BADCOM DB "Entry error",13,10,"$" 97 | NEWFIL DB "New file",13,10,"$" 98 | NOSUCH DB "Not found",13,10,"$" 99 | ASK DB "O.K.? $" 100 | TOOLNG DB "Line too long",13,10,"$" 101 | EOF DB "End of input file",13,10,"$" 102 | QMES DB "Abort edit (Y/N)? $" 103 | DEST DB "Must specify destination line number",13,10,"$" 104 | MRGERR DB "Not enough room to merge the entire file",13,10,"$" 105 | 106 | CONST ENDS 107 | END 108 | -------------------------------------------------------------------------------- /v20object/CONFIG.DOC: -------------------------------------------------------------------------------- 1 | 2 | 3 | Configuration files in MSDOS 2.0 4 | 5 | 6 | In many cases, there are installation-specific configurations 7 | of the DOS that are need to be set up at boot time. It is 8 | considered ugly for a user/OEM to have to re-build the DOS to 9 | include special drivers or to include a particular number of 10 | device drivers. The configuration file allows a user/OEM to 11 | configure his system without extra work. 12 | 13 | The configuration file is simply an ASCII file that has 14 | certain commands for the boot task. The boot process is as 15 | follows: 16 | 17 | Disk boot sector is read. This contains enough code to 18 | read the DOS and the initial BIOS. 19 | 20 | This DOS and initial BIOS are read. 21 | 22 | A long jump to the BIOSINIT routine is made. A variety of 23 | BIOS initializations are done. 24 | 25 | A long jump to the SYSINIT routine in the SYSINIT module 26 | is made. This module (supplied by MICROSOFT) will 27 | initialize the DOS and read the configuration file 28 | CONFIG.SYS, if it exists, to perform device instalation 29 | and various other user settable things. Its final task is 30 | to EXEC the command interpreter, which finishes the 31 | bootstrap process. 32 | 33 | The following are a list of commands for the configuration 34 | file CONFIG.SYS: 35 | 36 | BUFFERS = 37 | This is the number of additional sector buffers to add 38 | to the system list. The effect of several BUFFERS 39 | commands is to allocate a series of buffers. 40 | 41 | FILES = 42 | This is the number of open files that the XENIX system 43 | calls can access. 44 | 45 | DEVICE = 46 | This installs the device driver in into the 47 | system list. 48 | 49 | BREAK = 50 | If ON is specified (the default is OFF), a check for 51 | ^C at the console input will be made every time the 52 | system is called. ON improves the ability to abort 53 | programs over previous versions of the DOS. 54 | 55 | SWITCHAR = 56 | Causes the DOS to return as the current switch 57 | designator character when the DOS call to return the 58 | switch character is made. Default is '/'. 59 | 60 | AVAILDEV = 61 | The default is TRUE which means both /dev/ and 62 | will reference the device . If FALSE is 63 | selected, only /dev/ refers to device , 64 | by itself means a file in the current directory 65 | with the same name as one of the devices. 66 | 67 | SHELL = 68 | This begins execution of the shell (top-level command 69 | processor) from . 70 | 71 | A typical configuration file might look like this: 72 | 73 | BUFFERS = 10 74 | FILES = 10 75 | DEVICE = /bin/network.sys 76 | BREAK = ON 77 | SWITCHAR = - 78 | SHELL = a:/bin/command.com a:/bin -p 79 | 80 | The default value for BUFFERS is OEM specific in that the 81 | OEM can specify the number in the BIOS. A typical value is 2, 82 | the minimal value is one. The default value for FILES is 83 | usually 8 (as above it may be set by OEM BIOS) , so "FILES = 84 | 10" actually allocates only 2 new file channels. If a number 85 | less than or equal to five is specified, the command is 86 | ignored. BREAK defaults to OFF, SWITCHAR to /, and AVAILDEV 87 | to TRUE. NOTE that the setting of SWITCHAR may effect 88 | characters used on the SHELL line (this is true of 89 | COMMAND.COM). 90 | -------------------------------------------------------------------------------- /v20source/CONFIG.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Configuration files in MSDOS 2.0 4 | 5 | 6 | In many cases, there are installation-specific configurations 7 | of the DOS that are need to be set up at boot time. It is 8 | considered ugly for a user/OEM to have to re-build the DOS to 9 | include special drivers or to include a particular number of 10 | device drivers. The configuration file allows a user/OEM to 11 | configure his system without extra work. 12 | 13 | The configuration file is simply an ASCII file that has 14 | certain commands for the boot task. The boot process is as 15 | follows: 16 | 17 | Disk boot sector is read. This contains enough code to 18 | read the DOS and the initial BIOS. 19 | 20 | This DOS and initial BIOS are read. 21 | 22 | A long jump to the BIOSINIT routine is made. A variety of 23 | BIOS initializations are done. 24 | 25 | A long jump to the SYSINIT routine in the SYSINIT module 26 | is made. This module (supplied by MICROSOFT) will 27 | initialize the DOS and read the configuration file 28 | CONFIG.SYS, if it exists, to perform device instalation 29 | and various other user settable things. Its final task is 30 | to EXEC the command interpreter, which finishes the 31 | bootstrap process. 32 | 33 | The following are a list of commands for the configuration 34 | file CONFIG.SYS: 35 | 36 | BUFFERS = 37 | This is the number of additional sector buffers to add 38 | to the system list. The effect of several BUFFERS 39 | commands is to allocate a series of buffers. 40 | 41 | FILES = 42 | This is the number of open files that the XENIX system 43 | calls can access. 44 | 45 | DEVICE = 46 | This installs the device driver in into the 47 | system list. 48 | 49 | BREAK = 50 | If ON is specified (the default is OFF), a check for 51 | ^C at the console input will be made every time the 52 | system is called. ON improves the ability to abort 53 | programs over previous versions of the DOS. 54 | 55 | SWITCHAR = 56 | Causes the DOS to return as the current switch 57 | designator character when the DOS call to return the 58 | switch character is made. Default is '/'. 59 | 60 | AVAILDEV = 61 | The default is TRUE which means both /dev/ and 62 | will reference the device . If FALSE is 63 | selected, only /dev/ refers to device , 64 | by itself means a file in the current directory 65 | with the same name as one of the devices. 66 | 67 | SHELL = 68 | This begins execution of the shell (top-level command 69 | processor) from . 70 | 71 | A typical configuration file might look like this: 72 | 73 | BUFFERS = 10 74 | FILES = 10 75 | DEVICE = /bin/network.sys 76 | BREAK = ON 77 | SWITCHAR = - 78 | SHELL = a:/bin/command.com a:/bin -p 79 | 80 | The default value for BUFFERS is OEM specific in that the 81 | OEM can specify the number in the BIOS. A typical value is 2, 82 | the minimal value is one. The default value for FILES is 83 | usually 8 (as above it may be set by OEM BIOS) , so "FILES = 84 | 10" actually allocates only 2 new file channels. If a number 85 | less than or equal to five is specified, the command is 86 | ignored. BREAK defaults to OFF, SWITCHAR to /, and AVAILDEV 87 | to TRUE. NOTE that the setting of SWITCHAR may effect 88 | characters used on the SHELL line (this is true of 89 | COMMAND.COM). 90 | -------------------------------------------------------------------------------- /v20source/PROC.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; process control system calls for MSDOS 3 | ; 4 | 5 | INCLUDE DOSSEG.ASM 6 | 7 | CODE SEGMENT BYTE PUBLIC 'CODE' 8 | ASSUME SS:DOSGROUP,CS:DOSGROUP 9 | 10 | .xlist 11 | .xcref 12 | INCLUDE DOSSYM.ASM 13 | INCLUDE DEVSYM.ASM 14 | .cref 15 | .list 16 | 17 | i_need CurrentPDB,WORD 18 | i_need CreatePDB,BYTE 19 | i_need NUMIO,BYTE 20 | i_need Exit_type,BYTE 21 | i_need INDOS,BYTE 22 | i_need DMAADD,DWORD 23 | i_need DidCTRLC,BYTE 24 | 25 | SUBTTL $WAIT - return previous process error code 26 | PAGE 27 | ; 28 | ; process control data 29 | ; 30 | i_need exit_code,WORD ; code of exit 31 | 32 | ; 33 | ; Assembler usage: 34 | ; MOV AH, Wait 35 | ; INT int_command 36 | ; AX has the exit code 37 | procedure $WAIT,NEAR 38 | ASSUME DS:NOTHING,ES:NOTHING 39 | MOV AX,[exit_code] 40 | XOR DX,DX 41 | MOV [exit_code],DX 42 | transfer SYS_RET_OK 43 | $WAIT ENDP 44 | 45 | IF IBM 46 | procedure $EXEC,NEAR 47 | error error_invalid_function 48 | $EXEC ENDP 49 | ENDIF 50 | IF NOT IBM 51 | INCLUDE EXEC.ASM 52 | ENDIF 53 | 54 | SUBTTL Terminate and stay resident handler 55 | PAGE 56 | ; 57 | ; Input: DX is an offset from CurrentPDB at which to 58 | ; truncate the current block. 59 | ; 60 | ; output: The current block is truncated (expanded) to be [DX+15]/16 61 | ; paragraphs long. An exit is simulated via resetting CurrentPDB 62 | ; and restoring the vectors. 63 | ; 64 | procedure $Keep_process,NEAR 65 | ASSUME DS:NOTHING,ES:NOTHING,SS:DOSGROUP 66 | 67 | PUSH AX ; keep exit code around 68 | MOV BYTE PTR [Exit_type],Exit_keep_process 69 | MOV ES,[CurrentPDB] 70 | CMP DX,6h ; keep enough space around for system 71 | JAE Keep_shrink ; info 72 | MOV DX,6h 73 | keep_shrink: 74 | MOV BX,DX 75 | PUSH BX 76 | PUSH ES 77 | invoke $SETBLOCK ; ignore return codes. 78 | POP DS 79 | POP BX 80 | JC keep_done ; failed on modification 81 | MOV AX,DS 82 | ADD AX,BX 83 | MOV DS:[PDB_block_len],AX 84 | 85 | keep_done: 86 | POP AX 87 | JMP SHORT exit_inner ; and let abort take care of the rest 88 | 89 | $Keep_process ENDP 90 | 91 | procedure Stay_resident,NEAR 92 | ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING 93 | MOV AX,(Keep_process SHL 8) + 0 ; Lower part is return code 94 | ADD DX,15 95 | MOV CL,4 96 | SHR DX,CL 97 | 98 | transfer COMMAND 99 | Stay_resident ENDP 100 | 101 | SUBTTL $EXIT - return to parent process 102 | PAGE 103 | ; 104 | ; Assembler usage: 105 | ; MOV AL, code 106 | ; MOV AH, Exit 107 | ; INT int_command 108 | ; Error return: 109 | ; None. 110 | ; 111 | procedure $EXIT,NEAR 112 | ASSUME DS:NOTHING,ES:NOTHING,SS:DOSGROUP 113 | XOR AH,AH 114 | XCHG AH,BYTE PTR [DidCTRLC] 115 | OR AH,AH 116 | MOV BYTE PTR [Exit_type],exit_terminate 117 | JZ exit_inner 118 | MOV BYTE PTR [Exit_type],exit_ctrl_c 119 | 120 | Exit_inner: 121 | invoke get_user_stack 122 | PUSH [CurrentPDB] 123 | POP [SI.user_CS] 124 | transfer abort_inner 125 | $EXIT ENDP 126 | 127 | do_ext 128 | 129 | CODE ENDS 130 | END 131 | -------------------------------------------------------------------------------- /v20object/QUICK.DOC: -------------------------------------------------------------------------------- 1 | INTERNALS 2 | 3 | 4 | DIR 5 | Same as before except directories appear with the 6 | string "" in the size field 7 | RENAME 8 | Same as before 9 | REN 10 | Same as above 11 | ERASE 12 | Same as before except will now take paths 13 | DEL 14 | Same as above 15 | TYPE 16 | Same as before except will now take paths 17 | REM 18 | Same as before 19 | COPY 20 | Same as before only now takes paths 21 | PAUSE 22 | Same as before 23 | DATE 24 | Same as before 25 | TIME 26 | Same as before 27 | VER 28 | Prints MS-DOS version number 29 | VOL [d:] 30 | Prints the volume ID of drive d: (default if missing) 31 | CHDIR [d:]path 32 | Changes current directory of drive d: (default if 33 | missing) to path. 34 | CD 35 | Same as above 36 | MKDIR [d:]path 37 | Make a directory 38 | MD 39 | Same as above 40 | RMDIR [d:]path 41 | Remove a directory (directory must be empty except 42 | for . and ..) 43 | RD 44 | Same as above 45 | PWD [d:] 46 | Print working directory for d: (default if missing) 47 | BREAK ON or OFF 48 | Turns on/off ^C check in function dispatcher 49 | VERIFY ON or OFF 50 | Turns on/off verify after write 51 | PATH [; or (path;)...] 52 | Set command search path. Path with no argument prints 53 | the current path. the single ; sets the current 54 | path to the current directory olny. The other form 55 | sets the search path so that each "path" in the 56 | argument is searched in the order specified. 57 | EXIT 58 | For commands EXECed as a sub task, causes return 59 | to the invoker. 60 | CTTY dev 61 | Changes the stdin and stdout of command to the 62 | specified device. 63 | 64 | BATCH MODE STUFF 65 | 66 | ECHO ON or OFF or message 67 | Enable or suppress echoing of command lines, or print 68 | the message on standard output. 69 | GOTO label 70 | Continue Batch execution at the command after label 71 | SHIFT 72 | Shift the batch arguments %0 lost, %1->%0, %2->%1, 73 | ... new arg->%9 74 | IF [NOT] (ERRORLEVEL n| EXISTS | string1 == string2) command 75 | If the condition is true, do the command. 76 | FOR %l IN ((set) or filespec) DO command 77 | Sequentually bind %l in the command and execute it. 78 | CLS 79 | Clears the Screen (only if ANSI supported on CON 80 | out) 81 | 82 | EXTERNAL COMMANDS 83 | 84 | FORMAT 85 | Formats disks 86 | CHKDSK 87 | Checks disks Now understands directory structure 88 | and has switches to prevent undesired blasting of 89 | disks and reports on extents 90 | EDLIN 91 | Ridiculous editor 92 | DEBUG 93 | The huge debugger, now has an assemble command 94 | SYS 95 | Copies the operating system onto disks 96 | RECOVER 97 | Reconstructs disk directories from the FAT and 98 | squeezes bad sectors out of files 99 | PRINT 100 | The infamous background file printing utility which 101 | fools you into thinking MS-DOS can do something it 102 | really can't. 103 | FILCOM 104 | Has not changed a bit 105 | EXEFIX 106 | Fixes .EXE files for stack allocation, and converts 107 | .COM files into .EXE format. 108 | LOCATE 109 | Sort of inverse of the above, turnes .EXE files into 110 | .COM files (sometimes). 111 | CONFIG.SYS 112 | A special file which will do all sorts of wonderous 113 | things when the system is booted. 114 | SORT, CIPHER, FGREP, MORE 115 | Filters (talk to CHRISP for details) 116 | -------------------------------------------------------------------------------- /v20source/QUICK.txt: -------------------------------------------------------------------------------- 1 | INTERNALS 2 | 3 | 4 | DIR 5 | Same as before except directories appear with the 6 | string "" in the size field 7 | RENAME 8 | Same as before 9 | REN 10 | Same as above 11 | ERASE 12 | Same as before except will now take paths 13 | DEL 14 | Same as above 15 | TYPE 16 | Same as before except will now take paths 17 | REM 18 | Same as before 19 | COPY 20 | Same as before only now takes paths 21 | PAUSE 22 | Same as before 23 | DATE 24 | Same as before 25 | TIME 26 | Same as before 27 | VER 28 | Prints MS-DOS version number 29 | VOL [d:] 30 | Prints the volume ID of drive d: (default if missing) 31 | CHDIR [d:]path 32 | Changes current directory of drive d: (default if 33 | missing) to path. 34 | CD 35 | Same as above 36 | MKDIR [d:]path 37 | Make a directory 38 | MD 39 | Same as above 40 | RMDIR [d:]path 41 | Remove a directory (directory must be empty except 42 | for . and ..) 43 | RD 44 | Same as above 45 | PWD [d:] 46 | Print working directory for d: (default if missing) 47 | BREAK ON or OFF 48 | Turns on/off ^C check in function dispatcher 49 | VERIFY ON or OFF 50 | Turns on/off verify after write 51 | PATH [; or (path;)...] 52 | Set command search path. Path with no argument prints 53 | the current path. the single ; sets the current 54 | path to the current directory olny. The other form 55 | sets the search path so that each "path" in the 56 | argument is searched in the order specified. 57 | EXIT 58 | For commands EXECed as a sub task, causes return 59 | to the invoker. 60 | CTTY dev 61 | Changes the stdin and stdout of command to the 62 | specified device. 63 | 64 | BATCH MODE STUFF 65 | 66 | ECHO ON or OFF or message 67 | Enable or suppress echoing of command lines, or print 68 | the message on standard output. 69 | GOTO label 70 | Continue Batch execution at the command after label 71 | SHIFT 72 | Shift the batch arguments %0 lost, %1->%0, %2->%1, 73 | ... new arg->%9 74 | IF [NOT] (ERRORLEVEL n| EXISTS | string1 == string2) command 75 | If the condition is true, do the command. 76 | FOR %l IN ((set) or filespec) DO command 77 | Sequentually bind %l in the command and execute it. 78 | CLS 79 | Clears the Screen (only if ANSI supported on CON 80 | out) 81 | 82 | EXTERNAL COMMANDS 83 | 84 | FORMAT 85 | Formats disks 86 | CHKDSK 87 | Checks disks Now understands directory structure 88 | and has switches to prevent undesired blasting of 89 | disks and reports on extents 90 | EDLIN 91 | Ridiculous editor 92 | DEBUG 93 | The huge debugger, now has an assemble command 94 | SYS 95 | Copies the operating system onto disks 96 | RECOVER 97 | Reconstructs disk directories from the FAT and 98 | squeezes bad sectors out of files 99 | PRINT 100 | The infamous background file printing utility which 101 | fools you into thinking MS-DOS can do something it 102 | really can't. 103 | FILCOM 104 | Has not changed a bit 105 | EXEFIX 106 | Fixes .EXE files for stack allocation, and converts 107 | .COM files into .EXE format. 108 | LOCATE 109 | Sort of inverse of the above, turnes .EXE files into 110 | .COM files (sometimes). 111 | CONFIG.SYS 112 | A special file which will do all sorts of wonderous 113 | things when the system is booted. 114 | SORT, CIPHER, FGREP, MORE 115 | Filters (talk to CHRISP for details) 116 | -------------------------------------------------------------------------------- /v20object/PROFILE.DOC: -------------------------------------------------------------------------------- 1 | MS-DOS PROGRAM PROFILER 2 | FOR .EXE .COM FILES 3 | 4 | 5 | I. PURPOSE 6 | 7 | The PROFIL program is designed to produce an execution 8 | profile of MS-DOS 1.25 or 2.00 .EXE or .COM files on 9 | 8086/8088 systems which have a programmable interrupting 10 | clock. The method employed is to chop the program up 11 | into a sequence of "buckets" and to increment the 12 | appropriate (based on CS:IP) bucket count when the clock 13 | interrupts. In addition there are counters for hits 14 | in the I/O system and the DOS so some idea of how I/O 15 | or DOS bound a program is. There is also a bucket for 16 | hits above the program area, you might get counts here 17 | if your program relocates itself, or goes haywire. 18 | 19 | The PROFIL program is not intended as an end-user 20 | program, but rather as a developement tool. To this 21 | end it is not particularly robust or friendly, but gets 22 | the job done. The OEM must write a PCLOCK routine (see 23 | PCLOCK.ASM) which implements the hardware dependant clock 24 | interrupt. The implementation should be evident from 25 | examining the source code, it is quite simple. There 26 | is a CLOCKON routine which sets up a clock interrupt 27 | to the CLK_INTER routine every DX micro seconds. A 28 | CLOCKOFF routine which un-does CLOCKON. And a LEAVE_INT 29 | routine which is responsible for the actual "IRET" from 30 | the clock interrupt. Also see the PROHIST documentation. 31 | 32 | II. USAGE 33 | 34 | The profiler is envoked by uttering: 35 | 36 | PROFIL fname.ext 37 | 38 | where the filename is completly specified, including 39 | extension. You will then be prompted for the number 40 | of paragraphs in one bucket. This number must be > 0, 41 | based on this number the number of buckets is computed 42 | by using the size of the executable file. Next you will 43 | be prompted for the clock interval, and lastly for 44 | parameters to the program. Type the parameters just 45 | as if you were running the program at the command level. 46 | 47 | NOTE: If a "bad" number is entered for the bucket size 48 | or clock interval, you will be reprompted. 49 | 50 | When the program terminates, normally or by Cntrl-C, 51 | PROFIL will print a termination message (similar to 52 | debug). The output file will be fname.PRF where fname 53 | is the same as the file containing the program being 54 | profiled. 55 | 56 | III. OUTPUT FORMAT 57 | 58 | The format of the output file is the following C 59 | type structure. 60 | 61 | struct profdata { 62 | short clock_grain; /* Clock sample interval in 63 | micro-seconds*/ 64 | short bucket_num; /* The total number of buckets */ 65 | short bucket_siz; /* Number of paragraphs per bucket */ 66 | short prog_low_pa; /* The Paragraph number of the lower 67 | bound on the sample area */ 68 | short prog_high_pa; /* The Paragraph number of the upper 69 | bound on the sample area */ 70 | short dos_pa; /* The Paragraph number of the I/O DOS 71 | boundry */ 72 | 73 | /* When the clock interrupts the current segment is computed 74 | from the CS:IP. If this is below dos_pa it is an I/O hit, 75 | if between dos_pa and prog_low_pa it is a DOS hit, if between 76 | prog_low_pa and prog_high_pa the appropriate bucket number 77 | is computed and that bucket count is incremented, if above 78 | prog_high_pa then it is a high hit. */ 79 | 80 | short hit_io; /* I/O bucket */ 81 | short hit_dos; /* DOS bucket */ 82 | short hit_high; /* Above program bucket */ 83 | }; 84 | 85 | short buckets[bucket_num]; 86 | /* The buckets *****NOTE: You can't declare it this way 87 | (bucket_num is a variable), the size of this area is 88 | determined by the value of bucket_num in the fixed header 89 | */ 90 | -------------------------------------------------------------------------------- /v20source/PROFILE.txt: -------------------------------------------------------------------------------- 1 | MS-DOS PROGRAM PROFILER 2 | FOR .EXE .COM FILES 3 | 4 | 5 | I. PURPOSE 6 | 7 | The PROFIL program is designed to produce an execution 8 | profile of MS-DOS 1.25 or 2.00 .EXE or .COM files on 9 | 8086/8088 systems which have a programmable interrupting 10 | clock. The method employed is to chop the program up 11 | into a sequence of "buckets" and to increment the 12 | appropriate (based on CS:IP) bucket count when the clock 13 | interrupts. In addition there are counters for hits 14 | in the I/O system and the DOS so some idea of how I/O 15 | or DOS bound a program is. There is also a bucket for 16 | hits above the program area, you might get counts here 17 | if your program relocates itself, or goes haywire. 18 | 19 | The PROFIL program is not intended as an end-user 20 | program, but rather as a developement tool. To this 21 | end it is not particularly robust or friendly, but gets 22 | the job done. The OEM must write a PCLOCK routine (see 23 | PCLOCK.ASM) which implements the hardware dependant clock 24 | interrupt. The implementation should be evident from 25 | examining the source code, it is quite simple. There 26 | is a CLOCKON routine which sets up a clock interrupt 27 | to the CLK_INTER routine every DX micro seconds. A 28 | CLOCKOFF routine which un-does CLOCKON. And a LEAVE_INT 29 | routine which is responsible for the actual "IRET" from 30 | the clock interrupt. Also see the PROHIST documentation. 31 | 32 | II. USAGE 33 | 34 | The profiler is envoked by uttering: 35 | 36 | PROFIL fname.ext 37 | 38 | where the filename is completly specified, including 39 | extension. You will then be prompted for the number 40 | of paragraphs in one bucket. This number must be > 0, 41 | based on this number the number of buckets is computed 42 | by using the size of the executable file. Next you will 43 | be prompted for the clock interval, and lastly for 44 | parameters to the program. Type the parameters just 45 | as if you were running the program at the command level. 46 | 47 | NOTE: If a "bad" number is entered for the bucket size 48 | or clock interval, you will be reprompted. 49 | 50 | When the program terminates, normally or by Cntrl-C, 51 | PROFIL will print a termination message (similar to 52 | debug). The output file will be fname.PRF where fname 53 | is the same as the file containing the program being 54 | profiled. 55 | 56 | III. OUTPUT FORMAT 57 | 58 | The format of the output file is the following C 59 | type structure. 60 | 61 | struct profdata { 62 | short clock_grain; /* Clock sample interval in 63 | micro-seconds*/ 64 | short bucket_num; /* The total number of buckets */ 65 | short bucket_siz; /* Number of paragraphs per bucket */ 66 | short prog_low_pa; /* The Paragraph number of the lower 67 | bound on the sample area */ 68 | short prog_high_pa; /* The Paragraph number of the upper 69 | bound on the sample area */ 70 | short dos_pa; /* The Paragraph number of the I/O DOS 71 | boundry */ 72 | 73 | /* When the clock interrupts the current segment is computed 74 | from the CS:IP. If this is below dos_pa it is an I/O hit, 75 | if between dos_pa and prog_low_pa it is a DOS hit, if between 76 | prog_low_pa and prog_high_pa the appropriate bucket number 77 | is computed and that bucket count is incremented, if above 78 | prog_high_pa then it is a high hit. */ 79 | 80 | short hit_io; /* I/O bucket */ 81 | short hit_dos; /* DOS bucket */ 82 | short hit_high; /* Above program bucket */ 83 | }; 84 | 85 | short buckets[bucket_num]; 86 | /* The buckets *****NOTE: You can't declare it this way 87 | (bucket_num is a variable), the size of this area is 88 | determined by the value of bucket_num in the fixed header 89 | */ 90 | -------------------------------------------------------------------------------- /v20source/MORE.ASM: -------------------------------------------------------------------------------- 1 | TITLE MORE MS-DOS Paginate Filter 2 | FALSE EQU 0 3 | TRUE EQU NOT FALSE 4 | 5 | IBMVER EQU TRUE 6 | KANJI EQU FALSE 7 | MSVER EQU FALSE 8 | 9 | INCLUDE DOSSYM.ASM 10 | 11 | CODE SEGMENT PUBLIC 12 | ORG 100H 13 | ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE 14 | START: 15 | 16 | MOV AH,GET_VERSION 17 | INT 21H 18 | XCHG AH,AL ; Turn it around to AH.AL 19 | CMP AX,200H 20 | JAE OKDOS 21 | MOV DX,OFFSET BADVER 22 | MOV AH,STD_CON_STRING_OUTPUT 23 | INT 21H 24 | INT 20H 25 | OKDOS: 26 | 27 | IF IBMVER 28 | IF KANJI 29 | MOV BYTE PTR MAXROW,24 30 | ELSE 31 | MOV BYTE PTR MAXROW,25 32 | ENDIF 33 | MOV AH,15 34 | INT 16 35 | MOV MAXCOL,AH 36 | ENDIF 37 | 38 | MOV DX,OFFSET CRLFTXT ; INITIALIZE CURSOR 39 | MOV AH,STD_CON_STRING_OUTPUT 40 | INT 21H 41 | 42 | XOR BX,BX ; DUP FILE HANDLE 0 43 | MOV AH,XDUP 44 | INT 21H 45 | MOV BP,AX 46 | 47 | MOV AH,CLOSE ; CLOSE STANDARD IN 48 | INT 21H 49 | 50 | MOV BX,2 ; DUP STD ERR TO STANDARD IN 51 | MOV AH,XDUP 52 | INT 21H 53 | 54 | ALOOP: 55 | CLD 56 | MOV DX,OFFSET BUFFER 57 | MOV CX,4096 58 | MOV BX,BP 59 | MOV AH,READ 60 | INT 21H 61 | OR AX,AX 62 | JNZ SETCX 63 | DONE: INT 20H 64 | SETCX: MOV CX,AX 65 | MOV SI,DX 66 | 67 | TLOOP: 68 | LODSB 69 | CMP AL,1AH 70 | JZ DONE 71 | CMP AL,13 72 | JNZ NOTCR 73 | MOV BYTE PTR CURCOL,1 74 | JMP SHORT ISCNTRL 75 | 76 | NOTCR: CMP AL,10 77 | JNZ NOTLF 78 | INC BYTE PTR CURROW 79 | JMP SHORT ISCNTRL 80 | 81 | NOTLF: CMP AL,8 82 | JNZ NOTBP 83 | CMP BYTE PTR CURCOL,1 84 | JZ ISCNTRL 85 | DEC BYTE PTR CURCOL 86 | JMP SHORT ISCNTRL 87 | 88 | NOTBP: CMP AL,9 89 | JNZ NOTTB 90 | MOV AH,CURCOL 91 | ADD AH,7 92 | AND AH,11111000B 93 | INC AH 94 | MOV CURCOL,AH 95 | JMP SHORT ISCNTRL 96 | 97 | NOTTB: 98 | IF MSVER ; IBM CONTROL CHARACTER PRINT 99 | CMP AL,' ' 100 | JB ISCNTRL 101 | ENDIF 102 | 103 | IF IBMVER 104 | CMP AL,7 ; ALL CHARACTERS PRINT BUT BELL 105 | JZ ISCNTRL 106 | ENDIF 107 | 108 | INC BYTE PTR CURCOL 109 | MOV AH,CURCOL 110 | CMP AH,MAXCOL 111 | JBE ISCNTRL 112 | INC BYTE PTR CURROW 113 | MOV BYTE PTR CURCOL,1 114 | 115 | ISCNTRL: 116 | MOV DL,AL 117 | MOV AH,STD_CON_OUTPUT 118 | INT 21H 119 | MOV AH,CURROW 120 | CMP AH,MAXROW 121 | JB CHARLOOP 122 | 123 | ASKMORE: 124 | MOV DX,OFFSET MORETXT 125 | MOV AH,STD_CON_STRING_OUTPUT 126 | INT 21H ; ASK MORE? 127 | 128 | MOV AH,STD_CON_INPUT_FLUSH ; WAIT FOR A KEY, NO ECHO 129 | MOV AL,STD_CON_INPUT 130 | INT 21H 131 | 132 | MOV DX,OFFSET CRLFTXT 133 | MOV AH,STD_CON_STRING_OUTPUT 134 | INT 21H 135 | 136 | MOV BYTE PTR CURCOL,1 137 | MOV BYTE PTR CURROW,1 138 | 139 | CHARLOOP: 140 | DEC CX 141 | JZ GOBIG 142 | JMP TLOOP 143 | GOBIG: JMP ALOOP 144 | 145 | MAXROW DB 24 146 | MAXCOL DB 80 147 | CURROW DB 1 148 | CURCOL DB 1 149 | EXTRN MORETXT:BYTE,BADVER:BYTE,CRLFTXT:BYTE,BUFFER:BYTE 150 | 151 | CODE ENDS 152 | END START 153 | 154 | 155 |  -------------------------------------------------------------------------------- /v20object/INT24.DOC: -------------------------------------------------------------------------------- 1 | DIFFERENCES AND NEW ADDITIONS 2 | TO THE INT 24H HARD ERROR 3 | HANDLER(s) FOR MSDOS 2.0 4 | 5 | 6 | 1.) Additional Constraints: 7 | 8 | Under previous versions it was not explicitly stated 9 | that an INT 24H handler must preserve the ES register. 10 | It is now required that INT 24H handlers preserve ES. 11 | 12 | When it is desired to ignore an error, the same 13 | registers must be preserved as when it is desired to 14 | retry the operation (SS,SP,DS,BX,CX,DX). 15 | 16 | It was not clearly stated in the past, but it was 17 | true, that only system calls 1-12 can be made by an INT 18 | 24H handler. Making any other calls will destroy the 19 | DOS stack and thus its ability to retry or ignore an 20 | error. 21 | 22 | INT 24H Handlers should always return to the DOS 23 | on a retry, ignore, or abort. Failure to return to the 24 | DOS will leave the DOS in an unstable state until a non 25 | 1-12 function call is made. 26 | 27 | 2.) Additional features: 28 | 29 | Character device errors are now handled by the INT 30 | 24H mechanism. Previously only Disk I/O errors were 31 | handled by the INT 24H handler. Additional information 32 | is now passed to the INT 24H handler in the BP and SI 33 | registers (which need not be preserved). 34 | 35 | BP:SI is a DWORD pointer to the Device Header of 36 | the device causing the error. Information can be gotten 37 | from this header as to whether the device is a block 38 | or character device, and if the device is a character 39 | device the name of the device can also be obtained. The 40 | DEVICE-DRIVERS document for 2.0 contains the definition 41 | of this header format. 42 | 43 | NOTE: AL (drive number for Disk errors) is indeterminate 44 | on character device errors. Bit 7 of AH is always 45 | 1 for character device errors, previously bit 7 was 46 | 1 only in the case of a bad memory image of the FAT. 47 | 48 | LIST OF INT 24H ERROR CODES PASSED IN DI 49 | 50 | 0 Write Protect violation 51 | 1 Unknown Unit NEW 52 | 2 Drive not ready 53 | 3 Unknown command NEW 54 | 4 CRC error 55 | 5 Bad Drive Request Structure length NEW 56 | 6 Seek error 57 | 7 Unknown media NEW 58 | 8 Sector not found 59 | 60 | 9 Printer out of paper NEW 61 | A Write Fault 62 | B Read Fault NEW 63 | C General Failure 64 | 65 | As mentioned above BP:SI points to the device header: 66 | 67 | BP:SI-> 68 | +--------------------------------------+ 69 | | DWORD Pointer to next device | 70 | | (-1 if last device) | 71 | +--------------------------------------+ 72 | | WORD Attributes | 73 | | Bit 15 = 1 if char device 0 if blk | 74 | | if bit 15 is 1 | 75 | | Bit 0 = 1 if Current sti device | 76 | | Bit 1 = 1 if Current sto output | 77 | | Bit 2 = 1 if Current NUL device | 78 | | Bit 3 = 1 if Current CLOCK dev | 79 | | Bit 14 is the IOCTL bit (see below) | 80 | | Bit 13 is the NON IBM FORMAT bit | 81 | +--------------------------------------+ 82 | | WORD Pointer to Device strategy | 83 | | entry point | 84 | +--------------------------------------+ 85 | | WORD Pointer to Device interrupt | 86 | | entry point | 87 | +--------------------------------------+ 88 | | 8-BYTE character device name field | 89 | | Character devices set a device name | 90 | | For block devices the first byte is | 91 | | The number of units | 92 | +--------------------------------------+ 93 | 94 | To tell if the error occured on a block or character 95 | device you must look at bit 15 in the attribute field (WORD 96 | at BP:SI+4). 97 | 98 | If the name of the character device is desired look at 99 | the eight bytes starting at BP:SI+10. 100 | -------------------------------------------------------------------------------- /v20source/INT24.txt: -------------------------------------------------------------------------------- 1 | DIFFERENCES AND NEW ADDITIONS 2 | TO THE INT 24H HARD ERROR 3 | HANDLER(s) FOR MSDOS 2.0 4 | 5 | 6 | 1.) Additional Constraints: 7 | 8 | Under previous versions it was not explicitly stated 9 | that an INT 24H handler must preserve the ES register. 10 | It is now required that INT 24H handlers preserve ES. 11 | 12 | When it is desired to ignore an error, the same 13 | registers must be preserved as when it is desired to 14 | retry the operation (SS,SP,DS,BX,CX,DX). 15 | 16 | It was not clearly stated in the past, but it was 17 | true, that only system calls 1-12 can be made by an INT 18 | 24H handler. Making any other calls will destroy the 19 | DOS stack and thus its ability to retry or ignore an 20 | error. 21 | 22 | INT 24H Handlers should always return to the DOS 23 | on a retry, ignore, or abort. Failure to return to the 24 | DOS will leave the DOS in an unstable state until a non 25 | 1-12 function call is made. 26 | 27 | 2.) Additional features: 28 | 29 | Character device errors are now handled by the INT 30 | 24H mechanism. Previously only Disk I/O errors were 31 | handled by the INT 24H handler. Additional information 32 | is now passed to the INT 24H handler in the BP and SI 33 | registers (which need not be preserved). 34 | 35 | BP:SI is a DWORD pointer to the Device Header of 36 | the device causing the error. Information can be gotten 37 | from this header as to whether the device is a block 38 | or character device, and if the device is a character 39 | device the name of the device can also be obtained. The 40 | DEVICE-DRIVERS document for 2.0 contains the definition 41 | of this header format. 42 | 43 | NOTE: AL (drive number for Disk errors) is indeterminate 44 | on character device errors. Bit 7 of AH is always 45 | 1 for character device errors, previously bit 7 was 46 | 1 only in the case of a bad memory image of the FAT. 47 | 48 | LIST OF INT 24H ERROR CODES PASSED IN DI 49 | 50 | 0 Write Protect violation 51 | 1 Unknown Unit NEW 52 | 2 Drive not ready 53 | 3 Unknown command NEW 54 | 4 CRC error 55 | 5 Bad Drive Request Structure length NEW 56 | 6 Seek error 57 | 7 Unknown media NEW 58 | 8 Sector not found 59 | 60 | 9 Printer out of paper NEW 61 | A Write Fault 62 | B Read Fault NEW 63 | C General Failure 64 | 65 | As mentioned above BP:SI points to the device header: 66 | 67 | BP:SI-> 68 | +--------------------------------------+ 69 | | DWORD Pointer to next device | 70 | | (-1 if last device) | 71 | +--------------------------------------+ 72 | | WORD Attributes | 73 | | Bit 15 = 1 if char device 0 if blk | 74 | | if bit 15 is 1 | 75 | | Bit 0 = 1 if Current sti device | 76 | | Bit 1 = 1 if Current sto output | 77 | | Bit 2 = 1 if Current NUL device | 78 | | Bit 3 = 1 if Current CLOCK dev | 79 | | Bit 14 is the IOCTL bit (see below) | 80 | | Bit 13 is the NON IBM FORMAT bit | 81 | +--------------------------------------+ 82 | | WORD Pointer to Device strategy | 83 | | entry point | 84 | +--------------------------------------+ 85 | | WORD Pointer to Device interrupt | 86 | | entry point | 87 | +--------------------------------------+ 88 | | 8-BYTE character device name field | 89 | | Character devices set a device name | 90 | | For block devices the first byte is | 91 | | The number of units | 92 | +--------------------------------------+ 93 | 94 | To tell if the error occured on a block or character 95 | device you must look at bit 15 in the attribute field (WORD 96 | at BP:SI+4). 97 | 98 | If the name of the character device is desired look at 99 | the eight bytes starting at BP:SI+10. 100 | -------------------------------------------------------------------------------- /v11source/HEX2BIN.ASM: -------------------------------------------------------------------------------- 1 | ; HEX2BIN version 1.02 2 | ; Converts Intel hex format files to straight binary 3 | 4 | FCB: EQU 5CH 5 | READ: EQU 20 6 | SETDMA: EQU 26 7 | OPEN: EQU 15 8 | CLOSE: EQU 16 9 | CREATE: EQU 22 10 | DELETE: EQU 19 11 | BLKWRT: EQU 40 12 | GETSEG: EQU 38 13 | BUFSIZ: EQU 1024 14 | 15 | ORG 100H 16 | PUT 100H 17 | 18 | HEX2BIN: 19 | MOV DI,FCB+9 20 | CMP B,[DI]," " 21 | JNZ HAVEXT 22 | MOV SI,HEX 23 | MOVB 24 | MOVW 25 | HAVEXT: 26 | ;Get load offset (default is -100H) 27 | MOV CL,4 ;Needed for shifts 28 | MOV [OFFSET],-100H 29 | MOV SI,FCB+11H ;Scan second FCB for offset 30 | LODB 31 | CMP AL," " ;Check if offset present 32 | JZ HAVOFF 33 | MOV B,[SIGN],0 ;Assume positive sign for now 34 | CMP AL,"+" 35 | JZ GETOFF ;Get a positive offset 36 | CMP AL,"-" 37 | JNZ GETOFF1 ;If not + or -, then not signed 38 | MOV B,[SIGN],1 ;Flag as negative offset 39 | GETOFF: 40 | LODB ;Eat sign 41 | GETOFF1: 42 | CALL HEXCHK ;Check for valid hex character 43 | JC HAVOFF ;No offset if not valid 44 | XOR BX,BX ;Intialize offset sum to 0 45 | CONVOFF: 46 | SHL BX,CL ;Multiply current sum by 16 47 | OR BL,AL ;Add in current hex digit 48 | LODB ;Get next digit 49 | CALL HEXCHK ;And convert it to binary 50 | JNC CONVOFF ;Loop until all hex digits read 51 | TEST B,[SIGN],-1 ;Check if offset was to be negative 52 | JZ SAVOFF 53 | NEG BX 54 | SAVOFF: 55 | MOV [OFFSET],BX 56 | HAVOFF: 57 | MOV DX,STARTSEG 58 | MOV AX,DS 59 | ADD DX,AX ;Compute load segment 60 | MOV AH,GETSEG 61 | INT 33 62 | MOV ES,DX 63 | SEG ES 64 | MOV CX,[6] ;Get size of segment 65 | MOV [SEGSIZ],CX 66 | XOR AX,AX 67 | MOV DI,AX 68 | MOV BP,AX 69 | SHR CX 70 | REP 71 | STOW ;Fill entire segment with zeros 72 | MOV AH,OPEN 73 | MOV DX,FCB 74 | INT 21H 75 | OR AL,AL 76 | JNZ NOFIL 77 | MOV B,[FCB+32],0 78 | MOV [FCB+14],BUFSIZ ;Set record size to buffer size 79 | MOV DX,BUFFER 80 | MOV AH,SETDMA 81 | INT 33 82 | MOV AH,READ 83 | MOV DX,FCB ;All set up for sequential reads 84 | MOV SI,BUFFER+BUFSIZ ;Flag input buffer as empty 85 | READHEX: 86 | CALL GETCH 87 | CMP AL,":" ;Search for : to start line 88 | JNZ READHEX 89 | CALL GETBYT ;Get byte count 90 | MOV CL,AL 91 | MOV CH,0 92 | JCXZ DONE 93 | CALL GETBYT ;Get high byte of load address 94 | MOV BH,AL 95 | CALL GETBYT ;Get low byte of load address 96 | MOV BL,AL 97 | ADD BX,[OFFSET] ;Add in offset 98 | MOV DI,BX 99 | CALL GETBYT ;Throw away type byte 100 | READLN: 101 | CMP DI,[SEGSIZ] 102 | JAE ADERR 103 | CALL GETBYT ;Get data byte 104 | STOB 105 | CMP DI,BP ;Check if this is the largest address so far 106 | JBE HAVBIG 107 | MOV BP,DI ;Save new largest 108 | HAVBIG: 109 | LOOP READLN 110 | JP READHEX 111 | 112 | NOFIL: 113 | MOV DX,NOFILE 114 | QUIT: 115 | MOV AH,9 116 | INT 21H 117 | INT 20H 118 | 119 | ADERR: 120 | MOV DX,ADDR 121 | JMP SHOWERR 122 | 123 | GETCH: 124 | CMP SI,BUFFER+BUFSIZ 125 | JNZ NOREAD 126 | INT 21H 127 | CMP AL,1 128 | JZ ERROR 129 | MOV SI,BUFFER 130 | NOREAD: 131 | LODB 132 | CMP AL,1AH 133 | JZ DONE 134 | RET 135 | 136 | GETBYT: 137 | CALL HEXDIG 138 | MOV BL,AL 139 | CALL HEXDIG 140 | SHL BL 141 | SHL BL 142 | SHL BL 143 | SHL BL 144 | OR AL,BL 145 | RET 146 | 147 | HEXCHK: 148 | SUB AL,"0" 149 | JC RET 150 | CMP AL,10 151 | JC CMCRET 152 | SUB AL,"A"-"0"-10 153 | JC RET 154 | CMP AL,16 155 | CMCRET: 156 | CMC 157 | RET 158 | 159 | HEXDIG: 160 | CALL GETCH 161 | CALL HEXCHK 162 | JNC RET 163 | ERROR: 164 | MOV DX,ERRMES 165 | SHOWERR: 166 | MOV AH,9 167 | INT 21H 168 | DONE: 169 | MOV [FCB+9],4F00H+"C" ;"CO" 170 | MOV B,[FCB+11],"M" 171 | MOV DX,FCB 172 | MOV AH,CREATE 173 | INT 21H 174 | OR AL,AL 175 | JNZ NOROOM 176 | XOR AX,AX 177 | MOV [FCB+33],AX 178 | MOV [FCB+35],AX ;Set RR field 179 | INC AX 180 | MOV [FCB+14],AX ;Set record size 181 | XOR DX,DX 182 | PUSH DS 183 | PUSH ES 184 | POP DS ;Get load segment 185 | MOV AH,SETDMA 186 | INT 21H 187 | POP DS 188 | MOV CX,BP 189 | MOV AH,BLKWRT 190 | MOV DX,FCB 191 | INT 21H 192 | MOV AH,CLOSE 193 | INT 21H 194 | EXIT: 195 | INT 20H 196 | 197 | NOROOM: 198 | MOV DX,DIRFUL 199 | JMP QUIT 200 | 201 | HEX: DB "HEX" 202 | ERRMES: DB "Error in HEX file--conversion aborted$" 203 | NOFILE: DB "File not found$" 204 | ADDR: DB "Address out of range--conversion aborted$" 205 | DIRFUL: DB "Disk directory full$" 206 | 207 | OFFSET: DS 2 208 | SEGSIZ: DS 2 209 | SIGN: DS 1 210 | BUFFER: DS BUFSIZ 211 | 212 | START: 213 | STARTSEG EQU (START+15)/16 214 |  -------------------------------------------------------------------------------- /v20source/GENFOR.ASM: -------------------------------------------------------------------------------- 1 | ; Generic FORMAT module for any ms-dos disk erases the directory, 2 | ; zeros FAT, and marks bad sectors 3 | 4 | INCLUDE DOST:DOSSYM.ASM 5 | 6 | CODE SEGMENT PUBLIC 'CODE' 7 | 8 | ASSUME CS:CODE,DS:CODE,ES:CODE 9 | 10 | PUBLIC FATID,STARTSECTOR,SWITCHLIST,FREESPACE,FATSPACE 11 | PUBLIC INIT,DISKFORMAT,BADSECTOR,DONE,WRTFAT,HARDFLAG 12 | EXTRN SWITCHMAP:WORD,DRIVE:BYTE 13 | 14 | WRTFAT: 15 | MOV AH,GET_DPB 16 | MOV DL,[DRIVE] 17 | INC DL ;A = 1 18 | INT 21H ;FORCE A FATREAD 19 | PUSH CS 20 | POP DS 21 | MOV AL,[FATCNT] 22 | MOV [CURCNT],AL ;SET UP FAT COUNT 23 | MOV AX,[FATSTART] 24 | MOV [COUNT],AX 25 | FATLOOP: 26 | MOV AL,BYTE PTR DRIVE 27 | CBW 28 | MOV CX,[FATSIZE] 29 | MOV DX,[COUNT] 30 | MOV BX,[FATSPACE] 31 | INT 26H 32 | POP AX 33 | JC GORET 34 | MOV CX,[FATSIZE] 35 | ADD [COUNT],CX 36 | DEC BYTE PTR [CURCNT] 37 | JNZ FATLOOP 38 | CLC ;Good return 39 | GORET: 40 | RET 41 | 42 | FATSIZE DW ? 43 | FATSTART DW ? 44 | COUNT DW ? 45 | STARTSECTOR DW ? 46 | SPC DB ? ;SECTORS PER CLUSTER 47 | FATCNT DB ? ;NUMBER OF FATS ON THIS DRIVE 48 | CURCNT DB ? 49 | DSKSIZE DW ? ;NUMBER OF SECTORS ON THE DRIVE 50 | START DW 0 ;CURRENT TEST SECTOR 51 | 52 | INIT: 53 | MOV AH,GET_DPB 54 | MOV DL,[DRIVE] 55 | INC DL ;A = 1 56 | INT 21H ;FORCE A FATREAD 57 | MOV AL,[BX+4] ;SECTORS PER CLUSTER - 1 58 | INC AL 59 | MOV CH,AL ;CH = SECTORS PER CLUSTER 60 | CBW 61 | MOV BP,[BX+0DH] ;MAXCLUS + 1 62 | DEC BP 63 | MUL BP 64 | MOV BP,AX 65 | ADD BP,[BX+0BH] ;BP = NUMBER OF SECTORS ON THE DISK 66 | MOV AL,[BX+0FH] ;GET SIZE OF FAT IN SECTORS 67 | MOV AH,[BX+8] ;GET NUMBER OF FATS 68 | MOV DX,[BX+6] ;FIRST SECTOR OF FAT 69 | MOV CL,[BX+16H] ;FATID BYTE 70 | MOV SI,[BX+2] ;SECTOR SIZE 71 | MOV BX,[BX+0BH] ;FIRST SECTOR OF DATA 72 | PUSH CS 73 | POP DS 74 | MOV [FATCNT],AH 75 | MOV [DSKSIZE],BP 76 | MOV [SPC],CH 77 | MOV [FATSTART],DX 78 | MOV [ENDLOC],CL 79 | MOV [FATID],CL 80 | MOV [STARTSECTOR],BX 81 | XOR AH,AH 82 | MOV [FATSIZE],AX 83 | MUL SI ;AX = SIZE OF FAT 84 | ADD [FREESPACE],AX 85 | ADD [BUFFER],AX 86 | MOV AX,BX 87 | MUL SI 88 | ADD [FREESPACE],AX ;AX = SIZE OF TEMP BUFFER 89 | DISKFORMAT: 90 | DONE: 91 | XOR AX,AX 92 | CLC 93 | RET 94 | 95 | BADSECTOR: 96 | MOV DX,[START] 97 | CMP DX,[DSKSIZE] 98 | JAE DONE 99 | 100 | MOV AL,[DRIVE] 101 | MOV CL,[SPC] ;READ ONE ALLOCATIONS WORTH 102 | XOR CH,CH 103 | CMP BYTE PTR [FIRSTFLAG],0 104 | JZ SETBX 105 | MOV CX,[STARTSECTOR] ;FIRST TIME THROUGH READ SYSTEM AREA 106 | MOV BYTE PTR [FIRSTFLAG],0 107 | MOV DX,[START] 108 | SETBX: MOV BX,[BUFFER] 109 | PUSH CX 110 | INT 25H ;TRY TO READ 111 | POP AX ;CLEAN UP STACK 112 | POP CX 113 | JC GOTBAD ;KEEP LOOKING FOR BADSECTORS 114 | ADD [START],CX 115 | JMP BADSECTOR 116 | 117 | GOTBAD: 118 | MOV AX,CX 119 | MOV BX,[START] 120 | ADD [START],AX ;SET UP FOR NEXT CALL 121 | CLC 122 | RET 123 | 124 | FIRSTFLAG DB 1 ;1 = FIRST CALL TO BADSECTOR 125 | HARDFLAG DB 1 126 | FATID DB 0FEH 127 | SWITCHLIST DB 3,"OVS" 128 | BUFFER DW ENDLOC 129 | FREESPACE DW ENDLOC 130 | FATSPACE DW ENDLOC 131 | ENDLOC LABEL BYTE 132 | DB 0FEH,0FFH,0FFH 133 | 134 | CODE ENDS 135 | END 136 | -------------------------------------------------------------------------------- /v20source/FORMES.ASM: -------------------------------------------------------------------------------- 1 | TITLE FORMAT Messages 2 | 3 | FALSE EQU 0 4 | TRUE EQU NOT FALSE 5 | 6 | IBMVER EQU FALSE 7 | 8 | .xlist 9 | .xcref 10 | INCLUDE DOSSYM.ASM 11 | .cref 12 | .list 13 | 14 | CODE SEGMENT PUBLIC 'CODE' 15 | ASSUME CS:CODE,DS:CODE,ES:CODE 16 | 17 | PUBLIC BADVER,SNGMSG,SNGDRV,HRDMSG,HRDDRV,REPORT 18 | PUBLIC LABPRMT,TARGMSG,TARGDRV 19 | PUBLIC SYSTRAN,CRLFMSG,INVCHR,INVDRV,INVPAR 20 | PUBLIC SYSMSG,SYSDRV,FRMTERR,NOTSYS,NOUSE,MEMEX 21 | PUBLIC WAITYN 22 | EXTRN PRINT:NEAR,CRLF:NEAR,UNSCALE:NEAR,DISP32BITS:NEAR 23 | EXTRN FDSKSIZ:DWORD,SECSIZ:WORD,CLUSSIZ:WORD,SYSSIZ:DWORD 24 | EXTRN BADSIZ:DWORD 25 | 26 | ;Wait for "Y" or "N" 27 | WAITYN: 28 | MOV DX,OFFSET MORMSG ;Point to the message 29 | CALL PRINT ;And print it 30 | MOV AX,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT 31 | ;Flush buffer and wait for keystroke 32 | INT 21H ;Input character now a Y or N 33 | AND AL,0DFH ;So lower case works too 34 | CMP AL,"Y" 35 | JZ WAIT20 36 | CMP AL,"N" 37 | JZ WAIT10 38 | CALL CRLF 39 | JMP SHORT WAITYN 40 | WAIT10: STC 41 | WAIT20: RET 42 | 43 | 44 | ;********************************************* 45 | ; Make a status report including the following information: 46 | ; Total disk capacity 47 | ; Total system area used 48 | ; Total bad space allocated 49 | ; Total data space available 50 | ;NOTE: 51 | ; The DISP32BITS routine prints the number in DI:SI followed 52 | ; by the message pointed to by BX. If it is desired to print 53 | ; a message before the number, point at the message with DX 54 | ; and call PRINT. 55 | 56 | REPORT: 57 | MOV AX,WORD PTR FDSKSIZ 58 | MUL SECSIZ 59 | MOV CX,CLUSSIZ 60 | CALL UNSCALE 61 | MOV WORD PTR FDSKSIZ,AX 62 | MOV WORD PTR FDSKSIZ+2,DX 63 | MOV SI,AX 64 | MOV DI,DX 65 | MOV BX,OFFSET DSKSPC 66 | CALL DISP32BITS ;Report total disk space 67 | MOV SI,WORD PTR SYSSIZ 68 | MOV DI,WORD PTR SYSSIZ+2 69 | CMP SI,0 70 | JNZ SHOWSYS 71 | CMP DI,0 72 | JZ CHKBAD 73 | SHOWSYS: 74 | MOV BX,OFFSET SYSSPC 75 | CALL DISP32BITS ;Report space used by system 76 | CHKBAD: 77 | MOV SI,WORD PTR BADSIZ 78 | MOV DI,WORD PTR BADSIZ+2 79 | CMP SI,0 80 | JNZ SHOWBAD 81 | CMP DI,0 82 | JZ SHOWDATA 83 | SHOWBAD: 84 | MOV BX,OFFSET BADSPC 85 | CALL DISP32BITS ;Report space used by bad sectors 86 | SHOWDATA: 87 | MOV CX,WORD PTR FDSKSIZ 88 | MOV BX,WORD PTR FDSKSIZ+2 89 | SUB CX,WORD PTR BADSIZ 90 | SBB BX,WORD PTR BADSIZ+2 91 | SUB CX,WORD PTR SYSSIZ 92 | SBB BX,WORD PTR SYSSIZ+2 93 | MOV SI,CX 94 | MOV DI,BX 95 | MOV BX,OFFSET DATASPC 96 | CALL DISP32BITS ;Report space left for user 97 | RET 98 | 99 | 100 | BADVER DB "Incorrect DOS version",13,10,"$" 101 | SNGMSG DB "Insert new diskette for drive " 102 | SNGDRV DB "x:",13,10,"and strike any key when ready$" 103 | HRDMSG DB "Press any key to begin formatting " 104 | HRDDRV DB "x: $" 105 | SYSTRAN DB "System transferred",13,10,"$" 106 | MORMSG DB "Format another (Y/N)?$" 107 | CRLFMSG DB 13,10,"$" 108 | INVCHR DB "Invalid characters in volume label",13,10,"$" 109 | INVDRV DB "Invalid drive specification$" 110 | INVPAR DB "Invalid parameter$" 111 | TARGMSG DB "Re-insert diskette for drive " 112 | TARGDRV DB "x:",13,10,"and strike any key when ready$" 113 | SYSMSG DB "Insert DOS disk in drive " 114 | SYSDRV DB "x:",13,10,"and strike any key when ready$" 115 | FRMTERR DB "Format failure",13,10,13,10,"$" 116 | NOTSYS DB "Disk unsuitable for system disk",13,10,"$" 117 | NOUSE DB "Track 0 bad - disk unusable",13,10,"$" 118 | MEMEX DB "Insufficient memory for system transfer",13,10,"$" 119 | 120 | ;Report messages 121 | DSKSPC DB " bytes total disk space",13,10,"$" 122 | SYSSPC DB " bytes used by system",13,10,"$" 123 | BADSPC DB " bytes in bad sectors",13,10,"$" 124 | DATASPC DB " bytes available on disk",13,10,13,10,"$" 125 | 126 | IF IBMVER 127 | PUBLIC ASGERR 128 | ASGERR DB "Cannot format an ASSIGNed drive. $" 129 | ENDIF 130 | 131 | LABPRMT DB "Volume label (11 characters, ENTER for none)? $" 132 | 133 | 134 | CODE ENDS 135 | END 136 | 137 | 138 |  -------------------------------------------------------------------------------- /v20source/TSPC.ASM: -------------------------------------------------------------------------------- 1 | TITLE COMMAND Transient Uninitialized DATA 2 | 3 | INCLUDE COMSW.ASM 4 | .xlist 5 | .xcref 6 | INCLUDE DOSSYM.ASM 7 | INCLUDE COMEQU.ASM 8 | INCLUDE COMSEG.ASM 9 | .list 10 | .cref 11 | 12 | ; Uninitialized transient data 13 | TRANSPACE SEGMENT PUBLIC BYTE 14 | 15 | PUBLIC UCOMBUF,COMBUF,USERDIR1,EXECPATH,HEADCALL,RESSEG,TPA,SWITCHAR 16 | PUBLIC DIRCHAR,EXEC_ADDR,RCH_ADDR,CHKDRV,RDEOF,IFNOTFLAG,FILTYP 17 | PUBLIC CURDRV,CONCAT,PARM1,ARGC,PARM2,COMSW,ARG1S,DESTSWITCH 18 | PUBLIC ARG2S,ALLSWITCH,ARGTS,CFLAG,DESTCLOSED,SPECDRV,BYTCNT 19 | PUBLIC NXTADD,FRSTSRCH,LINCNT,LINLEN,FILECNT,CHARBUF,DESTFCB2,IDLEN 20 | PUBLIC ID,COM,DEST,DESTNAME,DESTFCB,DESTDIR,GOTOLEN,PWDBUF,EXEFCB 21 | PUBLIC DIRBUF,SDIRBUF,BITS,PATHCNT,PATHPOS,PATHSW,FULLSCR 22 | PUBLIC DESTVARS,DESTISDIR,DESTSIZ,DESTTAIL,DESTINFO,DESTBUF 23 | PUBLIC DESTHAND,DESTISDEV,FIRSTDEST,MELCOPY,MELSTART,SRCVARS 24 | PUBLIC SRCISDIR,SRCSIZ,SRCTAIL,SRCINFO,SRCBUF,SRCHAND,SRCISDEV 25 | PUBLIC SCANBUF,SRCPT,INEXACT,APPEND,NOWRITE,BINARY,WRITTEN,TERMREAD 26 | PUBLIC ASCII,PLUS,CPDATE,CPTIME,BATHAND,STARTEL,ELCNT,ELPOS,SKPDEL 27 | PUBLIC SOURCE,STACK 28 | PUBLIC TRANSPACEEND 29 | PUBLIC INTERNATVARS 30 | 31 | IF IBM 32 | PUBLIC ROM_CALL,ROM_IP,ROM_CS 33 | ENDIF 34 | 35 | IF KANJI 36 | PUBLIC KPARSE 37 | ENDIF 38 | 39 | ORG 0 40 | ZERO = $ 41 | UCOMBUF DB COMBUFLEN+3 DUP(?) ; Raw console buffer 42 | COMBUF DB COMBUFLEN+3 DUP(?) ; Cooked console buffer 43 | USERDIR1 DB DIRSTRLEN+3 DUP(?) ; Storage for users current directory 44 | EXECPATH DB DIRSTRLEN+15 DUP(?) ; Path for external command 45 | 46 | ; Variables passed up from resident 47 | HEADCALL LABEL DWORD 48 | DW ? 49 | RESSEG DW ? 50 | TPA DW ? 51 | SWITCHAR DB ? 52 | DIRCHAR DB ? 53 | EXEC_ADDR DD ? 54 | RCH_ADDR DD ? 55 | 56 | CHKDRV DB ? 57 | RDEOF LABEL BYTE ; Misc flags 58 | IFNOTFLAG LABEL BYTE 59 | FILTYP DB ? 60 | CURDRV DB ? 61 | CONCAT LABEL BYTE 62 | PARM1 DB ? 63 | ARGC LABEL BYTE 64 | PARM2 DB ? 65 | COMSW DW ? ; Switches between command and 1st arg 66 | ARG1S DW ? ; Switches between 1st and 2nd arg 67 | DESTSWITCH LABEL WORD 68 | ARG2S DW ? ; Switches after 2nd arg 69 | ALLSWITCH LABEL WORD 70 | ARGTS DW ? ; ALL switches except for COMSW 71 | CFLAG DB ? 72 | DESTCLOSED LABEL BYTE 73 | SPECDRV DB ? 74 | BYTCNT DW ? ; Size of buffer between RES and TRANS 75 | NXTADD DW ? 76 | FRSTSRCH DB ? 77 | LINCNT DB ? 78 | LINLEN DB ? 79 | FILECNT DW ? 80 | CHARBUF DB 80 DUP (?) ;line byte character buffer for xenix write 81 | DESTFCB2 LABEL BYTE 82 | IDLEN DB ? 83 | ID DB 8 DUP(?) 84 | COM DB 3 DUP(?) 85 | DEST DB 37 DUP(?) 86 | DESTNAME DB 11 DUP(?) 87 | DESTFCB LABEL BYTE 88 | DESTDIR DB DIRSTRLEN DUP(?) ; Directory for PATH searches 89 | GOTOLEN LABEL WORD 90 | PWDBUF LABEL BYTE 91 | EXEFCB LABEL WORD 92 | DIRBUF DB DIRSTRLEN+3 DUP(?) 93 | SDIRBUF DB 12 DUP(?) 94 | BITS DW ? 95 | PATHCNT DW ? 96 | PATHPOS DW ? 97 | PATHSW DW ? 98 | FULLSCR DW ? 99 | 100 | IF IBM 101 | ROM_CALL DB ? ; flag for rom function 102 | ROM_IP DW ? 103 | ROM_CS DW ? 104 | ENDIF 105 | 106 | DESTVARS LABEL BYTE 107 | DESTISDIR DB ? 108 | DESTSIZ DB ? 109 | DESTTAIL DW ? 110 | DESTINFO DB ? 111 | DESTBUF DB DIRSTRLEN + 20 DUP (?) 112 | 113 | DESTHAND DW ? 114 | DESTISDEV DB ? 115 | FIRSTDEST DB ? 116 | MELCOPY DB ? 117 | MELSTART DW ? 118 | 119 | SRCVARS LABEL BYTE 120 | SRCISDIR DB ? 121 | SRCSIZ DB ? 122 | SRCTAIL DW ? 123 | SRCINFO DB ? 124 | SRCBUF DB DIRSTRLEN + 20 DUP (?) 125 | 126 | SRCHAND DW ? 127 | SRCISDEV DB ? 128 | 129 | SCANBUF DB DIRSTRLEN + 20 DUP (?) 130 | 131 | SRCPT DW ? 132 | INEXACT DB ? 133 | APPEND DB ? 134 | NOWRITE DB ? 135 | BINARY DB ? 136 | WRITTEN DB ? 137 | TERMREAD DB ? 138 | ASCII DB ? 139 | PLUS DB ? 140 | CPDATE DW ? 141 | CPTIME DW ? 142 | BATHAND DW ? ; Batch handle 143 | STARTEL DW ? 144 | ELCNT DB ? 145 | ELPOS DB ? 146 | SKPDEL DB ? 147 | SOURCE DB 11 DUP(?) 148 | 149 | IF KANJI 150 | KPARSE DB ? 151 | ENDIF 152 | 153 | INTERNATVARS internat_block <> 154 | DB (internat_block_max - ($ - INTERNATVARS)) DUP (?) 155 | 156 | 157 | DB 80H DUP(0) ; Init to 0 to make sure the linker is not fooled 158 | STACK LABEL WORD 159 | 160 | TRANSPACEEND LABEL BYTE 161 | 162 | TRANSPACE ENDS 163 | END 164 | -------------------------------------------------------------------------------- /v20source/DOSMAC_v211.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Macro file for MSDOS. 3 | ; 4 | 5 | SUBTTL BREAK a listing into pages and give new subtitles 6 | PAGE 7 | BREAK MACRO subtitle 8 | SUBTTL subtitle 9 | PAGE 10 | ENDM 11 | 12 | BREAK 13 | 14 | ; 15 | ; declare a variable external and allocate a size 16 | ; 17 | I_NEED MACRO sym,len 18 | DATA SEGMENT BYTE PUBLIC 'DATA' 19 | IFIDN , 20 | EXTRN &sym:WORD 21 | ELSE 22 | IFIDN , 23 | EXTRN &sym:DWORD 24 | ELSE 25 | EXTRN &sym:BYTE 26 | ENDIF 27 | ENDIF 28 | DATA ENDS 29 | ENDM 30 | 31 | ; 32 | ; call a procedure that may be external. The call will be short. 33 | ; 34 | invoke MACRO name 35 | .xcref 36 | IF2 37 | IFNDEF name 38 | EXTRN name:NEAR 39 | ENDIF 40 | ENDIF 41 | .cref 42 | CALL name 43 | ENDM 44 | 45 | PAGE 46 | ; 47 | ; jump to a label that may be external. The jump will be near. 48 | ; 49 | transfer MACRO name 50 | .xcref 51 | IF2 52 | IFNDEF name 53 | EXTRN name:NEAR 54 | ENDIF 55 | ENDIF 56 | .cref 57 | JUMP name 58 | ENDM 59 | 60 | ; 61 | ; get a short address in a word 62 | ; 63 | short_addr MACRO name 64 | IFDIF , 65 | .xcref 66 | IF2 67 | IFNDEF name 68 | EXTRN name:NEAR 69 | ENDIF 70 | ENDIF 71 | .cref 72 | DW OFFSET DOSGROUP:name 73 | ELSE 74 | DW ? 75 | ENDIF 76 | ENDM 77 | 78 | ; 79 | ; get a long address in a dword 80 | ; 81 | long_addr MACRO name 82 | .xcref 83 | IF2 84 | IFNDEF name 85 | EXTRN name:NEAR 86 | ENDIF 87 | .cref 88 | DD name 89 | ENDM 90 | 91 | ; 92 | ; declare a PROC near or far but PUBLIC nonetheless 93 | ; 94 | procedure MACRO name,distance 95 | PUBLIC name 96 | name PROC distance 97 | ENDM 98 | 99 | PAGE 100 | ; 101 | ; define a data item to be public and of an appropriate size/type 102 | ; 103 | I_AM MACRO name,size 104 | PUBLIC name 105 | 106 | IFIDN , 107 | name DW ? 108 | ELSE 109 | IFIDN , 110 | name DD ? 111 | ELSE 112 | IFIDN , 113 | name DB ? 114 | ELSE 115 | name DB size DUP (?) 116 | ENDIF 117 | ENDIF 118 | ENDIF 119 | ENDM 120 | 121 | PAGE 122 | ; 123 | ; call the macro chain 124 | ; 125 | do_ext macro 126 | endm 127 | 128 | PAGE 129 | 130 | ; 131 | ; define an entry in a procedure 132 | ; 133 | entry macro name 134 | PUBLIC name 135 | name: 136 | endm 137 | 138 | BREAK 139 | 140 | error macro code 141 | local a 142 | .xcref 143 | MOV AL,code 144 | transfer SYS_RET_ERR 145 | .cref 146 | ENDM 147 | 148 | BREAK 149 | ; 150 | ; given a label either 2 byte jump to another label _J 151 | ; if it is near enough or 3 byte jump to 152 | ; 153 | 154 | jump macro lbl 155 | local a 156 | .xcref 157 | a: 158 | ifndef lbl&_J ;; is this the first invocation 159 | JMP lbl 160 | ELSE 161 | IF lbl&_J GE $ 162 | JMP lbl 163 | ELSE 164 | IF ($-lbl&_J) GT 126 ;; is the jump too far away? 165 | JMP lbl 166 | ELSE ;; do the short one... 167 | JMP lbl&_J 168 | ENDIF 169 | ENDIF 170 | ENDIF 171 | lbl&_j = a 172 | .cref 173 | endm 174 | 175 | BREAK 176 | 177 | return macro 178 | local a 179 | .xcref 180 | a: 181 | RET 182 | ret_l = a 183 | .cref 184 | endm 185 | 186 | BREAK 187 | 188 | makelab macro l,cc,ncc 189 | local a 190 | j&ncc a ;; j a: 191 | return ;; return 192 | a: ;; a: 193 | ret_&cc = ret_l ;; define ret_ to be ret_l 194 | endm 195 | 196 | condret macro cc,ncc 197 | local a,b 198 | ifdef ret_l ;; if ret_l is defined 199 | if (($ - ret_l) le 126) and ($ gt ret_l) 200 | ;; if ret_l is near enough then 201 | a: j&cc ret_l ;; a: j to ret_l 202 | ret_&cc = a ;; define ret_ to be a: 203 | else 204 | makelab a,cc,ncc 205 | endif 206 | else 207 | ifdef ret_&cc ;; if ret_ defined 208 | if (($ - ret_&cc) le 126) and ($ gt ret_&cc) 209 | ;; if ret_ is near enough 210 | a: j&cc ret_&cc ;; a: j to ret_ 211 | ret_&cc = a ;; define ret_ to be a: 212 | else 213 | makelab a,cc,ncc 214 | endif 215 | else 216 | makelab a,cc,ncc 217 | endif 218 | endif 219 | endm 220 | ;condret macro cc,ncc 221 | ; local a,b 222 | ; ifdef ret_l ; if ret_l is defined 223 | ; if (($ - ret_l) le 126) and ($ gt ret_l) 224 | ; ; if ret_l is near enough then 225 | ; a: j&cc ret_l ; a: j to ret_l 226 | ; ret_&cc = a ; define ret_ to be a: 227 | ; exitm 228 | ; endif 229 | ; endif 230 | ; ifdef ret_&cc ; if ret_ defined 231 | ; if (($ - ret_&cc) le 126) and ($ gt ret_&cc) 232 | ; ; if ret_ is near enough 233 | ; a: j&cc ret_&cc ; a: j to ret_ 234 | ; ret_&cc = a ; define ret_ to be a: 235 | ; exitm 236 | ; endif 237 | ; endif 238 | ; j&ncc a ; j a: 239 | ; return ; return 240 | ; a: ; a: 241 | ; ret_&cc = ret_l ; define ret_ to be ret_l 242 | ;endm 243 | ; 244 | BREAK 245 | 246 | retz macro 247 | condret z,nz 248 | endm 249 | 250 | BREAK 251 | 252 | retnz macro 253 | condret nz,z 254 | endm 255 | 256 | BREAK 257 | 258 | retc macro 259 | condret c,nc 260 | endm 261 | 262 | BREAK 263 | 264 | retnc macro 265 | condret nc,c 266 | endm 267 | 268 | BREAK 269 | 270 | context macro r 271 | PUSH SS 272 | POP r 273 | ASSUME r:DOSGROUP 274 | endm 275 | -------------------------------------------------------------------------------- /v20source/DEBMES.ASM: -------------------------------------------------------------------------------- 1 | TITLE DEBUGger Messages 2 | FALSE EQU 0 3 | TRUE EQU NOT FALSE 4 | 5 | SYSVER EQU FALSE ;if true, i/o direct to bios 6 | ; so DOS can be debugged 7 | IBMJAPVER EQU FALSE ; true for their special parity stuff 8 | 9 | .xlist 10 | .xcref 11 | INCLUDE DOSSYM.ASM 12 | .cref 13 | .list 14 | 15 | FIRSTDRV EQU "A" 16 | 17 | CODE SEGMENT PUBLIC BYTE 'CODE' 18 | CODE ENDS 19 | 20 | CONST SEGMENT PUBLIC BYTE 21 | CONST ENDS 22 | 23 | DATA SEGMENT PUBLIC BYTE 24 | EXTRN ParityFlag:BYTE 25 | DATA ENDS 26 | 27 | DG GROUP CODE,CONST,DATA 28 | 29 | 30 | CODE SEGMENT PUBLIC BYTE 'CODE' 31 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG 32 | 33 | EXTRN RPRBUF:NEAR,RESTART:NEAR 34 | PUBLIC DRVERR, TrapParity, ReleaseParity, NMIInt, NMIIntEnd 35 | TrapParity: 36 | IF IBMJAPVER 37 | PUSH BX 38 | PUSH ES 39 | PUSH DX ; save location of new offset 40 | MOV DX,OFFSET DG:NMIInt ; DS:DX has new interrupt vector 41 | CALL SwapInt ; diddle interrupts 42 | ASSUME ES:NOTHING 43 | MOV WORD PTR [NMIPtr],BX ; save old offset 44 | MOV WORD PTR [NMIPtr+2],ES ; save old segment 45 | POP DX ; get old regs back 46 | POP ES ; restore old values 47 | ASSUME ES:DG 48 | POP BX 49 | MOV BYTE PTR [ParityFlag],0 ; no interrupts detected yet! 50 | RET 51 | SwapInt: 52 | PUSH AX 53 | MOV AX,(Get_interrupt_vector SHL 8) + 2 54 | INT 21h ; get old nmi vector 55 | MOV AX,(Set_Interrupt_Vector SHL 8) + 2 56 | INT 21h ; let OS set new vector 57 | POP AX 58 | ENDIF 59 | RET 60 | ReleaseParity: 61 | IF IBMJAPVER 62 | PUSH DX 63 | PUSH DS 64 | PUSH BX 65 | PUSH ES 66 | LDS DX,DWORD PTR [NMIPtr] ; get old vector 67 | CALL SwapInt ; diddle back to original 68 | POP ES 69 | POP BX 70 | POP DS 71 | POP DX 72 | MOV [ParityFlag],0 ; no interrupts possible! 73 | ENDIF 74 | RET 75 | 76 | NMIInt: 77 | IF IBMJAPVER 78 | PUSH AX ; save AX 79 | IN AL,0A0h ; get status register 80 | OR AL,1 ; was there parity check? 81 | POP AX ; get old AX back 82 | JZ NMIChain ; no, go chain interrupt 83 | OUT 0A2h,AL ; reset NMI detector 84 | MOV CS:[ParityFlag],1 ; signal detection 85 | IRET 86 | NMIChain: 87 | JMP DWORD PTR CS:[NMIPtr] ; chain the vectors 88 | NMIPtr DD ? ; where old NMI gets stashed 89 | ENDIF 90 | NMIIntEnd: 91 | 92 | DRVERR: MOV DX,OFFSET DG:DISK 93 | OR AL,AL 94 | JNZ SAVDRV 95 | MOV DX,OFFSET DG:WRTPRO 96 | SAVDRV: 97 | PUSH CS 98 | POP DS 99 | PUSH CS 100 | POP ES 101 | ADD BYTE PTR DRVLET,FIRSTDRV 102 | MOV SI,OFFSET DG:READM 103 | MOV DI,OFFSET DG:ERRTYP 104 | CMP BYTE PTR RDFLG,WRITE 105 | JNZ MOVMES 106 | MOV SI,OFFSET DG:WRITM 107 | MOVMES: 108 | MOVSW 109 | MOVSW 110 | CALL RPRBUF 111 | MOV DX,OFFSET DG:DSKERR 112 | JMP RESTART 113 | CODEEND: 114 | 115 | CODE ENDS 116 | 117 | 118 | CONST SEGMENT PUBLIC BYTE 119 | 120 | PUBLIC BADVER,ENDMES,CARRET,NAMBAD,NOTFND,NOROOM 121 | PUBLIC NOSPACE,DRVLET 122 | PUBLIC ACCMES 123 | PUBLIC TOOBIG,SYNERR,ERRMES,BACMES 124 | PUBLIC EXEBAD,HEXERR,EXEWRT,HEXWRT,WRTMES1,WRTMES2 125 | PUBLIC EXECEMES, ParityMes 126 | EXTRN RDFLG:BYTE 127 | 128 | IF SYSVER 129 | PUBLIC BADDEV,BADLSTMES 130 | BADDEV DB "Bad device name",13,10,"$" 131 | BADLSTMES DB "Couldn't open list device PRN",13,10 132 | DB "Enter name of list device? $" 133 | ENDIF 134 | 135 | BADVER DB "Incorrect DOS version",13,10,"$" 136 | ENDMES DB 13,10,"Program terminated normally" 137 | CARRET DB 13,10,"$" 138 | NAMBAD DB "Invalid drive specification",13,10,"$" 139 | NOTFND DB "File not found",13,10,"$" 140 | NOROOM DB "File creation error",13,10,"$" 141 | NOSPACE DB "Insufficient space on disk",13,10,"$" 142 | 143 | 144 | DISK DB "Disk$" 145 | WRTPRO DB "Write protect$" 146 | DSKERR DB " error " 147 | ERRTYP DB "reading drive " 148 | DRVLET DB "A",13,10,"$" 149 | READM DB "read" 150 | WRITM DB "writ" 151 | 152 | 153 | TOOBIG DB "Insufficient memory",13,10,"$" 154 | SYNERR DB '^' 155 | ERRMES DB " Error",13,10+80H 156 | BACMES DB 32,8+80H 157 | EXEBAD LABEL BYTE 158 | HEXERR DB "Error in EXE or HEX file",13,10,"$" 159 | EXEWRT LABEL BYTE 160 | HEXWRT DB "EXE and HEX files cannot be written",13,10,"$" 161 | WRTMES1 DB "Writing $" 162 | WRTMES2 DB " bytes",13,10,"$" 163 | EXECEMES DB "EXEC failure",13,10,"$" 164 | ACCMES DB "Access denied",13,10,"$" 165 | ParityMes DB "Parity error or nonexistant memory error detected",13,10,"$" 166 | 167 | CONSTEND: 168 | 169 | CONST ENDS 170 | END 171 | -------------------------------------------------------------------------------- /v20source/RECMES.ASM: -------------------------------------------------------------------------------- 1 | TITLE RECOVER Messages 2 | FALSE EQU 0 3 | TRUE EQU NOT FALSE 4 | 5 | 6 | bdos equ 21h 7 | boot equ 20h 8 | aread equ 25h 9 | awrite equ 26h 10 | 11 | 12 | .xlist 13 | .xcref 14 | INCLUDE DOSSYM.ASM 15 | ;The DOST: prefix is a DEC TOPS/20 directory prefix. Remove it for 16 | ; assembly in MS-DOS assembly environments using MASM. The DOSSYM.ASM 17 | ; file must exist though, it is included with OEM distribution. 18 | .cref 19 | .list 20 | 21 | code segment public 22 | code ends 23 | 24 | const segment public byte 25 | const ends 26 | 27 | data segment public byte 28 | EXTRN filsiz:WORD 29 | data ends 30 | 31 | 32 | dg group code,const,data 33 | 34 | cr equ 0dh 35 | lf equ 0ah 36 | 37 | code segment public byte 38 | assume cs:dg,ds:dg,es:dg,ss:dg 39 | 40 | EXTRN PCRLF:NEAR,PRINT:NEAR,INT_23:NEAR,CONVERT:NEAR 41 | PUBLIC dskwrt,dskrd,DSKERR,report 42 | 43 | hecode db 0 44 | 45 | dskwrt: push ax 46 | push bx 47 | push cx 48 | push dx 49 | int awrite 50 | mov [hecode],al 51 | inc sp 52 | inc sp ;clean up stack 53 | pop dx 54 | pop cx 55 | pop bx 56 | pop ax 57 | jnc pret 58 | mov si,offset dg: writing 59 | call dskerr 60 | jz dskwrt 61 | clc 62 | pret: ret 63 | 64 | dskrd: push ax 65 | push bx 66 | push cx 67 | push dx 68 | int aread 69 | mov [hecode],al 70 | inc sp 71 | inc sp ;clean up stack 72 | pop dx 73 | pop cx 74 | pop bx 75 | pop ax 76 | jnc pret 77 | mov si,offset dg: reading 78 | call dskerr 79 | jz dskrd 80 | clc 81 | ret 82 | 83 | DSKERR: 84 | PUSH AX 85 | PUSH BX 86 | PUSH CX 87 | PUSH DX 88 | PUSH DI 89 | PUSH ES 90 | CALL PCRLF 91 | MOV AL,[HECODE] 92 | CMP AL,12 93 | JBE HAVCOD 94 | MOV AL,12 95 | HAVCOD: 96 | XOR AH,AH 97 | MOV DI,AX 98 | SHL DI,1 99 | MOV DX,WORD PTR [DI+MESBAS] ; Get pointer to error message 100 | CALL PRINT ; Print error type 101 | MOV DX,OFFSET DG:ERRMES 102 | CALL PRINT 103 | MOV DX,SI 104 | CALL PRINT 105 | MOV DX,OFFSET DG:DRVMES 106 | CALL PRINT 107 | ASK: 108 | MOV DX,OFFSET DG:REQUEST 109 | CALL PRINT 110 | MOV AX,(STD_CON_INPUT_FLUSH SHL 8)+STD_CON_INPUT 111 | INT 21H ; Get response 112 | PUSH AX 113 | CALL PCRLF 114 | POP AX 115 | OR AL,20H ; Convert to lower case 116 | CMP AL,"i" ; Ignore? 117 | JZ EEXITNZ 118 | CMP AL,"r" ; Retry? 119 | JZ EEXIT 120 | CMP AL,"a" ; Abort? 121 | JNZ ASK 122 | JMP INT_23 123 | 124 | EEXITNZ: 125 | OR AL,AL ; Resets zero flag 126 | EEXIT: 127 | POP ES 128 | POP DI 129 | POP DX 130 | POP CX 131 | POP BX 132 | POP AX 133 | RET 134 | 135 | ;****************************************** 136 | ; Prints the XXX of YYY bytes recovered message. 137 | ; The XXX value is a dword at di+16 on entry. 138 | ; The YYY value is a dword (declared as a word) at filsiz. 139 | ; Note: 140 | ; If it is desired to print a message before the first number, 141 | ; point at the message with DX and call PRINT. 142 | 143 | report: 144 | mov si,[di+16] ;Get the XXX value 145 | mov di,[di+18] 146 | mov bx,offset dg: ofmsg 147 | call convert ;Print "XXX of " (DI:SI followed by message 148 | ; pointed to by BX) 149 | mov si,filsiz ;Get the YYY value 150 | mov di,filsiz+2 151 | mov bx,offset dg: endmsg 152 | call convert ;Print "YYY bytes recovered CR LF" 153 | ret 154 | 155 | code ends 156 | 157 | const segment public byte 158 | 159 | PUBLIC BADVER,askmsg,drvlet,DRVLET1,dirmsg,recmsg_pre 160 | PUBLIC crlf,drverr,baddrv,opnerr,recmsg_post 161 | 162 | MESBAS DW OFFSET DG:ERR0 163 | DW OFFSET DG:ERR1 164 | DW OFFSET DG:ERR2 165 | DW OFFSET DG:ERR3 166 | DW OFFSET DG:ERR4 167 | DW OFFSET DG:ERR5 168 | DW OFFSET DG:ERR6 169 | DW OFFSET DG:ERR7 170 | DW OFFSET DG:ERR8 171 | DW OFFSET DG:ERR9 172 | DW OFFSET DG:ERR10 173 | DW OFFSET DG:ERR11 174 | DW OFFSET DG:ERR12 175 | 176 | READING DB "read$" 177 | WRITING DB "writ$" 178 | ERRMES DB " error $" 179 | DRVMES DB "ing drive " 180 | DRVLET1 DB "A",13,10,"$" 181 | REQUEST DB "Abort, Retry, Ignore? $" 182 | 183 | ERR0 DB "Write protect$" 184 | ERR1 DB "Bad unit$" 185 | ERR2 DB "Not ready$" 186 | ERR3 DB "Bad command$" 187 | ERR4 DB "Data$" 188 | ERR5 DB "Bad call format$" 189 | ERR6 DB "Seek$" 190 | ERR7 DB "Non-DOS disk$" 191 | ERR8 DB "Sector not found$" 192 | ERR9 DB "No paper$" 193 | ERR10 DB "Write fault$" 194 | ERR11 DB "Read fault$" 195 | ERR12 DB "Disk$" 196 | 197 | ;-----------------------------------------------------------------------; 198 | 199 | BADVER DB "Incorrect DOS version" 200 | crlf db cr,lf,'$' 201 | askmsg db cr,lf,'Press any key to begin recovery of the' 202 | db cr,lf,'file(s) on drive ' 203 | drvlet db 'A: ',cr,lf,cr,lf,'$' 204 | dirmsg db cr,lf,'Warning - directory full',cr,lf,'$' 205 | 206 | ;"recmsg_prerecmsg_post" 207 | recmsg_post db ' file(s) recovered',cr,lf 208 | recmsg_pre db '$' 209 | 210 | ofmsg db ' of $' 211 | endmsg db ' bytes recovered',13,10,"$" 212 | 213 | drverr db 'Invalid number of parameters$' 214 | baddrv db 'Invalid drive or file name$' 215 | opnerr db 'File not found$' 216 | 217 | 218 | const ends 219 | end 220 | -------------------------------------------------------------------------------- /v20object/FILBP.PAS: -------------------------------------------------------------------------------- 1 | {$title: 'Command Line Filename Parser' $linesize:79} 2 | MODULE parse; {$debug- $stackck+} 3 | { command line filename parsing; Bob Wallace Microsoft 7/81 } 4 | CONST maxfile = 32; {NOTE: must be set same as caller} 5 | 6 | 7 | dfprf = 'PRF'; 8 | msprf = 'Profile filename ['; 9 | dfhst = 'HST'; 10 | mshst = 'Histogram filename ['; 11 | dfmap = 'MAP'; 12 | msmap = 'Map file ['; 13 | nuln = 'NUL '; 14 | 15 | TYPE 16 | filenam = lstring (maxfile); {filename parameter type} 17 | setsw = ARRAY [wrd(0)..3] OF byte; {switches parameter type} 18 | sets = set of 0..31; {caller's parameter type} 19 | setc = set of chr(0)..chr(127); {set of characters} 20 | cpmex = string (3); cpmnm = string (8); 21 | cpmfn = RECORD 22 | cfd [0]: string (2); 23 | cfn [2]: cpmnm; cfp [10]: char; cfe [11]: cpmex; 24 | END; 25 | setbitt = ARRAY [wrd(0)..7] OF byte; 26 | CONST setbit = setbitt (128, 64, 32, 16, 8, 4, 2, 1); 27 | 28 | VAR idset:setc; VALUE idset:=setc ['A'..'Z','a'..'z','0'..'9', 29 | '$', '&', '#', '@', '!', '%', '-', '_', '`', '''', 30 | '(', ')', '<', '>', '{', '}', '\', '^', '~', '|']; 31 | VAR drset:setc; VALUE drset:=setc ['A'..'O','a'..'o']; 32 | 33 | PROCEDURE fillc (dst: adrmem; len: word; chc: char); extern; 34 | PROCEDURE movel (prf: adrmem; dst: adrmem; len: word); extern; 35 | PROCEDURE ptyuqq (len: word; prf: adsmem); extern; 36 | PROCEDURE plyuqq; extern; 37 | FUNCTION gtyuqq (len: word; dst: adsmem): word; extern; 38 | 39 | PROCEDURE filbm 40 | (VAR prffil,hstfil,mapfil: filenam; VAR oldsw: setsw); 41 | (* sets the filenames for source, hstect, listing, and second 42 | listing (hstect list or cross ref); also sets any switches, 43 | allowing those in the oldsw set and returning them in oldsw *) 44 | VAR prf, hst, map: cpmfn; {target filenames in CPM format} 45 | newsw: setsw; {new switches, return in oldsw} 46 | qq: lstring (128); iq: word; {command line, current index} 47 | pqq: ads of lstring (128); {address CPM-type command line} 48 | cesxqq [extern]: word; {segment val} 49 | c: char; l: word; iscomma: boolean; i: word; {other stuff} 50 | 51 | FUNCTION parchr (ch: char): boolean; {true iff CH found} 52 | BEGIN 53 | parchr := (iq <= qq.len) AND (qq [iq] = ch); 54 | IF result (parchr) THEN iq := iq+1; 55 | END; 56 | 57 | FUNCTION upperc: char; {return current char, in upper case} 58 | BEGIN 59 | upperc := qq[iq]; 60 | IF result (upperc) >= 'a' 61 | THEN upperc := chr (ord (result (upperc)) - 32); 62 | END; 63 | 64 | PROCEDURE blanks; {skip blanks and set any switches} 65 | BEGIN 66 | WHILE parchr (' ') DO {nothing}; 67 | IF parchr ('/') THEN 68 | BEGIN 69 | IF (iq <= qq.len) 70 | AND THEN (ord (upperc) - 64) IN retype (sets, oldsw) 71 | THEN 72 | BEGIN 73 | i := wrd (upperc) - 64; iq := iq + 1; 74 | newsw[i DIV 8] := newsw[i DIV 8] OR setbit[i MOD 8]; 75 | blanks; {recurse for more} 76 | END 77 | ELSE iq := iq - 1; {put "/" back on line to get error} 78 | END; 79 | END; 80 | 81 | FUNCTION parset (VAR dst: string; CONST chs: setc): boolean; 82 | (* Move characters from qq to DST as long as they are in CHS 83 | Deletes from qq, blanks DST, returns true if any moved *) 84 | VAR i: word; 85 | BEGIN 86 | fillc (adr dst, wrd (upper (dst)), ' '); parset := false; 87 | FOR i := 1 TO wrd (upper (dst)) DO 88 | IF (iq > qq.len) OR ELSE NOT (qq [iq] IN chs) 89 | THEN BREAK 90 | ELSE 91 | BEGIN 92 | dst [i] := upperc; parset := true; iq := iq + 1; 93 | END; 94 | END; 95 | 96 | FUNCTION filenm (CONST prompt: string; VAR nam: filenam; 97 | VAR fcb: cpmfn; defext: cpmex): boolean; 98 | (* Get a filename into the FCB, setting defaults as 99 | appropriate; return true iff a filename found *) 100 | VAR i: word; p: adrmem; defile: cpmnm; 101 | BEGIN 102 | blanks; 103 | IF iscomma THEN defile := prf.cfn ELSE defile := nuln; 104 | IF iq > qq.len THEN 105 | BEGIN 106 | ptyuqq (wrd (upper (prompt)), ads prompt); 107 | FOR i := 1 TO 8 DO 108 | IF defile [i] <> ' ' THEN ptyuqq (1, ads defile [i]); 109 | ptyuqq (1, ads '.'); ptyuqq (3, ads defext); 110 | ptyuqq (3, ads ']: '); 111 | qq.len := gtyuqq (upper (qq), ads qq [1]); iq := 1; 112 | END; 113 | fcb.cfp := '.'; 114 | IF (iq < qq.len) AND (qq [iq+1] = ':') 115 | AND THEN parset (c, drset) 116 | THEN 117 | BEGIN 118 | fcb.cfd[1] := c; fcb.cfd[2] := ':'; iq := iq+1; 119 | defile := prf.cfn; {default to source name now} 120 | END 121 | ELSE fcb.cfd := ' '; 122 | filenm := parset (fcb.cfn, idset); 123 | IF parchr (':') 124 | THEN BEGIN fcb.cfe := ': '; fcb.cfp := ' '; END 125 | ELSE 126 | IF parchr ('.') 127 | THEN [eval (parset (fcb.cfe, idset)); defile := prf.cfn] 128 | ELSE fcb.cfe := defext; 129 | IF NOT result (filenm) THEN fcb.cfn := defile; 130 | blanks; 131 | nam.len := 0; p := adr fcb; 132 | FOR i := 0 TO 13 DO IF p^[i] <> wrd (' ') 133 | THEN [nam.len := nam.len+1; nam[nam.len] := chr (p^[i])]; 134 | END; 135 | 136 | FUNCTION conso (CONST fn: cpmnm): boolean; 137 | BEGIN 138 | conso := (fn = 'CON ') OR (fn = 'USER '); 139 | END; 140 | 141 | 142 | BEGIN 143 | newsw := setsw (do 4 of 0); 144 | pqq.r := 128; pqq.s := cesxqq; 145 | FOR i := 0 TO pqq^.len+1 DO qq[i] := pqq^[i]; iq := 1; 146 | REPEAT 147 | iscomma := true; prf.cfn := ' '; 148 | IF filenm (msprf, prffil, prf, dfprf) 149 | THEN 150 | BEGIN 151 | eval (parchr (',')); 152 | eval (filenm (mshst, hstfil, hst, dfhst)); 153 | iscomma := parchr (','); 154 | eval (filenm (msmap, mapfil, map, 'map')); 155 | blanks; eval (parchr (';')); blanks; 156 | IF hst.cfn <> nuln THEN newsw[3] := newsw[3] OR 8; 157 | IF map.cfn <> nuln THEN newsw[3] := newsw[3] OR 04; 158 | IF conso (map.cfn) THEN newsw[3] := newsw[3] OR 01; 159 | IF iq > qq.len THEN [oldsw := newsw; return]; 160 | END; 161 | ptyuqq (15, ads 'Line invalid: '''); i := qq.len - iq + 1; 162 | IF i > 0 THEN ptyuqq (i, ads qq [iq]); 163 | ptyuqq (15, ads ''', start again.'); plyuqq; iq := 256; 164 | UNTIL FALSE; 165 | END; 166 | END. 167 | -------------------------------------------------------------------------------- /v20source/RDATA.ASM: -------------------------------------------------------------------------------- 1 | TITLE COMMAND Resident DATA 2 | 3 | INCLUDE COMSW.ASM 4 | .xlist 5 | .xcref 6 | INCLUDE COMSEG.ASM 7 | .list 8 | .cref 9 | 10 | INCLUDE IFEQU.ASM 11 | 12 | CODERES SEGMENT PUBLIC 13 | EXTRN THEADFIX:NEAR,EXT_EXEC:NEAR,TREMCHECK:NEAR 14 | CODERES ENDS 15 | 16 | TRANCODE SEGMENT PUBLIC 17 | EXTRN COMMAND:NEAR 18 | TRANCODE ENDS 19 | 20 | ZEXEC_CODE SEGMENT PUBLIC 21 | IF IBMVER 22 | EXTRN $EXEC:NEAR 23 | ENDIF 24 | ZEXEC_CODE ENDS 25 | 26 | 27 | ; Data for resident portion 28 | 29 | DATARES SEGMENT PUBLIC BYTE 30 | 31 | PUBLIC MESBAS,MESADD,MREAD,MWRITE,ERRMES,IOTYP,DRVNUM,DRVLET,NEWLIN 32 | PUBLIC DEVEMES,DEVENAM,REQUEST,CDEVAT,BADFAT,COMBAD,NEEDCOM,DRVMSG 33 | PUBLIC COMLET,DEFMSG,PROMPT,ENDBATMES,EXECEMES,EXEBAD,TOOBIG,NOCOM 34 | PUBLIC NOHANDMES,BMEMMES,HALTMES,FRETMES,RBADNAM,INT_2E_RET,SAVE_PDB 35 | PUBLIC PARENT,ERRCD_24,HANDLE01,LOADING,BATCH,BATLOC,COMSPEC,TRANS 36 | PUBLIC TRNSEG,COMDRV,BATBYT,MEMSIZ,SUM,EXTCOM,RETCODE,ECHOFLAG 37 | PUBLIC IO_SAVE,RESTDIR,PERMCOM,SINGLECOM,VERVAL,FORFLAG,UFORDRV 38 | PUBLIC FORSET,FORCOM,FORVAR,FORPTR,FORUFCB,FORFCB,RE_INSTR,RE_OUT_APP 39 | PUBLIC RE_OUTSTR,PIPEFLAG,PIPEFILES,PIPEPTR,PIPESTR,PIPE1,PIPE2 40 | PUBLIC INPIPEPTR,OUTPIPEPTR,EXEC_BLOCK,ENVIRSEG,COM_PTR,COM_FCB1 41 | PUBLIC COM_FCB2,PARMBUF,TRANVARS,MYSEG,LTPA,RSWITCHAR,RDIRCHAR 42 | PUBLIC MYSEG1,MYSEG2 43 | PUBLIC DATARESEND 44 | 45 | IF IBMVER 46 | PUBLIC SYS_CALL,ZEXEC,EXESEG,USER_SP,USER_SS,EXESUM 47 | ENDIF 48 | 49 | ORG 0 50 | ZERO = $ 51 | MESBAS DW OFFSET RESGROUP:ERR0 52 | DW OFFSET RESGROUP:ERR1 53 | DW OFFSET RESGROUP:ERR2 54 | DW OFFSET RESGROUP:ERR3 55 | DW OFFSET RESGROUP:ERR4 56 | DW OFFSET RESGROUP:ERR5 57 | DW OFFSET RESGROUP:ERR6 58 | DW OFFSET RESGROUP:ERR7 59 | DW OFFSET RESGROUP:ERR8 60 | DW OFFSET RESGROUP:ERR9 61 | DW OFFSET RESGROUP:ERR10 62 | DW OFFSET RESGROUP:ERR11 63 | DW OFFSET RESGROUP:ERR12 64 | 65 | MESADD DW OFFSET RESGROUP:NEWLIN ;"0" 66 | DW OFFSET RESGROUP:COM$1 ;"1" 67 | DW OFFSET RESGROUP:ERR3 ;"2" 68 | DW OFFSET RESGROUP:ALLOC$3 ;"3" 69 | DW OFFSET RESGROUP:FILE$4 ;"4" 70 | DW OFFSET RESGROUP:RROR$5 ;"5" 71 | DW OFFSET RESGROUP:CAN$6 ;"6" 72 | DW OFFSET RESGROUP:EMORY$7 ;"7" 73 | DW OFFSET RESGROUP:BAT$8 ;"8" 74 | DW OFFSET RESGROUP:INS$9 ;"9" 75 | 76 | ERR0 DB "Write protec","t"+80h 77 | ERR1 DB "Bad uni","t"+80h 78 | ERR2 DB "Not read","y"+80h 79 | ERR3 DB "Bad command"," "+80h 80 | ERR4 DB "Dat","a"+80h 81 | ERR5 DB "Bad call forma","t"+80h 82 | ERR6 DB "See","k"+80h 83 | ERR7 DB "Non-DOS dis","k"+80h 84 | ERR8 DB "Sector not foun","d"+80h 85 | ERR9 DB "No pape","r"+80h 86 | ERR10 DB "Write faul","t"+80h 87 | ERR11 DB "Read faul","t"+80h 88 | ERR12 DB "Dis","k"+80h 89 | MREAD DB "read" 90 | MWRITE DB "writ" 91 | ERRMES DB " e5" 92 | IOTYP DB "writin","g"+80h 93 | DRVNUM DB " drive " 94 | DRVLET DB "A" 95 | NEWLIN DB 13,10+80h 96 | DEVEMES DB " device " 97 | DEVENAM DB 8 DUP (?) 98 | DB 13,10,"$" ;Must be $ terminated 99 | COM$1 DB " COMMAN","D"+80h 100 | ALLOC$3 DB " allocation"," "+80h 101 | FILE$4 DB " file"," "+80h 102 | RROR$5 DB "rror"," "+80h 103 | CAN$6 DB "Cannot"," "+80h 104 | EMORY$7 DB "emor","y"+80h 105 | BAT$8 DB " batc","h"+80h 106 | INS$9 DB "Inser","t"+80h 107 | REQUEST DB "Abort, Retry, Ignore?"," "+80h 108 | CDEVAT DB ? 109 | BADFAT DB "0File3table bad",","+80h 110 | COMBAD DB "0Invalid1.COM" 111 | NEEDCOM DB "091.COM disk in"," "+80h 112 | DRVMSG DB "drive " 113 | COMLET DB "A"," "+80h 114 | DEFMSG DB "default driv","e"+80h 115 | PROMPT DB "0and strike any key when ready","0"+80h 116 | ENDBATMES DB "0Terminate8 job (Y/N)?"," "+80h 117 | EXECEMES DB "EXEC failure","0"+80h 118 | EXEBAD DB "E5in EXE4","0"+80h 119 | TOOBIG DB "Program too big to fit in m7","0"+80h 120 | NOCOM DB "0Bad or missing Command Interprete","r"+80H 121 | NOHANDMES DB "0No free4handle","s"+80h 122 | BMEMMES DB "0M73e","5"+80h 123 | HALTMES DB "06load1, system halte","d"+80h 124 | FRETMES DB "06start1, exiting","0"+80h 125 | RBADNAM DB "2or4name","0"+80h 126 | 127 | INT_2E_RET DD ? ; Magic command executer return address 128 | SAVE_PDB DW ? 129 | PARENT DW ? 130 | ERRCD_24 DW ? 131 | HANDLE01 DW ? 132 | LOADING DB 0 133 | BATCH DW 0 ; Assume no batch mode initially 134 | BATLOC DD 0 ; Position in batch file 135 | COMSPEC DB 40 DUP(0) 136 | TRANS DW OFFSET TRANGROUP:COMMAND 137 | TRNSEG DW ? 138 | COMDRV DB ? ; DRIVE SPEC TO LOAD AUTOEXEC AND COMMAND 139 | BATBYT DB ? 140 | MEMSIZ DW ? 141 | SUM DW ? 142 | EXTCOM DB 1 ; For init, pretend just did an external 143 | RETCODE DW ? 144 | ECHOFLAG DB 1 145 | IO_SAVE DW ? 146 | RESTDIR DB 0 147 | PERMCOM DB 0 148 | SINGLECOM DW 0 149 | VERVAL DW -1 150 | 151 | FORFLAG DB ? 152 | UFORDRV DB 0 153 | FORSET DB 40 DUP (?) 154 | FORCOM DB 90 DUP (?) 155 | FORVAR DB ? 156 | FORPTR DW ? 157 | FORUFCB DB -1 158 | FORFCB DB 0 159 | DB 34 DUP(?) 160 | DW 0 161 | DW 0 ; Initialize RR field to zero 162 | 163 | RE_INSTR DB 40 DUP(0) 164 | RE_OUT_APP DB 0 165 | RE_OUTSTR DB 40 DUP(0) 166 | 167 | ;These two bytes refed as a word 168 | PIPEFLAG DB 0 169 | PIPEFILES DB 0 170 | 171 | PIPEPTR DW ? 172 | PIPESTR DB 129 DUP(?) 173 | PIPE1 DB "_:/%PIPE1.$$$",0 174 | PIPE2 DB "_:/%PIPE2.$$$",0 175 | INPIPEPTR DW OFFSET RESGROUP:PIPE1 176 | OUTPIPEPTR DW OFFSET RESGROUP:PIPE2 177 | 178 | EXEC_BLOCK LABEL BYTE ; The data block for EXEC calls 179 | ENVIRSEG DW ? 180 | COM_PTR LABEL DWORD 181 | DW 80H ; Point at unformatted parameters 182 | DW ? 183 | COM_FCB1 LABEL DWORD 184 | DW 5CH 185 | DW ? 186 | COM_FCB2 LABEL DWORD 187 | DW 6CH 188 | DW ? 189 | 190 | PARMBUF DB 129 DUP (?) 191 | 192 | IF IBMVER 193 | SYS_CALL DD ? 194 | ZEXEC DW OFFSET ZEXEC_CODE:$EXEC 195 | EXESEG DW ? 196 | USER_SP DW ? 197 | USER_SS DW ? 198 | EXESUM DW ? 199 | ENDIF 200 | 201 | TRANVARS LABEL BYTE ; Variables passed to transient 202 | DW OFFSET RESGROUP:THEADFIX 203 | MYSEG DW 0 ; Put our own segment here 204 | LTPA DW 0 ; WILL STORE TPA SEGMENT HERE 205 | RSWITCHAR DB "-" 206 | RDIRCHAR DB "/" 207 | DW OFFSET RESGROUP:EXT_EXEC 208 | MYSEG1 DW ? 209 | DW OFFSET RESGROUP:TREMCHECK 210 | MYSEG2 DW 0 211 | 212 | DATARESEND LABEL BYTE 213 | 214 | DATARES ENDS 215 | END 216 | -------------------------------------------------------------------------------- /v20object/ANSI.DOC: -------------------------------------------------------------------------------- 1 | This document explains the how the ANSI escape sequences are 2 | defined for the IBM PC. 3 | 4 | Notes: 5 | 6 | 1. The default value is used when no explicit value is given 7 | or a value of zero is given. 8 | 9 | 2. Pn - Numeric parameter. A decimal number specified 10 | with ASCII digits. 11 | 12 | 3. Ps - Selective parameter. Any decimal number that is 13 | is used to select a subfunction. Multiple subfunctions 14 | may be selected by separating the parameters with 15 | semi-colons. 16 | 17 | C U R S O R F U N C T I O N S 18 | 19 | CUP - Cursor Postion 20 | 21 | ESC [ Pl ; Pc H 22 | 23 | HVP - Horizontal & Vertical Postion 24 | 25 | ESC [ Pl ; Pc f 26 | 27 | CUP and HVP move the cursor to the position specified by 28 | the parameters. The first parameter specifies the line number 29 | and the second parameter specifies the column number. The 30 | default value is one. When no parameters are given the cursor 31 | is moved to the home postion. 32 | 33 | CUU - Cursor Up 34 | 35 | ESC [ Pn A 36 | 37 | Moves the cursor up one line without changing columns. The 38 | value of Pn determines the number of lines moved. The default 39 | value for Pn is one. This sequence is ignored if the cursor 40 | is already on the top line. 41 | 42 | CUD - Cursor Down 43 | 44 | ESC [ Pn B 45 | 46 | Moves the cursor down one line without changing columns. 47 | The value of Pn determines the number of lines moved. The 48 | default value for Pn is one. This sequence is ignored if the 49 | cursor is already on the bottom line. 50 | 51 | CUF - Cursor Forward 52 | 53 | ESC [ Pn C 54 | 55 | Moves the cursor forword one column without changing lines. 56 | The value of Pn determines the number of columns moved. The 57 | default value for Pn is one. This sequence is ignored if the 58 | cursor is already in the rightmost column. 59 | 60 | ESC [ Pn D 61 | 62 | Moves the cursor back one column without changing lines. The 63 | value of Pn determines the number of columns moved. The default 64 | value for Pn is one. This sequence is ignored if the cursor 65 | is already in the leftmost column. 66 | 67 | DSR - Device Status Report 68 | 69 | ESC [ 6 n 70 | 71 | The console driver will output a CPR sequence on receipt of 72 | DSR. 73 | 74 | CPR - Cursor Position Report (from console driver to system) 75 | 76 | ESC [ Pn ; Pn R 77 | 78 | The CPR sequence reports current cursor position via 79 | standard input. The first parameter specifies the current 80 | line and the second parameter specifies the current column. 81 | 82 | SCP - Save Cursor Postion 83 | 84 | ESC [ s 85 | 86 | The current cursor position is saved. This cursor position 87 | can be restored with the RCP sequence. 88 | 89 | RCP - Restore cursor position 90 | 91 | ESC [ u 92 | 93 | Restores the cursor position to the value it had when the 94 | console driver received the SCP sequence. 95 | 96 | E R A S I N G 97 | 98 | ED - Erase Display 99 | 100 | ESC [ 2 J 101 | 102 | Erases all of the screen and the cursor goes to the home 103 | position. 104 | 105 | EL - Erase Line 106 | 107 | ESC [ K 108 | 109 | Erases from the cursor to the end of the line and includes 110 | the cursor position. 111 | 112 | 113 | 114 | M O D E S O F O P E R A T I O N 115 | 116 | SGR - Set Graphics Rendition 117 | 118 | ESC [ Ps ; ... ; Ps m 119 | 120 | Invokes the graphic rendition specified by the parameter(s). 121 | All following characters are rendered according to the 122 | parameter(s) until the next occurence of SGR. 123 | 124 | Parameter Parameter Function 125 | 126 | 0 All Attributes Off 127 | 1 Bold On 128 | 4 Underscore On (monochrome displays 129 | only) 130 | 5 Blink On 131 | 7 Reverse Video On 132 | 8 Concealed On (ISO 6429 standard) 133 | 30 Black foreground (ISO 6429 standard) 134 | 31 Red foreground (ISO 6429 standard) 135 | 32 Green foreground (ISO 6429 standard) 136 | 33 Yellow foreground (ISO 6429 standard) 137 | 34 Blue foreground (ISO 6429 standard) 138 | 35 Magenta foreground (ISO 6429 standard) 139 | 36 Cyan foreground (ISO 6429 standard) 140 | 37 White foregound (ISO 6429 standard) 141 | 40 Black background (ISO 6429 standard) 142 | 41 Red background (ISO 6429 standard) 143 | 42 Green background (ISO 6429 standard) 144 | 43 Yellow background (ISO 6429 standard) 145 | 44 Blue background (ISO 6429 standard) 146 | 45 Magenta background (ISO 6429 standard) 147 | 46 Cyan background (ISO 6429 standard) 148 | 47 White backgound (ISO 6429 standard) 149 | 150 | SM - Set Mode (IBM/MICROSOFT Private) 151 | 152 | ESC [ = Ps h 153 | or ESC [ = h 154 | or ESC [ = 0 h 155 | or ESC [ ? 7 h 156 | 157 | 158 | Invokes the screen width or type specified by the parameter. 159 | 160 | Parameter Parameter Function 161 | 162 | 0 40 x 25 black and white 163 | 1 40 x 25 color 164 | 2 80 x 25 black and white 165 | 3 80 x 25 color 166 | 167 | 4 320 x 200 color 168 | 5 320 x 200 black and white 169 | 6 640 x 200 black and white 170 | 7 wrap at end of line 171 | 172 | 173 | RM - Reset Mode 174 | 175 | ESC [ = Ps l 176 | or ESC [ = l 177 | or ESC [ = 0 l 178 | or ESC [ ? 7 l 179 | 180 | 181 | Parameters are the same as SM (Set Mode) except that 182 | parameter 7 will reset wrap at end of line mode. 183 | 184 | 185 | K E Y B O A R D R E - A S S I G N M E N T 186 | 187 | Although not part of the ANSI 3.64-1979 or ISO 6429 standard 188 | the IBM PC keyboard re-assignment was done in a compatible 189 | way. 190 | 191 | The control sequence is: 192 | 193 | ESC [ Pn ; Pn ; ... Pn p 194 | or ESC [ "string" ; p 195 | or ESC [ Pn ; "string" ; Pn ; Pn ; "string" ; Pn p 196 | or any other combination of strings and decimal numbers 197 | 198 | The final code in the control sequence ("p") is one reserved 199 | for private use the by ANSI 3.64-1979 standard. 200 | 201 | The first ASCII code in the control sequence defines which 202 | code is being mapped. The remaining numbers define the 203 | sequence of ASCII codes generated when this key is 204 | intercepted. 205 | 206 | To every rule there is an exception, however! If the first 207 | code in the sequence is zero (NUL) then the first and second 208 | code make up an extended ASCII re-definition. 209 | 210 | Here are some examples: 211 | 212 | 1. Reassign the Q and q key to the A and a key (and the other 213 | way as well): 214 | 215 | ESC [ 6 5 ; 8 1 p A becomes Q 216 | ESC [ 9 7 ; 1 1 3 p a becomes q 217 | ESC [ 8 1 ; 6 5 p Q becomes A 218 | ESC [ 1 1 3 ; 9 7 p q becomes a 219 | 220 | 2. Reassign the F10 key to to a dir command followed by a 221 | carriage return: 222 | 223 | ESC [ 0 ; 6 8 ; " d i r " ; 1 3 p 224 | 225 | The 0;68 is the extended ASCII code for the F10 key. 13 226 | decimal is a carriage return 227 | -------------------------------------------------------------------------------- /v20source/ANSI.txt: -------------------------------------------------------------------------------- 1 | This document explains the how the ANSI escape sequences are 2 | defined for the IBM PC. 3 | 4 | Notes: 5 | 6 | 1. The default value is used when no explicit value is given 7 | or a value of zero is given. 8 | 9 | 2. Pn - Numeric parameter. A decimal number specified 10 | with ASCII digits. 11 | 12 | 3. Ps - Selective parameter. Any decimal number that is 13 | is used to select a subfunction. Multiple subfunctions 14 | may be selected by separating the parameters with 15 | semi-colons. 16 | 17 | C U R S O R F U N C T I O N S 18 | 19 | CUP - Cursor Postion 20 | 21 | ESC [ Pl ; Pc H 22 | 23 | HVP - Horizontal & Vertical Postion 24 | 25 | ESC [ Pl ; Pc f 26 | 27 | CUP and HVP move the cursor to the position specified by 28 | the parameters. The first parameter specifies the line number 29 | and the second parameter specifies the column number. The 30 | default value is one. When no parameters are given the cursor 31 | is moved to the home postion. 32 | 33 | CUU - Cursor Up 34 | 35 | ESC [ Pn A 36 | 37 | Moves the cursor up one line without changing columns. The 38 | value of Pn determines the number of lines moved. The default 39 | value for Pn is one. This sequence is ignored if the cursor 40 | is already on the top line. 41 | 42 | CUD - Cursor Down 43 | 44 | ESC [ Pn B 45 | 46 | Moves the cursor down one line without changing columns. 47 | The value of Pn determines the number of lines moved. The 48 | default value for Pn is one. This sequence is ignored if the 49 | cursor is already on the bottom line. 50 | 51 | CUF - Cursor Forward 52 | 53 | ESC [ Pn C 54 | 55 | Moves the cursor forword one column without changing lines. 56 | The value of Pn determines the number of columns moved. The 57 | default value for Pn is one. This sequence is ignored if the 58 | cursor is already in the rightmost column. 59 | 60 | ESC [ Pn D 61 | 62 | Moves the cursor back one column without changing lines. The 63 | value of Pn determines the number of columns moved. The default 64 | value for Pn is one. This sequence is ignored if the cursor 65 | is already in the leftmost column. 66 | 67 | DSR - Device Status Report 68 | 69 | ESC [ 6 n 70 | 71 | The console driver will output a CPR sequence on receipt of 72 | DSR. 73 | 74 | CPR - Cursor Position Report (from console driver to system) 75 | 76 | ESC [ Pn ; Pn R 77 | 78 | The CPR sequence reports current cursor position via 79 | standard input. The first parameter specifies the current 80 | line and the second parameter specifies the current column. 81 | 82 | SCP - Save Cursor Postion 83 | 84 | ESC [ s 85 | 86 | The current cursor position is saved. This cursor position 87 | can be restored with the RCP sequence. 88 | 89 | RCP - Restore cursor position 90 | 91 | ESC [ u 92 | 93 | Restores the cursor position to the value it had when the 94 | console driver received the SCP sequence. 95 | 96 | E R A S I N G 97 | 98 | ED - Erase Display 99 | 100 | ESC [ 2 J 101 | 102 | Erases all of the screen and the cursor goes to the home 103 | position. 104 | 105 | EL - Erase Line 106 | 107 | ESC [ K 108 | 109 | Erases from the cursor to the end of the line and includes 110 | the cursor position. 111 | 112 | 113 | 114 | M O D E S O F O P E R A T I O N 115 | 116 | SGR - Set Graphics Rendition 117 | 118 | ESC [ Ps ; ... ; Ps m 119 | 120 | Invokes the graphic rendition specified by the parameter(s). 121 | All following characters are rendered according to the 122 | parameter(s) until the next occurence of SGR. 123 | 124 | Parameter Parameter Function 125 | 126 | 0 All Attributes Off 127 | 1 Bold On 128 | 4 Underscore On (monochrome displays 129 | only) 130 | 5 Blink On 131 | 7 Reverse Video On 132 | 8 Concealed On (ISO 6429 standard) 133 | 30 Black foreground (ISO 6429 standard) 134 | 31 Red foreground (ISO 6429 standard) 135 | 32 Green foreground (ISO 6429 standard) 136 | 33 Yellow foreground (ISO 6429 standard) 137 | 34 Blue foreground (ISO 6429 standard) 138 | 35 Magenta foreground (ISO 6429 standard) 139 | 36 Cyan foreground (ISO 6429 standard) 140 | 37 White foregound (ISO 6429 standard) 141 | 40 Black background (ISO 6429 standard) 142 | 41 Red background (ISO 6429 standard) 143 | 42 Green background (ISO 6429 standard) 144 | 43 Yellow background (ISO 6429 standard) 145 | 44 Blue background (ISO 6429 standard) 146 | 45 Magenta background (ISO 6429 standard) 147 | 46 Cyan background (ISO 6429 standard) 148 | 47 White backgound (ISO 6429 standard) 149 | 150 | SM - Set Mode (IBM/MICROSOFT Private) 151 | 152 | ESC [ = Ps h 153 | or ESC [ = h 154 | or ESC [ = 0 h 155 | or ESC [ ? 7 h 156 | 157 | 158 | Invokes the screen width or type specified by the parameter. 159 | 160 | Parameter Parameter Function 161 | 162 | 0 40 x 25 black and white 163 | 1 40 x 25 color 164 | 2 80 x 25 black and white 165 | 3 80 x 25 color 166 | 167 | 4 320 x 200 color 168 | 5 320 x 200 black and white 169 | 6 640 x 200 black and white 170 | 7 wrap at end of line 171 | 172 | 173 | RM - Reset Mode 174 | 175 | ESC [ = Ps l 176 | or ESC [ = l 177 | or ESC [ = 0 l 178 | or ESC [ ? 7 l 179 | 180 | 181 | Parameters are the same as SM (Set Mode) except that 182 | parameter 7 will reset wrap at end of line mode. 183 | 184 | 185 | K E Y B O A R D R E - A S S I G N M E N T 186 | 187 | Although not part of the ANSI 3.64-1979 or ISO 6429 standard 188 | the IBM PC keyboard re-assignment was done in a compatible 189 | way. 190 | 191 | The control sequence is: 192 | 193 | ESC [ Pn ; Pn ; ... Pn p 194 | or ESC [ "string" ; p 195 | or ESC [ Pn ; "string" ; Pn ; Pn ; "string" ; Pn p 196 | or any other combination of strings and decimal numbers 197 | 198 | The final code in the control sequence ("p") is one reserved 199 | for private use the by ANSI 3.64-1979 standard. 200 | 201 | The first ASCII code in the control sequence defines which 202 | code is being mapped. The remaining numbers define the 203 | sequence of ASCII codes generated when this key is 204 | intercepted. 205 | 206 | To every rule there is an exception, however! If the first 207 | code in the sequence is zero (NUL) then the first and second 208 | code make up an extended ASCII re-definition. 209 | 210 | Here are some examples: 211 | 212 | 1. Reassign the Q and q key to the A and a key (and the other 213 | way as well): 214 | 215 | ESC [ 6 5 ; 8 1 p A becomes Q 216 | ESC [ 9 7 ; 1 1 3 p a becomes q 217 | ESC [ 8 1 ; 6 5 p Q becomes A 218 | ESC [ 1 1 3 ; 9 7 p q becomes a 219 | 220 | 2. Reassign the F10 key to to a dir command followed by a 221 | carriage return: 222 | 223 | ESC [ 0 ; 6 8 ; " d i r " ; 1 3 p 224 | 225 | The 0;68 is the extended ASCII code for the F10 key. 13 226 | decimal is a carriage return 227 | -------------------------------------------------------------------------------- /v20source/RUCODE.ASM: -------------------------------------------------------------------------------- 1 | TITLE COMMAND Language modifiable Code Resident 2 | 3 | 4 | .xlist 5 | .xcref 6 | INCLUDE DOSSYM.ASM 7 | INCLUDE DEVSYM.ASM 8 | INCLUDE COMSEG.ASM 9 | INCLUDE COMSW.ASM 10 | .list 11 | .cref 12 | 13 | INCLUDE COMEQU.ASM 14 | 15 | DATARES SEGMENT PUBLIC 16 | EXTRN ENDBATMES:BYTE,BATCH:WORD,ECHOFLAG:BYTE,CDEVAT:BYTE 17 | EXTRN DEVENAM:BYTE,DRVLET:BYTE,MREAD:BYTE,MWRITE:BYTE,IOTYP:BYTE 18 | EXTRN ERRCD_24:WORD,MESBAS:BYTE,ERRMES:BYTE,DEVEMES:BYTE 19 | EXTRN DRVNUM:BYTE,LOADING:BYTE,REQUEST:BYTE,PIPEFLAG:BYTE 20 | EXTRN SINGLECOM:WORD,FORFLAG:BYTE,BADFAT:BYTE,NEWLIN:BYTE 21 | EXTRN MESADD:BYTE 22 | DATARES ENDS 23 | 24 | 25 | CODERES SEGMENT PUBLIC BYTE 26 | 27 | EXTRN SAVHAND:NEAR,RESTHAND:NEAR,CONTCTERM:NEAR 28 | EXTRN GETCOMDSK2:NEAR 29 | 30 | PUBLIC ASKEND,DSKERR,RPRINT 31 | 32 | ASSUME CS:RESGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING 33 | 34 | ;******************************************** 35 | ; TERMINATE BATCH JOB PROMPTER 36 | 37 | ASSUME DS:RESGROUP 38 | ASKEND: 39 | CALL SAVHAND 40 | ASKEND2: 41 | MOV DX,OFFSET RESGROUP:ENDBATMES 42 | CALL RPRINT 43 | MOV AX,(STD_CON_INPUT_FLUSH SHL 8)+STD_CON_INPUT 44 | INT int_command 45 | AND AL,5FH 46 | CMP AL,"N" 47 | JZ RESTHJ 48 | CMP AL,"Y" 49 | JNZ ASKEND2 50 | MOV ES,[BATCH] 51 | MOV AH,DEALLOC 52 | INT int_command 53 | MOV [BATCH],0 ; Flag no batch AFTER DEALLOC in case 54 | ; of ^C 55 | MOV [ECHOFLAG],1 ; Make sure ECHO turned back on 56 | RESTHJ: 57 | CALL RESTHAND 58 | JMP CONTCTERM 59 | 60 | 61 | 62 | DSKERR: 63 | ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING 64 | ; ****************************************************** 65 | ; THIS IS THE DEFAULT DISK ERROR HANDLING CODE 66 | ; AVAILABLE TO ALL USERS IF THEY DO NOT TRY TO 67 | ; INTERCEPT INTERRUPT 24H. 68 | ; ****************************************************** 69 | STI 70 | PUSH DS 71 | PUSH ES 72 | PUSH DI 73 | PUSH CX 74 | PUSH AX 75 | MOV DS,BP 76 | MOV AX,[SI.SDEVATT] 77 | MOV [CDEVAT],AH 78 | PUSH CS 79 | POP ES 80 | MOV DI,OFFSET RESGROUP:DEVENAM 81 | MOV CX,8 82 | ADD SI,SDEVNAME ; Suck up device name (even on Block) 83 | REP MOVSB 84 | POP AX 85 | POP CX 86 | POP DI 87 | POP ES ; Stack just contains DS at this point 88 | CALL SAVHAND 89 | PUSH CS 90 | POP DS ; Set up local data segment 91 | ASSUME DS:RESGROUP 92 | 93 | PUSH DX 94 | CALL CRLF 95 | POP DX 96 | 97 | ADD AL,"A" ; Compute drive letter (even on character) 98 | MOV [DRVLET],AL 99 | TEST AH,80H ; Check if hard disk error 100 | JZ NOHARDE 101 | TEST [CDEVAT],DEVTYP SHR 8 102 | JNZ NOHARDE 103 | JMP FATERR 104 | NOHARDE: 105 | MOV SI,OFFSET RESGROUP:MREAD 106 | TEST AH,1 107 | JZ SAVMES 108 | MOV SI,OFFSET RESGROUP:MWRITE 109 | SAVMES: 110 | LODSW 111 | MOV WORD PTR [IOTYP],AX 112 | LODSW 113 | MOV WORD PTR [IOTYP+2],AX 114 | AND DI,0FFH 115 | CMP DI,12 116 | JBE HAVCOD 117 | MOV DI,12 118 | HAVCOD: 119 | MOV [ERRCD_24],DI 120 | SHL DI,1 121 | MOV DI,WORD PTR [DI+MESBAS] ; Get pointer to error message 122 | XCHG DI,DX ; May need DX later 123 | CALL RPRINT ; Print error type 124 | MOV DX,OFFSET RESGROUP:ERRMES 125 | CALL RPRINT 126 | TEST [CDEVAT],DEVTYP SHR 8 127 | JZ BLKERR 128 | MOV DX,OFFSET RESGROUP:DEVEMES 129 | MOV AH,STD_CON_STRING_OUTPUT 130 | INT int_command 131 | JMP SHORT ASK ; Don't ralph on COMMAND 132 | 133 | BLKERR: 134 | MOV DX,OFFSET RESGROUP:DRVNUM 135 | CALL RPRINT 136 | CMP [LOADING],0 137 | JZ ASK 138 | CALL RESTHAND 139 | JMP GETCOMDSK2 ; If error loading COMMAND, re-prompt 140 | ASK: 141 | MOV DX,OFFSET RESGROUP:REQUEST 142 | CALL RPRINT 143 | MOV AX,(STD_CON_INPUT_FLUSH SHL 8)+STD_CON_INPUT 144 | INT int_command ; Get response 145 | CALL CRLF 146 | OR AL,20H ; Convert to lower case 147 | MOV AH,0 ; Return code for ignore 148 | CMP AL,"i" ; Ignore? 149 | JZ EEXIT 150 | INC AH 151 | CMP AL,"r" ; Retry? 152 | JZ EEXIT 153 | INC AH 154 | CMP AL,"a" ; Abort? 155 | JNZ ASK 156 | XOR DX,DX 157 | XCHG DL,[PIPEFLAG] ; Abort a pipe in progress 158 | OR DL,DL 159 | JZ CHECKFORA 160 | CMP [SINGLECOM],0 161 | JZ CHECKFORA 162 | MOV [SINGLECOM],-1 ; Make sure SINGLECOM exits 163 | CHECKFORA: 164 | CMP [ERRCD_24],0 ; Write protect 165 | JZ ABORTFOR 166 | CMP [ERRCD_24],2 ; Drive not ready 167 | JNZ EEXIT ; Don't abort the FOR 168 | ABORTFOR: 169 | MOV [FORFLAG],0 ; Abort a FOR in progress 170 | CMP [SINGLECOM],0 171 | JZ EEXIT 172 | MOV [SINGLECOM],-1 ; Make sure SINGLECOM exits 173 | EEXIT: 174 | MOV AL,AH 175 | MOV DX,DI 176 | RESTHD: 177 | CALL RESTHAND 178 | POP DS 179 | IRET 180 | 181 | FATERR: 182 | MOV DX,OFFSET RESGROUP:BADFAT 183 | CALL RPRINT 184 | MOV DX,OFFSET RESGROUP:ERRMES 185 | CALL RPRINT 186 | MOV DX,OFFSET RESGROUP:DRVNUM 187 | CALL RPRINT 188 | MOV AL,2 ; Abort 189 | JMP RESTHD 190 | 191 | 192 | ;********************************************* 193 | ; Print routines for Tokenized resident messages 194 | 195 | ASSUME DS:RESGROUP,SS:RESGROUP 196 | 197 | CRLF: 198 | MOV DX,OFFSET RESGROUP:NEWLIN 199 | 200 | RPRINT: 201 | PUSH AX ; Tokenized message printer 202 | PUSH BX 203 | PUSH DX 204 | PUSH SI 205 | MOV SI,DX 206 | RPRINT1: 207 | LODSB 208 | PUSH AX 209 | AND AL,7FH 210 | CMP AL,"0" 211 | JB RPRINT2 212 | CMP AL,"9" 213 | JA RPRINT2 214 | SUB AL,"0" 215 | CBW 216 | SHL AX,1 217 | MOV BX,OFFSET RESGROUP:MESADD 218 | ADD BX,AX 219 | MOV DX,[BX] 220 | CALL RPRINT 221 | JMP SHORT RPRINT3 222 | RPRINT2: 223 | MOV DL,AL 224 | MOV AH,STD_CON_OUTPUT 225 | INT int_command 226 | RPRINT3: 227 | POP AX 228 | TEST AL,10000000B ; High bit set indicates end 229 | JZ RPRINT1 230 | POP SI 231 | POP DX 232 | POP BX 233 | POP AX 234 | RET 235 | 236 | CODERES ENDS 237 | END 238 | -------------------------------------------------------------------------------- /v20source/DISKCOPY.ASM: -------------------------------------------------------------------------------- 1 | TITLE DISKCOPY MSDOS Disk Copier 2 | ;---------------------------------------------------------- 3 | ; 4 | ; Diskcopy - Program to copy entire diskettes 5 | ; 6 | ; Copyright 1982 by Microsoft Corporation 7 | ; Written by Chris Peters, August 1982 8 | ; 9 | ;----------------------------------------------------------- 10 | ; 11 | ; Rev 1.00 Initial instance 12 | ; Rev 1.20 13 | ; Read in > 64K hunks 14 | 15 | FALSE EQU 0 16 | TRUE EQU NOT FALSE 17 | 18 | 19 | bdos equ 21h 20 | boot equ 20h 21 | aread equ 25h 22 | awrite equ 26h 23 | 24 | INCLUDE DOSSYM.ASM 25 | 26 | fcb equ 5ch 27 | 28 | CODE SEGMENT PUBLIC 29 | CODE ENDS 30 | 31 | CONST SEGMENT PUBLIC BYTE 32 | CONST ENDS 33 | 34 | DATA SEGMENT PUBLIC BYTE 35 | DATA ENDS 36 | 37 | DG GROUP CODE,CONST,DATA 38 | 39 | CODE segment PUBLIC 40 | assume cs:DG,ds:DG,es:DG,ss:DG 41 | 42 | EXTRN dskrd:NEAR,dskwrt:NEAR,promptyn:NEAR 43 | PUBLIC PRINT,PCRLF,ASKANOTHER,sec64k,secsiz 44 | 45 | org 100h 46 | 47 | diskcopy: 48 | jmp disk_entry 49 | 50 | HEADER DB "Vers 1.20" 51 | 52 | source db 0 53 | dest db 0 54 | count dw 0 55 | start dw 0 56 | secsiz dw 0 57 | passcnt dw 0 58 | sec64k dw 0 59 | media db 0 60 | buffer dw 0 61 | bufsiz dw 0 62 | 63 | pcrlf: mov dx,OFFSET DG: crlf 64 | print: mov ah,STD_CON_STRING_OUTPUT 65 | int bdos 66 | pret: ret 67 | 68 | getkey: mov dx,OFFSET DG: keymsg 69 | call print 70 | mov ah,12 ;wait for key press 71 | mov al,1 72 | int 21h 73 | ret 74 | ; 75 | ; returns number of sectors on the disk in cx, sector size in ax 76 | ; 77 | getdpb: push ds 78 | inc dl 79 | mov ah,GET_DPB 80 | int bdos 81 | mov al,[bx+dpb_cluster_mask] 82 | cbw 83 | inc ax 84 | mov cx,[bx+dpb_max_cluster] 85 | dec cx 86 | mul cx 87 | add ax,[bx+dpb_first_sector] 88 | mov cx,[bx+dpb_sector_size] 89 | mov bl,[bx+dpb_media] 90 | pop ds 91 | ret 92 | 93 | getdrv: mov al,[bx] 94 | dec al 95 | cmp al,-1 96 | jnz get1 97 | mov ah,19h 98 | int 21h 99 | get1: ret 100 | ; 101 | ; set zero flag if drives the same 102 | ; 103 | compare:push ax 104 | mov al,[dest] 105 | cmp al,[source] 106 | pop ax 107 | ret 108 | 109 | printerr: 110 | call print 111 | int boot 112 | 113 | disk_entry: 114 | cli ;set up local stack 115 | mov sp,100h 116 | sti 117 | 118 | 119 | ;Code to print header 120 | ; PUSH AX 121 | ; MOV DX,OFFSET DG: HEADER 122 | ; CALL print 123 | ; POP AX 124 | 125 | mov dx,OFFSET DG: drverr1 126 | inc al 127 | jz printerr 128 | inc ah 129 | jz printerr 130 | 131 | mov bx,fcb 132 | call getdrv 133 | mov [source],al 134 | add [srclet],al 135 | mov bx,fcb+16 136 | call getdrv 137 | mov [dest],al 138 | add [dstlet],al 139 | add [fdstlet],al 140 | mov ah,DISK_RESET 141 | int bdos ;empty buffer queue 142 | 143 | mov bx,OFFSET DG:progsiz + 15 144 | shr bx,1 145 | shr bx,1 146 | shr bx,1 147 | shr bx,1 148 | mov ah,setblock 149 | int 21h ;give back extra memory 150 | 151 | mov bx,0FFFFh ;ask for Biggest hunk 152 | mov ah,alloc 153 | int 21h 154 | jnc gotmem 155 | mov ah,alloc 156 | int 21h 157 | gotmem: 158 | mov [buffer],ax 159 | mov [bufsiz],bx 160 | 161 | copyagn: 162 | mov [start],0 ;Initialize start sector 163 | call compare 164 | jz onedrv1 165 | mov dx,OFFSET DG: srcmsg 166 | call print 167 | onedrv1:mov dx,OFFSET DG: fdstmsg 168 | call print 169 | call getkey 170 | 171 | mov dl,[dest] 172 | call getdpb 173 | mov [count],ax 174 | mov [secsiz],cx 175 | mov [media],bl 176 | 177 | call compare 178 | jnz twodrv1 179 | mov dx,OFFSET DG: srcmsg 180 | call print 181 | call getkey 182 | 183 | twodrv1:mov dl,[source] 184 | call getdpb 185 | mov dx,OFFSET DG: drverr3 186 | cmp [media],bl ;make sure media and sizes match 187 | jnz errv 188 | cmp [count],ax 189 | jz sizeok 190 | errv: jmp printerr 191 | 192 | sizeok: 193 | mov bx,[secsiz] 194 | add bx,15 195 | mov cl,4 196 | shr bx,cl 197 | xor dx,dx 198 | mov ax,1000H 199 | div bx 200 | mov [sec64k],ax ;set number of sectors in 64K bytes 201 | xor dx,dx 202 | mov ax,[bufsiz] 203 | div bx 204 | mov [passcnt],ax ;set number of sectors per pass 205 | 206 | call compare ;print copying.... 207 | jz loop 208 | mov dx,OFFSET DG: cpymsg 209 | call print 210 | 211 | loop: push ds 212 | 213 | mov al,[source] 214 | xor bx,bx 215 | mov cx,[passcnt] 216 | cmp cx,[count] 217 | jbe countok 218 | mov cx,[count] 219 | countok:mov dx,[start] 220 | mov ds,[buffer] 221 | call dskrd 222 | pop ds 223 | 224 | push ds 225 | push cx 226 | 227 | call compare 228 | jnz twodrv2 229 | mov dx,OFFSET DG: dstmsg 230 | call print 231 | call getkey 232 | 233 | twodrv2:mov al,[dest] 234 | xor bx,bx 235 | mov dx,[start] 236 | mov ds,[buffer] 237 | call dskwrt 238 | pop cx 239 | pop ds 240 | 241 | add [start],cx 242 | sub [count],cx 243 | jbe quitcopy 244 | 245 | call compare 246 | jnz loop 247 | mov dx,OFFSET DG: srcmsg 248 | call print 249 | call getkey 250 | jmp loop 251 | 252 | quitcopy: 253 | mov ah,DISK_RESET 254 | int bdos ;empty buffer queue 255 | mov dx,OFFSET DG: goodmsg 256 | call compare 257 | jnz twodrv3 258 | mov dx,OFFSET DG: good1 259 | 260 | ASKANOTHER: 261 | twodrv3:call print 262 | mov dx,OFFSET DG:anoprompt 263 | call promptyn 264 | jnz alldone 265 | jmp copyagn 266 | alldone: 267 | int boot ;home, james... 268 | 269 | CODE ENDS 270 | 271 | CONST SEGMENT PUBLIC BYTE 272 | 273 | EXTRN fdstmsg:BYTE,dstmsg:BYTE,fdstlet:BYTE,dstlet:BYTE 274 | EXTRN cpymsg:BYTE,good1:BYTE,goodmsg:BYTE,srcmsg:BYTE,srclet:BYTE 275 | EXTRN keymsg:BYTE,drverr1:BYTE,drverr3:BYTE,crlf:BYTE 276 | EXTRN anoprompt:BYTE 277 | 278 | db ' MICROSOFT - PETERS ' 279 | CONST ENDS 280 | 281 | DATA SEGMENT BYTE 282 | 283 | progsiz LABEL BYTE 284 | 285 | DATA ends 286 | end diskcopy 287 | -------------------------------------------------------------------------------- /v20source/TIME.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Time and date functions for MSDOS 3 | ; 4 | 5 | INCLUDE DOSSEG.ASM 6 | 7 | CODE SEGMENT BYTE PUBLIC 'CODE' 8 | ASSUME SS:DOSGROUP,CS:DOSGROUP 9 | 10 | .xlist 11 | .xcref 12 | INCLUDE DOSSYM.ASM 13 | INCLUDE DEVSYM.ASM 14 | .cref 15 | .list 16 | 17 | TITLE TIME - time and date functions 18 | NAME TIME 19 | 20 | 21 | i_need DAY,BYTE 22 | i_need MONTH,BYTE 23 | i_need YEAR,WORD 24 | i_need WEEKDAY,BYTE 25 | i_need TIMEBUF,6 26 | i_need BCLOCK,DWORD 27 | i_need DAYCNT,WORD 28 | i_need YRTAB,8 29 | i_need MONTAB,12 30 | 31 | FOURYEARS = 3*365 + 366 32 | 33 | SUBTTL DATE16, READTIME, DODATE -- GUTS OF TIME AND DATE 34 | PAGE 35 | ; 36 | ; Date16 returns the current date in AX, current time in DX 37 | ; AX - YYYYYYYMMMMDDDDD years months days 38 | ; DX - HHHHHMMMMMMSSSSS hours minutes seconds/2 39 | ; 40 | procedure DATE16,NEAR 41 | ASSUME DS:DOSGROUP,ES:NOTHING 42 | PUSH CX 43 | PUSH ES 44 | CALL READTIME 45 | POP ES 46 | SHL CL,1 ;Minutes to left part of byte 47 | SHL CL,1 48 | SHL CX,1 ;Push hours and minutes to left end 49 | SHL CX,1 50 | SHL CX,1 51 | SHR DH,1 ;Count every two seconds 52 | OR CL,DH ;Combine seconds with hours and minutes 53 | MOV DX,CX 54 | MOV AX,WORD PTR [MONTH] ;Fetch month and year 55 | MOV CL,4 56 | SHL AL,CL ;Push month to left to make room for day 57 | SHL AX,1 58 | POP CX 59 | OR AL,[DAY] 60 | RET 61 | DATE16 ENDP 62 | 63 | procedure READTIME,NEAR 64 | 65 | ASSUME DS:DOSGROUP,ES:NOTHING 66 | ;Gets time in CX:DX. Figures new date if it has changed. 67 | ;Uses AX, CX, DX. 68 | 69 | PUSH SI 70 | PUSH BX 71 | MOV BX,OFFSET DOSGROUP:TIMEBUF 72 | MOV CX,6 73 | XOR DX,DX 74 | MOV AX,DX 75 | invoke SETREAD 76 | PUSH DS 77 | LDS SI,[BCLOCK] 78 | ASSUME DS:NOTHING 79 | invoke DEVIOCALL2 ;Get correct date and time 80 | POP DS 81 | ASSUME DS:DOSGROUP 82 | POP BX 83 | POP SI 84 | MOV AX,WORD PTR [TIMEBUF] 85 | MOV CX,WORD PTR [TIMEBUF+2] 86 | MOV DX,WORD PTR [TIMEBUF+4] 87 | CMP AX,[DAYCNT] ;See if day count is the same 88 | JZ RET22 89 | CMP AX,FOURYEARS*30 ;Number of days in 120 years 90 | JAE RET22 ;Ignore if too large 91 | MOV [DAYCNT],AX 92 | PUSH SI 93 | PUSH CX 94 | PUSH DX ;Save time 95 | XOR DX,DX 96 | MOV CX,FOURYEARS ;Number of days in 4 years 97 | DIV CX ;Compute number of 4-year units 98 | SHL AX,1 99 | SHL AX,1 100 | SHL AX,1 ;Multiply by 8 (no. of half-years) 101 | MOV CX,AX ;<240 implies AH=0 102 | MOV SI,OFFSET DOSGROUP:YRTAB ;Table of days in each year 103 | CALL DSLIDE ;Find out which of four years we're in 104 | SHR CX,1 ;Convert half-years to whole years 105 | JNC SK ;Extra half-year? 106 | ADD DX,200 107 | SK: 108 | CALL SETYEAR 109 | MOV CL,1 ;At least at first month in year 110 | MOV SI,OFFSET DOSGROUP:MONTAB ;Table of days in each month 111 | CALL DSLIDE ;Find out which month we're in 112 | MOV [MONTH],CL 113 | INC DX ;Remainder is day of month (start with one) 114 | MOV [DAY],DL 115 | CALL WKDAY ;Set day of week 116 | POP DX 117 | POP CX 118 | POP SI 119 | RET22: RET 120 | READTIME ENDP 121 | 122 | procedure DSLIDE,NEAR 123 | MOV AH,0 124 | DSLIDE1: 125 | LODSB ;Get count of days 126 | CMP DX,AX ;See if it will fit 127 | JB RET23 ;If not, done 128 | SUB DX,AX 129 | INC CX ;Count one more month/year 130 | JMP SHORT DSLIDE1 131 | DSLIDE ENDP 132 | 133 | procedure SETYEAR,NEAR 134 | ;Set year with value in CX. Adjust length of February for this year. 135 | MOV BYTE PTR [YEAR],CL 136 | 137 | CHKYR: 138 | TEST CL,3 ;Check for leap year 139 | MOV AL,28 140 | JNZ SAVFEB ;28 days if no leap year 141 | INC AL ;Add leap day 142 | SAVFEB: 143 | MOV [MONTAB+1],AL ;Store for February 144 | RET23: RET 145 | SETYEAR ENDP 146 | 147 | procedure DODATE,NEAR 148 | ASSUME DS:DOSGROUP,ES:NOTHING 149 | CALL CHKYR ;Set Feb. up for new year 150 | MOV AL,DH 151 | MOV BX,OFFSET DOSGROUP:MONTAB-1 152 | XLAT ;Look up days in month 153 | CMP AL,DL 154 | MOV AL,-1 ;Restore error flag, just in case 155 | JB RET25 ;Error if too many days 156 | CALL SETYEAR 157 | MOV WORD PTR [DAY],DX ;Set both day and month 158 | SHR CX,1 159 | SHR CX,1 160 | MOV AX,FOURYEARS 161 | MOV BX,DX 162 | MUL CX 163 | MOV CL,BYTE PTR [YEAR] 164 | AND CL,3 165 | MOV SI,OFFSET DOSGROUP:YRTAB 166 | MOV DX,AX 167 | SHL CX,1 ;Two entries per year, so double count 168 | CALL DSUM ;Add up the days in each year 169 | MOV CL,BH ;Month of year 170 | MOV SI,OFFSET DOSGROUP:MONTAB 171 | DEC CX ;Account for months starting with one 172 | CALL DSUM ;Add up days in each month 173 | MOV CL,BL ;Day of month 174 | DEC CX ;Account for days starting with one 175 | ADD DX,CX ;Add in to day total 176 | XCHG AX,DX ;Get day count in AX 177 | MOV [DAYCNT],AX 178 | PUSH SI 179 | PUSH BX 180 | PUSH AX 181 | MOV BX,OFFSET DOSGROUP:TIMEBUF 182 | MOV CX,6 183 | XOR DX,DX 184 | MOV AX,DX 185 | PUSH BX 186 | invoke SETREAD 187 | ASSUME ES:DOSGROUP 188 | PUSH DS 189 | LDS SI,[BCLOCK] 190 | ASSUME DS:NOTHING 191 | invoke DEVIOCALL2 ;Get correct date and time 192 | POP DS 193 | POP BX 194 | ASSUME DS:DOSGROUP 195 | invoke SETWRITE 196 | POP WORD PTR [TIMEBUF] 197 | PUSH DS 198 | LDS SI,[BCLOCK] 199 | ASSUME DS:NOTHING 200 | invoke DEVIOCALL2 ;Set the date 201 | POP DS 202 | ASSUME DS:DOSGROUP 203 | POP BX 204 | POP SI 205 | WKDAY: 206 | MOV AX,[DAYCNT] 207 | XOR DX,DX 208 | MOV CX,7 209 | INC AX 210 | INC AX ;First day was Tuesday 211 | DIV CX ;Compute day of week 212 | MOV [WEEKDAY],DL 213 | XOR AL,AL ;Flag OK 214 | RET25: RET 215 | DODATE ENDP 216 | 217 | procedure DSUM,NEAR 218 | MOV AH,0 219 | JCXZ RET25 220 | DSUM1: 221 | LODSB 222 | ADD DX,AX 223 | LOOP DSUM1 224 | RET 225 | DSUM ENDP 226 | 227 | do_ext 228 | 229 | CODE ENDS 230 | END 231 | -------------------------------------------------------------------------------- /v20source/DOSMAC.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Macro file for MSDOS. 3 | ; 4 | 5 | SUBTTL BREAK a listing into pages and give new subtitles 6 | PAGE 7 | BREAK MACRO subtitle 8 | SUBTTL subtitle 9 | PAGE 10 | ENDM 11 | 12 | BREAK 13 | 14 | ; 15 | ; declare a variable external and allocate a size 16 | ; 17 | I_NEED MACRO sym,len 18 | CODE ENDS 19 | DATA SEGMENT BYTE PUBLIC 'DATA' 20 | 21 | IFIDN , 22 | EXTRN &sym:WORD 23 | ELSE 24 | IFIDN , 25 | EXTRN &sym:DWORD 26 | ELSE 27 | EXTRN &sym:BYTE 28 | ENDIF 29 | ENDIF 30 | 31 | DATA ENDS 32 | CODE SEGMENT BYTE PUBLIC 'CODE' 33 | ENDM 34 | 35 | ; 36 | ; call a procedure that may be external. The call will be short. 37 | ; 38 | invoke MACRO name 39 | &.xcref 40 | add_ext name,near 41 | &.cref 42 | CALL name 43 | ENDM 44 | 45 | PAGE 46 | ; 47 | ; jump to a label that may be external. The call will be near. 48 | ; 49 | transfer MACRO name 50 | &.xcref 51 | add_ext name,near 52 | &.cref 53 | JUMP name 54 | ENDM 55 | 56 | ; 57 | ; get a short address in a word 58 | ; 59 | short_addr MACRO name 60 | IFDIF , 61 | &.xcref 62 | add_ext name,near 63 | &.cref 64 | DW OFFSET DOSGROUP:name 65 | ELSE 66 | DW ? 67 | ENDIF 68 | ENDM 69 | 70 | ; 71 | ; get a long address in a dword 72 | ; 73 | long_addr MACRO name 74 | &.xcref 75 | add_ext name,far 76 | &.cref 77 | DD name 78 | ENDM 79 | 80 | ; 81 | ; declare a PROC near or far but PUBLIC nonetheless 82 | ; 83 | procedure MACRO name,distance 84 | PUBLIC name 85 | name PROC distance 86 | ENDM 87 | 88 | PAGE 89 | ; 90 | ; define a data item to be public and of an appropriate size/type 91 | ; 92 | I_AM MACRO name,size 93 | PUBLIC name 94 | 95 | IFIDN , 96 | name DW ? 97 | ELSE 98 | IFIDN , 99 | name DD ? 100 | ELSE 101 | IFIDN , 102 | name DB ? 103 | ELSE 104 | name DB size DUP (?) 105 | ENDIF 106 | ENDIF 107 | ENDIF 108 | ENDM 109 | 110 | PAGE 111 | ; 112 | ; play games with a possible external. Create a new 113 | ; macro for the symbol and text, and string it together 114 | ; with a central invoker 115 | ; 116 | 117 | .xcref 118 | .xcref ?i 119 | .xcref def_mac 120 | .xcref ?z0 121 | .xcref add_ext 122 | .cref 123 | 124 | IF1 125 | ?i=0 126 | ENDIF 127 | 128 | ?z0 macro 129 | endm 130 | 131 | ; 132 | ; add an external declaration to s with type t if it is not defined 133 | ; 134 | add_ext macro s,t 135 | &.xcref 136 | &.xcref ?&s 137 | &.cref 138 | IFNDEF ?&s 139 | ?i = ?i + 1 140 | def_mac ?z&%?i,?z&%(?i-1),s,t 141 | ENDIF 142 | endm 143 | 144 | ; 145 | ; define a macro called that possibly externals s:t and then calls macro n 146 | ; 147 | def_mac macro m,n,s,t 148 | &.xcref 149 | &.xcref ?&s 150 | &.xcref m 151 | &.cref 152 | m macro 153 | ifndef s 154 | extrn s:&t 155 | endif 156 | purge m 157 | purge ?&s 158 | n 159 | endm 160 | ?&s macro 161 | &endm 162 | endm 163 | 164 | ; 165 | ; call the macro chain 166 | ; 167 | do_ext macro 168 | &.xcref 169 | expand_mac ?z%?i 170 | &.cref 171 | endm 172 | 173 | PAGE 174 | expand_mac macro m 175 | m 176 | endm 177 | 178 | ; 179 | ; define an entry in a procedure 180 | ; 181 | entry macro name 182 | PUBLIC name 183 | name: 184 | endm 185 | 186 | BREAK 187 | 188 | error macro code 189 | local a 190 | .xcref 191 | MOV AL,code 192 | transfer SYS_RET_ERR 193 | .cref 194 | ENDM 195 | 196 | BREAK 197 | ; 198 | ; given a label either 2 byte jump to another label _J 199 | ; if it is near enough or 3 byte jump to 200 | ; 201 | 202 | jump macro lbl 203 | local a 204 | .xcref 205 | a: 206 | ifndef lbl&_J ; is this the first invocation 207 | JMP lbl 208 | ELSE 209 | IF lbl&_J GE $ 210 | JMP lbl 211 | ELSE 212 | IF ($-lbl&_J) GT 126 ; is the jump too far away? 213 | JMP lbl 214 | ELSE ; do the short one... 215 | JMP lbl&_J 216 | ENDIF 217 | ENDIF 218 | ENDIF 219 | endm 220 | 221 | BREAK 222 | 223 | return macro 224 | local a 225 | .xcref 226 | a: 227 | RET 228 | ret_l = a 229 | endm 230 | 231 | BREAK 232 | 233 | makelab macro l,cc,ncc 234 | j&ncc a ; j a: 235 | return ; return 236 | a: ; a: 237 | ret_&cc = ret_l ; define ret_ to be ret_l 238 | endm 239 | 240 | condret macro cc,ncc 241 | local a,b 242 | ifdef ret_l ; if ret_l is defined 243 | if (($ - ret_l) le 126) and ($ gt ret_l) 244 | ; if ret_l is near enough then 245 | a: j&cc ret_l ; a: j to ret_l 246 | ret_&cc = a ; define ret_ to be a: 247 | else 248 | makelab a,cc,ncc 249 | endif 250 | else 251 | ifdef ret_&cc ; if ret_ defined 252 | if (($ - ret_&cc) le 126) and ($ gt ret_&cc) 253 | ; if ret_ is near enough 254 | a: j&cc ret_&cc ; a: j to ret_ 255 | ret_&cc = a ; define ret_ to be a: 256 | else 257 | makelab a,cc,ncc 258 | endif 259 | else 260 | makelab a,cc,ncc 261 | endif 262 | endif 263 | endm 264 | ;condret macro cc,ncc 265 | ; local a,b 266 | ; ifdef ret_l ; if ret_l is defined 267 | ; if (($ - ret_l) le 126) and ($ gt ret_l) 268 | ; ; if ret_l is near enough then 269 | ; a: j&cc ret_l ; a: j to ret_l 270 | ; ret_&cc = a ; define ret_ to be a: 271 | ; exitm 272 | ; endif 273 | ; endif 274 | ; ifdef ret_&cc ; if ret_ defined 275 | ; if (($ - ret_&cc) le 126) and ($ gt ret_&cc) 276 | ; ; if ret_ is near enough 277 | ; a: j&cc ret_&cc ; a: j to ret_ 278 | ; ret_&cc = a ; define ret_ to be a: 279 | ; exitm 280 | ; endif 281 | ; endif 282 | ; j&ncc a ; j a: 283 | ; return ; return 284 | ; a: ; a: 285 | ; ret_&cc = ret_l ; define ret_ to be ret_l 286 | ;endm 287 | 288 | BREAK 289 | 290 | retz macro 291 | condret z,nz 292 | endm 293 | 294 | BREAK 295 | 296 | retnz macro 297 | condret nz,z 298 | endm 299 | 300 | BREAK 301 | 302 | retc macro 303 | condret c,nc 304 | endm 305 | 306 | BREAK 307 | 308 | retnc macro 309 | condret nc,c 310 | endm 311 | -------------------------------------------------------------------------------- /v20source/TUCODE.ASM: -------------------------------------------------------------------------------- 1 | TITLE COMMAND Language midifiable Code Transient 2 | 3 | 4 | .xlist 5 | .xcref 6 | INCLUDE DOSSYM.ASM 7 | INCLUDE DEVSYM.ASM 8 | INCLUDE COMSEG.ASM 9 | INCLUDE COMSW.ASM 10 | .list 11 | .cref 12 | 13 | INCLUDE COMEQU.ASM 14 | 15 | DATARES SEGMENT PUBLIC 16 | EXTRN ECHOFLAG:BYTE 17 | DATARES ENDS 18 | 19 | TRANDATA SEGMENT PUBLIC 20 | EXTRN SUREMES:BYTE,NOTFND:BYTE,ECHOMES:BYTE,CTRLCMES:BYTE 21 | EXTRN ONMES:BYTE,OFFMES:BYTE,VERIMES:BYTE,BAD_ON_OFF:BYTE 22 | EXTRN VOLMES:BYTE,GOTVOL:BYTE,NOVOL:BYTE,WeekTab:BYTE 23 | EXTRN CurDat_Mid:BYTE 24 | TRANDATA ENDS 25 | 26 | TRANSPACE SEGMENT PUBLIC 27 | EXTRN RESSEG:WORD,CURDRV:BYTE,DIRBUF:BYTE,CHARBUF:BYTE 28 | TRANSPACE ENDS 29 | 30 | TRANCODE SEGMENT PUBLIC BYTE 31 | 32 | EXTRN PRINT:NEAR,SCANOFF:NEAR,CRLF2:NEAR,RESTUDIR:NEAR,CERROR:NEAR 33 | EXTRN CRPRINT:NEAR,OUT:NEAR,ZPRINT:NEAR 34 | EXTRN ERROR_PRINT:NEAR,MesTran:NEAR,P_Date:NEAR 35 | 36 | IF KANJI 37 | EXTRN TESTKANJ:NEAR 38 | ENDIF 39 | PUBLIC NOTEST2,ECHO,CNTRLC,VERIFY,PRINTVOL,GetDate,PRINT_DATE 40 | 41 | ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:TRANGROUP,SS:NOTHING 42 | 43 | ;*************************************** 44 | ; ARE YOU SURE prompt when deleting *.* 45 | 46 | NOTEST2: 47 | MOV CX,11 48 | MOV SI,FCB+1 49 | AMBSPEC: 50 | LODSB 51 | CMP AL,"?" 52 | JNZ ALLFIL 53 | LOOP AMBSPEC 54 | ALLFIL: 55 | CMP CX,0 56 | JNZ NOPRMPT 57 | ASKAGN: 58 | MOV DX,OFFSET TRANGROUP:SUREMES ; "Are you sure (Y/N)?" 59 | CALL PRINT 60 | MOV SI,80H 61 | MOV DX,SI 62 | MOV WORD PTR [SI],120 ; zero length 63 | MOV AX,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_STRING_INPUT 64 | INT int_command 65 | LODSW 66 | OR AH,AH 67 | JZ ASKAGN 68 | CALL SCANOFF 69 | OR AL,20H ; Convert to lower case 70 | CMP AL,'n' 71 | JZ RETERA 72 | CMP AL,'y' 73 | PUSHF 74 | CALL CRLF2 75 | POPF 76 | JNZ ASKAGN 77 | NOPRMPT: 78 | MOV AH,FCB_DELETE 79 | MOV DX,FCB 80 | INT int_command 81 | PUSH AX 82 | CALL RESTUDIR 83 | POP AX 84 | MOV DX,OFFSET TRANGROUP:NOTFND 85 | INC AL 86 | JZ CERRORJ 87 | RETERA: 88 | RET 89 | 90 | 91 | ;************************************************ 92 | ; ECHO, BREAK, and VERIFY commands. Check for "ON" and "OFF" 93 | 94 | ECHO: 95 | ASSUME DS:TRANGROUP,ES:TRANGROUP 96 | CALL ON_OFF 97 | JC DOEMES 98 | MOV DS,[RESSEG] 99 | ASSUME DS:RESGROUP 100 | JNZ ECH_OFF 101 | MOV [ECHOFLAG],1 102 | RET 103 | ECH_OFF: 104 | MOV [ECHOFLAG],0 105 | RET 106 | 107 | ASSUME DS:TRANGROUP 108 | DOEMES: 109 | MOV AL,BYTE PTR DS:[80H] 110 | CMP AL,2 111 | JB PECHO ; Gota have at least 2 characters 112 | MOV DX,82H ; Skip one char after "ECHO" 113 | CALL CRPRINT 114 | JMP CRLF2 115 | 116 | PECHO: 117 | MOV DS,[RESSEG] 118 | ASSUME DS:RESGROUP 119 | MOV BL,[ECHOFLAG] 120 | PUSH CS 121 | POP DS 122 | ASSUME DS:TRANGROUP 123 | MOV DX,OFFSET TRANGROUP:ECHOMES 124 | JMP SHORT PYN 125 | 126 | 127 | CERRORJ: 128 | JMP CERROR 129 | 130 | ; is rest of line blank? 131 | IsBlank: 132 | MOV SI,81h ; point at text spot 133 | CALL SCANOFF ; skip separators 134 | SUB SI,81h ; number of characters advanced 135 | MOV CX,SI ; put count in byte addressable spot 136 | CMP CL,DS:[80h] ; compare with count 137 | return ; bye! 138 | 139 | ;The BREAK command 140 | CNTRLC: 141 | CALL ON_OFF 142 | MOV AX,(SET_CTRL_C_TRAPPING SHL 8) OR 1 143 | JC PCNTRLC 144 | JNZ CNTRLC_OFF 145 | MOV DL,1 146 | INT int_command ; Set ^C 147 | RET 148 | CNTRLC_OFF: 149 | XOR DL,DL 150 | INT int_command ; Turn off ^C check 151 | RET 152 | 153 | PCNTRLC: 154 | CALL IsBlank ; rest of line blank? 155 | JNZ CERRORJ ; no, oops! 156 | XOR AL,AL 157 | INT int_command 158 | MOV BL,DL 159 | MOV DX,OFFSET TRANGROUP:CTRLCMES 160 | PYN: 161 | CALL PRINT 162 | MOV DX,OFFSET TRANGROUP:ONMES 163 | OR BL,BL 164 | JNZ PRINTVAL 165 | MOV DX,OFFSET TRANGROUP:OFFMES 166 | PRINTVAL: 167 | JMP PRINT 168 | 169 | VERIFY: 170 | CALL ON_OFF 171 | MOV AX,(SET_VERIFY_ON_WRITE SHL 8) OR 1 172 | JC PVERIFY 173 | JNZ VER_OFF 174 | INT int_command ; Set verify 175 | RET 176 | VER_OFF: 177 | DEC AL 178 | INT int_command ; Turn off verify after write 179 | RET 180 | 181 | PVERIFY: 182 | CALL IsBlank ; is rest of line blank? 183 | JNZ CERRORJ ; nope... 184 | MOV AH,GET_VERIFY_ON_WRITE 185 | INT int_command 186 | MOV BL,AL 187 | MOV DX,OFFSET TRANGROUP:VERIMES 188 | JMP PYN 189 | 190 | ON_OFF: 191 | MOV SI,FCB+1 192 | LODSB 193 | OR AL,20H 194 | CMP AL,'o' 195 | JNZ BADONF 196 | LODSW 197 | OR AX,2020H ; Convert to lower case 198 | CMP AL,'n' 199 | JNZ OFFCHK 200 | CMP AH,' ' ; ' ' ORed with 20H is still ' ' 201 | JNZ BADONF 202 | RET ; Carry clear from CMP 203 | OFFCHK: 204 | CMP AX,6666H ; 'ff' 205 | JNZ BADONF 206 | LODSB 207 | CMP AL,' ' 208 | JNZ BADONF 209 | INC AL ; Reset zero Carry clear from CMP 210 | RET 211 | BADONF: 212 | MOV DX,OFFSET TRANGROUP:BAD_ON_OFF 213 | STC 214 | RET 215 | 216 | ;******************************** 217 | ; Print volume ID info 218 | 219 | ASSUME DS:TRANGROUP,ES:TRANGROUP 220 | 221 | PRINTVOL: 222 | PUSH AX ; AX return from SEARCH_FIRST for VOL ID 223 | MOV DX,OFFSET TRANGROUP:VOLMES 224 | CALL PRINT 225 | MOV AL,DS:[FCB] 226 | ADD AL,'@' 227 | CMP AL,'@' 228 | JNZ DRVOK 229 | MOV AL,[CURDRV] 230 | ADD AL,'A' 231 | DRVOK: 232 | CALL OUT 233 | POP AX 234 | OR AL,AL 235 | JZ GOODVOL 236 | MOV DX,OFFSET TRANGROUP:NOVOL 237 | CALL PRINT 238 | JMP CRLF2 239 | GOODVOL: 240 | MOV DX,OFFSET TRANGROUP:GOTVOL 241 | CALL PRINT 242 | MOV SI,OFFSET TRANGROUP:DIRBUF + 8 243 | MOV CX,11 244 | MOV DI,OFFSET TRANGROUP:CHARBUF 245 | MOV DX,DI 246 | REP MOVSB 247 | MOV AX,0A0DH 248 | STOSW 249 | XOR AX,AX 250 | STOSB 251 | JMP ZPRINT 252 | 253 | ;************************************************************************* 254 | ; print date 255 | PRINT_DATE: 256 | PUSH ES 257 | PUSH DI 258 | PUSH CS 259 | POP ES 260 | MOV DI,OFFSET TRANGROUP:CHARBUF 261 | MOV AH,GET_DATE 262 | INT int_command ; Get date in CX:DX 263 | CBW 264 | CALL GetDate ; get date and put into DI 265 | MOV AL," " 266 | STOSB 267 | MOV SI,OFFSET TRANGROUP:CURDAT_MID 268 | CALL MESTRAN 269 | CALL P_DATE 270 | XOR AX,AX 271 | STOSB 272 | MOV DX,OFFSET TRANGROUP:CHARBUF 273 | CALL ZPRINT 274 | POP ES 275 | POP DI 276 | return 277 | 278 | GetDate: 279 | MOV SI,AX 280 | SHL SI,1 281 | ADD SI,AX ; SI=AX*3 282 | ADD SI,OFFSET TRANGROUP:WEEKTAB 283 | MOV BX,CX 284 | MOV CX,3 285 | REP MOVSB 286 | return 287 | 288 | TRANCODE ENDS 289 | END 290 | --------------------------------------------------------------------------------