]> wirehaze git hosting - MS-DOS.git/blob - v2.0/source/FORMES.ASM

wirehaze git hosting

Add Turkish translation for README
[MS-DOS.git] / v2.0 / source / 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