1 2 section code public align=16 class=CODE 3 4 %include "sysmsg.mac" 1 <1> ; PAGE ,132 2 <1> ; SUBTTL DOS - Message Retriever - SYSTEM CONTROL file 3 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4 <1> ;; DOS -- Message Retriever 5 <1> ;; (c) Copyright 1988 Microsoft 6 <1> ;; 7 <1> ;; File Name: SYSMSG.INC 8 <1> ;; ---------- 9 <1> ;; 10 <1> ;; Description: Message retriever functions are included into source code 11 <1> ;; ------------ by referencing a MSG_SERVICES macro. That macro is defined 12 <1> ;; here as well as the logic to include necessary .ASM and .INC 13 <1> ;; files. 14 <1> ;; 15 <1> ;; 16 <1> ;; Documentation Reference: 17 <1> ;; ------------------------ 18 <1> ;; DOS -Message Retriever I0 Document - Feb. ?? 1987 19 <1> ;; DOS -Message Retriever I1 Document - Mar. ?? 1987 20 <1> ;; DOS -Message Retriever I2 Document - Mar. ?? 1987 21 <1> ;; DOS -Final Functional Specification Document - Mar ?? 1987 22 <1> ;; 23 <1> ;; Procedures Contained in This File: 24 <1> ;; --------------------------------- 25 <1> ;; None 26 <1> ;; 27 <1> ;; Include Files Required: 28 <1> ;; ----------------------- 29 <1> ;; MSGSERV.INC := All message services 30 <1> ;; ???? := ???? 31 <1> ;; 32 <1> ;; External Procedure References: 33 <1> ;; ------------------------------ 34 <1> ;; None 35 <1> ;; 36 <1> ;; Linkage Instructions: 37 <1> ;; -------------------- 38 <1> ;; None 39 <1> ;; 40 <1> ;; Change History: 41 <1> ;; --------------- 42 <1> ;; CREATED March, 1987 RPS 43 <1> ;; 44 <1> ;; Psuedocode: 45 <1> ;; ----------- 46 <1> ;; None 47 <1> ;; 48 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 49 <1> ;; 50 <1> %include "versiona.mac" ;;AN003;; 1 <2> 2 <2> major_version equ 4 ;Major DOS version 3 <2> minor_version equ 00 ;Minor DOS Version 4 <2> 5 <2> MINOR_VERSION equ minor_version ; NASM port equate 6 <2> MAJOR_VERSION equ major_version ; NASM port equate 7 <2> expected_version equ (MINOR_VERSION << 8)+MAJOR_VERSION 8 <2> 9 <2> alt_major_version equ 5 ;Major DOS version 10 <2> alt_minor_version equ 26 ;Minor DOS Version 11 <2> 12 <2> alt_expected_version equ (alt_minor_version << 8) + alt_major_version 13 <2> 14 <2> new_major_version equ 5 ;Major DOS version 15 <2> new_minor_version equ 38 ;Minor DOS Version 16 <2> new_expected_version equ (new_minor_version << 8) + new_major_version 17 <2> 18 <2> %warning out: ... for DOS Version 4.00 ... 18 ****************** <2> warning: out: ... for DOS Version 4.00 ... [-w+user] 19 <2> 20 <2> ;****************************** 21 <2> ;Each assembler program should: 22 <2> ; mov ah,030h ;DOS Get Version function 23 <2> ; int 021h ;Version ret. in AX,minor version first 24 <2> ; cmp ax,expected_version ;ALL utilities should check for an 25 <2> ; jne error_handler ; EXACT version match. 26 <2> ;****************************** 27 <2> 51 <1> 52 <1> FALSE equ 0 ;; 53 <1> TRUE equ 0FFFFh ;; List message services and flags 54 <1> ;; 55 <1> 56 <1> ; Control Characters For Message Skeleton file 57 <1> 58 <1> NULL EQU 00H ;; Null 59 <1> BELL EQU 07H ;; Bell 60 <1> TAB EQU 09H ;; Tab 61 <1> LF EQU 0AH ;; Line Feed 62 <1> HOME EQU 0BH ;; Home 63 <1> FORMFD EQU 0CH ;; Form Feed 64 <1> CR EQU 0DH ;; Carriage Return 65 <1> COLON EQU 3AH ;; Colon 66 <1> 67 <1> ; SYSDISPMSG and SYSGETMSG Equates 68 <1> 69 <1> MSG_SER_CLASS EQU 00H ;; Message Service Class (reserved) 70 <1> EXT_ERR_CLASS EQU 01H ;; DOS Extended error class 71 <1> PARSE_ERR_CLASS EQU 02H ;; Parse error class 72 <1> UTILITY_MSG_CLASS EQU 0FFH ;; Utility message class 73 <1> 74 <1> NO_HANDLE EQU 0FFFFH ;; No handle specified (Use DOS functions 01H-09H only) 75 <1> 76 <1> NO_REPLACE EQU 0000H ;; No replacable parameters 77 <1> 78 <1> ; SUBLIST Equates 79 <1> 80 <1> Sublist_Length EQU 11 ;; Length of sublist structure 81 <1> Reserved EQU 0 ;; Reserved byte field 82 <1> 83 <1> Left_Align EQU 0 ;;00xxxxxx 84 <1> Right_Align EQU 80h ;;10xxxxxx 85 <1> 86 <1> Char_type EQU 0 ;;axxx0000 - Character type 87 <1> Char_Field_Char EQU 0 ;;a0000000 88 <1> Char_Field_ASCIIZ EQU 10h ;;a0010000 89 <1> 90 <1> Unsgn_Bin_Type EQU 01h ;;axxx0001 - Unsigned Binary to Decimal character 91 <1> Unsgn_Bin_Byte EQU 11h ;;a0010001 92 <1> Unsgn_Bin_Word EQU 21h ;;a0100001 93 <1> Unsgn_Bin_DWord EQU 31h ;;a0110001 94 <1> 95 <1> Sgn_Bin_Type EQU 02h ;;axxx0010 - Signed Binary to Decimal character 96 <1> Sgn_Bin_Byte EQU 12h ;;a0010010 97 <1> Sgn_Bin_Word EQU 22h ;;a0100010 98 <1> Sgn_Bin_DWord EQU 32h ;;a0110010 99 <1> 100 <1> Bin_Hex_Type EQU 03h ;;axxx0011 - Unsigned Binary to Hexidecimal character 101 <1> Bin_Hex_Byte EQU 13h ;;a0010011 102 <1> Bin_Hex_Word EQU 23h ;;a0100011 103 <1> Bin_Hex_DWord EQU 33h ;;a0110011 104 <1> 105 <1> Date_Type EQU 04h ;;axxx0100 - Date to character using current country format 106 <1> Date_MD EQU 14h ;;a0010100 107 <1> Date_MDY_2 EQU 24h ;;a0100100 108 <1> Date_MDY_4 EQU 34h ;;a0110100 109 <1> 110 <1> Time_Cty_Type EQU 05h ;;axxx0101 - Time to character using current country format 111 <1> Time_HHMM_Cty EQU 05h ;;a0000101 112 <1> Time_HHMMSS_Cty EQU 15h ;;a0010101 113 <1> Time_HHMMSSHH_Cty EQU 25h ;;a0100101 114 <1> 115 <1> Time_24_Type EQU 06h ;;axxx0110 - Time to character using 24 hour format 116 <1> Time_HHMM_24 EQU 06h ;;a0000110 117 <1> Time_HHMMSS_24 EQU 16h ;;a0010110 118 <1> Time_HHMMSSHH_24 EQU 26h ;;a0100110 119 <1> 120 <1> $M_EXTPAR_Type EQU 08h ;;axxx1000 - Special case for extended parse replace format 121 <1> 122 <1> NO_INPUT EQU 00H ;; No input characters 123 <1> DOS_KEYB_INP EQU 01H ;; DOS INT 21H - AH=01H := Keyboard Input 124 <1> DOS_DIR_CON_INP EQU 07H ;; DOS INT 21H - AH=07H := Direct Console Input Without Echo 125 <1> DOS_CON_INP EQU 08H ;; DOS INT 21H - AH=08H := Console Input Without Echo (Check CTL-BK) 126 <1> DOS_BUF_KEYB_INP EQU 0AH ;; DOS INT 21H - AH=0AH := Buffered Keyboard Input 127 <1> DOS_CLR_KEYB_BUF EQU 0CH ;; DOS INT 21H - AH=0CH := Clear keyboard buffer 128 <1> DOS_WRITE_HANDLE EQU 40H ;; DOS INT 21H - AH=40H := Write to a DOS handle 129 <1> DOS_DISP_STRING EQU 09H ;; DOS INT 21H - AH=09H := Display $ terminated string 130 <1> DOS_DISP_CHAR EQU 02H ;; DOS INT 21H - AH=02H := Display Character 131 <1> LOWEST_4CH_VERSION EQU 0002H ;; First DOS version to allow AH = 4CH Exit (VERSION 2.00) 132 <1> 133 <1> DOS_GET_DBCS_INFO EQU 6300H ;; DOS INT 21H - AX=6507H := Get DBCS Vector Table 134 <1> DOS_GET_EXT_ERROR EQU 59H ;; DOS INT 21H - AH=59H := Get Extended Error 135 <1> DOS_GET_EXT_ERROR_BX EQU 00H ;; DOS INT 21H - BX=0000H := Version 0 136 <1> 137 <1> DOS_EXTENDED_OPEN EQU 6C00H ;AN003; DOS INT 21H - AX=6C00H := Extended Open 138 <1> NO_CRIT_OPEN EQU 2000H ;AN003; Extended Open Mode bit 139 <1> NOT_EX_FAIL_EX_OPEN EQU 0101H ;AN003; Extended Open Flag 140 <1> DOS_LSEEK_FILE EQU 4200H ;AN003; DOS INT 21H - AX=4200H := LSEEK file 141 <1> DOS_READ_BYTE EQU 3FH ;AN003; DOS INT 21H - AH=3FH := Read byte block 142 <1> DOS_CLOSE_FILE EQU 3EH ;AN003; DOS INT 21H - AH=3EH := Close file handle 143 <1> 144 <1> IFSFUNC_INSTALL_CHECK EQU 0500H ;AN006; IFSFUNC Installation Check 145 <1> IFS_GET_ERR_TEXT EQU 0502H ;AN006; IFSFUNC Get Extended Error Text 146 <1> IFSFUNC_INSTALLED EQU 0FFH ;AN006; Return code if IFSFUNC is installed 147 <1> 148 <1> EXT_ERR_39 EQU 39 ;; Insufficent Disk Space EXTENDED ERROR (changed from hex to decimal - eg d201) 149 <1> ERROR_CLASS_39 EQU 01H ;; Error Class = 1 150 <1> ACTION_39 EQU 04H ;; Suggested Action = 4 151 <1> LOCUS_39 EQU 01H ;; Locus = 1 152 <1> 153 <1> DOS_GET_COUNTRY EQU 38H ;; DOS INT 21H - AH=38H := Get Country Dependant Information 154 <1> DOS_GET_VERSION EQU 30H ;; DOS INT 21H - AH=30H := Get DOS Version number 155 <1> DOS_IOCTL_GET_INFO EQU 4400H ;; DOS INT 21H - AH=4400H := I/O control for devices 156 <1> DOS_IOCTL_SET_INFO EQU 4401H ;; DOS INT 21H - AH=4401H := I/O control for devices 157 <1> DOS_GET_EXT_PARSE_ADD EQU 122EH ;; DOS INT 2FH - AX=122EH := Get Extended/Parse error address 158 <1> DOS_GET_EXTENDED EQU 00 ;; DOS INT 2FH - AX=122EH - DL=00 := Get Extended address 159 <1> DOS_GET_PARSE EQU 02 ;; DOS INT 2FH - AX=122EH - DL=02 := Get Parse address 160 <1> DOS_GET_CRITICAL EQU 04 ;; DOS INT 2FH - AX=122EH - DL=04 := Get Critical address 161 <1> DOS_GET_FILE EQU 06 ;; DOS INT 2FH - AX=122EH - DL=06 := Get File system dependant 162 <1> DOS_GET_ADDR EQU 08 ;; DOS INT 2FH - AX=122EH - DL=08 := Get Address of READ_DISK_PROC 163 <1> DOS_SET_ADDR EQU 09 ;; DOS INT 2FH - AX=122EH - DL=09 := Set Address of READ_DISK_PROC 164 <1> LOW_NIB_MASK EQU 0FH ;; Mask out the high byte 165 <1> DOS_CLR_KEYB_BUF_MASK EQU 0C0H ;; Check if high nibble is C Hex 166 <1> $M_CON_INP EQU -1 ;; If DOS INT 21H Function 06H - DL := 0FFH for input 167 <1> $M_CRIT_LO EQU 19 ;; First Extended Error considered CRITICAL 168 <1> $M_CRIT_HI EQU 39 ;; Last Extended Error considered CRITICAL (EG - D191) 169 <1> $M_AM EQU "a" ;; Time format AM indicator 170 <1> $M_PM EQU "p" ;; Time format PM indicator 171 <1> $M_NEG_SIGN EQU "-" ;; Signed decimal number format negative indicator 172 <1> $M_DEF_TIME_FORM EQU 1 ;; Default Time format - 24 hour 173 <1> $M_DEF_DATE_FORM EQU 0 ;; Default Time format - 0 := USA format 174 <1> $M_DEF_TIME_SEP EQU ":" ;; Default Time separator - ":" 175 <1> $M_DEF_DATE_SEP EQU "-" ;; Default Time separator - "-" 176 <1> $M_DEF_DECI_SEP EQU "." ;; Default Time hundreds separator - "." 177 <1> $M_TIMEDATE_PAD EQU "0" ;; Time/Date PAD character - "0" (ie 12:03p) 178 <1> $M_MAX_2_YEAR EQU 99 ;; Maximum 2 digit year 179 <1> $M_SINGLE_CHAR EQU 1 ;; A single character is this long ^ 180 <1> $M_SPECIAL_CASE EQU 30H ;; Special case for replacable parameters %0 181 <1> $M_UNLIM_W EQU 0 ;; Unlimited width character 182 <1> $M_COMMA EQU "," ;; Default Thousand separate 183 <1> $M_CR_LF EQU 0A0DH ;; Default CR/LF 184 <1> $M_SPACE_HYP EQU " -" ;; Default Space/Hyphan 185 <1> $M_SPACE EQU " " ;; Default Space 186 <1> $M_NULL EQU 0 ;; Null 187 <1> $M_FIRST_THOU EQU 3 ;; Location of first thousand separator 188 <1> $M_SECOND_THOU EQU 6 ;; Location of second thousand separator 189 <1> $M_THIRD_THOU EQU 9 ;; Location of third thousand separator 190 <1> $M_BASE10 EQU 10 ;; Base 10 for arthmetic 191 <1> $M_BASE16 EQU 16 ;; Base 16 for arthmetic 192 <1> $M_CLASS_NOT_EXIST EQU 0 ;; Does class exist? 193 <1> $M_TERMINATING_FLAG EQU -1 ;; Is there any more classes? 194 <1> $M_ADDR_SZ_NEAR EQU 2 ;; Size to increment if NEAR 195 <1> $M_ADDR_SZ_FAR EQU 4 ;; Size to increment if FAR 196 <1> labelsize $M_SL, byte, SI ;; Refer to SUBLIST as $M_SL 197 <1> $M_NO_HANDLE EQU -1 ;; No handle flag 198 <1> $M_TEMP_BUF_SZ EQU 64 ;; Size of temporary buffer ;AN003; 199 <1> $M_NEXT_DBCS_VECTOR EQU 2 ;; Amount to increment to get next vector 200 <1> $M_DBCS_TERM EQU 0000 ;; DBCS vector table terminating flag 201 <1> $M_SPECIAL_MSG_NUM EQU 0FFFFH ;; Special generic message number 202 <1> $M_CRLF_SIZE EQU 2 ;; Size of the CR LF message 203 <1> $M_NO_CRLF_MASK EQU 10000000B ;; Mask to supress CR LF 204 <1> $M_ONE_REPLACE EQU 1 ;; Indicate one replacement 205 <1> $M_CRIT_ERR_MASK EQU 00000001B ;; Mask to allow EOF/EOI Crit error 206 <1> ;; 207 <1> $M_ALIGN_MASK EQU 10000000b ;; Mask for align 208 <1> $M_TYPE_MASK EQU 00001111b ;; Mask for types 209 <1> $M_SIZE_MASK EQU 00110000b ;; Mask for types 210 <1> $M_TIME_MASK EQU 00000001b ;; Mask for TIME 211 <1> $M_DATE_MASK EQU 00010000b ;; Mask for TIME 212 <1> $M_BYTE EQU 00010000b ;; BYTE indicator 213 <1> $M_WORD EQU 00100000b ;; WORD indicator 214 <1> $M_DWORD EQU 00110000b ;; DWORD indicator 215 <1> 216 <1> ; Standard reserved DOS handles 217 <1> 218 <1> STDIN EQU 0000H ;; Standard Input device handle 219 <1> STDOUT EQU 0001H ;; Standard Output device handle 220 <1> STDERR EQU 0002H ;; Standard Error Output device handle 221 <1> STDAUX EQU 0003H ;; Standard Auxiliary device handle 222 <1> STDPRN EQU 0004H ;; Standard Printer device handle 223 <1> 224 <1> ; Reserved Message Service equates 225 <1> 226 <1> %iassign NEARmsg TRUE ;; \. 227 <1> %iassign NOVERCHECKmsg FALSE ;; | 228 <1> %iassign MSGDATA FALSE ;; | 229 <1> %iassign FARmsg FALSE ;; | 230 <1> %iassign GETmsg FALSE ;; | 231 <1> %iassign LOADmsg FALSE ;; | 232 <1> %iassign DISPLAYmsg FALSE ;; } Set default cases 233 <1> %iassign SETSTDIO FALSE ;; | 234 <1> %iassign NOCHECKSTDIN FALSE ;; | 235 <1> %iassign NOCHECKSTDOUT FALSE ;; | 236 <1> %iassign DISK_PROC FALSE ;; | ;AN003; 237 <1> %iassign INPUTmsg FALSE ;; | 238 <1> %iassign CHARmsg FALSE ;; | 239 <1> %iassign NUMmsg FALSE ;; | 240 <1> %iassign TIMEmsg FALSE ;; | 241 <1> %iassign DATEmsg FALSE ;; / 242 <1> 243 <1> %iassign COMR FALSE ;; COMMAND.COM Cases (resident) 244 <1> %iassign COMT FALSE ;; (transient) 245 <1> 246 <1> %iassign $M_STRUC TRUE ;; Internal message service defaults 247 <1> %iassign $M_LOAD TRUE ;; 248 <1> %iassign $M_SUBS TRUE ;; 249 <1> %iassign $M_REPLACE TRUE ;; 250 <1> %iassign $M_REPL_DONE FALSE ;; 251 <1> %iassign $M_CHAR_ONLY TRUE ;; 252 <1> %iassign $M_PARSE_FLAG TRUE ;; 253 <1> %iassign $M_EXT_ERR_FLAG TRUE ;; 254 <1> %iassign $M_MSGDATA_ONLY TRUE ;; 255 <1> %iassign $M_END FALSE ;; 256 <1> %iassign $M_EXT_CLS TRUE ;; 257 <1> %iassign $M_PAR_CLS TRUE ;; 258 <1> ;; 259 <1> 260 <1> ; NASM original macros 261 <1> 262 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 263 <1> ;; $M_POPF Macro 264 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 265 <1> 266 <1> %imacro $M_POPF 0.nolist 267 <1> JMP short %%skip 268 <1> %%M_MYRET: 269 <1> IRET 270 <1> %%skip: 271 <1> PUSH CS 272 <1> CALL %%M_MYRET 273 <1> %endmacro 274 <1> 275 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 276 <1> ;; 277 <1> ;; Message Retreiver requests 278 <1> ;; 279 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 280 <1> 281 <1> %unimacro stripangles 2.nolist 282 <1> 283 <1> %imacro stripangles 2.nolist 284 <1> %defstr %%param %2 285 <1> %rep 16 286 <1> %substr %%opening %%param 1 287 <1> %ifidn %%opening, '<' 288 <1> %substr %%param %%param 2,-1 289 <1> %endif 290 <1> %endrep 291 <1> %rep 16 292 <1> %strlen %%length %%param 293 <1> %substr %%closing %%param %%length 294 <1> %ifidn %%closing, '>' 295 <1> %substr %%param %%param 1,-2 296 <1> %endif 297 <1> %endrep 298 <1> %deftok %%token %%param 299 <1> %1 %%token 300 <1> %endmacro 301 <1> 302 <1> %imacro MSG_UTILNAME 1 303 <1> stripangles %defstr %%string, %1 304 <1> %strlen %%length %%string 305 <1> %assign %%ii 1 306 <1> %define %%name "" 307 <1> %rep %%length 308 <1> %substr %%cc %%string %%ii 309 <1> %assign %%ii %%ii + 1 310 <1> %if %%cc >= 'A' && %%cc <= 'Z' 311 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <1> %endif 313 <1> %strcat %%name %%name,%%cc 314 <1> %endrep 315 <1> %strcat %%name %%name,".ctl" 316 <1> %unimacro equ 1+.nolist 317 <1> %imacro equ 1+.nolist 318 <1> %defstr %%string %00 319 <1> %substr %%cc %%string 1 320 <1> %ifidni %%cc, "$" 321 <1> %iassign %00 %1 322 <1> %else 323 <1> %00 equ %1 324 <1> %endif 325 <1> %endmacro 326 <1> %include %%name ; Include the control file for the utility 327 <1> %unimacro equ 1+.nolist 328 <1> %iassign $M_STRUC TRUE ; 329 <1> ;=== Push trace listing source: msgserv.nas 330 <1> %include "msgserv.nas" ; Get structure definitions ; NASM included file 331 <1> ;=== Pop trace listing source 332 <1> %endmacro 333 <1> 334 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 335 <1> ;; MSG_SERVICES Macro 336 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 337 <1> 338 <1> %macro MSG_SERVICES_list1 2-*.nolist 339 <1> %xdefine %%input %1 340 <1> %rep %0 - 1 341 <1> %rotate 1 342 <1> %strcat %%check %1,"msg" 343 <1> %ifidni %%input, %%check 344 <1> %deftok %%prefix %1 345 <1> %iassign %[%%prefix]msg TRUE ; Let the assembler know about the service 346 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 347 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 348 <1> %ifidni %1, "CHAR" 349 <1> %iassign $M_REPLACE TRUE 350 <1> %elifidni %1, "NUM" 351 <1> %iassign $M_REPLACE TRUE 352 <1> %elifidni %1, "TIME" 353 <1> %iassign $M_REPLACE TRUE 354 <1> %elifidni %1, "DATE" 355 <1> %iassign $M_REPLACE TRUE 356 <1> %endif 357 <1> %iassign MSG_SERVICES_MATCHED 1 358 <1> %exitrep 359 <1> %endif 360 <1> %endrep 361 <1> %endmacro 362 <1> 363 <1> %imacro MSG_SERVICES 1-* ; MACRO used in source routine 364 <1> %iassign $M_SERVICE FALSE ; Reset service flag 365 <1> %rep %0 ; FOR each variable in the list 366 <1> %iassign $M_INCLUDE TRUE ; Reset include flag 367 <1> %iassign MSG_SERVICES_MATCHED 0 368 <1> %ifidni %1, "MSGDATA" 369 <1> %iassign MSGDATA TRUE 370 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 371 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 372 <1> %iassign MSG_SERVICES_MATCHED 1 373 <1> %else ; IF it is NOT the message data space request 374 <1> %iassign $M_MSGDATA_ONLY FALSE ; Instruct the assembler to include all services 375 <1> %endif 376 <1> 377 <1> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <1> 379 <1> %ifidni %1,"COMR" 380 <1> %iassign COMR TRUE ; Let the assembler know about the service 381 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 382 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 383 <1> %iassign MSG_SERVICES_MATCHED 1 384 <1> %elifidni %1,"COMT" 385 <1> %iassign COMT TRUE ; Let the assembler know about the service 386 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 387 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 388 <1> %iassign MSG_SERVICES_MATCHED 1 389 <1> %elifidni %1,"SETSTDIO" 390 <1> %iassign SETSTDIO TRUE ; Let the assembler know about the service 391 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 392 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 393 <1> %iassign MSG_SERVICES_MATCHED 1 394 <1> %elifidni %1,"NOCHECKSTDIN" 395 <1> %iassign NOCHECKSTDIN TRUE ; Let the assembler know about the service 396 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 397 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 398 <1> %iassign MSG_SERVICES_MATCHED 1 399 <1> %elifidni %1,"NOCHECKSTDOUT" 400 <1> %iassign NOCHECKSTDOUT TRUE ; Let the assembler know about the service 401 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 402 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 403 <1> %iassign MSG_SERVICES_MATCHED 1 404 <1> %elifidni %1,"DISK_PROC" 405 <1> %iassign DISK_PROC TRUE ; Let the assembler know about the service 406 <1> %iassign $M_SERVICE TRUE ; Let the macro know it was a service 407 <1> %iassign $M_INCLUDE FALSE ; Let the macro know it wasn't a class 408 <1> %iassign MSG_SERVICES_MATCHED 1 409 <1> %endif 410 <1> 411 <1> %IF $M_INCLUDE ; IF message class was requested 412 <1> %define %%string %1 413 <1> %strlen %%length %%string 414 <1> %assign %%ii 1 415 <1> %define %%name "" 416 <1> %rep %%length 417 <1> %substr %%cc %%string %%ii 418 <1> %assign %%ii %%ii + 1 419 <1> %if %%cc >= 'A' && %%cc <= 'Z' 420 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <1> %endif 422 <1> %strcat %%name %%name,%%cc 423 <1> %endrep 424 <1> %ifidni %%name, "format.ctl" 425 <1> ; do nothing, format's display.nas incorrectly includes this twice 426 <1> %else 427 <1> %include %%name ; Include it as a message class 428 <1> %endif 429 <1> %ENDIF ; ENDIF 430 <1> 431 <1> %rotate 1 432 <1> %endrep 433 <1> ; 434 <1> %IF $M_SERVICE ; IF it any services were requested THEN 435 <1> ;=== Push trace listing source: msgserv.nas 436 <1> %include "msgserv.nas" ; THEN include module to get service ; NASM included file 437 <1> ;=== Pop trace listing source 438 <1> %ENDIF ; ENDIF 439 <1> 440 <1> %endmacro 441 <1> 442 <1> 443 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 444 <1> ;; $M_BUILD_PTRS Macro 445 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 446 <1> 447 <1> %imacro $M_BUILD_PTRS 1 448 <1> %iassign $M_INDEX 0 449 <1> %if COMR ; IF this is resident COMMAND.COM 450 <1> $M_MAKE_COMR 451 <1> %elif COMT ; IF this is transient COMMAND.COM 452 <1> $M_MAKE_COMT 453 <1> %else ; Build normal utilities 454 <1> %iassign $M_INDEX 0 455 <1> %iassign $M_COUNT 0 456 <1> %rep %1 457 <1> %iassign $M_COUNT $M_COUNT + 1 458 <1> $M_MAKE $M_COUNT 459 <1> %endrep 460 <1> %endif 461 <1> %endmacro 462 <1> 463 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 464 <1> ;; $M_MAKE Macro 465 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 466 <1> ; 467 <1> %imacro $M_MAKE 1 468 <1> %IF FARmsg ; 469 <1> CALL FAR $M_CLS_%1 ; Get addressibilty to class &$M_APPEND (ES:DI) 470 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX+2],ES ; Move into first avaliable table location 471 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 472 <1> %ELSE ; 473 <1> CALL $M_CLS_%1 ; Get addressibilty to class &$M_APPEND (ES:DI) 474 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 475 <1> %ENDIF ; 476 <1> %iassign $M_INDEX $M_INDEX + 4 ; Set next available table location 477 <1> ; 478 <1> %ENDMacro ; 479 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 480 <1> ;; $M_MAKE_COMR Macro 481 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 482 <1> ; 483 <1> %imacro $M_MAKE_COMR 0 ; 484 <1> ; 485 <1> CALL $M_CLS_3 ; Get addressibilty to class A 486 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 487 <1> %iassign $M_INDEX $M_INDEX + 4 ; Set next available table location 488 <1> ; 489 <1> CALL $M_CLS_4 ; Get addressibilty to class B 490 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 491 <1> %iassign $M_INDEX $M_INDEX + 4 ; Set next available table location 492 <1> ; 493 <1> CALL $M_CLS_5 ; Get addressibilty to class C 494 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 495 <1> %iassign $M_INDEX $M_INDEX + 4 ; Set next available table location 496 <1> ; 497 <1> CALL $M_CLS_6 ; Get addressibilty to class D 498 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 499 <1> %iassign $M_INDEX $M_INDEX + 4 ; Set next available table location 500 <1> ; 501 <1> CALL $M_CLS_7 ; Get addressibilty to class E 502 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 503 <1> %iassign $M_INDEX $M_INDEX + 4 ; Set next available table location 504 <1> ; 505 <1> %ENDMacro ; 506 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 507 <1> ;; $M_MAKE_COMT Macro 508 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 509 <1> ; 510 <1> %imacro $M_MAKE_COMT 0 ; 511 <1> ; 512 <1> CALL $M_CLS_8 ; Get addressibilty to class A 513 <1> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI ; 514 <1> %iassign $M_INDEX $M_INDEX + 4 ; Set next available table location 515 <1> ; 516 <1> %ENDMacro ; 517 <1> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 5 6 MSG_UTILNAME 303 <1> stripangles %defstr %%string, %1 304 <1> %strlen %%length %%string 305 <1> %assign %%ii 1 306 <1> %define %%name "" 307 <1> %rep %%length 308 <1> %substr %%cc %%string %%ii 309 <1> %assign %%ii %%ii + 1 310 <1> %if %%cc >= 'A' && %%cc <= 'Z' 311 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <1> %endif 313 <1> %strcat %%name %%name,%%cc 314 <1> %endrep 308 <2> %substr %%cc %%string %%ii 309 <2> %assign %%ii %%ii + 1 310 <2> %if %%cc >= 'A' && %%cc <= 'Z' 311 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <2> %endif 313 <2> %strcat %%name %%name,%%cc 308 <2> %substr %%cc %%string %%ii 309 <2> %assign %%ii %%ii + 1 310 <2> %if %%cc >= 'A' && %%cc <= 'Z' 311 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <2> %endif 313 <2> %strcat %%name %%name,%%cc 308 <2> %substr %%cc %%string %%ii 309 <2> %assign %%ii %%ii + 1 310 <2> %if %%cc >= 'A' && %%cc <= 'Z' 311 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <2> %endif 313 <2> %strcat %%name %%name,%%cc 308 <2> %substr %%cc %%string %%ii 309 <2> %assign %%ii %%ii + 1 310 <2> %if %%cc >= 'A' && %%cc <= 'Z' 311 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <2> %endif 313 <2> %strcat %%name %%name,%%cc 308 <2> %substr %%cc %%string %%ii 309 <2> %assign %%ii %%ii + 1 310 <2> %if %%cc >= 'A' && %%cc <= 'Z' 311 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <2> %endif 313 <2> %strcat %%name %%name,%%cc 308 <2> %substr %%cc %%string %%ii 309 <2> %assign %%ii %%ii + 1 310 <2> %if %%cc >= 'A' && %%cc <= 'Z' 311 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 312 <2> %endif 313 <2> %strcat %%name %%name,%%cc 315 <1> %strcat %%name %%name,".ctl" 316 <1> %unimacro equ 1+.nolist 317 <1> %imacro equ 1+.nolist 318 <1> %defstr %%string %00 319 <1> %substr %%cc %%string 1 320 <1> %ifidni %%cc, "$" 321 <1> %iassign %00 %1 322 <1> %else 323 <1> %00 equ %1 324 <1> %endif 325 <1> %endmacro 326 <1> %include %%name 1 <2> $M_NUM_CLS EQU 3 327 <1> %unimacro equ 1+.nolist 328 <1> %iassign $M_STRUC TRUE 329 <1> 330 <1> %include "msgserv.nas" 1 <2> ;=== Push trace listing source: msgserv.nas 2 <2> 3 <2> ; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * * 4 <2> ; 5 <2> ; MODULE NAME: MSGSERV.SAL 6 <2> ; 7 <2> ; DESCRIPTIVE NAME: Message Services SALUT file 8 <2> ; 9 <2> ; FUNCTION: This module incorporates all the messages services and 10 <2> ; is called upon at build time to INCLUDE the code requested 11 <2> ; by a utility. Code is requested using the macro MSG_SERVICES. 12 <2> ; 13 <2> ; ENTRY POINT: Since this a collection of subroutines, entry point is at 14 <2> ; requested procedure. 15 <2> ; 16 <2> ; INPUT: Since this a collection of subroutines, input is dependent on function 17 <2> ; requested. 18 <2> ; 19 <2> ; EXIT-NORMAL: In all cases, CARRY FLAG = 0 20 <2> ; 21 <2> ; EXIT-ERROR: In all cases, CARRY FLAG = 1 22 <2> ; 23 <2> ; INTERNAL REFERENCES: (list of included subroutines) 24 <2> ; 25 <2> ; - SYSLOADMSG 26 <2> ; - SYSDISPMSG 27 <2> ; - SYSGETMSG 28 <2> ; 29 <2> ; 30 <2> ; EXTERNAL REFERENCES: None 31 <2> ; 32 <2> ; NOTES: At build time, some modules must be included. These are only included 33 <2> ; once using assembler switches. Other logic is included at the request 34 <2> ; of the utility. 35 <2> ; 36 <2> ; COMR and COMT are assembler switches to conditionally assemble code 37 <2> ; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident 38 <2> ; storage and multiple EQUates. 39 <2> ; 40 <2> ; REVISION HISTORY: Created MAY 1987 41 <2> ; 42 <2> ; Label: DOS - - Message Retriever 43 <2> ; (c) Copyright 1988 Microsoft 44 <2> ; 45 <2> ; 46 <2> ; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * * 47 <2> ; Page 48 <2> 49 <2> ; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting 50 <2> 51 <2> %IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN 52 <2> %iassign $M_STRUC FALSE ;;AN000;; Let the assembler know that we have 53 <2> ;;AN000;; and include them 54 <2> 55 <2> ; PAGE 56 <2> ; SUBTTL DOS - Message Retriever - MSGSTR.INC Module 57 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 58 <2> ;; 59 <2> ;; STRUCTURE: $M_SUBLIST_STRUC 60 <2> ;; 61 <2> ;; Replacable parameters are described by a sublist structure 62 <2> ;; 63 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 64 <2> ;; 65 <2> $M_SUBLIST_STRUC STRUC ;;AN000;; 66 <2> ;; 67 00000000 ?? <2> $M_S_SIZE DB ? ;11 ;;AN000;; SUBLIST size (PTR to next SUBLIST) 68 00000001 ?? <2> $M_S_RESV DB ? ;0 ;;AN000;; RESERVED 69 00000002 ???????? <2> $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item 70 00000006 ?? <2> $M_S_ID DB ? ;;AN000;; n of %n 71 00000007 ?? <2> $M_S_FLAG DB ? ;;AN000;; Data-type flags 72 00000008 ?? <2> $M_S_MAXW DB ? ;;AN000;; Maximum field width 73 00000009 ?? <2> $M_S_MINW DB ? ;;AN000;; Minimum field width 74 0000000A ?? <2> $M_S_PAD DB ? ;;AN000;; Character for Pad field 75 <2> ;; 76 <2> $M_SUBLIST_STRUC ENDS ;;AN000;; 77 <2> ;; 78 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 79 <2> ;; 80 <2> ;; STRUCTURE: $M_CLASS_ID 81 <2> ;; 82 <2> ;; Each class will be defined by this structure. 83 <2> ;; 84 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 85 <2> ;; 86 <2> EXPECTED_VERSION equ expected_version ; NASM port equate 87 <2> 88 <2> $M_CLASS_ID STRUC ;;AN000;; 89 <2> ;; 90 00000000 ?? <2> $M_CLS_ID DB ? ;-1 ;;AN000;; Class identifer 91 00000001 ???? <2> $M_COMMAND_VER DW ? ;EXPECTED_VERSION ;;AN003;; COMMAND.COM version check 92 00000003 ?? <2> $M_NUM_CLS_MSG DB ? ;0 ;;AN000;; Total number of message in class 93 <2> ;; 94 <2> $M_CLASS_ID ENDS ;; 95 <2> ;;AN000;; 96 <2> $M_CLASS_ID_SZ EQU $M_CLASS_ID_struc_size ;;AN000;; 97 <2> ;; 98 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 99 <2> ;; 100 <2> ;; STRUCTURE: $M_ID_STRUC 101 <2> ;; 102 <2> ;; Each message will be defined by this structure. 103 <2> ;; 104 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 105 <2> ;; 106 <2> $M_ID STRUC ;;AN000;; 107 <2> ;; 108 00000000 ???? <2> $M_NUM DW ? ;-1 ;;AN000;; Message Number 109 00000002 ???? <2> $M_TXT_PTR DW ? ;;AN000;; Pointer to message text 110 <2> ;; 111 <2> $M_ID ENDS ;;AN000;; 112 <2> ;;AN000;; Status Flag Values: 113 <2> $M_ID_SZ EQU $M_ID_struc_size ;;AN000;; 114 <2> ;; 115 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 116 <2> ;; 117 <2> ;; STRUCTURE: $M_RES_ADDRS 118 <2> ;; 119 <2> ;; Resident data area definition of variables 120 <2> ;; 121 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 122 <2> ;; 123 <2> $M_RES_ADDRS STRUC ;;AN000;; 124 <2> ;; 125 00000000 ???????? <2> $M_EXT_ERR_ADDRS DD ? ;0 ;;AN000;; Allow pointers to THREE Extended error locations 126 00000004 ???????? <2> $M_EXT_FILE DD ? ;0 ;;AN001;; 127 00000008 ???????? <2> $M_EXT_COMMAND DD ? ;0 ;;AN000;; 128 0000000C ???????? <2> $M_EXT_TERM DD ? ;-1 ;;AN000;; 129 00000010 ???????? <2> $M_PARSE_COMMAND DD ? ;0 ;;AN000;; 130 00000014 ???????? <2> $M_PARSE_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Parse error locations 131 00000018 ???????? <2> $M_PARSE_TERM DD ? ;-1 ;;AN000;; 132 0000001C ???????? <2> $M_CRIT_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Critical error locations 133 00000020 ???????? <2> $M_CRIT_COMMAND DD ? ;0 ;;AN000;; 134 00000024 ???????? <2> $M_CRIT_TERM DD ? ;-1 ;;AN000;; 135 00000028 ???????? <2> $M_DISK_PROC_ADDR DD ? ;-1 ;;AN004;; Address of READ_DISK_PROC 136 0000002C <2> $M_CLASS_ADDRS DD $M_NUM_CLS DUP (?) ;(0) ;;AN000;; Allow pointers to specified classes 137 00000038 ???????? <2> $M_CLS_TERM DD ? ;-1 ;;AN000;; 138 0000003C ???????? <2> $M_DBCS_VEC DD ? ;0 ;;AN000;; Save DBCS vector 139 00000040 ???? <2> $M_HANDLE DW ? ;;AN000;; 140 00000042 ?? <2> $M_SIZE DB ? ;0 ;;AN000;; 141 00000043 ???? <2> $M_CRLF DB ?,? ;0DH,0AH ;;AN004;; CR LF message 142 00000045 ?? <2> $M_CLASS DB ? ;;AN004;; Saved class 143 00000046 ???? <2> $M_RETURN_ADDR DW ? ;;AN000;; 144 00000048 ???? <2> $M_MSG_NUM DW ? ;$M_NULL ;;AN000;; 145 0000004A ???? <2> $M_DIVISOR DW ? ;10 ;;AN000;; Default = 10 (must be a WORD for division) 146 0000004C <2> $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP (?) ;("$") ;;AN000;; Temporary buffer 147 0000008C ?? <2> $M_BUF_TERM DB ? ;"$" ;;AN000;; 148 <2> 149 <2> $M_RES_ADDRS ENDS ;;AN000;; 150 <2> ;; 151 <2> $M_RES_ADDRS_SZ EQU $M_RES_ADDRS_struc_size ;;AN000;; 152 <2> ;; 153 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 154 <2> ;; 155 <2> ;; STRUCTURE: $M_COUNTRY_INFO 156 <2> ;; 157 <2> ;; Important fields of the Get Country Information call 158 <2> ;; 159 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 160 <2> ;; 161 <2> $M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation 162 <2> ;; 163 00000000 <2> $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc 164 0000004C ???? <2> $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format 165 0000004E ?????????? <2> $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;; 166 00000053 ???? <2> $M_THOU_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Thou Separator 167 00000055 ???? <2> $M_DECI_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Decimal Separator 168 00000057 ???? <2> $M_DATE_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Date Separator 169 00000059 ???? <2> $M_TIME_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Time Separator 170 0000005B ?? <2> $M_CURR_FORMAT DB ? ;;AN000;; 171 0000005C ?? <2> $M_SIG_DIGS_CU DB ? ;;AN000;; 172 0000005D ?? <2> $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format 173 <2> ;; 174 <2> $M_COUNTRY_INFO ENDS ;;AN000;; 175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 176 <2> ;; 177 <2> %ELSE ;;AN000;; ELSE if we have already included the STRUCTURES 178 <2> ; 179 <2> ; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section 180 <2> 181 <2> %IF MSGDATA ;;AN000;; IF this is a request to include the data area 182 <2> %iassign MSGDATA FALSE ;;AN000;; Let the assembler know not to include it again 183 <2> ;;AN000;; and include it 184 <2> ; PAGE 185 <2> ; SUBTTL DOS - Message Retriever - MSGRES.TAB Module 186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 187 <2> ;; 188 <2> ;; DATA NAME: $M_RES_TABLE 189 <2> ;; 190 <2> ;; REFERENCE LABEL: $M_RT 191 <2> ;; 192 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 193 <2> 194 <2> %if 0 ; disabled for now, figure out later 195 <2> %IF COMR ;;AN000;; Since COMMAND.COM includes this twice 196 <2> $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no 197 <2> $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur 198 <2> $M_ALTLABEL equ TRUE ;;AN000;; Flag that label was changed 199 <2> %ELSE ;;AN000;; 200 <2> $M_RT LABEL BYTE ;;AN000;; 201 <2> %ENDIF 202 <2> %endif 203 <2> $M_RT: ; NASM structure instance 204 <2> $M_RES_ADDRS_size equ $M_RES_ADDRS_struc_size ; NASM port equate 205 <2> istruc $M_RES_ADDRS 206 <2> at $M_EXT_ERR_ADDRS 207 <2> dd 0 208 <2> at $M_EXT_FILE 209 <2> dd 0 210 <2> at $M_EXT_COMMAND 211 <2> dd 0 212 <2> at $M_EXT_TERM 213 <2> dd -1 214 <2> at $M_PARSE_COMMAND 215 <2> dd 0 216 <2> at $M_PARSE_ADDRS 217 <2> dd 0 218 <2> at $M_PARSE_TERM 219 <2> dd -1 220 <2> at $M_CRIT_ADDRS 221 <2> dd 0 222 <2> at $M_CRIT_COMMAND 223 <2> dd 0 224 <2> at $M_CRIT_TERM 225 <2> dd -1 226 <2> at $M_DISK_PROC_ADDR 227 <2> dd -1 228 <2> at $M_CLASS_ADDRS 229 <2> times $M_NUM_CLS dd 0 230 <2> at $M_CLS_TERM 231 <2> dd -1 232 <2> at $M_DBCS_VEC 233 <2> dd 0 234 <2> at $M_HANDLE 235 <2> dw 0 236 <2> at $M_SIZE 237 <2> db 0 238 <2> at $M_CRLF 239 <2> db 0Dh, 0Ah 240 <2> at $M_CLASS 241 <2> db 0 242 <2> at $M_RETURN_ADDR 243 <2> dw 0 244 <2> at $M_MSG_NUM 245 <2> dw 0 246 <2> at $M_DIVISOR 247 <2> dw 10 248 <2> at $M_TEMP_BUF 249 <2> times $M_TEMP_BUF_SZ db "$" 250 <2> at $M_BUF_TERM 251 <2> db "$" 252 <2> iend 253 <2> ;; 254 <2> %include "copyrigh.mac" ;;AN001;; Include Copyright 1988 Microsoft 255 <2> ;; 256 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 257 <2> %ENDIF ;;AN000;; END of include of Data table 258 <2> 259 <2> ; 260 <2> %IFN $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN 261 <2> ;; don't include any more code 262 <2> ;;AN000;; Figure out what other code to include 263 <2> %IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code 264 <2> %IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it) 265 <2> $M_RT EQU $M_RT2 ;;AN003;; 266 <2> %ENDIF 267 <2> %iassign DISK_PROC FALSE ;;AN003;; Yes, THEN include it and reset flag 268 <2> ; PAGE 269 <2> ; SUBTTL DOS - Message Retriever - DISK_PROC Module 270 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 271 <2> ;; 272 <2> ;; PROC NAME: DISK_PROC 273 <2> ;; 274 <2> ;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended 275 <2> ;; errors from disk\diskette 276 <2> ;; INPUTS: AX has the message number 277 <2> ;; DX has the message class 278 <2> ;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is 279 <2> ;; assumed to be set!! 280 <2> ;; 281 <2> ;; OUTPUTS: ES:DI points to message length (BYTE) followed by text 282 <2> ;; 283 <2> ;; 284 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 285 <2> ;; 286 <2> PUBLIC READ_DISK_PROC ;; 287 <2> ;; 288 <2> READ_DISK_PROC PROC FAR ;;AN003;; 289 <2> 290 <2> PUSH AX ;;AN003;; Save everything 291 <2> PUSH BX ;;AN003;; 292 <2> PUSH DX ;;AN003;; 293 <2> PUSH SI ;;AN003;; 294 <2> PUSH BP ;;AN003;; 295 <2> PUSH DS ;;AN003;; 296 <2> PUSH DI ;;AN003;; 297 <2> MOV BP,AX ;;AN003;; Save message number 298 <2> MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function 299 <2> LEA SI,[COMSPEC wrt RESGROUP] ;;AN003;; Get addressibilty to COMMAND.COM 300 <2> PUSH CS ;;AN003;; 301 <2> POP DS ;;AN003;; 302 <2> MOV DI,-1 ;;AN003;; No extended attribute list 303 <2> MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error 304 <2> MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag 305 <2> INT 21H ;;AN003;; Open the file 306 <2> POP DI ;;AN003;; Retreive LSEEK pointer 307 <2> ;;AN003;; Error ? 308 <2> ; $IF NC,LONG ;;AN003;; No, 309 <2> JNC $MXL1 310 <2> JMP $MIF1 311 <2> $MXL1: 312 <2> PUSH DI ;;AN003;; Save LSEEK pointer 313 <2> MOV BX,AX ;;AN003;; Set handle in BX 314 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors 315 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 316 <2> MOV DX,DI ;;AN003;; 317 <2> INT 21H ;;AN003;; LSEEK the file 318 <2> POP DX ;;AN003;; Retreive LSEEK pointer 319 <2> ;;AN003;; Error ? 320 <2> ; $IF NC ;;AN003;; No, 321 <2> JC $MIF2 322 <2> INC CX ;;AN003;; Set flag to first pass 323 <2> ; $DO ;;AN003;; 324 <2> $MDO3: 325 <2> PUSH DX ;;AN003;; Save LSEEK pointer 326 <2> PUSH CX ;;AN003;; Save first pass flag 327 <2> PUSH AX ;;AN003;; Save number of messages (if set yet) 328 <2> XOR SI,SI ;;AN003;; Reset buffer index 329 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 330 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header 331 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 332 <2> INT 21H ;;AN003;; Read it 333 <2> MOV DI,DX ;;AN003;; 334 <2> POP AX ;;AN003;; 335 <2> POP CX ;;AN003;; 336 <2> OR CX,CX ;;AN003;; 337 <2> ; $IF NZ ;;AN003;; 338 <2> JZ $MIF4 339 <2> XOR CX,CX ;;AN003;; Set flag to second pass 340 <2> XOR AH,AH ;;AN003;; Get number of messages in class 341 <2> MOV AL,[DI + $M_NUM_CLS_MSG] ;;AN003;; 342 <2> MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index 343 <2> CMP word [DI + $M_COMMAND_VER],EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM? 344 <2> ; $ENDIF ;;AN003;; 345 <2> $MIF4: 346 <2> POP DX ;;AN003;; 347 <2> ; $IF Z ;;AN003;; Yes, 348 <2> JNZ $MIF6 349 <2> ; $SEARCH ;;AN003;; 350 <2> $MDO7: 351 <2> CMP BP,WORD PTR [$M_RT + $M_TEMP_BUF + SI] ;;AN003;; Is this the message I'm looking for? 352 <2> ; $EXITIF Z ;;AN003;; Yes, (ZF=1) 353 <2> JNZ $MIF7 354 <2> CLC ;;AN003;; Reset carry, exit search 355 <2> ; $ORELSE ;;AN003;; No, (ZF=0) 356 <2> JMP SHORT $MSR7 357 <2> $MIF7: 358 <2> ADD SI,$M_ID_SZ ;;AN003;; Increment index 359 <2> ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header 360 <2> DEC AX ;;AN003;; Decrement # of messages left 361 <2> ; $LEAVE Z ;;AN003;; Have we exhausted all messages? 362 <2> JZ $MEN7 363 <2> CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer? 364 <2> ; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1) 365 <2> JNA $MDO7 366 <2> $MEN7: 367 <2> STC ;;AN003;; Yes, (ZF=0) set error (ZF=0) 368 <2> ; $ENDSRCH ;;AN003;; 369 <2> $MSR7: 370 <2> ; $ELSE ;;AN003;; No, 371 <2> JMP SHORT $MEN6 372 <2> $MIF6: 373 <2> XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop 374 <2> STC ;;AN003;; Set Carry 375 <2> ; $ENDIF ;;AN003;; 376 <2> $MEN6: 377 <2> ; $ENDDO Z ;;AN003;; Get next buffer full if needed 378 <2> JNZ $MDO3 379 <2> ;;AN003;; Error ? 380 <2> ; $IF NC ;;AN003;; No, 381 <2> JC $MIF16 382 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message 383 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 384 <2> ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header 385 <2> ADD DX,WORD PTR [$M_RT + $M_TEMP_BUF + SI + 2] ;;AN003;; Add offset from msg structure 386 <2> INT 21H ;;AN003;; LSEEK the file 387 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 388 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message 389 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 390 <2> INT 21H ;;AN003;; Read it 391 <2> MOV DI,DX ;;AN003;; into the temp buffer 392 <2> PUSH DS ;;AN003;; into the temp buffer 393 <2> POP ES ;;AN003;; into the temp buffer 394 <2> ; $ENDIF ;;AN003;; 395 <2> $MIF16: 396 <2> ; $ENDIF ;;AN003;; 397 <2> $MIF2: 398 <2> PUSHF ;;AN003;; Close file handle 399 <2> MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle 400 <2> INT 21H ;;AN003;; 401 <2> $M_POPF ;;AN003;; 402 <2> ; $ENDIF ;;AN003;; Yes there was an error, 403 <2> $MIF1: 404 <2> POP DS ;;AN003;; 405 <2> POP BP ;;AN003;; 406 <2> POP SI ;;AN003;; 407 <2> POP DX ;;AN003;; 408 <2> POP BX ;;AN003;; 409 <2> POP AX ;;AN003;; 410 <2> ;;AN003;; abort everything 411 <2> RET ;;AN003;; 412 <2> 413 <2> READ_DISK_PROC ENDP ;;AN003;; 414 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 415 <2> %ENDIF ;;AN003;; END of include for DISK_PROC 416 <2> ; 417 <2> 418 <2> %IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO 419 <2> %iassign SETSTDIO FALSE ;;AN000;; Yes, THEN include it and reset flag 420 <2> ; PAGE 421 <2> ; SUBTTL DOS - Message Retriever - SETSTDIO Module 422 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 423 <2> ;; 424 <2> ;; PROC NAME: SETSTDIO 425 <2> ;; 426 <2> ;; FUNCTION: 427 <2> ;; INPUTS: 428 <2> ;; 429 <2> ;; OUPUTS: 430 <2> ;; 431 <2> ;; 432 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 433 <2> ;; 434 <2> %IF FARmsg ;AN001; 435 <2> SETSTDINON PROC FAR ;AN001; 436 <2> %ELSE ;AN001; 437 <2> SETSTDINON PROC NEAR ;AN001; 438 <2> %ENDIF ;AN001; 439 <2> PUSH AX ;AN002; Save changed regs 440 <2> PUSH BX ;AN002; 441 <2> PUSH DX ;AN002; 442 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 443 <2> MOV BX,STDIN ;AN001; 444 <2> XOR DX,DX ;AN001; 445 <2> INT 21H ;AN001; 446 <2> 447 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 448 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 449 <2> INT 21H ;AN001; 450 <2> POP DX ;AN002; Restore Regs 451 <2> POP BX ;AN002; 452 <2> POP AX ;AN002; 453 <2> 454 <2> RET ;AN001; 455 <2> ;AN001; 456 <2> SETSTDINON ENDP ;AN001; 457 <2> 458 <2> %IF FARmsg ;AN001; 459 <2> SETSTDINOFF PROC FAR ;AN001; 460 <2> %ELSE ;AN001; 461 <2> SETSTDINOFF PROC NEAR ;AN001; 462 <2> %ENDIF ;AN001; 463 <2> 464 <2> PUSH AX ;AN002; Save changed regs 465 <2> PUSH BX ;AN002; 466 <2> PUSH DX ;AN002; 467 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 468 <2> MOV BX,STDIN ;AN001; 469 <2> XOR DX,DX ;AN001; 470 <2> INT 21H ;AN001; 471 <2> 472 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 473 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 474 <2> INT 21H ;AN001; 475 <2> POP DX ;AN002; Restore Regs 476 <2> POP BX ;AN002; 477 <2> POP AX ;AN002; 478 <2> 479 <2> RET ;AN001; 480 <2> 481 <2> SETSTDINOFF ENDP ;AN001; 482 <2> 483 <2> %IF FARmsg ;AN001; 484 <2> SETSTDOUTON PROC FAR ;AN001; 485 <2> %ELSE ;AN001; 486 <2> SETSTDOUTON PROC NEAR ;AN001; 487 <2> %ENDIF ;AN001; 488 <2> 489 <2> PUSH AX ;AN002; Save changed regs 490 <2> PUSH BX ;AN002; 491 <2> PUSH DX ;AN002; 492 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 493 <2> MOV BX,STDOUT ;AN001; 494 <2> XOR DX,DX ;AN001; 495 <2> INT 21H ;AN001; 496 <2> 497 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 498 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 499 <2> INT 21H ;AN001; 500 <2> POP DX ;AN002; Restore Regs 501 <2> POP BX ;AN002; 502 <2> POP AX ;AN002; 503 <2> 504 <2> RET ;AN001; 505 <2> 506 <2> SETSTDOUTON ENDP ;AN001; 507 <2> 508 <2> %IF FARmsg ;AN001; 509 <2> SETSTDOUTOFF PROC FAR ;AN001; 510 <2> %ELSE ;AN001; 511 <2> SETSTDOUTOFF PROC NEAR 512 <2> %ENDIF ;AN001; 513 <2> 514 <2> PUSH AX ;AN002; Save changed regs 515 <2> PUSH BX ;AN002; 516 <2> PUSH DX ;AN002; 517 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 518 <2> MOV BX,STDOUT ;AN001; 519 <2> XOR DX,DX ;AN001; 520 <2> INT 21H ;AN001; 521 <2> 522 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 523 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 524 <2> INT 21H ;AN001; 525 <2> POP DX ;AN002; Restore Regs 526 <2> POP BX ;AN002; 527 <2> POP AX ;AN002; 528 <2> 529 <2> RET ;AN001; 530 <2> 531 <2> SETSTDOUTOFF ENDP ;AN001; 532 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 533 <2> %ENDIF ;;AN000;; END of include for SETSTDIO 534 <2> ; 535 <2> %IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ? 536 <2> %IF COMR ;;AN000;; 537 <2> $M_RT EQU $M_RT2 ;;AN000;; 538 <2> %ENDIF 539 <2> %iassign LOADmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 540 <2> ; PAGE 541 <2> ; SUBTTL DOS - Message Retriever - LOADMSG.ASM Module 542 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 543 <2> ;; 544 <2> ;; PROC NAME: SYSLOADMSG 545 <2> ;; 546 <2> ;; FUNCTION: 547 <2> ;; INPUTS: 548 <2> ;; 549 <2> ;; OUPUTS: 550 <2> ;; 551 <2> ;; 552 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 553 <2> ;; 554 <2> %IF FARmsg ;;AN000;; 555 <2> SYSLOADMSG PROC FAR ;;AN000;; 556 <2> %ELSE ;;AN000;; 557 <2> SYSLOADMSG PROC NEAR ;;AN000;; 558 <2> %ENDIF ;;AN000;; 559 <2> PUSH AX ;;AN000; 560 <2> PUSH BX ;;AN000; 561 <2> PUSH DX ;;AN000; 562 <2> PUSH ES ;;AN000; 563 <2> PUSH DI ;;AN000; 564 <2> XOR CX,CX ;;AN000; Reset to zero 565 <2> MOV ES,CX ;;AN000; 566 <2> XOR DI,DI ;;AN000; 567 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 568 <2> MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM 569 <2> INT 2FH ;;AN000;; Private interface 570 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 571 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND],DI ;;AN000;; 572 <2> ;; 573 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 574 <2> MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM 575 <2> INT 2FH ;;AN000;; Private interface 576 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 577 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND],DI ;;AN000;; 578 <2> ;; 579 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 580 <2> MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM 581 <2> INT 2FH ;;AN000;; Private interface 582 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 583 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND],DI ;;AN000;; 584 <2> 585 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 586 <2> MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE 587 <2> INT 2FH ;;AN001;; Private interface 588 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE+2],ES ;;AN001;; Move into first avaliable table location 589 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE],DI ;;AN001;; 590 <2> 591 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 592 <2> Extrn READ_DISK_PROC:Far ;;AN003;; 593 <2> %ELSE ;; 594 <2> %IF FARmsg ;;AN000;; 595 <2> CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 596 <2> %ELSE ;;AN000;; 597 <2> CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 598 <2> %ENDIF ;;AN000;; 599 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 600 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS],DI ;;AN000;; 601 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 602 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS],DI ;;AN000;; 603 <2> ;; 604 <2> %IF FARmsg ;;AN000;; 605 <2> CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 606 <2> %ELSE ;;AN000;; 607 <2> CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 608 <2> %ENDIF ;;AN000;; 609 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 610 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS],DI ;;AN000;; 611 <2> %ENDIF ;; 612 <2> ;; 613 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 614 <2> MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM 615 <2> INT 2FH ;;AN001;; Private interface 616 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR+2],ES ;;AN001;; Move into first avaliable table location 617 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR],DI ;;AN001;; 618 <2> 619 <2> $M_BUILD_PTRS $M_NUM_CLS ;;AN000;; Build all utility classes 620 <2> ;;AN000;; 621 <2> CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector 622 <2> 623 <2> %IFN NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed 624 <2> CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK 625 <2> %ENDIF ;;AN000;; 626 <2> ;;AN000;; 627 <2> %IFN NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed 628 <2> CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK 629 <2> %ENDIF ;;AN000;; 630 <2> ;;AN000;; 631 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 632 <2> CLC ;;AN000;; Make sure carry is clear 633 <2> %ELSE ;;AN000;; ELSE 634 <2> PUSH CX ;;AN000;; 635 <2> CALL $M_VERSION_CHECK ;;AN000;; Check Version 636 <2> %ENDIF ;;AN000;; 637 <2> ;; Error ? 638 <2> ; $IF NC ;;AN000;; No. 639 <2> JC $MIF20 640 <2> %IFN NOVERCHECKmsg ;;AN000;; IF version check was not supressed 641 <2> POP CX ;;AN000;; Reset stack 642 <2> %ENDIF ;;AN000;; 643 <2> POP DI ;;AN000;; Restore REGS 644 <2> POP ES ;;AN000;; 645 <2> POP DX ;;AN000;; 646 <2> POP BX ;;AN000;; 647 <2> POP AX ;;AN000;; 648 <2> ; $ELSE ;;AN000;; Yes, 649 <2> JMP SHORT $MEN20 650 <2> $MIF20: 651 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 652 <2> ADD SP,10 ;;AN000;; 653 <2> STC ;;AN000;; Reset carry flag 654 <2> %ELSE ;;AN000;; IF version check is to be supressed 655 <2> ADD SP,12 ;;AN000;; 656 <2> STC ;;AN000;; Reset carry flag 657 <2> %ENDIF ;;AN000;; IF version check is to be supressed 658 <2> ; $ENDIF ;;AN000;; 659 <2> $MEN20: 660 <2> RET ;;AN000;; 661 <2> ;; 662 <2> SYSLOADMSG ENDP ;;AN000;; 663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 664 <2> ; PAGE 665 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 666 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 667 <2> ;; 668 <2> ;; Proc Name: $M_GET_DBCS_VEC 669 <2> ;; 670 <2> ;; Function: Get the DBCS vector and save it for later use 671 <2> ;; 672 <2> ;; Inputs: None 673 <2> ;; 674 <2> ;; Outputs: None 675 <2> ;; 676 <2> ;; Regs Changed: 677 <2> ;; 678 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 679 <2> ;; 680 <2> $M_GET_DBCS_VEC PROC NEAR ;;AN000;; 681 <2> ;; 682 <2> PUSH AX ;;AN000;; Save character to check 683 <2> PUSH SI ;;AN000;; 684 <2> PUSH DS ;;AN000;; 685 <2> MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment 686 <2> INT 21H ;;AN000;; Get environment pointer 687 <2> PUSH DS ;;AN000;; Get environment pointer 688 <2> POP ES ;;AN000;; Get environment pointer 689 <2> POP DS ;;AN000;; Get environment pointer 690 <2> ; $IF NC ;;AN000;; 691 <2> JC $MIF23 692 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC],SI ;;AN000;; Save DBCS Vector 693 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC+2],ES ;;AN000;; 694 <2> ; $ENDIF ;;AN000;; 695 <2> $MIF23: 696 <2> POP SI ;;AN000;; 697 <2> POP AX ;;AN000;; Retrieve character to check 698 <2> RET ;;AN000;; Return 699 <2> ;; 700 <2> $M_GET_DBCS_VEC ENDP ;; 701 <2> ;; 702 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 703 <2> %IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ? 704 <2> %ELSE ;AN001; Yes, THEN include it 705 <2> ; PAGE 706 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc 707 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 708 <2> ;; 709 <2> ;; Proc Name: $M_CHECKSTDIN 710 <2> ;; 711 <2> ;; Function: 712 <2> ;; 713 <2> ;; Inputs: None 714 <2> ;; 715 <2> ;; Outputs: 716 <2> ;; 717 <2> ;; Regs Changed: 718 <2> ;; 719 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 720 <2> ;; 721 <2> $M_CHECKSTDIN PROC NEAR ;AN001; 722 <2> 723 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 724 <2> MOV BX,STDIN ;AN001; 725 <2> XOR DX,DX ;AN001; 726 <2> INT 21H ;AN001; 727 <2> 728 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 729 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 730 <2> INT 21H ;AN001; 731 <2> 732 <2> RET ;AN001; 733 <2> 734 <2> $M_CHECKSTDIN ENDP ;AN001; 735 <2> ;; 736 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 737 <2> %ENDIF ;AN001; END of include for EOF Check 738 <2> %IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full? 739 <2> %ELSE ;AN001; Yes, THEN include it 740 <2> ; PAGE 741 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc 742 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 743 <2> ;; 744 <2> ;; Proc Name: $M_CHECKSTDOUT 745 <2> ;; 746 <2> ;; Function: 747 <2> ;; 748 <2> ;; Inputs: None 749 <2> ;; 750 <2> ;; Outputs: 751 <2> ;; 752 <2> ;; Regs Changed: 753 <2> ;; 754 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 755 <2> ;; 756 <2> $M_CHECKSTDOUT PROC NEAR ;AN001; 757 <2> 758 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 759 <2> MOV BX,STDOUT ;AN001; 760 <2> XOR DX,DX ;AN001; 761 <2> INT 21H ;AN001; 762 <2> 763 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 764 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 765 <2> INT 21H ;AN001; 766 <2> 767 <2> RET ;AN001; 768 <2> 769 <2> $M_CHECKSTDOUT ENDP ;AN001; 770 <2> ;; 771 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 772 <2> %ENDIF ;AN001; END of include for Disk Full Check 773 <2> %IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check? 774 <2> %ELSE ;;AN000;; Yes, THEN include it 775 <2> ; PAGE 776 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 778 <2> ;; 779 <2> ;; Proc Name: $M_VERSION_CHECK 780 <2> ;; 781 <2> ;; Function: Determine if DOS version is within allowable limits 782 <2> ;; 783 <2> ;; Inputs: None 784 <2> ;; 785 <2> ;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version 786 <2> ;; Registers set for SYSDISPMSG 787 <2> ;; CARRY_FLAG = 0 if Correct DOS version 788 <2> ;; 789 <2> ;; Regs Changed: AX 790 <2> ;; 791 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 792 <2> 793 <2> check_amis: 794 <2> push ax 795 <2> push ds 796 <2> push si 797 <2> push es 798 <2> push di 799 <2> push dx 800 <2> push ax ; version number, last on stack 801 <2> 802 <2> mov ah, 0 ; multiplex number = 0 803 <2> .loop: 804 <2> mov al, 0 805 <2> int 2Dh ; installation check 806 <2> cmp al, -1 ; multiplexer installed ? 807 <2> jne .next ; no --> 808 <2> push cs 809 <2> pop ds 810 <2> mov si, offset amis_sign ; ds:si -> amis_sign (for lDOS) 811 <2> mov es, dx ; es:di -> multiplexer's sign 812 <2> mov cx, 8 ; 16 bytes 813 <2> repe cmpsw ; compare 814 <2> jne .next ; not us --> 815 <2> mov dx, cs ; dx:si -> amis_id 816 <2> mov al, 11h 817 <2> int 2Dh ; CHG: al, bx, cx, dx, si, di 818 <2> cmp al, 0 ; id call supported ? 819 <2> je .unsup ; no, allow if alt version --> 820 <2> pop dx 821 <2> xor dx, dx ; 2D.MM11 supported, mark that we need it 822 <2> push dx 823 <2> cmp al, 0F0h ; CY if below 0F0h 824 <2> jmp .done 825 <2> 826 <2> .next: 827 <2> inc ah ; next multiplex number 828 <2> jnz .loop ; ZR if done, NZ if more to check --> 829 <2> .unsup: 830 <2> stc ; multiplexer not found 831 <2> ; or function not supported 832 <2> .done: 833 <2> ; CY if not an lDOS revision with our id supported, 834 <2> ; on stack: alt_expected_version if it's fine and either 835 <2> ; no multiplexer or func 11h not supported 836 <2> ; new_expected_version if not fine and either 837 <2> ; no multiplexer or func 11h not suppprted, 838 <2> ; 0 if multiplexer found, func 11h supported, but 839 <2> ; our id is unsupported 840 <2> ; NC if lDOS revision with multiplexer and our id supported 841 <2> pop bx 842 <2> pop dx 843 <2> pop di 844 <2> pop es 845 <2> pop si 846 <2> pop ds 847 <2> pop ax 848 <2> jnc alt_good_DOS ; id is supported --> 849 <2> cmp bx, alt_expected_version ; is it fine ? 850 <2> je alt_good_DOS ; yes --> (NC) 851 <2> jmp $MIF25 ; no, cancel program --> 852 <2> 853 <2> $M_VERSION_CHECK PROC NEAR ;;AN000;; 854 <2> ;; 855 <2> MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC 856 <2> INT 21H ;;AN000;; 857 <2> ;; 858 <2> cmp ax,new_expected_version ; compare with DOS version 859 <2> je check_amis 860 <2> cmp ax,alt_expected_version ; compare with DOS version 861 <2> je check_amis 862 <2> CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct 863 <2> ; $IF E ;;AN000;; 864 <2> JNE $MIF25 865 <2> alt_good_DOS: 866 <2> CLC ;;AN000;; Clear the carry flag 867 <2> ; $ELSE ;;AN000;; ELSE 868 <2> JMP SHORT $MEN25 869 <2> $MIF25: 870 <2> %IFN COMR ;; ** Special case for RESIDENT COMMAND.COM 871 <2> CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH 872 <2> ; $IF B ;;AN000;; No, 873 <2> JNB $MIF27 874 <2> MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support) 875 <2> ; $ELSE ;;AN000;; Yes, 876 <2> JMP SHORT $MEN27 877 <2> $MIF27: 878 <2> MOV BX,STDERR ;;AN000;; Standard Error 879 <2> ; $ENDIF ;;AN000;; 880 <2> $MEN27: 881 <2> %ELSE 882 <2> MOV BX,NO_HANDLE ;;AN000;; No handle 883 <2> %ENDIF 884 <2> MOV AX,1 ;;AN000;; Set message # 1 885 <2> MOV CX,NO_REPLACE ;;AN000;; No replacable parms 886 <2> MOV DL,NO_INPUT ;;AN000;; No input 887 <2> MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message 888 <2> STC ;;AN000;; Set Carry Flag 889 <2> ; $ENDIF ;;AN000;; 890 <2> $MEN25: 891 <2> ;; 892 <2> RET ;;AN000;; Return 893 <2> ;; 894 <2> $M_VERSION_CHECK ENDP ;; 895 <2> ;; 896 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 897 <2> %ENDIF ;;AN000;; END of include for DOS version check 898 <2> %ENDIF ;;AN000;; END of include for SYSLOADMSG 899 <2> ; 900 <2> %IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 901 <2> %IF COMR ;;AN000;; 902 <2> $M_RT EQU $M_RT2 ;;AN000;; 903 <2> %ENDIF ;;AN000;; 904 <2> GETmsg equ FALSE ;;AN000;; Yes, THEN include it and reset flag 905 <2> ; PAGE 906 <2> ; SUBTTL DOS - Message Retriever - GETMSG.ASM Module 907 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 908 <2> ;; 909 <2> ;; Proc Name: SYSGETMSG 910 <2> ;; 911 <2> ;; Function: The GET service returns the segment, offset and size of the 912 <2> ;; message text to the caller based on a message number. 913 <2> ;; The GET function will not display the message thus assumes 914 <2> ;; caller will handle replaceable parameters. 915 <2> ;; 916 <2> ;; Inputs: 917 <2> ;; 918 <2> ;; Outputs: 919 <2> ;; 920 <2> ;; Psuedocode: 921 <2> ;; Call $M_GET_MSG_ADDRESS 922 <2> ;; IF MSG_NUM exists THEN 923 <2> ;; Set DS:SI = MSG_TXT_PTR + 1 924 <2> ;; CARRY_FLAG = 0 925 <2> ;; ELSE 926 <2> ;; CARRY_FLAG = 1 927 <2> ;; ENDIF 928 <2> ;; 929 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 930 <2> ;; 931 <2> %IF FARmsg ;;AN000;; 932 <2> SYSGETMSG PROC FAR ;;AN000;; 933 <2> %ELSE ;;AN000;; 934 <2> SYSGETMSG PROC NEAR ;;AN000;; 935 <2> %ENDIF ;;AN000;; 936 <2> ;; 937 <2> ;; Save registers needed later 938 <2> 939 <2> PUSH AX ;;AN000;; Save changed regs 940 <2> PUSH ES ;;AN000;; 941 <2> PUSH DI ;;AN000;; 942 <2> PUSH BP ;;AN000;; 943 <2> ;; 944 <2> %IF FARmsg ;;AN000;; 945 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 946 <2> %ELSE ;;AN000;; 947 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 948 <2> %ENDIF ;;AN000;; Return message in ES:DI 949 <2> ; $IF NC ;;AN000;; Message found? 950 <2> JC $MIF31 951 <2> CMP DH,UTILITY_MSG_CLASS 952 <2> CLC ;;AN000;; 953 <2> ; $IF NE 954 <2> JE $MIF32 955 <2> PUSH ES ;;AN000;; 956 <2> POP DS ;;AN000;; Return message in DS:SI 957 <2> ; $ELSE 958 <2> JMP SHORT $MEN32 959 <2> $MIF32: 960 <2> %IF FARmsg ;;AN000;; Yes, 961 <2> PUSH ES ;;AN000;; 962 <2> POP DS ;;AN000;; Return message in DS:SI 963 <2> %ELSE ;;AN000;; 964 <2> PUSH CS ;;AN000;; Return message in DS:SI 965 <2> POP DS ;;AN000;; 966 <2> %ENDIF ;;AN000;; 967 <2> ; $ENDIF ;;AN000;; 968 <2> $MEN32: 969 <2> MOV SI,DI ;;AN000;; Return message in DS:SI 970 <2> ; $ENDIF ;;AN000;; 971 <2> $MIF31: 972 <2> ;; 973 <2> POP BP ;;AN000;; Restore changed regs 974 <2> POP DI ;;AN000;; 975 <2> POP ES ;;AN000;; 976 <2> POP AX ;;AN000;; 977 <2> ;; 978 <2> RET ;;AN000;; Return 979 <2> ;; 980 <2> SYSGETMSG ENDP ;; 981 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 982 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 983 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 984 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 985 <2> ;; 986 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 987 <2> ;; 988 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 989 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 990 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 991 <2> ;; IF CX > 1 THEN ES:DI points to the specified message 992 <2> ;; REGS CHANGED: ES,DI,CX 993 <2> ;; 994 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 995 <2> ;; 996 <2> %IF FARmsg ;;AN000;; 997 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 998 <2> %ELSE ;;AN000;; 999 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 1000 <2> %ENDIF ;;AN000;; 1001 <2> ;; 1002 <2> PUSH SI ;;AN000;; 1003 <2> PUSH BX ;;AN000;; 1004 <2> XOR SI,SI ;;AN000;; Use SI as an index 1005 <2> XOR CX,CX ;;AN000;; Use CX as an size 1006 <2> ; $DO ;;AN000;; 1007 <2> $MDO36: 1008 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 1009 <2> ; $IF E ;;AN000;; Yes, 1010 <2> JNE $MIF37 1011 <2> %IF FARmsg ;;AN000;; 1012 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1013 <2> MOV BX,ES ;;AN000; 1014 <2> %ELSE ;;AN000;; 1015 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1016 <2> MOV BX,DI ;;AN000; 1017 <2> %ENDIF ;;AN000;; 1018 <2> ; $ELSE ;;AN000;; No, 1019 <2> JMP SHORT $MEN37 1020 <2> $MIF37: 1021 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 1022 <2> ; $IF NE ;;AN000;; Yes, 1023 <2> JE $MIF39 1024 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 1025 <2> MOV BX,ES ;;AN000; 1026 <2> ; $ELSE ;;AN000;; No, extended errors were specified 1027 <2> JMP SHORT $MEN39 1028 <2> $MIF39: 1029 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 1030 <2> ; $IF AE,AND ;;AN000;; 1031 <2> JNAE $MIF41 1032 <2> CMP AX,$M_CRIT_HI ;;AN000;; 1033 <2> ; $IF BE ;;AN000;; Yes, 1034 <2> JNBE $MIF41 1035 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 1036 <2> MOV BX,ES ;;AN000; 1037 <2> ; $ELSE ;;AN000;; 1038 <2> JMP SHORT $MEN41 1039 <2> $MIF41: 1040 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 1041 <2> MOV BX,ES ;;AN000; 1042 <2> ; $ENDIF ;;AN000;; 1043 <2> $MEN41: 1044 <2> ; $ENDIF ;;AN000;; 1045 <2> $MEN39: 1046 <2> ; $ENDIF ;;AN000;; 1047 <2> $MEN37: 1048 <2> ;; 1049 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 1050 <2> ; $IF E ;;AN000;; Yes, 1051 <2> JNE $MIF46 1052 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 1053 <2> ; $IF E ;;AN000;; Yes, 1054 <2> JNE $MIF47 1055 <2> STC ;;AN000;; Set the carry flag 1056 <2> ; $ELSE ;;AN000;; No, 1057 <2> JMP SHORT $MEN47 1058 <2> $MIF47: 1059 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 1060 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 1061 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 1062 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 1063 <2> CLC ;;AN000;; 1064 <2> ; $ENDIF ;;AN000;; No, 1065 <2> $MEN47: 1066 <2> ; $ELSE ;;AN000;; 1067 <2> JMP SHORT $MEN46 1068 <2> $MIF46: 1069 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 1070 <2> ; $IF NE ;;AN001;; Yes, 1071 <2> JE $MIF51 1072 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 1073 <2> ; $ENDIF ;;AN000;; 1074 <2> $MIF51: 1075 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 1076 <2> CLC ;;AN000;; 1077 <2> ; $ENDIF ;;AN000;; 1078 <2> $MEN46: 1079 <2> ; $LEAVE C ;;AN000;; 1080 <2> JC $MEN36 1081 <2> OR CX,CX ;;AN000;; Was the message found? 1082 <2> ; $ENDDO NZ,LONG ;;AN000;; 1083 <2> JNZ $MXL2 1084 <2> JMP $MDO36 1085 <2> $MXL2: 1086 <2> $MEN36: 1087 <2> 1088 <2> PUSHF ;;AN006;; Save the flag state 1089 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 1090 <2> ; $IF E ;;AN006;; Yes, 1091 <2> JNE $MIF56 1092 <2> PUSH DX ;;AN006;; Save all needed registers 1093 <2> PUSH BP ;;AN006;; 1094 <2> PUSH CX ;;AN006;; 1095 <2> PUSH ES ;;AN006;; 1096 <2> PUSH DI ;;AN006;; 1097 <2> PUSH AX ;;AN006;; 1098 <2> 1099 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 1100 <2> INT 2FH ;;AN006;; 1101 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 1102 <2> POP AX ;;AN006;; Restore msg number 1103 <2> ; $IF E ;;AN006;; Yes, 1104 <2> JNE $MIF57 1105 <2> MOV BX,AX ;;AN006;; BX is the extended error number 1106 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 1107 <2> INT 2FH ;;AN006;; Call IFSFUNC 1108 <2> ; $ELSE ;;AN006;; No, 1109 <2> JMP SHORT $MEN57 1110 <2> $MIF57: 1111 <2> STC ;;AN006;; Carry conditon 1112 <2> ; $ENDIF ;;AN006;; 1113 <2> $MEN57: 1114 <2> 1115 <2> ; $IF C ;;AN006;; Was there an update? 1116 <2> JNC $MIF60 1117 <2> POP DI ;;AN006;; No, 1118 <2> POP ES ;;AN006;; Restore old pointer 1119 <2> POP CX ;;AN006;; 1120 <2> ; $ELSE ;;AN006;; Yes 1121 <2> JMP SHORT $MEN60 1122 <2> $MIF60: 1123 <2> ADD SP,6 ;;AN006;; Throw away old pointer 1124 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 1125 <2> ; $ENDIF ;;AN006;; 1126 <2> $MEN60: 1127 <2> POP BP ;;AN006;; Restore other Regs 1128 <2> POP DX ;;AN006;; 1129 <2> ; $ENDIF ;;AN006;; 1130 <2> $MIF56: 1131 <2> $M_POPF ;;AN006;; Restore the flag state 1132 <2> 1133 <2> POP BX ;;AN000;; 1134 <2> POP SI ;;AN000;; 1135 <2> RET ;;AN000;; Return ES:DI pointing to the message 1136 <2> ;; 1137 <2> $M_GET_MSG_ADDRESS ENDP ;; 1138 <2> ;; 1139 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 1140 <2> ;; 1141 <2> PUSH DI ;;AN006;; Save position 1142 <2> PUSH AX ;;AN006;; 1143 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 1144 <2> XOR AL,AL ;;AN006;; Prepare compare register 1145 <2> REPNE SCASB ;;AN006;; Scan for zero 1146 <2> NOT CX ;;AN006;; Change decrement into number 1147 <2> DEC CX ;;AN006;; Don't include the zero 1148 <2> POP AX ;;AN006;; 1149 <2> POP DI ;;AN006;; Restore position 1150 <2> RET ;;AN006;; 1151 <2> ;; 1152 <2> $M_SET_LEN_IN_CX ENDP ;; 1153 <2> ;; 1154 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1155 <2> ;; 1156 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 1157 <2> ;; 1158 <2> ;; FUNCTION: To scan thru message headers until message is found 1159 <2> ;; INPUTS: ES:DI points to beginning of msg headers 1160 <2> ;; CX contains the number of messages in class 1161 <2> ;; DH contains the message class 1162 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 1163 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 1164 <2> ;; 1165 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1166 <2> ;; 1167 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 1168 <2> ;; 1169 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 1170 <2> ; $IF E,AND ;;AN004;; Yes, 1171 <2> JNE $MIF64 1172 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 1173 <2> ; $IF NE ;;AN004;; Yes, 1174 <2> JE $MIF64 1175 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 1176 <2> ; $IF E ;;AN004;; . . . and . . . 1177 <2> JNE $MIF65 1178 <2> PUSH AX ;;AN004;; Reset the special message number 1179 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 1180 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1181 <2> POP AX ;;AN004;; Reset the special message number 1182 <2> ; $ELSE ;;AN004;; Get the old message number 1183 <2> JMP SHORT $MEN65 1184 <2> $MIF65: 1185 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1186 <2> ; $ENDIF ;;AN004;; Get the old message number 1187 <2> $MEN65: 1188 <2> ; $ELSE ;;AN004;; 1189 <2> JMP SHORT $MEN64 1190 <2> $MIF64: 1191 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 1192 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1193 <2> ; $IF NE ;;AN001;; 1194 <2> JE $MIF69 1195 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 1196 <2> ; $ELSE ;;AN001;; 1197 <2> JMP SHORT $MEN69 1198 <2> $MIF69: 1199 <2> %IF FARmsg ;;AN001;; 1200 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1201 <2> %ELSE 1202 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1203 <2> %ENDIF 1204 <2> ; $IF E ;;AN002;; pointer (hopefully) 1205 <2> JNE $MIF71 1206 <2> %IF FARmsg ;;AN001;; 1207 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1208 <2> %ELSE 1209 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1210 <2> %ENDIF 1211 <2> ; $ENDIF ;;AN002;; go on to the next class 1212 <2> $MIF71: 1213 <2> ; $ENDIF ;;AN001;; 1214 <2> $MEN69: 1215 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 1216 <2> STC ;;AN004;; Flag that we haven't found anything yet 1217 <2> ; $ENDIF ;;AN004;; 1218 <2> $MEN64: 1219 <2> 1220 <2> ; $IF C ;;AN004;; Have we found anything yet? 1221 <2> JNC $MIF75 1222 <2> CLC ;;AN004;; No, reset carry 1223 <2> ; $SEARCH ;;AN000;; 1224 <2> $MDO76: 1225 <2> OR CX,CX ;;AN000;; Do we have any to check? 1226 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1227 <2> JZ $MEN76 1228 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1229 <2> ; $IF NE ;;AN001;; 1230 <2> JE $MIF78 1231 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 1232 <2> ; $ELSE ;;AN001;; 1233 <2> JMP SHORT $MEN78 1234 <2> $MIF78: 1235 <2> %IF FARmsg ;;AN001;; 1236 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 1237 <2> %ELSE 1238 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 1239 <2> %ENDIF 1240 <2> ; $ENDIF 1241 <2> $MEN78: 1242 <2> ; $EXITIF E ;;AN000;; 1243 <2> JNE $MIF76 1244 <2> ; $ORELSE ;;AN000; 1245 <2> JMP SHORT $MSR76 1246 <2> $MIF76: 1247 <2> DEC CX ;;AN000;; No, well do we have more to check? 1248 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1249 <2> JZ $MEN76 1250 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 1251 <2> ; $ENDLOOP ;;AN000;; 1252 <2> JMP SHORT $MDO76 1253 <2> $MEN76: 1254 <2> STC ;;AN000;; 1255 <2> ; $ENDSRCH ;;AN000;; Check next message 1256 <2> $MSR76: 1257 <2> ; $IF NC ;;AN000;; Did we find the message? 1258 <2> JC $MIF86 1259 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 1260 <2> CLC ;;AN001;; 1261 <2> ; $IF E ;;AN001;; 1262 <2> JNE $MIF87 1263 <2> %IF FARmsg ;;AN001;; 1264 <2> %ELSE ;;AN000;; 1265 <2> PUSH CS ;;AN000;; 1266 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 1267 <2> %ENDIF 1268 <2> ; $ENDIF ;;AN001;; 1269 <2> $MIF87: 1270 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 1271 <2> ; $ENDIF ;;AN004;; 1272 <2> $MIF86: 1273 <2> ; $ENDIF ;;AN004;; 1274 <2> $MIF75: 1275 <2> ;; Yes, great we can return with CX > 0 1276 <2> 1277 <2> ; $IF NC ;;AN000;; Did we find the message? 1278 <2> JC $MIF91 1279 <2> XOR CH,CH ;;AN000;; 1280 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 1281 <2> INC DI ;;AN000;; Increment past length 1282 <2> ; $ENDIF ;;AN004;; 1283 <2> $MIF91: 1284 <2> 1285 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 1286 <2> RET ;;AN000;; Return 1287 <2> ;; 1288 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 1289 <2> ;; 1290 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1291 <2> %ENDIF ;;AN000;; END of include of common subroutines 1292 <2> %ENDIF ;;AN000;; END of include of SYSGETMSG 1293 <2> ; 1294 <2> %IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 1295 <2> %IF COMR ;;AN000;; 1296 <2> $M_RT EQU $M_RT2 ;;AN000;; 1297 <2> %ENDIF ;;AN000;; 1298 <2> %iassign DISPLAYmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 1299 <2> ; PAGE 1300 <2> ; SUBTTL DOS - Message Retriever - DISPMSG.ASM Module 1301 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1302 <2> ;; 1303 <2> ;; Proc Name: SYSDISPMSG 1304 <2> ;; 1305 <2> ;; Function: The DISPLAY service will output a defined message to a handle 1306 <2> ;; requested by the caller. It also provides function to display 1307 <2> ;; messages when handles are not applicable (ie. DOS function calls 1308 <2> ;; 00h to 0Ah) Replaceable parameters are allowed and are 1309 <2> ;; defined previous to entry. 1310 <2> ;; 1311 <2> ;; It is assumes that a PRELOAD function has already determined 1312 <2> ;; the addressibilty internally to the message retriever services. 1313 <2> ;; Inputs: 1314 <2> ;; 1315 <2> ;; Outputs: 1316 <2> ;; 1317 <2> ;; Psuedocode: 1318 <2> ;; Save registers needed later 1319 <2> ;; Get address of the message requested 1320 <2> ;; IF Message number exists THEN 1321 <2> ;; IF replacable parameters were specified THEN 1322 <2> ;; Display message with replacable parms 1323 <2> ;; ELSE 1324 <2> ;; Display string without replacable parms 1325 <2> ;; ENDIF 1326 <2> ;; IF character input was requested THEN 1327 <2> ;; Wait for character input 1328 <2> ;; ENDIF 1329 <2> ;; Clear CARRY FLAG 1330 <2> ;; ELSE 1331 <2> ;; Set CARRY FLAG 1332 <2> ;; ENDIF 1333 <2> ;; Return 1334 <2> ;; 1335 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1336 <2> ;; 1337 <2> %IF FARmsg ;;AN000;; 1338 <2> SYSDISPMSG PROC FAR ;;AN000;; 1339 <2> %ELSE ;;AN000;; 1340 <2> SYSDISPMSG PROC NEAR ;;AN000;; 1341 <2> %ENDIF ;;AN000;; 1342 <2> ;; 1343 <2> ;; Save registers and values needed later 1344 <2> 1345 <2> PUSH AX ;;AN000;; Save changed REGs 1346 <2> PUSH BX ;;AN000;; 1347 <2> PUSH CX ;;AN000;; 1348 <2> PUSH BP ;;AN000;; 1349 <2> PUSH DI ;;AN000;; Save pointer to input buffer (offset) 1350 <2> PUSH ES ;;AN000;; Save pointer to input buffer (segment) 1351 <2> PUSH DX ;;AN000;; Save Input/Class request 1352 <2> 1353 <2> MOV BP,CX ;;AN000;; Use BP to hold replace count 1354 <2> MOV WORD PTR [$M_RT + $M_HANDLE],BX ;;AN000;; Save handle 1355 <2> MOV BYTE PTR [$M_RT + $M_CLASS],DH ;;AN004;; Save class 1356 <2> 1357 <2> ;; Get address of the message requested 1358 <2> 1359 <2> %IF FARmsg ;;AN000;; 1360 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1361 <2> %ELSE ;;AN000;; 1362 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1363 <2> %ENDIF ;;AN000;; 1364 <2> OR CX,CX ;;AN000;; Was message found? 1365 <2> ; $IF NZ ;;AN000;; YES, Message address in ES:DI 1366 <2> JZ $MIF93 1367 <2> 1368 <2> ;; Test if replacable parameters were specified 1369 <2> 1370 <2> OR BP,BP ;;AN000;; Were replacable parameters requested 1371 <2> ; $IF Z ;;AN000;; 1372 <2> JNZ $MIF94 1373 <2> 1374 <2> ;; Display string without replacable parms 1375 <2> 1376 <2> CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message 1377 <2> ; $ELSE ;;AN000;; 1378 <2> JMP SHORT $MEN94 1379 <2> $MIF94: 1380 <2> %IF $M_REPLACE ;;AN000;; 1381 <2> 1382 <2> ;; Display message with replacable parms 1383 <2> 1384 <2> CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions 1385 <2> %ENDIF ;;AN000;; 1386 <2> ; $ENDIF ;;AN000;; 1387 <2> $MEN94: 1388 <2> ; $IF NC 1389 <2> JC $MIF97 1390 <2> 1391 <2> POP DX ;;AN000;; Get Input/Class request 1392 <2> 1393 <2> CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. 1394 <2> 1395 <2> POP ES ;;AN000;; Get location of input buffer (if specified) 1396 <2> POP DI ;;AN000;; 1397 <2> 1398 <2> ;; Test if character input was requested 1399 <2> 1400 <2> %IF INPUTmsg ;;AN000;; 1401 <2> OR DL,DL ;;AN000;; Was Wait-For-Input requested? 1402 <2> ; $IF NZ ;;AN000;; 1403 <2> JZ $MIF98 1404 <2> CALL $M_WAIT_FOR_INPUT ;;AN000;; 1405 <2> ; $ENDIF ;;AN000;; 1406 <2> $MIF98: 1407 <2> %ENDIF ;;AN000;; 1408 <2> ; $ELSE ;;AN000;; 1409 <2> JMP SHORT $MEN97 1410 <2> $MIF97: 1411 <2> ADD SP,6 ;;AN000;; 1412 <2> STC ;;AN000;; Reset carry flag 1413 <2> ; $ENDIF ;;AN000;; 1414 <2> $MEN97: 1415 <2> ; $ELSE ;;AN000;; No, 1416 <2> JMP SHORT $MEN93 1417 <2> $MIF93: 1418 <2> POP ES ;;AN000;; Get pointer to input buffer (segment) 1419 <2> POP DI ;;AN000;; Get base pointer to first sublist (offset) 1420 <2> POP DX ;;AN000;; Get base pointer to first sublist (segment) 1421 <2> STC ;;AN000;; Set carry flag 1422 <2> ; $ENDIF ;;AN000;; 1423 <2> $MEN93: 1424 <2> ;; 1425 <2> ; $IF NC ;;AN000;; Was there an error? 1426 <2> JC $MIF104 1427 <2> POP BP ;;AN000;; No, 1428 <2> POP CX ;;AN000;; 1429 <2> POP BX ;;AN000;; 1430 <2> %IF INPUTmsg ;;AN000;; 1431 <2> ADD SP,2 ;;AN000;; 1432 <2> %ELSE ;AN000; 1433 <2> POP AX ;;AN000;; 1434 <2> %ENDIF ;;AN000;; 1435 <2> ; $ELSE ;;AN000;; Yes, 1436 <2> JMP SHORT $MEN104 1437 <2> $MIF104: 1438 <2> ADD SP,8 ;;AN000;; Eliminate from stack 1439 <2> STC ;;AN000;; 1440 <2> ; $ENDIF ;;AN000;; 1441 <2> $MEN104: 1442 <2> ;; 1443 <2> RET ;;AN000;; Return 1444 <2> ;; 1445 <2> SYSDISPMSG ENDP ;;AN000;; 1446 <2> ;; 1447 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1448 <2> ; 1449 <2> ;; 1450 <2> ;; PROC NAME: $M_DISPLAY_STRING 1451 <2> ;; 1452 <2> ;; FUNCTION: Will display or write string 1453 <2> ;; INPUTS: ES:DI points to beginning of message 1454 <2> ;; CX contains the length of string to write (if applicable) 1455 <2> ;; OUTPUTS: None 1456 <2> ;; REGS Revised: None 1457 <2> ;; 1458 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1459 <2> ;; 1460 <2> $M_DISPLAY_STRING PROC NEAR ;;AN000;; 1461 <2> ;; 1462 <2> PUSH AX ;;AN000;; 1463 <2> PUSH BX ;;AN000;; 1464 <2> PUSH DX ;;AN000;; 1465 <2> ;; 1466 <2> MOV BX,[$M_RT + $M_HANDLE] ;;AN000;; Retrieve handle 1467 <2> ;; 1468 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 1469 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1470 <2> %ELSE 1471 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1472 <2> ; $IF E ;;AN000;; 1473 <2> JNE $MIF107 1474 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1475 <2> ; $ELSE ;;AN000;; 1476 <2> JMP SHORT $MEN107 1477 <2> $MIF107: 1478 <2> CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle 1479 <2> ; $ENDIF ;;AN000;; 1480 <2> $MEN107: 1481 <2> ;AN001; 1482 <2> ; $IF C ;;AN000;; Was there an error? 1483 <2> JNC $MIF110 1484 <2> MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes, 1485 <2> MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error 1486 <2> INT 21H ;;AN000;; 1487 <2> XOR AH,AH ;;AN000;; Clear AH 1488 <2> ADD SP,6 ;;AN000;; Clean up stack 1489 <2> STC ;;AN000;; Flag that there was an error 1490 <2> ; $ELSE ;;AN000;; No, 1491 <2> JMP SHORT $MEN110 1492 <2> $MIF110: 1493 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1494 <2> ; $IF NE ;;AN000;; 1495 <2> JE $MIF112 1496 <2> CMP AX,CX ;AN001; Was it ALL written? 1497 <2> ; $IF NE ;AN001; No, 1498 <2> JE $MIF113 1499 <2> CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error 1500 <2> ADD SP,6 ;AN001; Clean up stack 1501 <2> STC ;AN001; Flag that there was an error 1502 <2> ; $ENDIF ;AN001; 1503 <2> $MIF113: 1504 <2> ; $ENDIF ;AN001; 1505 <2> $MIF112: 1506 <2> ; $ENDIF ;;AN000;; 1507 <2> $MEN110: 1508 <2> %ENDIF 1509 <2> ; $IF NC ;;AN000;; Was there ANY error? 1510 <2> JC $MIF117 1511 <2> POP DX ;;AN000;; Restore regs 1512 <2> POP BX ;;AN000;; 1513 <2> POP AX ;;AN000;; 1514 <2> ; $ENDIF ;;AN000;; 1515 <2> $MIF117: 1516 <2> RET ;;AN000;; Return 1517 <2> ;; 1518 <2> $M_DISPLAY_STRING ENDP ;;AN000;; 1519 <2> ;; 1520 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1521 <2> ;; 1522 <2> ;; PROC NAME: $M_DISPLAY_$_STRING 1523 <2> ;; 1524 <2> ;; FUNCTION: Will display a $ terminated string 1525 <2> ;; INPUTS: ES:DI points to beginning of message text (not the length) 1526 <2> ;; OUPUTS: None 1527 <2> ;; REGS USED: AX,DX 1528 <2> ;; 1529 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1530 <2> ;; 1531 <2> $M_DISPLAY_$_STRING PROC NEAR ;;AN000;; 1532 <2> ;; 1533 <2> PUSH DS ;;AN000;; 1534 <2> PUSH ES ;;AN000;; 1535 <2> POP DS ;;AN000;; Set DS to segment of message text 1536 <2> %IFN COMR 1537 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1538 <2> ; $IF E ;;AN000;; Yes, 1539 <2> JNE $MIF119 1540 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1541 <2> MOV DL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1542 <2> INT 21H ;;AN000;; Write character 1543 <2> POP DS ;;AN000;; Set DS to segment of message text 1544 <2> MOV AL,DL ;;AN000;; Get the character in AL 1545 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1546 <2> PUSH DS ;;AN000;; 1547 <2> PUSH ES ;;AN000;; 1548 <2> POP DS ;;AN000;; Set DS to segment of message text 1549 <2> ; $IF C ;;AN000;; Yes, 1550 <2> JNC $MIF120 1551 <2> MOV DL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 1552 <2> INT 21H ;;AN000;; Write character 1553 <2> CLC ;;AN000;; Clear the DBCS indicator 1554 <2> ; $ENDIF ;;AN000;; 1555 <2> $MIF120: 1556 <2> ; $ELSE ;;AN000;; No, 1557 <2> JMP SHORT $MEN119 1558 <2> $MIF119: 1559 <2> %ENDIF 1560 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1561 <2> ; $DO ;;AN002;; No, 1562 <2> $MDO123: 1563 <2> OR CX,CX ;;AN002;; Are there any left to display? 1564 <2> ; $LEAVE Z ;;AN002;; Yes, 1565 <2> JZ $MEN123 1566 <2> MOV DL,BYTE PTR [ES:DI] ;;AN002;; Get the character 1567 <2> INT 21H ;;AN002;; Display the character 1568 <2> INC DI ;;AN002;; Set pointer to next character 1569 <2> DEC CX ;;AN002;; Count this character 1570 <2> ; $ENDDO Z ;;AN002;; No, 1571 <2> JNZ $MDO123 1572 <2> $MEN123: 1573 <2> %IFN COMR 1574 <2> ; $ENDIF ;;AN000;; 1575 <2> $MEN119: 1576 <2> %ENDIF 1577 <2> CLC ;;AN000;; Char functions used don't return carry as error 1578 <2> POP DS ;;AN000;; 1579 <2> RET ;;AN000;; 1580 <2> ;; 1581 <2> $M_DISPLAY_$_STRING ENDP ;;AN000;; 1582 <2> ;; 1583 <2> %IFN COMR 1584 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1585 <2> ;; 1586 <2> ;; PROC NAME: $M_DISPLAY_H_STRING 1587 <2> ;; 1588 <2> ;; FUNCTION: Will display a string to a specified handle 1589 <2> ;; INPUTS: ES:DI points to beginning of message 1590 <2> ;; CX contains the number of bytes to write 1591 <2> ;; BX contains the handle to write to 1592 <2> ;; OUPUTS: None 1593 <2> ;; REGS USED: AX,DX 1594 <2> ;; 1595 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1596 <2> ;; 1597 <2> $M_DISPLAY_H_STRING PROC NEAR ;;AN000;; 1598 <2> ;; 1599 <2> XOR AX,AX ;;AN002;; Set number of bytes written to 0 1600 <2> OR CX,CX ;;AN002;; For performance, don't write if not necessary 1601 <2> ; $IF NZ ;;AN002;; Any chars to write? 1602 <2> JZ $MIF127 1603 <2> PUSH DS ;;AN000;; Yes, 1604 <2> PUSH ES ;;AN000;; 1605 <2> POP DS ;;AN000;; Set DS to segment of message text 1606 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1607 <2> MOV DX,DI ;;AN000;; Pointer to data to write 1608 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1609 <2> ; $IF E ;;AN000;; Yes, 1610 <2> JNE $MIF128 1611 <2> INT 21H ;;AN000;; Write character 1612 <2> POP DS ;;AN000;; Set DS to segment of message text 1613 <2> PUSH AX ;;AN000;; 1614 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1615 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1616 <2> POP AX ;;AN000;; Set DS to segment of message text 1617 <2> PUSH DS ;;AN000;; 1618 <2> PUSH ES ;;AN000;; 1619 <2> POP DS ;;AN000;; Set DS to segment of message text 1620 <2> ; $IF C ;;AN000;; Yes, 1621 <2> JNC $MIF129 1622 <2> CLC ;;AN000;; Clear the DBCS indicator 1623 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1624 <2> INC DX ;;AN000;; Point to next character 1625 <2> INT 21H ;;AN000;; Write character 1626 <2> ; $ENDIF ;;AN000;; 1627 <2> $MIF129: 1628 <2> ; $ELSE ;;AN000;; No, 1629 <2> JMP SHORT $MEN128 1630 <2> $MIF128: 1631 <2> INT 21H ;;AN000;; Write String at DS:SI to handle 1632 <2> ; $ENDIF ;;AN000;; 1633 <2> $MEN128: 1634 <2> POP DS ;;AN000;; 1635 <2> ; $ENDIF ;;AN002;; 1636 <2> $MIF127: 1637 <2> ;; 1638 <2> RET ;;AN000;; 1639 <2> ;; 1640 <2> $M_DISPLAY_H_STRING ENDP ;;AN000;; 1641 <2> ;; 1642 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1643 <2> ;; 1644 <2> ;; PROC NAME: $M_GET_EXT_ERR_39 1645 <2> ;; 1646 <2> ;; FUNCTION: Will set registers for extended error #39 1647 <2> ;; INPUTS: None 1648 <2> ;; OUPUTS: AX,BX,CX set 1649 <2> ;; REGS USED: 1650 <2> ;; 1651 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1652 <2> ;; 1653 <2> $M_GET_EXT_ERR_39 PROC NEAR ;AN001; 1654 <2> ;; 1655 <2> MOV AX,EXT_ERR_39 ;AN001; Set AX=39 1656 <2> MOV BX,(ERROR_CLASS_39 >> 8) + ACTION_39 ;AN001; Set BH=1 BL=4 1657 <2> MOV CH,LOCUS_39 ;AN001; Set CH=1 1658 <2> ;AN001; 1659 <2> RET ;AN001; 1660 <2> ;; 1661 <2> $M_GET_EXT_ERR_39 ENDP ;AN001; 1662 <2> ;; 1663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1664 <2> %ENDIF 1665 <2> ;; 1666 <2> ;; PROC NAME: $M_ADD_CRLF 1667 <2> ;; 1668 <2> ;; FUNCTION: Will decide whether to display a CRLF 1669 <2> ;; INPUTS: DX contains the Input/Class requested 1670 <2> ;; OUTPUTS: None 1671 <2> ;; REGS Revised: CX,ES,DI 1672 <2> ;; 1673 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1674 <2> ;; 1675 <2> $M_ADD_CRLF PROC NEAR ;;AN004;; 1676 <2> ;; 1677 <2> CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1678 <2> ; $IF NE ;;AN004;; No, 1679 <2> JE $MIF134 1680 <2> TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? 1681 <2> ; $IF Z ;;AN004;; No, 1682 <2> JNZ $MIF135 1683 <2> PUSH DS ;;AN004;; 1684 <2> POP ES ;;AN004;; Set ES to data segment 1685 <2> LEA DI,[$M_RT + $M_CRLF] ;;AN004;; Point at CRLF message 1686 <2> MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size 1687 <2> CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF 1688 <2> ; $ENDIF ;;AN004;; 1689 <2> $MIF135: 1690 <2> ; $ENDIF ;;AN004;; 1691 <2> $MIF134: 1692 <2> RET ;;AN004;; Return 1693 <2> ;; 1694 <2> $M_ADD_CRLF ENDP ;;AN004;; 1695 <2> ;; 1696 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1697 <2> ;; 1698 <2> ;; PROC NAME: $M_IS_IT_DBCS 1699 <2> ;; 1700 <2> ;; FUNCTION: Will decide whether character is Single or Double Byte 1701 <2> ;; INPUTS: AL contains the byte to be checked 1702 <2> ;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range 1703 <2> ;; Carry flag = 1 if byte IS in DBCS range 1704 <2> ;; REGS USED: All restored 1705 <2> ;; 1706 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1707 <2> ;; 1708 <2> $M_IS_IT_DBCS PROC NEAR ;;AN000;; 1709 <2> ;; 1710 <2> PUSH ES ;;AN000;; Save Extra segment register 1711 <2> PUSH DI ;;AN000;; Save SI register 1712 <2> ;; 1713 <2> LES DI,[$M_RT + $M_DBCS_VEC] ;;AN000;; 1714 <2> OR DI,DI ;;AN000;; Was the DBCS vector set? 1715 <2> ; $IF NZ ;;AN000;; 1716 <2> JZ $MIF138 1717 <2> ; $DO ;;AN000;; 1718 <2> $MDO139: 1719 <2> CMP WORD PTR [ES:DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag? 1720 <2> CLC ;;AN000;; 1721 <2> ; $LEAVE E ;;AN000;; 1722 <2> JE $MEN139 1723 <2> ;; No, 1724 <2> CMP AL,BYTE PTR [ES:DI] ;;AN000;; Does the character fall in the DBCS range? 1725 <2> ; $IF AE,AND ;;AN000;; 1726 <2> JNAE $MIF141 1727 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Does the character fall in the DBCS range? 1728 <2> ; $IF BE ;;AN000;; 1729 <2> JNBE $MIF141 1730 <2> STC ;;AN000;; Yes, 1731 <2> ; $ENDIF ;;AN000;; Set carry flag 1732 <2> $MIF141: 1733 <2> INC DI ;;AN000;; No, 1734 <2> INC DI ;;AN000;; Go to next vector 1735 <2> ; $ENDDO ;;AN000;; 1736 <2> JMP SHORT $MDO139 1737 <2> $MEN139: 1738 <2> ; $ENDIF ;;AN000;; 1739 <2> $MIF138: 1740 <2> 1741 <2> POP DI ;;AN000;; 1742 <2> POP ES ;;AN000;; Restore SI register 1743 <2> RET ;;AN000;; Return 1744 <2> ;; 1745 <2> $M_IS_IT_DBCS ENDP ;;AN000;; 1746 <2> ;; 1747 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1748 <2> ;; 1749 <2> ;; PROC NAME: $M_CONVERT2ASC 1750 <2> ;; 1751 <2> ;; FUNCTION: Convert a binary number to a ASCII string 1752 <2> ;; INPUTS: DX:AX contains the number to be converted 1753 <2> ;; $M_RT_DIVISOR contains the divisor 1754 <2> ;; OUPUTS: CX contains the number of characters 1755 <2> ;; Top of stack --> Last character 1756 <2> ;; . . . 1757 <2> ;; Bot of stack --> First character 1758 <2> ;; REGS USED: 1759 <2> ;; 1760 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1761 <2> ;; 1762 <2> $M_CONVERT2ASC PROC NEAR ;;AN000;; 1763 <2> ;; 1764 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Save Return Address 1765 <2> XOR BX,BX ;;AN000;; Use BP as a swapping register 1766 <2> ;; 1767 <2> XCHG BX,AX ;;AN000;; Initialize - Low Word in BP 1768 <2> XCHG AX,DX ;;AN000;; - High Word in AX 1769 <2> ; $DO ;;AN000;; DO UNTIL Low Word becomes zero 1770 <2> $MDO145: 1771 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide High Word by divisor 1772 <2> XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder 1773 <2> ;; and save reduced High Word in BP 1774 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide Low Word by divisor 1775 <2> CMP DX,9 ;;AN000;; Make a digit of the remainder 1776 <2> ; $IF A ;;AN000;; IF 10 to 15, 1777 <2> JNA $MIF146 1778 <2> ADD DL,55 ;;AN000;; Make A to F ASCII 1779 <2> ; $ELSE ;;AN000;; IF 0 to 9, 1780 <2> JMP SHORT $MEN146 1781 <2> $MIF146: 1782 <2> ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII 1783 <2> ; $ENDIF ;;AN000;; 1784 <2> $MEN146: 1785 <2> PUSH DX ;;AN000;; Save the digit on the stack 1786 <2> INC CX ;;AN000;; Count that digit 1787 <2> OR AX,AX ;;AN000;; Are we done? 1788 <2> ; $LEAVE Z,AND ;;AN000;; 1789 <2> JNZ $MLL149 1790 <2> OR BX,BX ;;AN000;; AX and BX must be ZERO!! 1791 <2> ; $LEAVE Z ;;AN000;; No, 1792 <2> JZ $MEN145 1793 <2> $MLL149: 1794 <2> %IFN COMR 1795 <2> CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark 1796 <2> ; $IF E ;;AN000;; Yes, 1797 <2> JNE $MIF150 1798 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1799 <2> ; $IF E ;;AN000;; Yes, 1800 <2> JNE $MIF151 1801 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1802 <2> INC CX ;;AN000;; 1803 <2> ; $ENDIF ;;AN000;; 1804 <2> $MIF151: 1805 <2> ; $ELSE ;;AN000;; No, 1806 <2> JMP SHORT $MEN150 1807 <2> $MIF150: 1808 <2> CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark 1809 <2> ; $IF E ;;AN000;; Yes, 1810 <2> JNE $MIF154 1811 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1812 <2> ; $IF E ;;AN000;; Yes, 1813 <2> JNE $MIF155 1814 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1815 <2> INC CX ;;AN000;; 1816 <2> ; $ENDIF ;;AN000;; 1817 <2> $MIF155: 1818 <2> ; $ELSE ;;AN000;; No, 1819 <2> JMP SHORT $MEN154 1820 <2> $MIF154: 1821 <2> CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark 1822 <2> ; $IF E ;;AN000;; Yes, 1823 <2> JNE $MIF158 1824 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1825 <2> ; $IF E ;;AN000;; Yes, 1826 <2> JNE $MIF159 1827 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1828 <2> INC CX ;;AN000;; 1829 <2> ; $ENDIF ;;AN000;; 1830 <2> $MIF159: 1831 <2> ; $ENDIF ;;AN000;; 1832 <2> $MIF158: 1833 <2> ; $ENDIF ;;AN000;; 1834 <2> $MEN154: 1835 <2> ; $ENDIF ;;AN000;; 1836 <2> $MEN150: 1837 <2> %ENDIF 1838 <2> XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word 1839 <2> ;;AN000;; and Revised Low Word 1840 <2> XOR DX,DX ;;AN000;; Reset remainder 1841 <2> ; $ENDDO ;;AN000;; NEXT 1842 <2> JMP SHORT $MDO145 1843 <2> $MEN145: 1844 <2> ;;AN000;; Yes, 1845 <2> XOR DX,DX ;;AN000;; Reset remainder 1846 <2> XOR AX,AX ;;AN000;; Reset remainder 1847 <2> PUSH word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Restore Return Address 1848 <2> RET ;;AN000;; Return 1849 <2> ;; 1850 <2> $M_CONVERT2ASC ENDP ;;AN000;; 1851 <2> ;; 1852 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1853 <2> ;; 1854 <2> ;; PROC NAME: $M_DISPLAY_MESSAGE 1855 <2> ;; 1856 <2> ;; FUNCTION: Will display or write entire message (with replacable parameters) 1857 <2> ;; INPUTS: ES:DI points to beginning of message 1858 <2> ;; DS:SI points to first sublist structure in chain 1859 <2> ;; BX contains the handle to write to (if applicable) 1860 <2> ;; CX contains the length of string to write (before substitutions) 1861 <2> ;; BP contains the count of replacables 1862 <2> ;; 1863 <2> ;; OUTPUTS: 1864 <2> ;; REGS USED: All 1865 <2> ;; 1866 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1867 <2> ;; 1868 <2> $M_DISPLAY_MESSAGE PROC NEAR ;;AN000;; 1869 <2> ;; 1870 <2> ; $DO ;;AN000;; Note: DS:SI -> message 1871 <2> $MDO165: 1872 <2> XOR DX,DX ;;AN000;; Set size = 0 1873 <2> OR CX,CX ;;AN000;; Are we finished the message yet? 1874 <2> ; $IF NZ ;;AN000;; No, 1875 <2> JZ $MIF166 1876 <2> MOV AH,"%" ;;AN000;; Prepare to scan for % 1877 <2> MOV AL,0 ;;AN004;; 1878 <2> ;; 1879 <2> ; $DO ;;AN000;; Scan through string until % 1880 <2> $MDO167: 1881 <2> CMP BYTE PTR [ES:DI],AH ;;AN000;; Is this character NOT a % 1882 <2> ; $LEAVE E,AND ;;AN000;; No, 1883 <2> JNE $MLL168 1884 <2> CMP BYTE PTR [ES:DI+1],AH ;;AN000;; Is the next character also a % 1885 <2> ; $LEAVE NE,AND ;;AN000;; No, 1886 <2> JE $MLL168 1887 <2> CMP AL,AH ;;AN000;; Was the character before a % 1888 <2> ; $LEAVE NE ;;AN000;; No, GREAT found it 1889 <2> JNE $MEN167 1890 <2> $MLL168: 1891 <2> MOV AL,BYTE PTR [ES:DI] ;;AN004;; Yes, (to any of the above) 1892 <2> CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? 1893 <2> ; $IF C ;;AN004;; Yes, 1894 <2> JNC $MIF169 1895 <2> INC DI ;;AN004;; Increment past second part 1896 <2> ; $ENDIF ;;AN004;; 1897 <2> $MIF169: 1898 <2> INC DI ;;AN000;; Next character in string 1899 <2> INC DX ;;AN000;; Size = Size + 1 1900 <2> DEC CX ;;AN000;; Decrement total size 1901 <2> ; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line 1902 <2> JNZ $MDO167 1903 <2> $MEN167: 1904 <2> ; $ENDIF ;;AN000;; 1905 <2> $MIF166: 1906 <2> ;; 1907 <2> PUSH SI ;;AN000;; Save beginning of sublists 1908 <2> XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX) 1909 <2> OR BP,BP ;;AN000;; Do we have any replacables to do? 1910 <2> ; $IF NZ ;;AN000;; Yes, 1911 <2> JZ $MIF173 1912 <2> DEC BP ;;AN000;; Decrement number of replacables 1913 <2> 1914 <2> ;; Search through sublists to find applicable one 1915 <2> 1916 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 1917 <2> ; $IF E ;;AN000;; No, 1918 <2> JNE $MIF174 1919 <2> ; $SEARCH ;;AN000;; 1920 <2> $MDO175: 1921 <2> MOV AL,[$M_SL + $M_S_ID] ;;AN000;; Get ID byte 1922 <2> ADD AL,30H ;;AN000;; Convert to ASCII 1923 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Is this the right sublist? 1924 <2> ; $EXITIF E ;;AN000;; 1925 <2> JNE $MIF175 1926 <2> ; $ORELSE ;;AN000;; No, 1927 <2> JMP SHORT $MSR175 1928 <2> $MIF175: 1929 <2> CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 1930 <2> ; $LEAVE E,AND ;;AN000;; Yes, 1931 <2> JNE $MLL178 1932 <2> OR DX,DX ;;AN000;; Are we at the end of the message? 1933 <2> ; $LEAVE Z ;;AN000;; No, 1934 <2> JZ $MEN175 1935 <2> $MLL178: 1936 <2> ADD SI,WORD PTR [$M_SL + $M_S_SIZE] ;;AN000;; Next SUBLIST 1937 <2> ; $ENDLOOP ;;AN000;; Yes, 1938 <2> JMP SHORT $MDO175 1939 <2> $MEN175: 1940 <2> CMP byte [$M_RT + $M_CLASS],UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1941 <2> ; $IF E ;;AN004;; Yes, 1942 <2> JNE $MIF180 1943 <2> INC DX ;;AN000;; Remember to display CR,LF 1944 <2> INC DX ;;AN000;; at the end of the message 1945 <2> DEC CX ;;AN000;; Adjust message length 1946 <2> DEC CX ;;AN000;; 1947 <2> DEC DI ;;AN000;; Adjust ending address of message 1948 <2> DEC DI ;;AN000;; 1949 <2> ; $ELSE ;;AN004;; No, 1950 <2> JMP SHORT $MEN180 1951 <2> $MIF180: 1952 <2> MOV DX,-1 ;;AN004;; Set special case 1953 <2> ; $ENDIF ;;AN004;; 1954 <2> $MEN180: 1955 <2> ; $ENDSRCH ;;AN000;; 1956 <2> $MSR175: 1957 <2> ; $ENDIF ;;AN000;; 1958 <2> $MIF174: 1959 <2> ; $ENDIF ;;AN000;; 1960 <2> $MIF173: 1961 <2> 1962 <2> ;; Prepare and display this part of message 1963 <2> 1964 <2> PUSH DI ;;AN000;; Save pointer to replace number 1965 <2> SUB DI,CX ;;AN000;; Determine beginning of string 1966 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) 1967 <2> POP DI ;;AN000;; Get back pointer to replace number 1968 <2> POP CX ;;AN000;; Clean up stack in case error 1969 <2> ; $LEAVE C,LONG ;;AN000;; Fail if carry was set 1970 <2> JNC $MXL3 1971 <2> JMP $MEN165 1972 <2> nop ; identicalise 1973 <2> $MXL3: 1974 <2> PUSH CX ;;AN000;; 1975 <2> 1976 <2> ;; Save and reset pointer registers 1977 <2> 1978 <2> MOV CX,DX ;;AN000;; Get the size of the rest of the message 1979 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case? 1980 <2> ; $IF NE ;;AN000;; No, 1981 <2> JE $MIF187 1982 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1983 <2> ; $IF NZ ;;AN000;; No, 1984 <2> JZ $MIF188 1985 <2> DEC CX ;;AN000;; Decrement total size (%) 1986 <2> DEC CX ;;AN000;; Decrement total size (#) 1987 <2> INC DI ;;AN000;; Go past % 1988 <2> INC DI ;;AN000;; Go past replace number 1989 <2> ; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) 1990 <2> JMP SHORT $MEN188 1991 <2> $MIF188: 1992 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 1993 <2> ; $ENDIF ;;AN000;; Yes, Note this will not leave because INC 1994 <2> $MEN188: 1995 <2> ; $ELSE ;;AN000;; 1996 <2> JMP SHORT $MEN187 1997 <2> $MIF187: 1998 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1999 <2> ; $IF Z ;;AN004;; No, 2000 <2> JNZ $MIF192 2001 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 2002 <2> ; $ELSE ;;AN000;; No, 2003 <2> JMP SHORT $MEN192 2004 <2> $MIF192: 2005 <2> CMP CX,-1 ;;AN004;; Are we at the end of the message? 2006 <2> ; $IF Z ;;AN004;; No, 2007 <2> JNZ $MIF194 2008 <2> XOR CX,CX ;;AN004;; 2009 <2> ; $ENDIF ;;AN000;; 2010 <2> $MIF194: 2011 <2> OR DI,DI ;;AN004;; Turn ZF off 2012 <2> ; $ENDIF ;;AN000;; 2013 <2> $MEN192: 2014 <2> ; $ENDIF ;;AN000;; Note this will not leave because INC 2015 <2> $MEN187: 2016 <2> ; $LEAVE Z ;;AN000;; 2017 <2> JZ $MEN165 2018 <2> PUSH BP ;;AN000;; Save the replace count 2019 <2> PUSH DI ;;AN000;; Save location to complete message 2020 <2> PUSH ES ;;AN000;; 2021 <2> PUSH CX ;;AN000;; Save size of the rest of the message 2022 <2> XOR CX,CX ;;AN000;; Reset CX used for character count 2023 <2> 2024 <2> ;; Determine what action is required on parameter 2025 <2> 2026 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2027 <2> ; $IF E ;;AN000;; 2028 <2> JNE $MIF199 2029 <2> 2030 <2> %IF CHARmsg ;;AN000;; Was Char specified? 2031 <2> Char_Type equ Char_type ; NASM port equate 2032 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2033 <2> ; $IF Z ;;AN000;; 2034 <2> JNZ $MIF200 2035 <2> 2036 <2> ;; Character type requested 2037 <2> ;;AN000;; 2038 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2039 <2> CALL $M_CHAR_REPLACE ;;AN000;; 2040 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2041 <2> JMP SHORT $MEN200 2042 <2> $MIF200: 2043 <2> %ENDIF ;;AN000;; 2044 <2> %IF NUMmsg ;;AN000;; Was Nnmeric type specified? 2045 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2046 <2> ; $IF Z,OR ;;AN000;; 2047 <2> JZ $MLL202 2048 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2049 <2> ; $IF Z,OR ;;AN000;; 2050 <2> JZ $MLL202 2051 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Bin_Hex_Type & $M_TYPE_MASK ;;AN000;; 2052 <2> ; $IF Z ;;AN000;; 2053 <2> JNZ $MIF202 2054 <2> $MLL202: 2055 <2> 2056 <2> ;; Numeric type requested 2057 <2> 2058 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2059 <2> CALL $M_BIN2ASC_REPLACE ;;AN000;; 2060 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2061 <2> JMP SHORT $MEN202 2062 <2> $MIF202: 2063 <2> %ENDIF ;;AN000;; 2064 <2> %IF DATEmsg ;;AN000;; Was date specified? 2065 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Date_Type & $M_TYPE_MASK ;;AN000;; 2066 <2> ; $IF E ;;AN000;; 2067 <2> JNE $MIF204 2068 <2> 2069 <2> ;; Date type requested 2070 <2> 2071 <2> CALL $M_DATE_REPLACE ;;AN000;; 2072 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2073 <2> JMP SHORT $MEN204 2074 <2> $MIF204: 2075 <2> %ENDIF ;;AN000;; 2076 <2> %IF TIMEmsg ;;AN000;; Was time (12 hour format) specified? 2077 <2> 2078 <2> ;; Time type requested (Default if we have not matched until here) 2079 <2> 2080 <2> CALL $M_TIME_REPLACE ;;AN000;; 2081 <2> %ENDIF ;;AN000;; 2082 <2> 2083 <2> %IF DATEmsg ;;AN000;; 2084 <2> ; $ENDIF ;;AN000;; 2085 <2> $MEN204: 2086 <2> %ENDIF ;;AN000;; 2087 <2> %IF NUMmsg ;;AN000;; 2088 <2> ; $ENDIF ;;AN000;; 2089 <2> $MEN202: 2090 <2> %ENDIF ;;AN000;; 2091 <2> %IF CHARmsg ;;AN000;; 2092 <2> ; $ENDIF ;;AN000;; 2093 <2> $MEN200: 2094 <2> %ENDIF ;;AN000;; 2095 <2> 2096 <2> %IF $M_REPLACE ;;AN000;; 2097 <2> ;; With the replace information of the Stack, display the replaceable field 2098 <2> 2099 <2> CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace 2100 <2> %ENDIF ;;AN000;; 2101 <2> ;; None of the above - Extended/Parse replace 2102 <2> ; $ELSE ;;AN000;; 2103 <2> JMP SHORT $MEN199 2104 <2> $MIF199: 2105 <2> %IFN COMR 2106 <2> CALL $M_EXT_PAR_REPLACE ;;AN000;; 2107 <2> %ENDIF 2108 <2> ; $ENDIF ;;AN000;; 2109 <2> $MEN199: 2110 <2> 2111 <2> ;; We must go back and complete the message after the replacable parameter if there is any left 2112 <2> 2113 <2> ; $IF NC ;;AN000;; IF there was an error displaying then EXIT 2114 <2> JC $MIF211 2115 <2> POP CX ;;AN000;; Get size of the rest of the message 2116 <2> POP ES ;;AN000;; Get address of the rest of the message 2117 <2> POP DI ;;AN000;; 2118 <2> POP BP ;;AN000;; Get replacment count 2119 <2> POP SI ;;AN000;; ELSE get address of first sublist structure 2120 <2> ; $ELSE ;;AN000;; 2121 <2> JMP SHORT $MEN211 2122 <2> $MIF211: 2123 <2> ADD SP,10 ;;AN000;; Clean up stack if error 2124 <2> STC ;;AN000;; 2125 <2> ; $ENDIF ;;AN000;; 2126 <2> $MEN211: 2127 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2128 <2> ; $ENDDO NE,OR ;;AN000;; 2129 <2> JNE $MLL214 2130 <2> ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message 2131 <2> JC $MXL4 2132 <2> JMP $MDO165 2133 <2> $MXL4: 2134 <2> $MLL214: 2135 <2> $MEN165: 2136 <2> ;; IF there was an error displaying then EXIT 2137 <2> MOV word [$M_RT + $M_MSG_NUM],0 ;;AN000;; Reset message number to null 2138 <2> RET ;;AN000;; Return 2139 <2> ;; 2140 <2> $M_DISPLAY_MESSAGE ENDP ;;AN000;; 2141 <2> %IFN COMR 2142 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2143 <2> ;; 2144 <2> ;; PROC NAME: $M_EXT_PAR_REPLACE 2145 <2> ;; 2146 <2> ;; FUNCTION: 2147 <2> ;; INPUTS: 2148 <2> ;; OUPUTS: 2149 <2> ;; 2150 <2> ;; REGS USED: 2151 <2> ;; 2152 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2153 <2> ;; 2154 <2> $M_EXT_PAR_REPLACE PROC NEAR ;;AN000;; 2155 <2> ;; 2156 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2157 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN000;; Prepare for get binary value (LOW) 2158 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2159 <2> ;; 2160 <2> CALL $M_CONVERT2ASC ;;AN000;; 2161 <2> ;; 2162 <2> ; $DO ;;AN000;; 2163 <2> $MDO215: 2164 <2> POP AX ;;AN000;; Get character in register 2165 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2166 <2> INC BX ;;AN000;; Increase buffer count 2167 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2168 <2> ; $IF E ;;AN000;; Yes, 2169 <2> JNE $MIF216 2170 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2171 <2> ; $ENDIF ;;AN000;; 2172 <2> $MIF216: 2173 <2> DEC CL ;;AN000;; Have we completed replace? 2174 <2> ; $ENDDO Z ;;AN000;; 2175 <2> JNZ $MDO215 2176 <2> ;; 2177 <2> MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer 2178 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],AX ;;AN000;; Move char into the buffer 2179 <2> INC BX ;;AN000;; Increase buffer count 2180 <2> INC BX ;;AN000;; Increase buffer count 2181 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2182 <2> RET ;;AN000:: 2183 <2> ;; 2184 <2> $M_EXT_PAR_REPLACE ENDP ;;AN000;; 2185 <2> ;; 2186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2187 <2> %ENDIF 2188 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 2189 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 2190 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2191 <2> ;; 2192 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 2193 <2> ;; 2194 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 2195 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 2196 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2197 <2> ;; IF CX > 1 THEN DS:SI points to the specified message 2198 <2> ;; REGS CHANGED: ES,DI,CX,DS,SI 2199 <2> ;; 2200 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2201 <2> ;; 2202 <2> %IF FARmsg ;;AN000;; 2203 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 2204 <2> %ELSE ;;AN000;; 2205 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 2206 <2> %ENDIF ;;AN000;; 2207 <2> ;; 2208 <2> PUSH SI ;;AN000;; 2209 <2> PUSH BX ;;AN000;; 2210 <2> XOR SI,SI ;;AN000;; Use SI as an index 2211 <2> XOR CX,CX ;;AN000;; Use CX as an size 2212 <2> ; $DO ;;AN000;; 2213 <2> $MDO219: 2214 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 2215 <2> ; $IF E ;;AN000;; Yes, 2216 <2> JNE $MIF220 2217 <2> %IF FARmsg ;;AN000;; 2218 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2219 <2> MOV BX,ES ;;AN000; 2220 <2> %ELSE ;;AN000;; 2221 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2222 <2> MOV BX,DI ;;AN000; 2223 <2> %ENDIF ;;AN000;; 2224 <2> ; $ELSE ;;AN000;; No, 2225 <2> JMP SHORT $MEN220 2226 <2> $MIF220: 2227 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 2228 <2> ; $IF NE ;;AN000;; Yes, 2229 <2> JE $MIF222 2230 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 2231 <2> MOV BX,ES ;;AN000; 2232 <2> ; $ELSE ;;AN000;; No, extended errors were specified 2233 <2> JMP SHORT $MEN222 2234 <2> $MIF222: 2235 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 2236 <2> ; $IF AE,AND ;;AN000;; 2237 <2> JNAE $MIF224 2238 <2> CMP AX,$M_CRIT_HI ;;AN000;; 2239 <2> ; $IF BE ;;AN000;; Yes, 2240 <2> JNBE $MIF224 2241 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 2242 <2> MOV BX,ES ;;AN000; 2243 <2> ; $ELSE ;;AN000;; 2244 <2> JMP SHORT $MEN224 2245 <2> $MIF224: 2246 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 2247 <2> MOV BX,ES ;;AN000; 2248 <2> ; $ENDIF ;;AN000;; 2249 <2> $MEN224: 2250 <2> ; $ENDIF ;;AN000;; 2251 <2> $MEN222: 2252 <2> ; $ENDIF ;;AN000;; 2253 <2> $MEN220: 2254 <2> ;; 2255 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 2256 <2> ; $IF E ;;AN000;; Yes, 2257 <2> JNE $MIF229 2258 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 2259 <2> ; $IF E ;;AN000;; Yes, 2260 <2> JNE $MIF230 2261 <2> STC ;;AN000;; Set the carry flag 2262 <2> ; $ELSE ;;AN000;; No, 2263 <2> JMP SHORT $MEN230 2264 <2> $MIF230: 2265 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 2266 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 2267 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 2268 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 2269 <2> CLC ;;AN000;; 2270 <2> ; $ENDIF ;;AN000;; No, 2271 <2> $MEN230: 2272 <2> ; $ELSE ;;AN000;; 2273 <2> JMP SHORT $MEN229 2274 <2> $MIF229: 2275 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 2276 <2> ; $IF NE ;;AN001;; Yes, 2277 <2> JE $MIF234 2278 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 2279 <2> ; $ENDIF ;;AN000;; 2280 <2> $MIF234: 2281 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 2282 <2> CLC ;;AN000;; 2283 <2> ; $ENDIF ;;AN000;; 2284 <2> $MEN229: 2285 <2> ; $LEAVE C ;;AN000;; 2286 <2> JC $MEN219 2287 <2> OR CX,CX ;;AN000;; Was the message found? 2288 <2> ; $ENDDO NZ,LONG ;;AN000;; 2289 <2> JNZ $MXL5 2290 <2> JMP $MDO219 2291 <2> $MXL5: 2292 <2> $MEN219: 2293 <2> 2294 <2> PUSHF ;;AN006;; Save the flag state 2295 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 2296 <2> ; $IF E ;;AN006;; Yes, 2297 <2> JNE $MIF239 2298 <2> PUSH DX ;;AN006;; Save all needed registers 2299 <2> PUSH BP ;;AN006;; 2300 <2> PUSH CX ;;AN006;; 2301 <2> PUSH ES ;;AN006;; 2302 <2> PUSH DI ;;AN006;; 2303 <2> PUSH AX ;;AN006;; 2304 <2> 2305 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 2306 <2> INT 2FH ;;AN006;; 2307 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 2308 <2> POP AX ;;AN006;; Restore msg number 2309 <2> ; $IF E ;;AN006;; Yes, 2310 <2> JNE $MIF240 2311 <2> MOV BX,AX ;;AN006;; BX is the extended error number 2312 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 2313 <2> INT 2FH ;;AN006;; Call IFSFUNC 2314 <2> ; $ELSE ;;AN006;; No, 2315 <2> JMP SHORT $MEN240 2316 <2> $MIF240: 2317 <2> STC ;;AN006;; Carry conditon 2318 <2> ; $ENDIF ;;AN006;; 2319 <2> $MEN240: 2320 <2> 2321 <2> ; $IF C ;;AN006;; Was there an update? 2322 <2> JNC $MIF243 2323 <2> POP DI ;;AN006;; No, 2324 <2> POP ES ;;AN006;; Restore old pointer 2325 <2> POP CX ;;AN006;; 2326 <2> ; $ELSE ;;AN006;; Yes 2327 <2> JMP SHORT $MEN243 2328 <2> $MIF243: 2329 <2> ADD SP,6 ;;AN006;; Throw away old pointer 2330 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 2331 <2> ; $ENDIF ;;AN006;; 2332 <2> $MEN243: 2333 <2> POP BP ;;AN006;; Restore other Regs 2334 <2> POP DX ;;AN006;; 2335 <2> ; $ENDIF ;;AN006;; 2336 <2> $MIF239: 2337 <2> $M_POPF ;;AN006;; Restore the flag state 2338 <2> 2339 <2> POP BX ;;AN000;; 2340 <2> POP SI ;;AN000;; 2341 <2> RET ;;AN000;; Return ES:DI pointing to the message 2342 <2> ;; 2343 <2> $M_GET_MSG_ADDRESS ENDP ;; 2344 <2> ;; 2345 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 2346 <2> ;; 2347 <2> PUSH DI ;;AN006;; Save position 2348 <2> PUSH AX ;;AN006;; 2349 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 2350 <2> XOR AL,AL ;;AN006;; Prepare compare register 2351 <2> REPNE SCASB ;;AN006;; Scan for zero 2352 <2> NOT CX ;;AN006;; Change decrement into number 2353 <2> DEC CX ;;AN006;; Don't include the zero 2354 <2> POP AX ;;AN006;; 2355 <2> POP DI ;;AN006;; Restore position 2356 <2> RET ;;AN006;; 2357 <2> ;; 2358 <2> $M_SET_LEN_IN_CX ENDP ;; 2359 <2> ;; 2360 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2361 <2> ;; 2362 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 2363 <2> ;; 2364 <2> ;; FUNCTION: To scan thru message headers until message is found 2365 <2> ;; INPUTS: ES:DI points to beginning of msg headers 2366 <2> ;; CX contains the number of messages in class 2367 <2> ;; DH contains the message class 2368 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2369 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 2370 <2> ;; 2371 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2372 <2> ;; 2373 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 2374 <2> ;; 2375 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 2376 <2> ; $IF E,AND ;;AN004;; Yes, 2377 <2> JNE $MIF247 2378 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 2379 <2> ; $IF NE ;;AN004;; Yes, 2380 <2> JE $MIF247 2381 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 2382 <2> ; $IF E ;;AN004;; . . . and . . . 2383 <2> JNE $MIF248 2384 <2> PUSH AX ;;AN004;; Reset the special message number 2385 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 2386 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2387 <2> POP AX ;;AN004;; Reset the special message number 2388 <2> ; $ELSE ;;AN004;; Get the old message number 2389 <2> JMP SHORT $MEN248 2390 <2> $MIF248: 2391 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2392 <2> ; $ENDIF ;;AN004;; Get the old message number 2393 <2> $MEN248: 2394 <2> ; $ELSE ;;AN004;; 2395 <2> JMP SHORT $MEN247 2396 <2> $MIF247: 2397 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 2398 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2399 <2> ; $IF NE ;;AN001;; 2400 <2> JE $MIF252 2401 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 2402 <2> ; $ELSE ;;AN001;; 2403 <2> JMP SHORT $MEN252 2404 <2> $MIF252: 2405 <2> %IF FARmsg ;;AN001;; 2406 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2407 <2> %ELSE 2408 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2409 <2> %ENDIF 2410 <2> ; $IF E ;;AN002;; pointer (hopefully) 2411 <2> JNE $MIF254 2412 <2> %IF FARmsg ;;AN001;; 2413 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2414 <2> %ELSE 2415 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2416 <2> %ENDIF 2417 <2> ; $ENDIF ;;AN002;; go on to the next class 2418 <2> $MIF254: 2419 <2> ; $ENDIF ;;AN001;; 2420 <2> $MEN252: 2421 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 2422 <2> STC ;;AN004;; Flag that we haven't found anything yet 2423 <2> ; $ENDIF ;;AN004;; 2424 <2> $MEN247: 2425 <2> 2426 <2> ; $IF C ;;AN004;; Have we found anything yet? 2427 <2> JNC $MIF258 2428 <2> CLC ;;AN004;; No, reset carry 2429 <2> ; $SEARCH ;;AN000;; 2430 <2> $MDO259: 2431 <2> OR CX,CX ;;AN000;; Do we have any to check? 2432 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2433 <2> JZ $MEN259 2434 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2435 <2> ; $IF NE ;;AN001;; 2436 <2> JE $MIF261 2437 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 2438 <2> ; $ELSE ;;AN001;; 2439 <2> JMP SHORT $MEN261 2440 <2> $MIF261: 2441 <2> %IF FARmsg ;;AN001;; 2442 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 2443 <2> %ELSE 2444 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 2445 <2> %ENDIF 2446 <2> ; $ENDIF 2447 <2> $MEN261: 2448 <2> ; $EXITIF E ;;AN000;; 2449 <2> JNE $MIF259 2450 <2> ; $ORELSE ;;AN000; 2451 <2> JMP SHORT $MSR259 2452 <2> $MIF259: 2453 <2> DEC CX ;;AN000;; No, well do we have more to check? 2454 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2455 <2> JZ $MEN259 2456 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 2457 <2> ; $ENDLOOP ;;AN000;; 2458 <2> JMP SHORT $MDO259 2459 <2> $MEN259: 2460 <2> STC ;;AN000;; 2461 <2> ; $ENDSRCH ;;AN000;; Check next message 2462 <2> $MSR259: 2463 <2> ; $IF NC ;;AN000;; Did we find the message? 2464 <2> JC $MIF269 2465 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 2466 <2> CLC ;;AN001;; 2467 <2> ; $IF E ;;AN001;; 2468 <2> JNE $MIF270 2469 <2> %IF FARmsg ;;AN001;; 2470 <2> %ELSE ;;AN000;; 2471 <2> PUSH CS ;;AN000;; 2472 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 2473 <2> %ENDIF 2474 <2> ; $ENDIF ;;AN001;; 2475 <2> $MIF270: 2476 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 2477 <2> ; $ENDIF ;;AN004;; 2478 <2> $MIF269: 2479 <2> ; $ENDIF ;;AN004;; 2480 <2> $MIF258: 2481 <2> ;; Yes, great we can return with CX > 0 2482 <2> 2483 <2> ; $IF NC ;;AN000;; Did we find the message? 2484 <2> JC $MIF274 2485 <2> XOR CH,CH ;;AN000;; 2486 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 2487 <2> INC DI ;;AN000;; Increment past length 2488 <2> ; $ENDIF ;;AN004;; 2489 <2> $MIF274: 2490 <2> 2491 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 2492 <2> RET ;;AN000;; Return 2493 <2> ;; 2494 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 2495 <2> ;; 2496 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2497 <2> %ENDIF ;;AN000;; END of include of common subroutines 2498 <2> ; 2499 <2> %IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms 2500 <2> %iassign $M_REPLACE FALSE ;;AN000;; Tell the assembler we did 2501 <2> ;; 2502 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2503 <2> $M_DISPLAY_REPLACE PROC NEAR ;;AN000;; 2504 <2> ;; 2505 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2506 <2> %IFN COMR 2507 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII) 2508 <2> ; $IF E ;;AN000;; Yes, 2509 <2> JNE $MIF276 2510 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE_HYP ;;AN000;; Move in a " -" 2511 <2> INC BX ;;AN000;; Increment count 2512 <2> INC BX ;;AN000;; Increment count 2513 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE ;;AN000;; Move in a " " 2514 <2> INC BX ;;AN000;; Increment count 2515 <2> CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case 2516 <2> ; $ENDIF ;;AN000;; If it fails we will catch it later 2517 <2> $MIF276: 2518 <2> %ENDIF 2519 <2> 2520 <2> POP BP ;;AN000;; Remember the return address 2521 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2522 <2> XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack 2523 <2> 2524 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save size to later clear stack 2525 <2> MOV AL,BYTE PTR [$M_SL + $M_S_MINW] ;;AN000;; Get the minimum width 2526 <2> ;; 2527 <2> CMP AL,CL ;;AN000;; Do we need pad chars added? 2528 <2> ; $IF A ;;AN000;; Yes, 2529 <2> JNA $MIF278 2530 <2> SUB AL,CL ;;AN000;; Calculate how many pad chars are needed. 2531 <2> MOV DH,AL ;;AN000;; Save the number of pad characters 2532 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be right aligned? 2533 <2> ; $IF NZ ;;AN000;; Yes, 2534 <2> JZ $MIF279 2535 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2536 <2> $MDO280: 2537 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2538 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2539 <2> INC BX ;;AN000;; 2540 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2541 <2> ; $IF E ;;AN000;; Yes, 2542 <2> JNE $MIF281 2543 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2544 <2> ; $ENDIF ;;AN000;; 2545 <2> $MIF281: 2546 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2547 <2> ; $ENDDO Z ;;AN000;; No, next pad character 2548 <2> JNZ $MDO280 2549 <2> ; $ENDIF ;;AN000;; 2550 <2> $MIF279: 2551 <2> ; $ENDIF ;;AN000;; Yes, 2552 <2> $MIF278: 2553 <2> ;; 2554 <2> CMP BYTE [$M_SL + $M_S_MAXW],$M_UNLIM_W ;;AN000;; Is maximum width unlimited? 2555 <2> ; $IF NE ;;AN000;; 2556 <2> JE $MIF286 2557 <2> CMP BYTE PTR [$M_SL + $M_S_MAXW],CL ;;AN000;; Will we exceed maximum width? 2558 <2> ; $IF B ;;AN000;; Yes, 2559 <2> JNB $MIF287 2560 <2> SUB CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Calculate how many extra chars 2561 <2> MOV DL,CL ;;AN000;; Remember how many chars to pop off 2562 <2> MOV CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Set new string length 2563 <2> ; $ENDIF ;;AN000;; 2564 <2> $MIF287: 2565 <2> ; $ENDIF ;;AN000;; 2566 <2> $MIF286: 2567 <2> OR CX,CX ;;AN000;; 2568 <2> ; $IF NZ ;;AN000;; 2569 <2> JZ $MIF290 2570 <2> ; $DO ;;AN000;; Begin filling buffer with string 2571 <2> $MDO291: 2572 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2573 <2> ; $IF Z,AND ;;AN000;; 2574 <2> JNZ $MIF292 2575 <2> Char_field_ASCIIZ equ Char_Field_ASCIIZ ; NASM port equate 2576 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ; Is this replace a ASCIIZ string? 2577 <2> ; $IF NZ ;;AN000;; Yes, 2578 <2> JZ $MIF292 2579 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get first character from string 2580 <2> INC DI ;;AN000;; Next character in string 2581 <2> ; $ELSE ;;AN000;; No, 2582 <2> JMP SHORT $MEN292 2583 <2> $MIF292: 2584 <2> POP AX ;;AN000;; Get character in register 2585 <2> ; $ENDIF ;;AN000;; 2586 <2> $MEN292: 2587 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2588 <2> INC BX ;;AN000;; Increase buffer count 2589 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2590 <2> ; $IF E ;;AN000;; Yes, 2591 <2> JNE $MIF295 2592 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2593 <2> ; $ENDIF ;;AN000;; 2594 <2> $MIF295: 2595 <2> DEC CL ;;AN000;; Have we completed replace? 2596 <2> ; $ENDDO Z ;;AN000;; Test again 2597 <2> JNZ $MDO291 2598 <2> ; $ENDIF ;;AN000;; 2599 <2> $MIF290: 2600 <2> ;; 2601 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be left aligned? 2602 <2> ; $IF Z ;;AN000;; Yes, 2603 <2> JNZ $MIF299 2604 <2> OR DH,DH ;;AN000;; Do we need pad chars added? 2605 <2> ; $IF NZ ;;AN000;; Yes, 2606 <2> JZ $MIF300 2607 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2608 <2> $MDO301: 2609 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2610 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2611 <2> INC BX ;;AN000;; 2612 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2613 <2> ; $IF E ;;AN000;; Yes, 2614 <2> JNE $MIF302 2615 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2616 <2> ; $ENDIF ;;AN000;; 2617 <2> $MIF302: 2618 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2619 <2> ; $ENDDO Z ;;AN000;; Test again 2620 <2> JNZ $MDO301 2621 <2> ; $ENDIF ;;AN000;; 2622 <2> $MIF300: 2623 <2> ; $ENDIF ;;AN000;; 2624 <2> $MIF299: 2625 <2> ;; 2626 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2627 <2> ; $IF Z,AND ;;AN000;; 2628 <2> JNZ $MIF307 2629 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string? 2630 <2> ; $IF NZ ;;AN000;; Yes, 2631 <2> JZ $MIF307 2632 <2> ; $ELSE ;;AN000;; 2633 <2> JMP SHORT $MEN307 2634 <2> $MIF307: 2635 <2> OR DL,DL ;;AN000;; 2636 <2> ; $IF NE ;;AN000;; 2637 <2> JE $MIF309 2638 <2> ; $DO ;;AN000;; 2639 <2> $MDO310: 2640 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable 2641 <2> DEC DL ;;AN000;; Are we done? 2642 <2> ; $ENDDO Z ;;AN000;; 2643 <2> JNZ $MDO310 2644 <2> ; $ENDIF ;;AN000;; 2645 <2> $MIF309: 2646 <2> ; $ENDIF ;;AN000;; 2647 <2> $MEN307: 2648 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time 2649 <2> PUSH BP ;;AN000;; Restore the return address 2650 <2> ;; 2651 <2> RET ;;AN000;; 2652 <2> ;; 2653 <2> $M_DISPLAY_REPLACE ENDP ;;AN000;; 2654 <2> ;; 2655 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2656 <2> ;; 2657 <2> ;; PROC NAME: $M_FLUSH_BUFFER 2658 <2> ;; 2659 <2> ;; FUNCTION: Display the contents of the temporary buffer 2660 <2> ;; INPUTS: DI contains the number of bytes to display 2661 <2> ;; OUTPUTS: BX reset to zero 2662 <2> ;; 2663 <2> ;; REGS USED: 2664 <2> ;; 2665 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2666 <2> ;; 2667 <2> $M_FLUSH_BUF PROC NEAR ;;AN000;; 2668 <2> ;; 2669 <2> PUSH CX ;;AN000;; Save changed regs 2670 <2> PUSH ES ;;AN000;; 2671 <2> PUSH DI ;;AN000;; 2672 <2> PUSH DS ;;AN000;; Set ES pointing to buffer 2673 <2> POP ES ;;AN000;; 2674 <2> ;; 2675 <2> MOV CX,BX ;;AN000;; Set number of bytes to display 2676 <2> XOR BX,BX ;;AN000;; Reset buffer counter 2677 <2> LEA DI,[$M_RT + $M_TEMP_BUF] ;;AN000;; Reset buffer location pointer 2678 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer 2679 <2> ;; 2680 <2> ; $IF NC ;;AN000;; Error? 2681 <2> JC $MIF314 2682 <2> POP DI ;;AN000;; No, Restore changed regs 2683 <2> POP ES ;;AN000;; 2684 <2> POP CX ;;AN000;; 2685 <2> ; $ELSE ;;AN000;; Yes, 2686 <2> JMP SHORT $MEN314 2687 <2> $MIF314: 2688 <2> ADD SP,6 ;;AN000;; Fix stack 2689 <2> STC ;;AN000;; 2690 <2> ; $ENDIF ;;AN000;; Error? 2691 <2> $MEN314: 2692 <2> ;; 2693 <2> RET ;;AN000;; Return 2694 <2> ;; 2695 <2> $M_FLUSH_BUF ENDP ;;AN000;; 2696 <2> ;; 2697 <2> ;; 2698 <2> %IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace? 2699 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2700 <2> %iassign $M_CHAR_ONLY TRUE ;;AN000;; replacement code later 2701 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2702 <2> ;; 2703 <2> ;; PROC NAME: $M_CHAR_REPLACE 2704 <2> ;; 2705 <2> ;; FUNCTION: Will prepare a single char or ASCIIZ string for replace 2706 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2707 <2> ;; ES:DI contains the VALUE from SUBLIST 2708 <2> ;; OUTPUTS: CX contains number of characters on stack 2709 <2> ;; Top of stack --> Last character 2710 <2> ;; . . . 2711 <2> ;; Bot of stack --> First character 2712 <2> ;; 2713 <2> ;; OTHER REGS Revised: AX 2714 <2> ;; 2715 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2716 <2> ;; 2717 <2> $M_CHAR_REPLACE PROC NEAR ;;AN000;; 2718 <2> ;; 2719 <2> POP BP ;;AN000;; Save return address 2720 <2> TEST byte [$M_SL + $M_S_FLAG],~ Char_Field_Char & $M_SIZE_MASK ;;AN000;; Was Character specified? 2721 <2> ; $IF Z ;;AN000;; Yes, 2722 <2> JNZ $MIF317 2723 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2724 <2> PUSH AX ;;AN000;; Put it on the stack 2725 <2> INC CX ;;AN000;; Increase the count 2726 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 2727 <2> ; $IF C ;;AN000;; Yes, 2728 <2> JNC $MIF318 2729 <2> MOV AL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 2730 <2> PUSH AX ;;AN000;; Put it on the stack 2731 <2> CLC ;;AN000;; Clear the carry 2732 <2> ; $ENDIF ;;AN000;; 2733 <2> $MIF318: 2734 <2> ; $ELSE ;;AN000;; No, it was an ASCIIZ string 2735 <2> JMP SHORT $MEN317 2736 <2> $MIF317: 2737 <2> ; $DO ;;AN000;; 2738 <2> $MDO321: 2739 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2740 <2> OR AL,AL ;;AN000;; Is it the NULL? 2741 <2> ; $LEAVE Z ;;AN000;; No, 2742 <2> JZ $MEN321 2743 <2> INC DI ;;AN000;; Next character 2744 <2> INC CX ;;AN000;; Increment the count 2745 <2> ; $ENDDO ;;AN000;; Yes, 2746 <2> JMP SHORT $MDO321 2747 <2> $MEN321: 2748 <2> SUB DI,CX ;;AN000;; Set SI at the beginning of the string 2749 <2> ; $ENDIF ;;AN000;; 2750 <2> $MEN317: 2751 <2> ;;AN000;; 2752 <2> PUSH BP ;;AN000;; Restore return address 2753 <2> RET ;;AN000;; Return 2754 <2> ;; 2755 <2> $M_CHAR_REPLACE ENDP ;;AN000;; 2756 <2> ;; 2757 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2758 <2> %ENDIF ;;AN000;; END of include of CHAR replace code 2759 <2> ; 2760 <2> %IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace? 2761 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2762 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2763 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2764 <2> ;; 2765 <2> ;; PROC NAME: $M_BIN2ASC_REPLACE 2766 <2> ;; 2767 <2> ;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string 2768 <2> ;; and prepare to display 2769 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2770 <2> ;; ES:DI contains the VALUE from SUBLIST 2771 <2> ;; OUTPUTS: CX contains number of characters on stack 2772 <2> ;; Top of stack --> Last character 2773 <2> ;; . . . 2774 <2> ;; Bot of stack --> First character 2775 <2> ;; OTHER REGS Revised: BX,DX,AX 2776 <2> ;; 2777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2778 <2> ;; 2779 <2> $M_BIN2ASC_REPLACE PROC NEAR ;;AN000;; 2780 <2> ;; 2781 <2> POP BP ;;AN000;; Save return address 2782 <2> ;; 2783 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2784 <2> XOR AX,AX ;;AN000;; Prepare for get binary value (LOW) 2785 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE16 ;;AN000;; Set default divisor 2786 <2> XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable) 2787 <2> %IFN COMR 2788 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_BYTE & $M_SIZE_MASK ;;AN000;; Was BYTE specified? 2789 <2> ; $IF Z ;;AN000;; 2790 <2> JNZ $MIF325 2791 <2> MOV AL, BYTE PTR [ES:DI] ;;AN000;; Setup byte in AL 2792 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2793 <2> ; $IF Z ;;AN000;; 2794 <2> JNZ $MIF326 2795 <2> TEST AL,10000000b ;;AN000;; Is this number negative? 2796 <2> ; $IF NZ ;;AN000;; Yes, 2797 <2> JZ $MIF327 2798 <2> INC BX ;;AN000;; Remember that it was negative 2799 <2> AND AL,01111111b ;;AN000;; Make it positive 2800 <2> ; $ENDIF ;;AN000;; 2801 <2> $MIF327: 2802 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2803 <2> ; $ENDIF ;;AN000;; 2804 <2> $MIF326: 2805 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2806 <2> ; $IF Z ;;AN000;; 2807 <2> JNZ $MIF330 2808 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2809 <2> ; $ENDIF ;;AN000;; 2810 <2> $MIF330: 2811 <2> ; $ELSE ;;AN000;; 2812 <2> JMP SHORT $MEN325 2813 <2> $MIF325: 2814 <2> %ENDIF 2815 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_WORD & $M_SIZE_MASK ;;AN000;; Was WORD specified? 2816 <2> ; $IF Z ;;AN000;; 2817 <2> JNZ $MIF333 2818 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup byte in AL 2819 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;; AN000;; Was Signed binary specified? 2820 <2> ; $IF Z ;;AN000;; 2821 <2> JNZ $MIF334 2822 <2> TEST AH,10000000b ;;AN000;; Is this number negative? 2823 <2> ; $IF NZ ;;AN000;; Yes, 2824 <2> JZ $MIF335 2825 <2> INC BX ;;AN000;; Remember that it was negative 2826 <2> AND AH,01111111b ;;AN000;; Make it positive 2827 <2> ; $ENDIF ;;AN000;; 2828 <2> $MIF335: 2829 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2830 <2> ; $ENDIF ;;AN000;; 2831 <2> $MIF334: 2832 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2833 <2> ; $IF Z ;;AN000;; 2834 <2> JNZ $MIF338 2835 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2836 <2> ; $ENDIF ;;AN000;; 2837 <2> $MIF338: 2838 <2> ; $ELSE ;;AN000;; 2839 <2> JMP SHORT $MEN333 2840 <2> $MIF333: 2841 <2> %IFN COMR 2842 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup Double word in DX:AX 2843 <2> MOV DX, WORD PTR [ES:DI + 2] ;;AN000;; 2844 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2845 <2> ; $IF Z ;;AN000;; 2846 <2> JNZ $MIF341 2847 <2> TEST DH,10000000b ;;AN000;; Is this number negative? 2848 <2> ; $IF NZ ;;AN000;; Yes, 2849 <2> JZ $MIF342 2850 <2> INC BX ;;AN000;; Remember that it was negative 2851 <2> AND DH,01111111b ;;AN000;; Make it positive 2852 <2> ; $ENDIF ;;AN000;; 2853 <2> $MIF342: 2854 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2855 <2> ; $ENDIF ;;AN000;; 2856 <2> $MIF341: 2857 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2858 <2> ; $IF Z ;;AN000;; 2859 <2> JNZ $MIF345 2860 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2861 <2> ; $ENDIF ;;AN000;; 2862 <2> $MIF345: 2863 <2> %ENDIF 2864 <2> ; $ENDIF ;;AN000;; 2865 <2> $MEN333: 2866 <2> ; $ENDIF ;;AN000;; 2867 <2> $MEN325: 2868 <2> ;; 2869 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string 2870 <2> %IFN COMR 2871 <2> OR BX,BX ;;AN000;; 2872 <2> ; $IF NZ ;;AN000;; Was number negative? 2873 <2> JZ $MIF349 2874 <2> XOR DX,DX ;;AN000;; Yes, 2875 <2> MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number 2876 <2> PUSH DX ;;AN000;; 2877 <2> ; $ENDIF ;;AN000;; No, 2878 <2> $MIF349: 2879 <2> %ENDIF 2880 <2> ;; 2881 <2> PUSH BP ;;AN000;; Restore return address 2882 <2> RET ;;AN000;; Return 2883 <2> ;; 2884 <2> $M_BIN2ASC_REPLACE ENDP ;;AN000;; 2885 <2> ;; 2886 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2887 <2> %ENDIF ;;AN000;; END of include of NUM replace code 2888 <2> ; 2889 <2> %IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace? 2890 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2891 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2892 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2893 <2> ;; 2894 <2> ;; PROC NAME: $M_DATE_REPLACE 2895 <2> ;; 2896 <2> ;; FUNCTION: Convert a date to a decimal ASCII string using current 2897 <2> ;; country format and prepare to display 2898 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2899 <2> ;; ES:DI points at VALUE from SUBLIST 2900 <2> ;; OUTPUTS: CX contains number of characters on stack 2901 <2> ;; Top of stack --> Last character 2902 <2> ;; . . . 2903 <2> ;; Bot of stack --> First character 2904 <2> ;; OTHER REGS Revised: DX, AX 2905 <2> ;; 2906 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2907 <2> ;; 2908 <2> $M_DATE_REPLACE PROC NEAR ;;AN000;; 2909 <2> ;; 2910 <2> POP BP ;;AN000;; Save return address 2911 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2912 <2> CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT 2913 <2> ;;AN000;; All O.K.? 2914 <2> XOR DX,DX ;;AN000;; Reset DX value 2915 <2> XOR AX,AX ;;AN000;; Reset AX value 2916 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],0 ;;AN000;; USA Date Format 2917 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2918 <2> JNE $MIF351 2919 <2> CALL $M_YEAR ;;AN000;; Get Year 2920 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2921 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2922 <2> INC CX ;;AN000;; Increment count 2923 <2> XOR AX,AX ;;AN000;; Reset AX value 2924 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2925 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2926 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2927 <2> INC CX ;;AN000;; Increment count 2928 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2929 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2930 <2> ; $ENDIF ;;AN000;; 2931 <2> $MIF351: 2932 <2> ;; 2933 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],1 ;;AN000;; EUROPE Date Format 2934 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2935 <2> JNE $MIF353 2936 <2> CALL $M_YEAR ;;AN000;; Get Year 2937 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2938 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2939 <2> INC CX ;;AN000;; 2940 <2> XOR AX,AX ;;AN000;; Reset AX 2941 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2942 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2943 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2944 <2> INC CX ;;AN000;; 2945 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2946 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2947 <2> ; $ENDIF ;;AN000;; 2948 <2> $MIF353: 2949 <2> ;; 2950 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],2 ;;AN000;; JAPAN Date Format 2951 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2952 <2> JNE $MIF355 2953 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2954 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2955 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2956 <2> INC CX ;;AN000;; 2957 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2958 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2959 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2960 <2> INC CX ;;AN000;; 2961 <2> CALL $M_YEAR ;;AN000;; Get Year 2962 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2963 <2> ; $ENDIF ;;AN000;; 2964 <2> $MIF355: 2965 <2> ;; 2966 <2> PUSH BP ;;AN000;; Restore return address 2967 <2> RET ;;AN000;; Return 2968 <2> ;; 2969 <2> $M_DATE_REPLACE ENDP ;;AN000;; 2970 <2> ;; 2971 <2> $M_GET_DATE PROC NEAR ;;AN000;; 2972 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 2973 <2> MOV AL,0 ;;AN000;; Get current country info 2974 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 2975 <2> INT 21H ;;AN000;; 2976 <2> ; $IF C ;;AN000;; No, 2977 <2> JNC $MIF357 2978 <2> MOV WORD [$M_RT + $M_DATE_FORMAT],$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH) 2979 <2> MOV BYTE [$M_RT + $M_DATE_SEPARA],$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL) 2980 <2> ; $ENDIF ;;AN000;; 2981 <2> $MIF357: 2982 <2> RET ;;AN000;; 2983 <2> $M_GET_DATE ENDP ;;AN000;; 2984 <2> ;; 2985 <2> $M_YEAR PROC NEAR ;;AN000;; 2986 <2> MOV AX,WORD PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Year 2987 <2> TEST byte [$M_SL + $M_S_FLAG],Date_MDY_4 & $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified? 2988 <2> ; $IF Z ;;AN000;; 2989 <2> JNZ $MIF359 2990 <2> CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year 2991 <2> ; $IF A ;;AN000;; 2992 <2> JNA $MIF360 2993 <2> MOV AX,$M_MAX_2_YEAR ;;AN000;; 2994 <2> ; $ENDIF ;;AN000;; 2995 <2> $MIF360: 2996 <2> ; $ENDIF ;;AN000;; 2997 <2> $MIF359: 2998 <2> RET ;;AN000;; 2999 <2> $M_YEAR ENDP ;;AN000;; 3000 <2> ;; 3001 <2> $M_CONVERTDATE PROC NEAR ;;AN000;; 3002 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3003 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3004 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3005 <2> DEC CX ;;AN000;; Test if size only grew by 1 3006 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3007 <2> ; $IF E ;;AN000;; Yes, 3008 <2> JNE $MIF363 3009 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3010 <2> PUSH AX ;;AN000;; Save it 3011 <2> INC CX ;;AN000;; Count it 3012 <2> ; $ENDIF ;;AN000;; 3013 <2> $MIF363: 3014 <2> INC CX ;;AN000;; Restore CX 3015 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3016 <2> RET ;;AN000;; 3017 <2> $M_CONVERTDATE ENDP ;;AN000;; 3018 <2> ;; 3019 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3020 <2> %ENDIF ;;AN000;; END of include of DATE replace code 3021 <2> ; 3022 <2> %IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace? 3023 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 3024 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 3025 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3026 <2> ;; 3027 <2> ;; PROC NAME: $M_TIME_REPLACE 3028 <2> ;; 3029 <2> ;; FUNCTION: Convert a time to a decimal ASCII string 3030 <2> ;; and prepare to display 3031 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 3032 <2> ;; ES:DI points at VALUE from SUBLIST 3033 <2> ;; OUTPUTS: CX contains number of characters on stack 3034 <2> ;; Top of stack --> Last character 3035 <2> ;; . . . 3036 <2> ;; Bot of stack --> First character 3037 <2> ;; REGS USED: BP,CX,AX 3038 <2> ;; 3039 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3040 <2> ;; 3041 <2> $M_TIME_REPLACE PROC NEAR ;;AN000;; 3042 <2> ;; 3043 <2> POP BP ;;AN000;; Save return address 3044 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 3045 <2> CALL $M_GET_TIME ;;AN000;; All O.K.? 3046 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3047 <2> ; $IF NZ ;;AN000;; Yes, 3048 <2> JZ $MIF365 3049 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3050 <2> ; $IF E ;;AN000;; Yes, 3051 <2> JNE $MIF366 3052 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3053 <2> CMP AL,12 ;;AN000;; Is hour 12 or less? 3054 <2> ; $IF L,OR ;;AN000;; or 3055 <2> JL $MLL367 3056 <2> CMP AL,23 ;;AN000;; Is hour 24 or greater? 3057 <2> ; $IF G ;;AN000;; Yes, 3058 <2> JNG $MIF367 3059 <2> $MLL367: 3060 <2> MOV AL,$M_AM ;;AN000;; 3061 <2> PUSH AX ;;AN000;; Push an "a" to represent AM. 3062 <2> INC CX ;;AN000;; 3063 <2> ; $ELSE ;;AN000;; No, 3064 <2> JMP SHORT $MEN367 3065 <2> $MIF367: 3066 <2> MOV AL,$M_PM ;;AN000;; 3067 <2> PUSH AX ;;AN000;; Push an "p" to represent PM. 3068 <2> INC CX ;;AN000;; 3069 <2> ; $ENDIF ;;AN000;; 3070 <2> $MEN367: 3071 <2> ; $ENDIF ;;AN000;; 3072 <2> $MIF366: 3073 <2> ; $ENDIF ;;AN000;; 3074 <2> $MIF365: 3075 <2> ;; 3076 <2> XOR AX,AX ;;AN000;; 3077 <2> XOR DX,DX ;;AN000;; 3078 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3079 <2> ; $IF NZ ;;AN000;; 3080 <2> JZ $MIF372 3081 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Hundreds 3082 <2> CALL $M_CONVERTTIME ;;AN000;; 3083 <2> PUSH WORD [$M_RT + $M_DECI_SEPARA] ;;AN000;; 3084 <2> INC CX ;;AN000;; 3085 <2> ; $ENDIF ;;AN000;; 3086 <2> $MIF372: 3087 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3088 <2> ; $IF NZ,OR ;;AN000;; 3089 <2> JNZ $MLL374 3090 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSS_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? 3091 <2> ; $IF NZ ;;AN000;; 3092 <2> JZ $MIF374 3093 <2> $MLL374: 3094 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Seconds 3095 <2> CALL $M_CONVERTTIME ;;AN000;; 3096 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3097 <2> INC CX ;;AN000;; 3098 <2> ; $ENDIF ;;AN000;; 3099 <2> $MIF374: 3100 <2> ;; Do Hour/Min (12 Hour) 3101 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+1] ;;AN000;; Get Minutes 3102 <2> CALL $M_CONVERTTIME ;;AN000;; 3103 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3104 <2> INC CX ;;AN000;; 3105 <2> ;; 3106 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3107 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3108 <2> ; $IF NZ ;;AN000;; Yes, 3109 <2> JZ $MIF376 3110 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3111 <2> ; $IF E ;;AN000;; Yes, 3112 <2> JNE $MIF377 3113 <2> CMP AL,13 ;;AN000;; Is hour less than 12? 3114 <2> ; $IF GE ;;AN000;; Yes, 3115 <2> JNGE $MIF378 3116 <2> SUB AL,12 ;;AN000;; Set to a 12 hour value 3117 <2> ; $ENDIF ;;AN000;; 3118 <2> $MIF378: 3119 <2> CMP AL,0 ;;AN000;; Is hour less than 12? 3120 <2> ; $IF E ;;AN000;; Yes, 3121 <2> JNE $MIF380 3122 <2> MOV AL,12 ;;AN000;; Set to a 12 hour value 3123 <2> ; $ENDIF ;;AN000;; 3124 <2> $MIF380: 3125 <2> ; $ENDIF ;;AN000;; 3126 <2> $MIF377: 3127 <2> ; $ENDIF ;;AN000;; 3128 <2> $MIF376: 3129 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII 3130 <2> ;; 3131 <2> PUSH BP ;;AN000;; Restore return address 3132 <2> RET ;;AN000;; Return 3133 <2> ;; 3134 <2> $M_TIME_REPLACE ENDP ;;AN000;; 3135 <2> ;; 3136 <2> $M_GET_TIME PROC NEAR ;;AN000;; 3137 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 3138 <2> MOV AL,0 ;;AN000;; Get current country info 3139 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 3140 <2> INT 21H ;;AN000;; 3141 <2> ; $IF C ;;AN000;; No, 3142 <2> JNC $MIF384 3143 <2> MOV WORD [$M_RT + $M_TIME_FORMAT],$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH) 3144 <2> MOV BYTE [$M_RT + $M_TIME_SEPARA],$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL) 3145 <2> MOV BYTE [$M_RT + $M_DECI_SEPARA],$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL) 3146 <2> ; $ENDIF ;;AN000;; 3147 <2> $MIF384: 3148 <2> RET ;;AN000;; 3149 <2> $M_GET_TIME ENDP ;;AN000;; 3150 <2> ;; 3151 <2> $M_CONVERTTIME PROC NEAR ;;AN000;; 3152 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3153 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3154 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3155 <2> DEC CX ;;AN000;; Test if size only grew by 1 3156 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3157 <2> ; $IF E ;;AN000;; Yes, 3158 <2> JNE $MIF386 3159 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3160 <2> PUSH AX ;;AN000;; Save it 3161 <2> INC CX ;;AN000;; Count it 3162 <2> ; $ENDIF ;;AN000;; 3163 <2> $MIF386: 3164 <2> INC CX ;;AN000;; Restore CX 3165 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3166 <2> RET ;;AN000;; 3167 <2> $M_CONVERTTIME ENDP ;;AN000;; 3168 <2> ;; 3169 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3170 <2> %ENDIF ;;AN000;; END of include of TIME replace 3171 <2> %ENDIF ;;AN000;; END of include of Replacement common code 3172 <2> ; 3173 <2> %IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace? 3174 <2> INPUTmsg equ FALSE ;;AN000;; Yes, THEN include it and reset the flag 3175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3176 <2> ;; 3177 <2> ;; PROC NAME: $M_WAIT_FOR_INPUT 3178 <2> ;; 3179 <2> ;; FUNCTION: To accept keyed input and return extended key value 3180 <2> ;; in AX register 3181 <2> ;; INPUTS: DL contains the DOS function requested for input 3182 <2> ;; OUPUTS: AX contains the extended key value that was read 3183 <2> ;; REGS USED: 3184 <2> ;; 3185 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3186 <2> ;; 3187 <2> $M_WAIT_FOR_INPUT PROC NEAR ;;AN000;; 3188 <2> ;; 3189 <2> PUSH CX ;;AN000;; Save CX 3190 <2> PUSH DX ;;AN000;; Save DX 3191 <2> PUSH DS ;;AN000;; Save Data segment 3192 <2> ;; 3193 <2> CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? 3194 <2> ; $IF A ;;AN001;; Yes, 3195 <2> JNA $MIF388 3196 <2> MOV AL,DL ;;AN001;; Mov function into AL 3197 <2> AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble 3198 <2> MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function 3199 <2> ; $ELSE ;;AN001;; No, 3200 <2> JMP SHORT $MEN388 3201 <2> $MIF388: 3202 <2> MOV AH,DL ;;AN000;; Put DOS function in AH 3203 <2> ; $ENDIF ;;AN001;; 3204 <2> $MEN388: 3205 <2> PUSH ES ;;AN000;; Get output buffer segment 3206 <2> POP DS ;;AN000;; 3207 <2> MOV DX,DI ;;AN000;; Get output buffer offset in case needed 3208 <2> INT 21H ;;AN000;; Get keyboard input 3209 <2> POP DS ;;AN000;; 3210 <2> 3211 <2> CMP DL,DOS_BUF_KEYB_INP ;;AN000;; 3212 <2> CLC ;;AN000;; 3213 <2> ; $IF NE ;;AN000;; If character input 3214 <2> JE $MIF391 3215 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? 3216 <2> ; $IF C ;;AN000;; 3217 <2> JNC $MIF392 3218 <2> MOV CL,AL ;;AN000;; Save first character 3219 <2> MOV AH,DL ;;AN001;; Get back function 3220 <2> INT 21H ;;AN000;; Get keyboard input 3221 <2> MOV AH,CL ;;AN000;; Retreive first character AX = xxxx 3222 <2> CLC ;;AN000;; Clear carry condition 3223 <2> ; $ELSE ;;AN000;; 3224 <2> JMP SHORT $MEN392 3225 <2> $MIF392: 3226 <2> MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS 3227 <2> ; $ENDIF ;;AN000;; 3228 <2> $MEN392: 3229 <2> ; $ENDIF ;;AN000;; 3230 <2> $MIF391: 3231 <2> ;; 3232 <2> ; $IF NC ;;AN000;; 3233 <2> JC $MIF396 3234 <2> POP DX ;;AN000;; 3235 <2> POP CX ;;AN000;; 3236 <2> ; $ELSE ;;AN000;; 3237 <2> JMP SHORT $MEN396 3238 <2> $MIF396: 3239 <2> ADD SP,4 ;;AN000;; 3240 <2> STC ;;AN000;; Reset carry flag 3241 <2> ; $ENDIF ;;AN000;; 3242 <2> $MEN396: 3243 <2> RET ;;AN000;; Return 3244 <2> ;; 3245 <2> $M_WAIT_FOR_INPUT ENDP ;;AN000;; 3246 <2> ;; 3247 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3248 <2> %ENDIF ;;AN000;; END of include of Wait for Input 3249 <2> %ENDIF ;;AN000;; END of include of SYSDISPMSG 3250 <2> %ENDIF ;;AN000;; END of include of MSG_DATA_ONLY 3251 <2> %ENDIF ;;AN000;; END of include of Structure only 3252 <2> 3253 <2> ;=== Pop trace listing source 3254 <2> 331 <1> 7 8 9 section data 10 Msg_Services "MSGDATA" 364 <1> %iassign $M_SERVICE FALSE 365 <1> %rep %0 366 <1> %iassign $M_INCLUDE TRUE 367 <1> %iassign MSG_SERVICES_MATCHED 0 368 <1> %ifidni %1, "MSGDATA" 369 <1> %iassign MSGDATA TRUE 370 <1> %iassign $M_SERVICE TRUE 371 <1> %iassign $M_INCLUDE FALSE 372 <1> %iassign MSG_SERVICES_MATCHED 1 373 <1> %else 374 <1> %iassign $M_MSGDATA_ONLY FALSE 375 <1> %endif 376 <1> 377 <1> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <1> 379 <1> %ifidni %1,"COMR" 380 <1> %iassign COMR TRUE 381 <1> %iassign $M_SERVICE TRUE 382 <1> %iassign $M_INCLUDE FALSE 383 <1> %iassign MSG_SERVICES_MATCHED 1 384 <1> %elifidni %1,"COMT" 385 <1> %iassign COMT TRUE 386 <1> %iassign $M_SERVICE TRUE 387 <1> %iassign $M_INCLUDE FALSE 388 <1> %iassign MSG_SERVICES_MATCHED 1 389 <1> %elifidni %1,"SETSTDIO" 390 <1> %iassign SETSTDIO TRUE 391 <1> %iassign $M_SERVICE TRUE 392 <1> %iassign $M_INCLUDE FALSE 393 <1> %iassign MSG_SERVICES_MATCHED 1 394 <1> %elifidni %1,"NOCHECKSTDIN" 395 <1> %iassign NOCHECKSTDIN TRUE 396 <1> %iassign $M_SERVICE TRUE 397 <1> %iassign $M_INCLUDE FALSE 398 <1> %iassign MSG_SERVICES_MATCHED 1 399 <1> %elifidni %1,"NOCHECKSTDOUT" 400 <1> %iassign NOCHECKSTDOUT TRUE 401 <1> %iassign $M_SERVICE TRUE 402 <1> %iassign $M_INCLUDE FALSE 403 <1> %iassign MSG_SERVICES_MATCHED 1 404 <1> %elifidni %1,"DISK_PROC" 405 <1> %iassign DISK_PROC TRUE 406 <1> %iassign $M_SERVICE TRUE 407 <1> %iassign $M_INCLUDE FALSE 408 <1> %iassign MSG_SERVICES_MATCHED 1 409 <1> %endif 410 <1> 411 <1> %IF $M_INCLUDE 412 <1> %define %%string %1 413 <1> %strlen %%length %%string 414 <1> %assign %%ii 1 415 <1> %define %%name "" 416 <1> %rep %%length 417 <1> %substr %%cc %%string %%ii 418 <1> %assign %%ii %%ii + 1 419 <1> %if %%cc >= 'A' && %%cc <= 'Z' 420 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <1> %endif 422 <1> %strcat %%name %%name,%%cc 423 <1> %endrep 424 <1> %ifidni %%name, "format.ctl" 425 <1> 426 <1> %else 427 <1> %include %%name 428 <1> %endif 429 <1> %ENDIF 430 <1> 431 <1> %rotate 1 432 <1> %endrep 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 433 <1> 434 <1> %IF $M_SERVICE 435 <1> 436 <1> %include "msgserv.nas" 1 <2> ;=== Push trace listing source: msgserv.nas 2 <2> 3 <2> ; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * * 4 <2> ; 5 <2> ; MODULE NAME: MSGSERV.SAL 6 <2> ; 7 <2> ; DESCRIPTIVE NAME: Message Services SALUT file 8 <2> ; 9 <2> ; FUNCTION: This module incorporates all the messages services and 10 <2> ; is called upon at build time to INCLUDE the code requested 11 <2> ; by a utility. Code is requested using the macro MSG_SERVICES. 12 <2> ; 13 <2> ; ENTRY POINT: Since this a collection of subroutines, entry point is at 14 <2> ; requested procedure. 15 <2> ; 16 <2> ; INPUT: Since this a collection of subroutines, input is dependent on function 17 <2> ; requested. 18 <2> ; 19 <2> ; EXIT-NORMAL: In all cases, CARRY FLAG = 0 20 <2> ; 21 <2> ; EXIT-ERROR: In all cases, CARRY FLAG = 1 22 <2> ; 23 <2> ; INTERNAL REFERENCES: (list of included subroutines) 24 <2> ; 25 <2> ; - SYSLOADMSG 26 <2> ; - SYSDISPMSG 27 <2> ; - SYSGETMSG 28 <2> ; 29 <2> ; 30 <2> ; EXTERNAL REFERENCES: None 31 <2> ; 32 <2> ; NOTES: At build time, some modules must be included. These are only included 33 <2> ; once using assembler switches. Other logic is included at the request 34 <2> ; of the utility. 35 <2> ; 36 <2> ; COMR and COMT are assembler switches to conditionally assemble code 37 <2> ; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident 38 <2> ; storage and multiple EQUates. 39 <2> ; 40 <2> ; REVISION HISTORY: Created MAY 1987 41 <2> ; 42 <2> ; Label: DOS - - Message Retriever 43 <2> ; (c) Copyright 1988 Microsoft 44 <2> ; 45 <2> ; 46 <2> ; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * * 47 <2> ; Page 48 <2> 49 <2> ; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting 50 <2> 51 <2> %IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN 52 <2> %iassign $M_STRUC FALSE ;;AN000;; Let the assembler know that we have 53 <2> ;;AN000;; and include them 54 <2> 55 <2> ; PAGE 56 <2> ; SUBTTL DOS - Message Retriever - MSGSTR.INC Module 57 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 58 <2> ;; 59 <2> ;; STRUCTURE: $M_SUBLIST_STRUC 60 <2> ;; 61 <2> ;; Replacable parameters are described by a sublist structure 62 <2> ;; 63 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 64 <2> ;; 65 <2> $M_SUBLIST_STRUC STRUC ;;AN000;; 66 <2> ;; 67 <2> $M_S_SIZE DB ? ;11 ;;AN000;; SUBLIST size (PTR to next SUBLIST) 68 <2> $M_S_RESV DB ? ;0 ;;AN000;; RESERVED 69 <2> $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item 70 <2> $M_S_ID DB ? ;;AN000;; n of %n 71 <2> $M_S_FLAG DB ? ;;AN000;; Data-type flags 72 <2> $M_S_MAXW DB ? ;;AN000;; Maximum field width 73 <2> $M_S_MINW DB ? ;;AN000;; Minimum field width 74 <2> $M_S_PAD DB ? ;;AN000;; Character for Pad field 75 <2> ;; 76 <2> $M_SUBLIST_STRUC ENDS ;;AN000;; 77 <2> ;; 78 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 79 <2> ;; 80 <2> ;; STRUCTURE: $M_CLASS_ID 81 <2> ;; 82 <2> ;; Each class will be defined by this structure. 83 <2> ;; 84 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 85 <2> ;; 86 <2> EXPECTED_VERSION equ expected_version ; NASM port equate 87 <2> 88 <2> $M_CLASS_ID STRUC ;;AN000;; 89 <2> ;; 90 <2> $M_CLS_ID DB ? ;-1 ;;AN000;; Class identifer 91 <2> $M_COMMAND_VER DW ? ;EXPECTED_VERSION ;;AN003;; COMMAND.COM version check 92 <2> $M_NUM_CLS_MSG DB ? ;0 ;;AN000;; Total number of message in class 93 <2> ;; 94 <2> $M_CLASS_ID ENDS ;; 95 <2> ;;AN000;; 96 <2> $M_CLASS_ID_SZ EQU $M_CLASS_ID_struc_size ;;AN000;; 97 <2> ;; 98 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 99 <2> ;; 100 <2> ;; STRUCTURE: $M_ID_STRUC 101 <2> ;; 102 <2> ;; Each message will be defined by this structure. 103 <2> ;; 104 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 105 <2> ;; 106 <2> $M_ID STRUC ;;AN000;; 107 <2> ;; 108 <2> $M_NUM DW ? ;-1 ;;AN000;; Message Number 109 <2> $M_TXT_PTR DW ? ;;AN000;; Pointer to message text 110 <2> ;; 111 <2> $M_ID ENDS ;;AN000;; 112 <2> ;;AN000;; Status Flag Values: 113 <2> $M_ID_SZ EQU $M_ID_struc_size ;;AN000;; 114 <2> ;; 115 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 116 <2> ;; 117 <2> ;; STRUCTURE: $M_RES_ADDRS 118 <2> ;; 119 <2> ;; Resident data area definition of variables 120 <2> ;; 121 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 122 <2> ;; 123 <2> $M_RES_ADDRS STRUC ;;AN000;; 124 <2> ;; 125 <2> $M_EXT_ERR_ADDRS DD ? ;0 ;;AN000;; Allow pointers to THREE Extended error locations 126 <2> $M_EXT_FILE DD ? ;0 ;;AN001;; 127 <2> $M_EXT_COMMAND DD ? ;0 ;;AN000;; 128 <2> $M_EXT_TERM DD ? ;-1 ;;AN000;; 129 <2> $M_PARSE_COMMAND DD ? ;0 ;;AN000;; 130 <2> $M_PARSE_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Parse error locations 131 <2> $M_PARSE_TERM DD ? ;-1 ;;AN000;; 132 <2> $M_CRIT_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Critical error locations 133 <2> $M_CRIT_COMMAND DD ? ;0 ;;AN000;; 134 <2> $M_CRIT_TERM DD ? ;-1 ;;AN000;; 135 <2> $M_DISK_PROC_ADDR DD ? ;-1 ;;AN004;; Address of READ_DISK_PROC 136 <2> $M_CLASS_ADDRS DD $M_NUM_CLS DUP (?) ;(0) ;;AN000;; Allow pointers to specified classes 137 <2> $M_CLS_TERM DD ? ;-1 ;;AN000;; 138 <2> $M_DBCS_VEC DD ? ;0 ;;AN000;; Save DBCS vector 139 <2> $M_HANDLE DW ? ;;AN000;; 140 <2> $M_SIZE DB ? ;0 ;;AN000;; 141 <2> $M_CRLF DB ?,? ;0DH,0AH ;;AN004;; CR LF message 142 <2> $M_CLASS DB ? ;;AN004;; Saved class 143 <2> $M_RETURN_ADDR DW ? ;;AN000;; 144 <2> $M_MSG_NUM DW ? ;$M_NULL ;;AN000;; 145 <2> $M_DIVISOR DW ? ;10 ;;AN000;; Default = 10 (must be a WORD for division) 146 <2> $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP (?) ;("$") ;;AN000;; Temporary buffer 147 <2> $M_BUF_TERM DB ? ;"$" ;;AN000;; 148 <2> 149 <2> $M_RES_ADDRS ENDS ;;AN000;; 150 <2> ;; 151 <2> $M_RES_ADDRS_SZ EQU $M_RES_ADDRS_struc_size ;;AN000;; 152 <2> ;; 153 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 154 <2> ;; 155 <2> ;; STRUCTURE: $M_COUNTRY_INFO 156 <2> ;; 157 <2> ;; Important fields of the Get Country Information call 158 <2> ;; 159 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 160 <2> ;; 161 <2> $M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation 162 <2> ;; 163 <2> $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc 164 <2> $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format 165 <2> $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;; 166 <2> $M_THOU_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Thou Separator 167 <2> $M_DECI_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Decimal Separator 168 <2> $M_DATE_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Date Separator 169 <2> $M_TIME_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Time Separator 170 <2> $M_CURR_FORMAT DB ? ;;AN000;; 171 <2> $M_SIG_DIGS_CU DB ? ;;AN000;; 172 <2> $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format 173 <2> ;; 174 <2> $M_COUNTRY_INFO ENDS ;;AN000;; 175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 176 <2> ;; 177 <2> %ELSE ;;AN000;; ELSE if we have already included the STRUCTURES 178 <2> ; 179 <2> ; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section 180 <2> 181 <2> %IF MSGDATA ;;AN000;; IF this is a request to include the data area 182 <2> %iassign MSGDATA FALSE ;;AN000;; Let the assembler know not to include it again 183 <2> ;;AN000;; and include it 184 <2> ; PAGE 185 <2> ; SUBTTL DOS - Message Retriever - MSGRES.TAB Module 186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 187 <2> ;; 188 <2> ;; DATA NAME: $M_RES_TABLE 189 <2> ;; 190 <2> ;; REFERENCE LABEL: $M_RT 191 <2> ;; 192 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 193 <2> 194 <2> %if 0 ; disabled for now, figure out later 195 <2> %IF COMR ;;AN000;; Since COMMAND.COM includes this twice 196 <2> $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no 197 <2> $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur 198 <2> $M_ALTLABEL equ TRUE ;;AN000;; Flag that label was changed 199 <2> %ELSE ;;AN000;; 200 <2> $M_RT LABEL BYTE ;;AN000;; 201 <2> %ENDIF 202 <2> %endif 203 <2> $M_RT: ; NASM structure instance 204 <2> $M_RES_ADDRS_size equ $M_RES_ADDRS_struc_size ; NASM port equate 205 <2> istruc $M_RES_ADDRS 206 <2> at $M_EXT_ERR_ADDRS 207 00000000 00000000 <2> dd 0 208 <2> at $M_EXT_FILE 209 00000004 00000000 <2> dd 0 210 <2> at $M_EXT_COMMAND 211 00000008 00000000 <2> dd 0 212 <2> at $M_EXT_TERM 213 0000000C FFFFFFFF <2> dd -1 214 <2> at $M_PARSE_COMMAND 215 00000010 00000000 <2> dd 0 216 <2> at $M_PARSE_ADDRS 217 00000014 00000000 <2> dd 0 218 <2> at $M_PARSE_TERM 219 00000018 FFFFFFFF <2> dd -1 220 <2> at $M_CRIT_ADDRS 221 0000001C 00000000 <2> dd 0 222 <2> at $M_CRIT_COMMAND 223 00000020 00000000 <2> dd 0 224 <2> at $M_CRIT_TERM 225 00000024 FFFFFFFF <2> dd -1 226 <2> at $M_DISK_PROC_ADDR 227 00000028 FFFFFFFF <2> dd -1 228 <2> at $M_CLASS_ADDRS 229 0000002C 00000000 <2> times $M_NUM_CLS dd 0 230 <2> at $M_CLS_TERM 231 00000038 FFFFFFFF <2> dd -1 232 <2> at $M_DBCS_VEC 233 0000003C 00000000 <2> dd 0 234 <2> at $M_HANDLE 235 00000040 0000 <2> dw 0 236 <2> at $M_SIZE 237 00000042 00 <2> db 0 238 <2> at $M_CRLF 239 00000043 0D0A <2> db 0Dh, 0Ah 240 <2> at $M_CLASS 241 00000045 00 <2> db 0 242 <2> at $M_RETURN_ADDR 243 00000046 0000 <2> dw 0 244 <2> at $M_MSG_NUM 245 00000048 0000 <2> dw 0 246 <2> at $M_DIVISOR 247 0000004A 0A00 <2> dw 10 248 <2> at $M_TEMP_BUF 249 0000004C 24 <2> times $M_TEMP_BUF_SZ db "$" 250 <2> at $M_BUF_TERM 251 0000008C 24 <2> db "$" 252 <2> iend 253 <2> ;; 254 <2> %include "copyrigh.mac" ;;AN001;; Include Copyright 1988 Microsoft 1 0000008D 4D5320444F53205665- <3> DB "MS DOS Version 4.00 (C)Copyright 1988 Microsoft Corp" 1 00000096 7273696F6E20342E30- <3> 1 0000009F 3020284329436F7079- <3> 1 000000A8 726967687420313938- <3> 1 000000B1 38204D6963726F736F- <3> 1 000000BA 667420436F7270 <3> 2 000000C1 4C6963656E73656420- <3> DB "Licensed Material - Property of Microsoft " 2 000000CA 4D6174657269616C20- <3> 2 000000D3 2D2050726F70657274- <3> 2 000000DC 79206F66204D696372- <3> 2 000000E5 6F736F66742020 <3> 255 <2> ;; 256 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 257 <2> %ENDIF ;;AN000;; END of include of Data table 258 <2> 259 <2> ; 260 <2> %IFN $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN 261 <2> ;; don't include any more code 262 <2> ;;AN000;; Figure out what other code to include 263 <2> %IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code 264 <2> %IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it) 265 <2> $M_RT EQU $M_RT2 ;;AN003;; 266 <2> %ENDIF 267 <2> %iassign DISK_PROC FALSE ;;AN003;; Yes, THEN include it and reset flag 268 <2> ; PAGE 269 <2> ; SUBTTL DOS - Message Retriever - DISK_PROC Module 270 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 271 <2> ;; 272 <2> ;; PROC NAME: DISK_PROC 273 <2> ;; 274 <2> ;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended 275 <2> ;; errors from disk\diskette 276 <2> ;; INPUTS: AX has the message number 277 <2> ;; DX has the message class 278 <2> ;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is 279 <2> ;; assumed to be set!! 280 <2> ;; 281 <2> ;; OUTPUTS: ES:DI points to message length (BYTE) followed by text 282 <2> ;; 283 <2> ;; 284 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 285 <2> ;; 286 <2> PUBLIC READ_DISK_PROC ;; 287 <2> ;; 288 <2> READ_DISK_PROC PROC FAR ;;AN003;; 289 <2> 290 <2> PUSH AX ;;AN003;; Save everything 291 <2> PUSH BX ;;AN003;; 292 <2> PUSH DX ;;AN003;; 293 <2> PUSH SI ;;AN003;; 294 <2> PUSH BP ;;AN003;; 295 <2> PUSH DS ;;AN003;; 296 <2> PUSH DI ;;AN003;; 297 <2> MOV BP,AX ;;AN003;; Save message number 298 <2> MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function 299 <2> LEA SI,[COMSPEC wrt RESGROUP] ;;AN003;; Get addressibilty to COMMAND.COM 300 <2> PUSH CS ;;AN003;; 301 <2> POP DS ;;AN003;; 302 <2> MOV DI,-1 ;;AN003;; No extended attribute list 303 <2> MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error 304 <2> MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag 305 <2> INT 21H ;;AN003;; Open the file 306 <2> POP DI ;;AN003;; Retreive LSEEK pointer 307 <2> ;;AN003;; Error ? 308 <2> ; $IF NC,LONG ;;AN003;; No, 309 <2> JNC $MXL1 310 <2> JMP $MIF1 311 <2> $MXL1: 312 <2> PUSH DI ;;AN003;; Save LSEEK pointer 313 <2> MOV BX,AX ;;AN003;; Set handle in BX 314 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors 315 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 316 <2> MOV DX,DI ;;AN003;; 317 <2> INT 21H ;;AN003;; LSEEK the file 318 <2> POP DX ;;AN003;; Retreive LSEEK pointer 319 <2> ;;AN003;; Error ? 320 <2> ; $IF NC ;;AN003;; No, 321 <2> JC $MIF2 322 <2> INC CX ;;AN003;; Set flag to first pass 323 <2> ; $DO ;;AN003;; 324 <2> $MDO3: 325 <2> PUSH DX ;;AN003;; Save LSEEK pointer 326 <2> PUSH CX ;;AN003;; Save first pass flag 327 <2> PUSH AX ;;AN003;; Save number of messages (if set yet) 328 <2> XOR SI,SI ;;AN003;; Reset buffer index 329 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 330 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header 331 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 332 <2> INT 21H ;;AN003;; Read it 333 <2> MOV DI,DX ;;AN003;; 334 <2> POP AX ;;AN003;; 335 <2> POP CX ;;AN003;; 336 <2> OR CX,CX ;;AN003;; 337 <2> ; $IF NZ ;;AN003;; 338 <2> JZ $MIF4 339 <2> XOR CX,CX ;;AN003;; Set flag to second pass 340 <2> XOR AH,AH ;;AN003;; Get number of messages in class 341 <2> MOV AL,[DI + $M_NUM_CLS_MSG] ;;AN003;; 342 <2> MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index 343 <2> CMP word [DI + $M_COMMAND_VER],EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM? 344 <2> ; $ENDIF ;;AN003;; 345 <2> $MIF4: 346 <2> POP DX ;;AN003;; 347 <2> ; $IF Z ;;AN003;; Yes, 348 <2> JNZ $MIF6 349 <2> ; $SEARCH ;;AN003;; 350 <2> $MDO7: 351 <2> CMP BP,WORD PTR [$M_RT + $M_TEMP_BUF + SI] ;;AN003;; Is this the message I'm looking for? 352 <2> ; $EXITIF Z ;;AN003;; Yes, (ZF=1) 353 <2> JNZ $MIF7 354 <2> CLC ;;AN003;; Reset carry, exit search 355 <2> ; $ORELSE ;;AN003;; No, (ZF=0) 356 <2> JMP SHORT $MSR7 357 <2> $MIF7: 358 <2> ADD SI,$M_ID_SZ ;;AN003;; Increment index 359 <2> ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header 360 <2> DEC AX ;;AN003;; Decrement # of messages left 361 <2> ; $LEAVE Z ;;AN003;; Have we exhausted all messages? 362 <2> JZ $MEN7 363 <2> CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer? 364 <2> ; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1) 365 <2> JNA $MDO7 366 <2> $MEN7: 367 <2> STC ;;AN003;; Yes, (ZF=0) set error (ZF=0) 368 <2> ; $ENDSRCH ;;AN003;; 369 <2> $MSR7: 370 <2> ; $ELSE ;;AN003;; No, 371 <2> JMP SHORT $MEN6 372 <2> $MIF6: 373 <2> XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop 374 <2> STC ;;AN003;; Set Carry 375 <2> ; $ENDIF ;;AN003;; 376 <2> $MEN6: 377 <2> ; $ENDDO Z ;;AN003;; Get next buffer full if needed 378 <2> JNZ $MDO3 379 <2> ;;AN003;; Error ? 380 <2> ; $IF NC ;;AN003;; No, 381 <2> JC $MIF16 382 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message 383 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 384 <2> ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header 385 <2> ADD DX,WORD PTR [$M_RT + $M_TEMP_BUF + SI + 2] ;;AN003;; Add offset from msg structure 386 <2> INT 21H ;;AN003;; LSEEK the file 387 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 388 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message 389 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 390 <2> INT 21H ;;AN003;; Read it 391 <2> MOV DI,DX ;;AN003;; into the temp buffer 392 <2> PUSH DS ;;AN003;; into the temp buffer 393 <2> POP ES ;;AN003;; into the temp buffer 394 <2> ; $ENDIF ;;AN003;; 395 <2> $MIF16: 396 <2> ; $ENDIF ;;AN003;; 397 <2> $MIF2: 398 <2> PUSHF ;;AN003;; Close file handle 399 <2> MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle 400 <2> INT 21H ;;AN003;; 401 <2> $M_POPF ;;AN003;; 402 <2> ; $ENDIF ;;AN003;; Yes there was an error, 403 <2> $MIF1: 404 <2> POP DS ;;AN003;; 405 <2> POP BP ;;AN003;; 406 <2> POP SI ;;AN003;; 407 <2> POP DX ;;AN003;; 408 <2> POP BX ;;AN003;; 409 <2> POP AX ;;AN003;; 410 <2> ;;AN003;; abort everything 411 <2> RET ;;AN003;; 412 <2> 413 <2> READ_DISK_PROC ENDP ;;AN003;; 414 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 415 <2> %ENDIF ;;AN003;; END of include for DISK_PROC 416 <2> ; 417 <2> 418 <2> %IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO 419 <2> %iassign SETSTDIO FALSE ;;AN000;; Yes, THEN include it and reset flag 420 <2> ; PAGE 421 <2> ; SUBTTL DOS - Message Retriever - SETSTDIO Module 422 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 423 <2> ;; 424 <2> ;; PROC NAME: SETSTDIO 425 <2> ;; 426 <2> ;; FUNCTION: 427 <2> ;; INPUTS: 428 <2> ;; 429 <2> ;; OUPUTS: 430 <2> ;; 431 <2> ;; 432 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 433 <2> ;; 434 <2> %IF FARmsg ;AN001; 435 <2> SETSTDINON PROC FAR ;AN001; 436 <2> %ELSE ;AN001; 437 <2> SETSTDINON PROC NEAR ;AN001; 438 <2> %ENDIF ;AN001; 439 <2> PUSH AX ;AN002; Save changed regs 440 <2> PUSH BX ;AN002; 441 <2> PUSH DX ;AN002; 442 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 443 <2> MOV BX,STDIN ;AN001; 444 <2> XOR DX,DX ;AN001; 445 <2> INT 21H ;AN001; 446 <2> 447 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 448 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 449 <2> INT 21H ;AN001; 450 <2> POP DX ;AN002; Restore Regs 451 <2> POP BX ;AN002; 452 <2> POP AX ;AN002; 453 <2> 454 <2> RET ;AN001; 455 <2> ;AN001; 456 <2> SETSTDINON ENDP ;AN001; 457 <2> 458 <2> %IF FARmsg ;AN001; 459 <2> SETSTDINOFF PROC FAR ;AN001; 460 <2> %ELSE ;AN001; 461 <2> SETSTDINOFF PROC NEAR ;AN001; 462 <2> %ENDIF ;AN001; 463 <2> 464 <2> PUSH AX ;AN002; Save changed regs 465 <2> PUSH BX ;AN002; 466 <2> PUSH DX ;AN002; 467 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 468 <2> MOV BX,STDIN ;AN001; 469 <2> XOR DX,DX ;AN001; 470 <2> INT 21H ;AN001; 471 <2> 472 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 473 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 474 <2> INT 21H ;AN001; 475 <2> POP DX ;AN002; Restore Regs 476 <2> POP BX ;AN002; 477 <2> POP AX ;AN002; 478 <2> 479 <2> RET ;AN001; 480 <2> 481 <2> SETSTDINOFF ENDP ;AN001; 482 <2> 483 <2> %IF FARmsg ;AN001; 484 <2> SETSTDOUTON PROC FAR ;AN001; 485 <2> %ELSE ;AN001; 486 <2> SETSTDOUTON PROC NEAR ;AN001; 487 <2> %ENDIF ;AN001; 488 <2> 489 <2> PUSH AX ;AN002; Save changed regs 490 <2> PUSH BX ;AN002; 491 <2> PUSH DX ;AN002; 492 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 493 <2> MOV BX,STDOUT ;AN001; 494 <2> XOR DX,DX ;AN001; 495 <2> INT 21H ;AN001; 496 <2> 497 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 498 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 499 <2> INT 21H ;AN001; 500 <2> POP DX ;AN002; Restore Regs 501 <2> POP BX ;AN002; 502 <2> POP AX ;AN002; 503 <2> 504 <2> RET ;AN001; 505 <2> 506 <2> SETSTDOUTON ENDP ;AN001; 507 <2> 508 <2> %IF FARmsg ;AN001; 509 <2> SETSTDOUTOFF PROC FAR ;AN001; 510 <2> %ELSE ;AN001; 511 <2> SETSTDOUTOFF PROC NEAR 512 <2> %ENDIF ;AN001; 513 <2> 514 <2> PUSH AX ;AN002; Save changed regs 515 <2> PUSH BX ;AN002; 516 <2> PUSH DX ;AN002; 517 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 518 <2> MOV BX,STDOUT ;AN001; 519 <2> XOR DX,DX ;AN001; 520 <2> INT 21H ;AN001; 521 <2> 522 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 523 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 524 <2> INT 21H ;AN001; 525 <2> POP DX ;AN002; Restore Regs 526 <2> POP BX ;AN002; 527 <2> POP AX ;AN002; 528 <2> 529 <2> RET ;AN001; 530 <2> 531 <2> SETSTDOUTOFF ENDP ;AN001; 532 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 533 <2> %ENDIF ;;AN000;; END of include for SETSTDIO 534 <2> ; 535 <2> %IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ? 536 <2> %IF COMR ;;AN000;; 537 <2> $M_RT EQU $M_RT2 ;;AN000;; 538 <2> %ENDIF 539 <2> %iassign LOADmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 540 <2> ; PAGE 541 <2> ; SUBTTL DOS - Message Retriever - LOADMSG.ASM Module 542 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 543 <2> ;; 544 <2> ;; PROC NAME: SYSLOADMSG 545 <2> ;; 546 <2> ;; FUNCTION: 547 <2> ;; INPUTS: 548 <2> ;; 549 <2> ;; OUPUTS: 550 <2> ;; 551 <2> ;; 552 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 553 <2> ;; 554 <2> %IF FARmsg ;;AN000;; 555 <2> SYSLOADMSG PROC FAR ;;AN000;; 556 <2> %ELSE ;;AN000;; 557 <2> SYSLOADMSG PROC NEAR ;;AN000;; 558 <2> %ENDIF ;;AN000;; 559 <2> PUSH AX ;;AN000; 560 <2> PUSH BX ;;AN000; 561 <2> PUSH DX ;;AN000; 562 <2> PUSH ES ;;AN000; 563 <2> PUSH DI ;;AN000; 564 <2> XOR CX,CX ;;AN000; Reset to zero 565 <2> MOV ES,CX ;;AN000; 566 <2> XOR DI,DI ;;AN000; 567 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 568 <2> MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM 569 <2> INT 2FH ;;AN000;; Private interface 570 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 571 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND],DI ;;AN000;; 572 <2> ;; 573 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 574 <2> MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM 575 <2> INT 2FH ;;AN000;; Private interface 576 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 577 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND],DI ;;AN000;; 578 <2> ;; 579 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 580 <2> MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM 581 <2> INT 2FH ;;AN000;; Private interface 582 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 583 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND],DI ;;AN000;; 584 <2> 585 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 586 <2> MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE 587 <2> INT 2FH ;;AN001;; Private interface 588 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE+2],ES ;;AN001;; Move into first avaliable table location 589 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE],DI ;;AN001;; 590 <2> 591 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 592 <2> Extrn READ_DISK_PROC:Far ;;AN003;; 593 <2> %ELSE ;; 594 <2> %IF FARmsg ;;AN000;; 595 <2> CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 596 <2> %ELSE ;;AN000;; 597 <2> CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 598 <2> %ENDIF ;;AN000;; 599 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 600 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS],DI ;;AN000;; 601 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 602 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS],DI ;;AN000;; 603 <2> ;; 604 <2> %IF FARmsg ;;AN000;; 605 <2> CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 606 <2> %ELSE ;;AN000;; 607 <2> CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 608 <2> %ENDIF ;;AN000;; 609 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 610 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS],DI ;;AN000;; 611 <2> %ENDIF ;; 612 <2> ;; 613 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 614 <2> MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM 615 <2> INT 2FH ;;AN001;; Private interface 616 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR+2],ES ;;AN001;; Move into first avaliable table location 617 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR],DI ;;AN001;; 618 <2> 619 <2> $M_BUILD_PTRS $M_NUM_CLS ;;AN000;; Build all utility classes 620 <2> ;;AN000;; 621 <2> CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector 622 <2> 623 <2> %IFN NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed 624 <2> CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK 625 <2> %ENDIF ;;AN000;; 626 <2> ;;AN000;; 627 <2> %IFN NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed 628 <2> CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK 629 <2> %ENDIF ;;AN000;; 630 <2> ;;AN000;; 631 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 632 <2> CLC ;;AN000;; Make sure carry is clear 633 <2> %ELSE ;;AN000;; ELSE 634 <2> PUSH CX ;;AN000;; 635 <2> CALL $M_VERSION_CHECK ;;AN000;; Check Version 636 <2> %ENDIF ;;AN000;; 637 <2> ;; Error ? 638 <2> ; $IF NC ;;AN000;; No. 639 <2> JC $MIF20 640 <2> %IFN NOVERCHECKmsg ;;AN000;; IF version check was not supressed 641 <2> POP CX ;;AN000;; Reset stack 642 <2> %ENDIF ;;AN000;; 643 <2> POP DI ;;AN000;; Restore REGS 644 <2> POP ES ;;AN000;; 645 <2> POP DX ;;AN000;; 646 <2> POP BX ;;AN000;; 647 <2> POP AX ;;AN000;; 648 <2> ; $ELSE ;;AN000;; Yes, 649 <2> JMP SHORT $MEN20 650 <2> $MIF20: 651 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 652 <2> ADD SP,10 ;;AN000;; 653 <2> STC ;;AN000;; Reset carry flag 654 <2> %ELSE ;;AN000;; IF version check is to be supressed 655 <2> ADD SP,12 ;;AN000;; 656 <2> STC ;;AN000;; Reset carry flag 657 <2> %ENDIF ;;AN000;; IF version check is to be supressed 658 <2> ; $ENDIF ;;AN000;; 659 <2> $MEN20: 660 <2> RET ;;AN000;; 661 <2> ;; 662 <2> SYSLOADMSG ENDP ;;AN000;; 663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 664 <2> ; PAGE 665 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 666 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 667 <2> ;; 668 <2> ;; Proc Name: $M_GET_DBCS_VEC 669 <2> ;; 670 <2> ;; Function: Get the DBCS vector and save it for later use 671 <2> ;; 672 <2> ;; Inputs: None 673 <2> ;; 674 <2> ;; Outputs: None 675 <2> ;; 676 <2> ;; Regs Changed: 677 <2> ;; 678 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 679 <2> ;; 680 <2> $M_GET_DBCS_VEC PROC NEAR ;;AN000;; 681 <2> ;; 682 <2> PUSH AX ;;AN000;; Save character to check 683 <2> PUSH SI ;;AN000;; 684 <2> PUSH DS ;;AN000;; 685 <2> MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment 686 <2> INT 21H ;;AN000;; Get environment pointer 687 <2> PUSH DS ;;AN000;; Get environment pointer 688 <2> POP ES ;;AN000;; Get environment pointer 689 <2> POP DS ;;AN000;; Get environment pointer 690 <2> ; $IF NC ;;AN000;; 691 <2> JC $MIF23 692 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC],SI ;;AN000;; Save DBCS Vector 693 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC+2],ES ;;AN000;; 694 <2> ; $ENDIF ;;AN000;; 695 <2> $MIF23: 696 <2> POP SI ;;AN000;; 697 <2> POP AX ;;AN000;; Retrieve character to check 698 <2> RET ;;AN000;; Return 699 <2> ;; 700 <2> $M_GET_DBCS_VEC ENDP ;; 701 <2> ;; 702 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 703 <2> %IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ? 704 <2> %ELSE ;AN001; Yes, THEN include it 705 <2> ; PAGE 706 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc 707 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 708 <2> ;; 709 <2> ;; Proc Name: $M_CHECKSTDIN 710 <2> ;; 711 <2> ;; Function: 712 <2> ;; 713 <2> ;; Inputs: None 714 <2> ;; 715 <2> ;; Outputs: 716 <2> ;; 717 <2> ;; Regs Changed: 718 <2> ;; 719 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 720 <2> ;; 721 <2> $M_CHECKSTDIN PROC NEAR ;AN001; 722 <2> 723 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 724 <2> MOV BX,STDIN ;AN001; 725 <2> XOR DX,DX ;AN001; 726 <2> INT 21H ;AN001; 727 <2> 728 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 729 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 730 <2> INT 21H ;AN001; 731 <2> 732 <2> RET ;AN001; 733 <2> 734 <2> $M_CHECKSTDIN ENDP ;AN001; 735 <2> ;; 736 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 737 <2> %ENDIF ;AN001; END of include for EOF Check 738 <2> %IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full? 739 <2> %ELSE ;AN001; Yes, THEN include it 740 <2> ; PAGE 741 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc 742 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 743 <2> ;; 744 <2> ;; Proc Name: $M_CHECKSTDOUT 745 <2> ;; 746 <2> ;; Function: 747 <2> ;; 748 <2> ;; Inputs: None 749 <2> ;; 750 <2> ;; Outputs: 751 <2> ;; 752 <2> ;; Regs Changed: 753 <2> ;; 754 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 755 <2> ;; 756 <2> $M_CHECKSTDOUT PROC NEAR ;AN001; 757 <2> 758 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 759 <2> MOV BX,STDOUT ;AN001; 760 <2> XOR DX,DX ;AN001; 761 <2> INT 21H ;AN001; 762 <2> 763 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 764 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 765 <2> INT 21H ;AN001; 766 <2> 767 <2> RET ;AN001; 768 <2> 769 <2> $M_CHECKSTDOUT ENDP ;AN001; 770 <2> ;; 771 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 772 <2> %ENDIF ;AN001; END of include for Disk Full Check 773 <2> %IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check? 774 <2> %ELSE ;;AN000;; Yes, THEN include it 775 <2> ; PAGE 776 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 778 <2> ;; 779 <2> ;; Proc Name: $M_VERSION_CHECK 780 <2> ;; 781 <2> ;; Function: Determine if DOS version is within allowable limits 782 <2> ;; 783 <2> ;; Inputs: None 784 <2> ;; 785 <2> ;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version 786 <2> ;; Registers set for SYSDISPMSG 787 <2> ;; CARRY_FLAG = 0 if Correct DOS version 788 <2> ;; 789 <2> ;; Regs Changed: AX 790 <2> ;; 791 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 792 <2> 793 <2> check_amis: 794 <2> push ax 795 <2> push ds 796 <2> push si 797 <2> push es 798 <2> push di 799 <2> push dx 800 <2> push ax ; version number, last on stack 801 <2> 802 <2> mov ah, 0 ; multiplex number = 0 803 <2> .loop: 804 <2> mov al, 0 805 <2> int 2Dh ; installation check 806 <2> cmp al, -1 ; multiplexer installed ? 807 <2> jne .next ; no --> 808 <2> push cs 809 <2> pop ds 810 <2> mov si, offset amis_sign ; ds:si -> amis_sign (for lDOS) 811 <2> mov es, dx ; es:di -> multiplexer's sign 812 <2> mov cx, 8 ; 16 bytes 813 <2> repe cmpsw ; compare 814 <2> jne .next ; not us --> 815 <2> mov dx, cs ; dx:si -> amis_id 816 <2> mov al, 11h 817 <2> int 2Dh ; CHG: al, bx, cx, dx, si, di 818 <2> cmp al, 0 ; id call supported ? 819 <2> je .unsup ; no, allow if alt version --> 820 <2> pop dx 821 <2> xor dx, dx ; 2D.MM11 supported, mark that we need it 822 <2> push dx 823 <2> cmp al, 0F0h ; CY if below 0F0h 824 <2> jmp .done 825 <2> 826 <2> .next: 827 <2> inc ah ; next multiplex number 828 <2> jnz .loop ; ZR if done, NZ if more to check --> 829 <2> .unsup: 830 <2> stc ; multiplexer not found 831 <2> ; or function not supported 832 <2> .done: 833 <2> ; CY if not an lDOS revision with our id supported, 834 <2> ; on stack: alt_expected_version if it's fine and either 835 <2> ; no multiplexer or func 11h not supported 836 <2> ; new_expected_version if not fine and either 837 <2> ; no multiplexer or func 11h not suppprted, 838 <2> ; 0 if multiplexer found, func 11h supported, but 839 <2> ; our id is unsupported 840 <2> ; NC if lDOS revision with multiplexer and our id supported 841 <2> pop bx 842 <2> pop dx 843 <2> pop di 844 <2> pop es 845 <2> pop si 846 <2> pop ds 847 <2> pop ax 848 <2> jnc alt_good_DOS ; id is supported --> 849 <2> cmp bx, alt_expected_version ; is it fine ? 850 <2> je alt_good_DOS ; yes --> (NC) 851 <2> jmp $MIF25 ; no, cancel program --> 852 <2> 853 <2> $M_VERSION_CHECK PROC NEAR ;;AN000;; 854 <2> ;; 855 <2> MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC 856 <2> INT 21H ;;AN000;; 857 <2> ;; 858 <2> cmp ax,new_expected_version ; compare with DOS version 859 <2> je check_amis 860 <2> cmp ax,alt_expected_version ; compare with DOS version 861 <2> je check_amis 862 <2> CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct 863 <2> ; $IF E ;;AN000;; 864 <2> JNE $MIF25 865 <2> alt_good_DOS: 866 <2> CLC ;;AN000;; Clear the carry flag 867 <2> ; $ELSE ;;AN000;; ELSE 868 <2> JMP SHORT $MEN25 869 <2> $MIF25: 870 <2> %IFN COMR ;; ** Special case for RESIDENT COMMAND.COM 871 <2> CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH 872 <2> ; $IF B ;;AN000;; No, 873 <2> JNB $MIF27 874 <2> MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support) 875 <2> ; $ELSE ;;AN000;; Yes, 876 <2> JMP SHORT $MEN27 877 <2> $MIF27: 878 <2> MOV BX,STDERR ;;AN000;; Standard Error 879 <2> ; $ENDIF ;;AN000;; 880 <2> $MEN27: 881 <2> %ELSE 882 <2> MOV BX,NO_HANDLE ;;AN000;; No handle 883 <2> %ENDIF 884 <2> MOV AX,1 ;;AN000;; Set message # 1 885 <2> MOV CX,NO_REPLACE ;;AN000;; No replacable parms 886 <2> MOV DL,NO_INPUT ;;AN000;; No input 887 <2> MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message 888 <2> STC ;;AN000;; Set Carry Flag 889 <2> ; $ENDIF ;;AN000;; 890 <2> $MEN25: 891 <2> ;; 892 <2> RET ;;AN000;; Return 893 <2> ;; 894 <2> $M_VERSION_CHECK ENDP ;; 895 <2> ;; 896 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 897 <2> %ENDIF ;;AN000;; END of include for DOS version check 898 <2> %ENDIF ;;AN000;; END of include for SYSLOADMSG 899 <2> ; 900 <2> %IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 901 <2> %IF COMR ;;AN000;; 902 <2> $M_RT EQU $M_RT2 ;;AN000;; 903 <2> %ENDIF ;;AN000;; 904 <2> GETmsg equ FALSE ;;AN000;; Yes, THEN include it and reset flag 905 <2> ; PAGE 906 <2> ; SUBTTL DOS - Message Retriever - GETMSG.ASM Module 907 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 908 <2> ;; 909 <2> ;; Proc Name: SYSGETMSG 910 <2> ;; 911 <2> ;; Function: The GET service returns the segment, offset and size of the 912 <2> ;; message text to the caller based on a message number. 913 <2> ;; The GET function will not display the message thus assumes 914 <2> ;; caller will handle replaceable parameters. 915 <2> ;; 916 <2> ;; Inputs: 917 <2> ;; 918 <2> ;; Outputs: 919 <2> ;; 920 <2> ;; Psuedocode: 921 <2> ;; Call $M_GET_MSG_ADDRESS 922 <2> ;; IF MSG_NUM exists THEN 923 <2> ;; Set DS:SI = MSG_TXT_PTR + 1 924 <2> ;; CARRY_FLAG = 0 925 <2> ;; ELSE 926 <2> ;; CARRY_FLAG = 1 927 <2> ;; ENDIF 928 <2> ;; 929 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 930 <2> ;; 931 <2> %IF FARmsg ;;AN000;; 932 <2> SYSGETMSG PROC FAR ;;AN000;; 933 <2> %ELSE ;;AN000;; 934 <2> SYSGETMSG PROC NEAR ;;AN000;; 935 <2> %ENDIF ;;AN000;; 936 <2> ;; 937 <2> ;; Save registers needed later 938 <2> 939 <2> PUSH AX ;;AN000;; Save changed regs 940 <2> PUSH ES ;;AN000;; 941 <2> PUSH DI ;;AN000;; 942 <2> PUSH BP ;;AN000;; 943 <2> ;; 944 <2> %IF FARmsg ;;AN000;; 945 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 946 <2> %ELSE ;;AN000;; 947 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 948 <2> %ENDIF ;;AN000;; Return message in ES:DI 949 <2> ; $IF NC ;;AN000;; Message found? 950 <2> JC $MIF31 951 <2> CMP DH,UTILITY_MSG_CLASS 952 <2> CLC ;;AN000;; 953 <2> ; $IF NE 954 <2> JE $MIF32 955 <2> PUSH ES ;;AN000;; 956 <2> POP DS ;;AN000;; Return message in DS:SI 957 <2> ; $ELSE 958 <2> JMP SHORT $MEN32 959 <2> $MIF32: 960 <2> %IF FARmsg ;;AN000;; Yes, 961 <2> PUSH ES ;;AN000;; 962 <2> POP DS ;;AN000;; Return message in DS:SI 963 <2> %ELSE ;;AN000;; 964 <2> PUSH CS ;;AN000;; Return message in DS:SI 965 <2> POP DS ;;AN000;; 966 <2> %ENDIF ;;AN000;; 967 <2> ; $ENDIF ;;AN000;; 968 <2> $MEN32: 969 <2> MOV SI,DI ;;AN000;; Return message in DS:SI 970 <2> ; $ENDIF ;;AN000;; 971 <2> $MIF31: 972 <2> ;; 973 <2> POP BP ;;AN000;; Restore changed regs 974 <2> POP DI ;;AN000;; 975 <2> POP ES ;;AN000;; 976 <2> POP AX ;;AN000;; 977 <2> ;; 978 <2> RET ;;AN000;; Return 979 <2> ;; 980 <2> SYSGETMSG ENDP ;; 981 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 982 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 983 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 984 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 985 <2> ;; 986 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 987 <2> ;; 988 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 989 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 990 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 991 <2> ;; IF CX > 1 THEN ES:DI points to the specified message 992 <2> ;; REGS CHANGED: ES,DI,CX 993 <2> ;; 994 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 995 <2> ;; 996 <2> %IF FARmsg ;;AN000;; 997 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 998 <2> %ELSE ;;AN000;; 999 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 1000 <2> %ENDIF ;;AN000;; 1001 <2> ;; 1002 <2> PUSH SI ;;AN000;; 1003 <2> PUSH BX ;;AN000;; 1004 <2> XOR SI,SI ;;AN000;; Use SI as an index 1005 <2> XOR CX,CX ;;AN000;; Use CX as an size 1006 <2> ; $DO ;;AN000;; 1007 <2> $MDO36: 1008 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 1009 <2> ; $IF E ;;AN000;; Yes, 1010 <2> JNE $MIF37 1011 <2> %IF FARmsg ;;AN000;; 1012 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1013 <2> MOV BX,ES ;;AN000; 1014 <2> %ELSE ;;AN000;; 1015 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1016 <2> MOV BX,DI ;;AN000; 1017 <2> %ENDIF ;;AN000;; 1018 <2> ; $ELSE ;;AN000;; No, 1019 <2> JMP SHORT $MEN37 1020 <2> $MIF37: 1021 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 1022 <2> ; $IF NE ;;AN000;; Yes, 1023 <2> JE $MIF39 1024 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 1025 <2> MOV BX,ES ;;AN000; 1026 <2> ; $ELSE ;;AN000;; No, extended errors were specified 1027 <2> JMP SHORT $MEN39 1028 <2> $MIF39: 1029 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 1030 <2> ; $IF AE,AND ;;AN000;; 1031 <2> JNAE $MIF41 1032 <2> CMP AX,$M_CRIT_HI ;;AN000;; 1033 <2> ; $IF BE ;;AN000;; Yes, 1034 <2> JNBE $MIF41 1035 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 1036 <2> MOV BX,ES ;;AN000; 1037 <2> ; $ELSE ;;AN000;; 1038 <2> JMP SHORT $MEN41 1039 <2> $MIF41: 1040 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 1041 <2> MOV BX,ES ;;AN000; 1042 <2> ; $ENDIF ;;AN000;; 1043 <2> $MEN41: 1044 <2> ; $ENDIF ;;AN000;; 1045 <2> $MEN39: 1046 <2> ; $ENDIF ;;AN000;; 1047 <2> $MEN37: 1048 <2> ;; 1049 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 1050 <2> ; $IF E ;;AN000;; Yes, 1051 <2> JNE $MIF46 1052 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 1053 <2> ; $IF E ;;AN000;; Yes, 1054 <2> JNE $MIF47 1055 <2> STC ;;AN000;; Set the carry flag 1056 <2> ; $ELSE ;;AN000;; No, 1057 <2> JMP SHORT $MEN47 1058 <2> $MIF47: 1059 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 1060 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 1061 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 1062 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 1063 <2> CLC ;;AN000;; 1064 <2> ; $ENDIF ;;AN000;; No, 1065 <2> $MEN47: 1066 <2> ; $ELSE ;;AN000;; 1067 <2> JMP SHORT $MEN46 1068 <2> $MIF46: 1069 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 1070 <2> ; $IF NE ;;AN001;; Yes, 1071 <2> JE $MIF51 1072 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 1073 <2> ; $ENDIF ;;AN000;; 1074 <2> $MIF51: 1075 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 1076 <2> CLC ;;AN000;; 1077 <2> ; $ENDIF ;;AN000;; 1078 <2> $MEN46: 1079 <2> ; $LEAVE C ;;AN000;; 1080 <2> JC $MEN36 1081 <2> OR CX,CX ;;AN000;; Was the message found? 1082 <2> ; $ENDDO NZ,LONG ;;AN000;; 1083 <2> JNZ $MXL2 1084 <2> JMP $MDO36 1085 <2> $MXL2: 1086 <2> $MEN36: 1087 <2> 1088 <2> PUSHF ;;AN006;; Save the flag state 1089 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 1090 <2> ; $IF E ;;AN006;; Yes, 1091 <2> JNE $MIF56 1092 <2> PUSH DX ;;AN006;; Save all needed registers 1093 <2> PUSH BP ;;AN006;; 1094 <2> PUSH CX ;;AN006;; 1095 <2> PUSH ES ;;AN006;; 1096 <2> PUSH DI ;;AN006;; 1097 <2> PUSH AX ;;AN006;; 1098 <2> 1099 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 1100 <2> INT 2FH ;;AN006;; 1101 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 1102 <2> POP AX ;;AN006;; Restore msg number 1103 <2> ; $IF E ;;AN006;; Yes, 1104 <2> JNE $MIF57 1105 <2> MOV BX,AX ;;AN006;; BX is the extended error number 1106 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 1107 <2> INT 2FH ;;AN006;; Call IFSFUNC 1108 <2> ; $ELSE ;;AN006;; No, 1109 <2> JMP SHORT $MEN57 1110 <2> $MIF57: 1111 <2> STC ;;AN006;; Carry conditon 1112 <2> ; $ENDIF ;;AN006;; 1113 <2> $MEN57: 1114 <2> 1115 <2> ; $IF C ;;AN006;; Was there an update? 1116 <2> JNC $MIF60 1117 <2> POP DI ;;AN006;; No, 1118 <2> POP ES ;;AN006;; Restore old pointer 1119 <2> POP CX ;;AN006;; 1120 <2> ; $ELSE ;;AN006;; Yes 1121 <2> JMP SHORT $MEN60 1122 <2> $MIF60: 1123 <2> ADD SP,6 ;;AN006;; Throw away old pointer 1124 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 1125 <2> ; $ENDIF ;;AN006;; 1126 <2> $MEN60: 1127 <2> POP BP ;;AN006;; Restore other Regs 1128 <2> POP DX ;;AN006;; 1129 <2> ; $ENDIF ;;AN006;; 1130 <2> $MIF56: 1131 <2> $M_POPF ;;AN006;; Restore the flag state 1132 <2> 1133 <2> POP BX ;;AN000;; 1134 <2> POP SI ;;AN000;; 1135 <2> RET ;;AN000;; Return ES:DI pointing to the message 1136 <2> ;; 1137 <2> $M_GET_MSG_ADDRESS ENDP ;; 1138 <2> ;; 1139 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 1140 <2> ;; 1141 <2> PUSH DI ;;AN006;; Save position 1142 <2> PUSH AX ;;AN006;; 1143 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 1144 <2> XOR AL,AL ;;AN006;; Prepare compare register 1145 <2> REPNE SCASB ;;AN006;; Scan for zero 1146 <2> NOT CX ;;AN006;; Change decrement into number 1147 <2> DEC CX ;;AN006;; Don't include the zero 1148 <2> POP AX ;;AN006;; 1149 <2> POP DI ;;AN006;; Restore position 1150 <2> RET ;;AN006;; 1151 <2> ;; 1152 <2> $M_SET_LEN_IN_CX ENDP ;; 1153 <2> ;; 1154 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1155 <2> ;; 1156 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 1157 <2> ;; 1158 <2> ;; FUNCTION: To scan thru message headers until message is found 1159 <2> ;; INPUTS: ES:DI points to beginning of msg headers 1160 <2> ;; CX contains the number of messages in class 1161 <2> ;; DH contains the message class 1162 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 1163 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 1164 <2> ;; 1165 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1166 <2> ;; 1167 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 1168 <2> ;; 1169 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 1170 <2> ; $IF E,AND ;;AN004;; Yes, 1171 <2> JNE $MIF64 1172 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 1173 <2> ; $IF NE ;;AN004;; Yes, 1174 <2> JE $MIF64 1175 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 1176 <2> ; $IF E ;;AN004;; . . . and . . . 1177 <2> JNE $MIF65 1178 <2> PUSH AX ;;AN004;; Reset the special message number 1179 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 1180 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1181 <2> POP AX ;;AN004;; Reset the special message number 1182 <2> ; $ELSE ;;AN004;; Get the old message number 1183 <2> JMP SHORT $MEN65 1184 <2> $MIF65: 1185 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1186 <2> ; $ENDIF ;;AN004;; Get the old message number 1187 <2> $MEN65: 1188 <2> ; $ELSE ;;AN004;; 1189 <2> JMP SHORT $MEN64 1190 <2> $MIF64: 1191 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 1192 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1193 <2> ; $IF NE ;;AN001;; 1194 <2> JE $MIF69 1195 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 1196 <2> ; $ELSE ;;AN001;; 1197 <2> JMP SHORT $MEN69 1198 <2> $MIF69: 1199 <2> %IF FARmsg ;;AN001;; 1200 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1201 <2> %ELSE 1202 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1203 <2> %ENDIF 1204 <2> ; $IF E ;;AN002;; pointer (hopefully) 1205 <2> JNE $MIF71 1206 <2> %IF FARmsg ;;AN001;; 1207 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1208 <2> %ELSE 1209 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1210 <2> %ENDIF 1211 <2> ; $ENDIF ;;AN002;; go on to the next class 1212 <2> $MIF71: 1213 <2> ; $ENDIF ;;AN001;; 1214 <2> $MEN69: 1215 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 1216 <2> STC ;;AN004;; Flag that we haven't found anything yet 1217 <2> ; $ENDIF ;;AN004;; 1218 <2> $MEN64: 1219 <2> 1220 <2> ; $IF C ;;AN004;; Have we found anything yet? 1221 <2> JNC $MIF75 1222 <2> CLC ;;AN004;; No, reset carry 1223 <2> ; $SEARCH ;;AN000;; 1224 <2> $MDO76: 1225 <2> OR CX,CX ;;AN000;; Do we have any to check? 1226 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1227 <2> JZ $MEN76 1228 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1229 <2> ; $IF NE ;;AN001;; 1230 <2> JE $MIF78 1231 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 1232 <2> ; $ELSE ;;AN001;; 1233 <2> JMP SHORT $MEN78 1234 <2> $MIF78: 1235 <2> %IF FARmsg ;;AN001;; 1236 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 1237 <2> %ELSE 1238 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 1239 <2> %ENDIF 1240 <2> ; $ENDIF 1241 <2> $MEN78: 1242 <2> ; $EXITIF E ;;AN000;; 1243 <2> JNE $MIF76 1244 <2> ; $ORELSE ;;AN000; 1245 <2> JMP SHORT $MSR76 1246 <2> $MIF76: 1247 <2> DEC CX ;;AN000;; No, well do we have more to check? 1248 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1249 <2> JZ $MEN76 1250 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 1251 <2> ; $ENDLOOP ;;AN000;; 1252 <2> JMP SHORT $MDO76 1253 <2> $MEN76: 1254 <2> STC ;;AN000;; 1255 <2> ; $ENDSRCH ;;AN000;; Check next message 1256 <2> $MSR76: 1257 <2> ; $IF NC ;;AN000;; Did we find the message? 1258 <2> JC $MIF86 1259 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 1260 <2> CLC ;;AN001;; 1261 <2> ; $IF E ;;AN001;; 1262 <2> JNE $MIF87 1263 <2> %IF FARmsg ;;AN001;; 1264 <2> %ELSE ;;AN000;; 1265 <2> PUSH CS ;;AN000;; 1266 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 1267 <2> %ENDIF 1268 <2> ; $ENDIF ;;AN001;; 1269 <2> $MIF87: 1270 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 1271 <2> ; $ENDIF ;;AN004;; 1272 <2> $MIF86: 1273 <2> ; $ENDIF ;;AN004;; 1274 <2> $MIF75: 1275 <2> ;; Yes, great we can return with CX > 0 1276 <2> 1277 <2> ; $IF NC ;;AN000;; Did we find the message? 1278 <2> JC $MIF91 1279 <2> XOR CH,CH ;;AN000;; 1280 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 1281 <2> INC DI ;;AN000;; Increment past length 1282 <2> ; $ENDIF ;;AN004;; 1283 <2> $MIF91: 1284 <2> 1285 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 1286 <2> RET ;;AN000;; Return 1287 <2> ;; 1288 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 1289 <2> ;; 1290 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1291 <2> %ENDIF ;;AN000;; END of include of common subroutines 1292 <2> %ENDIF ;;AN000;; END of include of SYSGETMSG 1293 <2> ; 1294 <2> %IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 1295 <2> %IF COMR ;;AN000;; 1296 <2> $M_RT EQU $M_RT2 ;;AN000;; 1297 <2> %ENDIF ;;AN000;; 1298 <2> %iassign DISPLAYmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 1299 <2> ; PAGE 1300 <2> ; SUBTTL DOS - Message Retriever - DISPMSG.ASM Module 1301 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1302 <2> ;; 1303 <2> ;; Proc Name: SYSDISPMSG 1304 <2> ;; 1305 <2> ;; Function: The DISPLAY service will output a defined message to a handle 1306 <2> ;; requested by the caller. It also provides function to display 1307 <2> ;; messages when handles are not applicable (ie. DOS function calls 1308 <2> ;; 00h to 0Ah) Replaceable parameters are allowed and are 1309 <2> ;; defined previous to entry. 1310 <2> ;; 1311 <2> ;; It is assumes that a PRELOAD function has already determined 1312 <2> ;; the addressibilty internally to the message retriever services. 1313 <2> ;; Inputs: 1314 <2> ;; 1315 <2> ;; Outputs: 1316 <2> ;; 1317 <2> ;; Psuedocode: 1318 <2> ;; Save registers needed later 1319 <2> ;; Get address of the message requested 1320 <2> ;; IF Message number exists THEN 1321 <2> ;; IF replacable parameters were specified THEN 1322 <2> ;; Display message with replacable parms 1323 <2> ;; ELSE 1324 <2> ;; Display string without replacable parms 1325 <2> ;; ENDIF 1326 <2> ;; IF character input was requested THEN 1327 <2> ;; Wait for character input 1328 <2> ;; ENDIF 1329 <2> ;; Clear CARRY FLAG 1330 <2> ;; ELSE 1331 <2> ;; Set CARRY FLAG 1332 <2> ;; ENDIF 1333 <2> ;; Return 1334 <2> ;; 1335 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1336 <2> ;; 1337 <2> %IF FARmsg ;;AN000;; 1338 <2> SYSDISPMSG PROC FAR ;;AN000;; 1339 <2> %ELSE ;;AN000;; 1340 <2> SYSDISPMSG PROC NEAR ;;AN000;; 1341 <2> %ENDIF ;;AN000;; 1342 <2> ;; 1343 <2> ;; Save registers and values needed later 1344 <2> 1345 <2> PUSH AX ;;AN000;; Save changed REGs 1346 <2> PUSH BX ;;AN000;; 1347 <2> PUSH CX ;;AN000;; 1348 <2> PUSH BP ;;AN000;; 1349 <2> PUSH DI ;;AN000;; Save pointer to input buffer (offset) 1350 <2> PUSH ES ;;AN000;; Save pointer to input buffer (segment) 1351 <2> PUSH DX ;;AN000;; Save Input/Class request 1352 <2> 1353 <2> MOV BP,CX ;;AN000;; Use BP to hold replace count 1354 <2> MOV WORD PTR [$M_RT + $M_HANDLE],BX ;;AN000;; Save handle 1355 <2> MOV BYTE PTR [$M_RT + $M_CLASS],DH ;;AN004;; Save class 1356 <2> 1357 <2> ;; Get address of the message requested 1358 <2> 1359 <2> %IF FARmsg ;;AN000;; 1360 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1361 <2> %ELSE ;;AN000;; 1362 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1363 <2> %ENDIF ;;AN000;; 1364 <2> OR CX,CX ;;AN000;; Was message found? 1365 <2> ; $IF NZ ;;AN000;; YES, Message address in ES:DI 1366 <2> JZ $MIF93 1367 <2> 1368 <2> ;; Test if replacable parameters were specified 1369 <2> 1370 <2> OR BP,BP ;;AN000;; Were replacable parameters requested 1371 <2> ; $IF Z ;;AN000;; 1372 <2> JNZ $MIF94 1373 <2> 1374 <2> ;; Display string without replacable parms 1375 <2> 1376 <2> CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message 1377 <2> ; $ELSE ;;AN000;; 1378 <2> JMP SHORT $MEN94 1379 <2> $MIF94: 1380 <2> %IF $M_REPLACE ;;AN000;; 1381 <2> 1382 <2> ;; Display message with replacable parms 1383 <2> 1384 <2> CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions 1385 <2> %ENDIF ;;AN000;; 1386 <2> ; $ENDIF ;;AN000;; 1387 <2> $MEN94: 1388 <2> ; $IF NC 1389 <2> JC $MIF97 1390 <2> 1391 <2> POP DX ;;AN000;; Get Input/Class request 1392 <2> 1393 <2> CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. 1394 <2> 1395 <2> POP ES ;;AN000;; Get location of input buffer (if specified) 1396 <2> POP DI ;;AN000;; 1397 <2> 1398 <2> ;; Test if character input was requested 1399 <2> 1400 <2> %IF INPUTmsg ;;AN000;; 1401 <2> OR DL,DL ;;AN000;; Was Wait-For-Input requested? 1402 <2> ; $IF NZ ;;AN000;; 1403 <2> JZ $MIF98 1404 <2> CALL $M_WAIT_FOR_INPUT ;;AN000;; 1405 <2> ; $ENDIF ;;AN000;; 1406 <2> $MIF98: 1407 <2> %ENDIF ;;AN000;; 1408 <2> ; $ELSE ;;AN000;; 1409 <2> JMP SHORT $MEN97 1410 <2> $MIF97: 1411 <2> ADD SP,6 ;;AN000;; 1412 <2> STC ;;AN000;; Reset carry flag 1413 <2> ; $ENDIF ;;AN000;; 1414 <2> $MEN97: 1415 <2> ; $ELSE ;;AN000;; No, 1416 <2> JMP SHORT $MEN93 1417 <2> $MIF93: 1418 <2> POP ES ;;AN000;; Get pointer to input buffer (segment) 1419 <2> POP DI ;;AN000;; Get base pointer to first sublist (offset) 1420 <2> POP DX ;;AN000;; Get base pointer to first sublist (segment) 1421 <2> STC ;;AN000;; Set carry flag 1422 <2> ; $ENDIF ;;AN000;; 1423 <2> $MEN93: 1424 <2> ;; 1425 <2> ; $IF NC ;;AN000;; Was there an error? 1426 <2> JC $MIF104 1427 <2> POP BP ;;AN000;; No, 1428 <2> POP CX ;;AN000;; 1429 <2> POP BX ;;AN000;; 1430 <2> %IF INPUTmsg ;;AN000;; 1431 <2> ADD SP,2 ;;AN000;; 1432 <2> %ELSE ;AN000; 1433 <2> POP AX ;;AN000;; 1434 <2> %ENDIF ;;AN000;; 1435 <2> ; $ELSE ;;AN000;; Yes, 1436 <2> JMP SHORT $MEN104 1437 <2> $MIF104: 1438 <2> ADD SP,8 ;;AN000;; Eliminate from stack 1439 <2> STC ;;AN000;; 1440 <2> ; $ENDIF ;;AN000;; 1441 <2> $MEN104: 1442 <2> ;; 1443 <2> RET ;;AN000;; Return 1444 <2> ;; 1445 <2> SYSDISPMSG ENDP ;;AN000;; 1446 <2> ;; 1447 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1448 <2> ; 1449 <2> ;; 1450 <2> ;; PROC NAME: $M_DISPLAY_STRING 1451 <2> ;; 1452 <2> ;; FUNCTION: Will display or write string 1453 <2> ;; INPUTS: ES:DI points to beginning of message 1454 <2> ;; CX contains the length of string to write (if applicable) 1455 <2> ;; OUTPUTS: None 1456 <2> ;; REGS Revised: None 1457 <2> ;; 1458 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1459 <2> ;; 1460 <2> $M_DISPLAY_STRING PROC NEAR ;;AN000;; 1461 <2> ;; 1462 <2> PUSH AX ;;AN000;; 1463 <2> PUSH BX ;;AN000;; 1464 <2> PUSH DX ;;AN000;; 1465 <2> ;; 1466 <2> MOV BX,[$M_RT + $M_HANDLE] ;;AN000;; Retrieve handle 1467 <2> ;; 1468 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 1469 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1470 <2> %ELSE 1471 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1472 <2> ; $IF E ;;AN000;; 1473 <2> JNE $MIF107 1474 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1475 <2> ; $ELSE ;;AN000;; 1476 <2> JMP SHORT $MEN107 1477 <2> $MIF107: 1478 <2> CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle 1479 <2> ; $ENDIF ;;AN000;; 1480 <2> $MEN107: 1481 <2> ;AN001; 1482 <2> ; $IF C ;;AN000;; Was there an error? 1483 <2> JNC $MIF110 1484 <2> MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes, 1485 <2> MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error 1486 <2> INT 21H ;;AN000;; 1487 <2> XOR AH,AH ;;AN000;; Clear AH 1488 <2> ADD SP,6 ;;AN000;; Clean up stack 1489 <2> STC ;;AN000;; Flag that there was an error 1490 <2> ; $ELSE ;;AN000;; No, 1491 <2> JMP SHORT $MEN110 1492 <2> $MIF110: 1493 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1494 <2> ; $IF NE ;;AN000;; 1495 <2> JE $MIF112 1496 <2> CMP AX,CX ;AN001; Was it ALL written? 1497 <2> ; $IF NE ;AN001; No, 1498 <2> JE $MIF113 1499 <2> CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error 1500 <2> ADD SP,6 ;AN001; Clean up stack 1501 <2> STC ;AN001; Flag that there was an error 1502 <2> ; $ENDIF ;AN001; 1503 <2> $MIF113: 1504 <2> ; $ENDIF ;AN001; 1505 <2> $MIF112: 1506 <2> ; $ENDIF ;;AN000;; 1507 <2> $MEN110: 1508 <2> %ENDIF 1509 <2> ; $IF NC ;;AN000;; Was there ANY error? 1510 <2> JC $MIF117 1511 <2> POP DX ;;AN000;; Restore regs 1512 <2> POP BX ;;AN000;; 1513 <2> POP AX ;;AN000;; 1514 <2> ; $ENDIF ;;AN000;; 1515 <2> $MIF117: 1516 <2> RET ;;AN000;; Return 1517 <2> ;; 1518 <2> $M_DISPLAY_STRING ENDP ;;AN000;; 1519 <2> ;; 1520 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1521 <2> ;; 1522 <2> ;; PROC NAME: $M_DISPLAY_$_STRING 1523 <2> ;; 1524 <2> ;; FUNCTION: Will display a $ terminated string 1525 <2> ;; INPUTS: ES:DI points to beginning of message text (not the length) 1526 <2> ;; OUPUTS: None 1527 <2> ;; REGS USED: AX,DX 1528 <2> ;; 1529 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1530 <2> ;; 1531 <2> $M_DISPLAY_$_STRING PROC NEAR ;;AN000;; 1532 <2> ;; 1533 <2> PUSH DS ;;AN000;; 1534 <2> PUSH ES ;;AN000;; 1535 <2> POP DS ;;AN000;; Set DS to segment of message text 1536 <2> %IFN COMR 1537 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1538 <2> ; $IF E ;;AN000;; Yes, 1539 <2> JNE $MIF119 1540 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1541 <2> MOV DL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1542 <2> INT 21H ;;AN000;; Write character 1543 <2> POP DS ;;AN000;; Set DS to segment of message text 1544 <2> MOV AL,DL ;;AN000;; Get the character in AL 1545 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1546 <2> PUSH DS ;;AN000;; 1547 <2> PUSH ES ;;AN000;; 1548 <2> POP DS ;;AN000;; Set DS to segment of message text 1549 <2> ; $IF C ;;AN000;; Yes, 1550 <2> JNC $MIF120 1551 <2> MOV DL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 1552 <2> INT 21H ;;AN000;; Write character 1553 <2> CLC ;;AN000;; Clear the DBCS indicator 1554 <2> ; $ENDIF ;;AN000;; 1555 <2> $MIF120: 1556 <2> ; $ELSE ;;AN000;; No, 1557 <2> JMP SHORT $MEN119 1558 <2> $MIF119: 1559 <2> %ENDIF 1560 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1561 <2> ; $DO ;;AN002;; No, 1562 <2> $MDO123: 1563 <2> OR CX,CX ;;AN002;; Are there any left to display? 1564 <2> ; $LEAVE Z ;;AN002;; Yes, 1565 <2> JZ $MEN123 1566 <2> MOV DL,BYTE PTR [ES:DI] ;;AN002;; Get the character 1567 <2> INT 21H ;;AN002;; Display the character 1568 <2> INC DI ;;AN002;; Set pointer to next character 1569 <2> DEC CX ;;AN002;; Count this character 1570 <2> ; $ENDDO Z ;;AN002;; No, 1571 <2> JNZ $MDO123 1572 <2> $MEN123: 1573 <2> %IFN COMR 1574 <2> ; $ENDIF ;;AN000;; 1575 <2> $MEN119: 1576 <2> %ENDIF 1577 <2> CLC ;;AN000;; Char functions used don't return carry as error 1578 <2> POP DS ;;AN000;; 1579 <2> RET ;;AN000;; 1580 <2> ;; 1581 <2> $M_DISPLAY_$_STRING ENDP ;;AN000;; 1582 <2> ;; 1583 <2> %IFN COMR 1584 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1585 <2> ;; 1586 <2> ;; PROC NAME: $M_DISPLAY_H_STRING 1587 <2> ;; 1588 <2> ;; FUNCTION: Will display a string to a specified handle 1589 <2> ;; INPUTS: ES:DI points to beginning of message 1590 <2> ;; CX contains the number of bytes to write 1591 <2> ;; BX contains the handle to write to 1592 <2> ;; OUPUTS: None 1593 <2> ;; REGS USED: AX,DX 1594 <2> ;; 1595 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1596 <2> ;; 1597 <2> $M_DISPLAY_H_STRING PROC NEAR ;;AN000;; 1598 <2> ;; 1599 <2> XOR AX,AX ;;AN002;; Set number of bytes written to 0 1600 <2> OR CX,CX ;;AN002;; For performance, don't write if not necessary 1601 <2> ; $IF NZ ;;AN002;; Any chars to write? 1602 <2> JZ $MIF127 1603 <2> PUSH DS ;;AN000;; Yes, 1604 <2> PUSH ES ;;AN000;; 1605 <2> POP DS ;;AN000;; Set DS to segment of message text 1606 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1607 <2> MOV DX,DI ;;AN000;; Pointer to data to write 1608 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1609 <2> ; $IF E ;;AN000;; Yes, 1610 <2> JNE $MIF128 1611 <2> INT 21H ;;AN000;; Write character 1612 <2> POP DS ;;AN000;; Set DS to segment of message text 1613 <2> PUSH AX ;;AN000;; 1614 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1615 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1616 <2> POP AX ;;AN000;; Set DS to segment of message text 1617 <2> PUSH DS ;;AN000;; 1618 <2> PUSH ES ;;AN000;; 1619 <2> POP DS ;;AN000;; Set DS to segment of message text 1620 <2> ; $IF C ;;AN000;; Yes, 1621 <2> JNC $MIF129 1622 <2> CLC ;;AN000;; Clear the DBCS indicator 1623 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1624 <2> INC DX ;;AN000;; Point to next character 1625 <2> INT 21H ;;AN000;; Write character 1626 <2> ; $ENDIF ;;AN000;; 1627 <2> $MIF129: 1628 <2> ; $ELSE ;;AN000;; No, 1629 <2> JMP SHORT $MEN128 1630 <2> $MIF128: 1631 <2> INT 21H ;;AN000;; Write String at DS:SI to handle 1632 <2> ; $ENDIF ;;AN000;; 1633 <2> $MEN128: 1634 <2> POP DS ;;AN000;; 1635 <2> ; $ENDIF ;;AN002;; 1636 <2> $MIF127: 1637 <2> ;; 1638 <2> RET ;;AN000;; 1639 <2> ;; 1640 <2> $M_DISPLAY_H_STRING ENDP ;;AN000;; 1641 <2> ;; 1642 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1643 <2> ;; 1644 <2> ;; PROC NAME: $M_GET_EXT_ERR_39 1645 <2> ;; 1646 <2> ;; FUNCTION: Will set registers for extended error #39 1647 <2> ;; INPUTS: None 1648 <2> ;; OUPUTS: AX,BX,CX set 1649 <2> ;; REGS USED: 1650 <2> ;; 1651 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1652 <2> ;; 1653 <2> $M_GET_EXT_ERR_39 PROC NEAR ;AN001; 1654 <2> ;; 1655 <2> MOV AX,EXT_ERR_39 ;AN001; Set AX=39 1656 <2> MOV BX,(ERROR_CLASS_39 >> 8) + ACTION_39 ;AN001; Set BH=1 BL=4 1657 <2> MOV CH,LOCUS_39 ;AN001; Set CH=1 1658 <2> ;AN001; 1659 <2> RET ;AN001; 1660 <2> ;; 1661 <2> $M_GET_EXT_ERR_39 ENDP ;AN001; 1662 <2> ;; 1663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1664 <2> %ENDIF 1665 <2> ;; 1666 <2> ;; PROC NAME: $M_ADD_CRLF 1667 <2> ;; 1668 <2> ;; FUNCTION: Will decide whether to display a CRLF 1669 <2> ;; INPUTS: DX contains the Input/Class requested 1670 <2> ;; OUTPUTS: None 1671 <2> ;; REGS Revised: CX,ES,DI 1672 <2> ;; 1673 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1674 <2> ;; 1675 <2> $M_ADD_CRLF PROC NEAR ;;AN004;; 1676 <2> ;; 1677 <2> CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1678 <2> ; $IF NE ;;AN004;; No, 1679 <2> JE $MIF134 1680 <2> TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? 1681 <2> ; $IF Z ;;AN004;; No, 1682 <2> JNZ $MIF135 1683 <2> PUSH DS ;;AN004;; 1684 <2> POP ES ;;AN004;; Set ES to data segment 1685 <2> LEA DI,[$M_RT + $M_CRLF] ;;AN004;; Point at CRLF message 1686 <2> MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size 1687 <2> CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF 1688 <2> ; $ENDIF ;;AN004;; 1689 <2> $MIF135: 1690 <2> ; $ENDIF ;;AN004;; 1691 <2> $MIF134: 1692 <2> RET ;;AN004;; Return 1693 <2> ;; 1694 <2> $M_ADD_CRLF ENDP ;;AN004;; 1695 <2> ;; 1696 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1697 <2> ;; 1698 <2> ;; PROC NAME: $M_IS_IT_DBCS 1699 <2> ;; 1700 <2> ;; FUNCTION: Will decide whether character is Single or Double Byte 1701 <2> ;; INPUTS: AL contains the byte to be checked 1702 <2> ;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range 1703 <2> ;; Carry flag = 1 if byte IS in DBCS range 1704 <2> ;; REGS USED: All restored 1705 <2> ;; 1706 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1707 <2> ;; 1708 <2> $M_IS_IT_DBCS PROC NEAR ;;AN000;; 1709 <2> ;; 1710 <2> PUSH ES ;;AN000;; Save Extra segment register 1711 <2> PUSH DI ;;AN000;; Save SI register 1712 <2> ;; 1713 <2> LES DI,[$M_RT + $M_DBCS_VEC] ;;AN000;; 1714 <2> OR DI,DI ;;AN000;; Was the DBCS vector set? 1715 <2> ; $IF NZ ;;AN000;; 1716 <2> JZ $MIF138 1717 <2> ; $DO ;;AN000;; 1718 <2> $MDO139: 1719 <2> CMP WORD PTR [ES:DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag? 1720 <2> CLC ;;AN000;; 1721 <2> ; $LEAVE E ;;AN000;; 1722 <2> JE $MEN139 1723 <2> ;; No, 1724 <2> CMP AL,BYTE PTR [ES:DI] ;;AN000;; Does the character fall in the DBCS range? 1725 <2> ; $IF AE,AND ;;AN000;; 1726 <2> JNAE $MIF141 1727 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Does the character fall in the DBCS range? 1728 <2> ; $IF BE ;;AN000;; 1729 <2> JNBE $MIF141 1730 <2> STC ;;AN000;; Yes, 1731 <2> ; $ENDIF ;;AN000;; Set carry flag 1732 <2> $MIF141: 1733 <2> INC DI ;;AN000;; No, 1734 <2> INC DI ;;AN000;; Go to next vector 1735 <2> ; $ENDDO ;;AN000;; 1736 <2> JMP SHORT $MDO139 1737 <2> $MEN139: 1738 <2> ; $ENDIF ;;AN000;; 1739 <2> $MIF138: 1740 <2> 1741 <2> POP DI ;;AN000;; 1742 <2> POP ES ;;AN000;; Restore SI register 1743 <2> RET ;;AN000;; Return 1744 <2> ;; 1745 <2> $M_IS_IT_DBCS ENDP ;;AN000;; 1746 <2> ;; 1747 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1748 <2> ;; 1749 <2> ;; PROC NAME: $M_CONVERT2ASC 1750 <2> ;; 1751 <2> ;; FUNCTION: Convert a binary number to a ASCII string 1752 <2> ;; INPUTS: DX:AX contains the number to be converted 1753 <2> ;; $M_RT_DIVISOR contains the divisor 1754 <2> ;; OUPUTS: CX contains the number of characters 1755 <2> ;; Top of stack --> Last character 1756 <2> ;; . . . 1757 <2> ;; Bot of stack --> First character 1758 <2> ;; REGS USED: 1759 <2> ;; 1760 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1761 <2> ;; 1762 <2> $M_CONVERT2ASC PROC NEAR ;;AN000;; 1763 <2> ;; 1764 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Save Return Address 1765 <2> XOR BX,BX ;;AN000;; Use BP as a swapping register 1766 <2> ;; 1767 <2> XCHG BX,AX ;;AN000;; Initialize - Low Word in BP 1768 <2> XCHG AX,DX ;;AN000;; - High Word in AX 1769 <2> ; $DO ;;AN000;; DO UNTIL Low Word becomes zero 1770 <2> $MDO145: 1771 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide High Word by divisor 1772 <2> XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder 1773 <2> ;; and save reduced High Word in BP 1774 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide Low Word by divisor 1775 <2> CMP DX,9 ;;AN000;; Make a digit of the remainder 1776 <2> ; $IF A ;;AN000;; IF 10 to 15, 1777 <2> JNA $MIF146 1778 <2> ADD DL,55 ;;AN000;; Make A to F ASCII 1779 <2> ; $ELSE ;;AN000;; IF 0 to 9, 1780 <2> JMP SHORT $MEN146 1781 <2> $MIF146: 1782 <2> ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII 1783 <2> ; $ENDIF ;;AN000;; 1784 <2> $MEN146: 1785 <2> PUSH DX ;;AN000;; Save the digit on the stack 1786 <2> INC CX ;;AN000;; Count that digit 1787 <2> OR AX,AX ;;AN000;; Are we done? 1788 <2> ; $LEAVE Z,AND ;;AN000;; 1789 <2> JNZ $MLL149 1790 <2> OR BX,BX ;;AN000;; AX and BX must be ZERO!! 1791 <2> ; $LEAVE Z ;;AN000;; No, 1792 <2> JZ $MEN145 1793 <2> $MLL149: 1794 <2> %IFN COMR 1795 <2> CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark 1796 <2> ; $IF E ;;AN000;; Yes, 1797 <2> JNE $MIF150 1798 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1799 <2> ; $IF E ;;AN000;; Yes, 1800 <2> JNE $MIF151 1801 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1802 <2> INC CX ;;AN000;; 1803 <2> ; $ENDIF ;;AN000;; 1804 <2> $MIF151: 1805 <2> ; $ELSE ;;AN000;; No, 1806 <2> JMP SHORT $MEN150 1807 <2> $MIF150: 1808 <2> CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark 1809 <2> ; $IF E ;;AN000;; Yes, 1810 <2> JNE $MIF154 1811 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1812 <2> ; $IF E ;;AN000;; Yes, 1813 <2> JNE $MIF155 1814 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1815 <2> INC CX ;;AN000;; 1816 <2> ; $ENDIF ;;AN000;; 1817 <2> $MIF155: 1818 <2> ; $ELSE ;;AN000;; No, 1819 <2> JMP SHORT $MEN154 1820 <2> $MIF154: 1821 <2> CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark 1822 <2> ; $IF E ;;AN000;; Yes, 1823 <2> JNE $MIF158 1824 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1825 <2> ; $IF E ;;AN000;; Yes, 1826 <2> JNE $MIF159 1827 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1828 <2> INC CX ;;AN000;; 1829 <2> ; $ENDIF ;;AN000;; 1830 <2> $MIF159: 1831 <2> ; $ENDIF ;;AN000;; 1832 <2> $MIF158: 1833 <2> ; $ENDIF ;;AN000;; 1834 <2> $MEN154: 1835 <2> ; $ENDIF ;;AN000;; 1836 <2> $MEN150: 1837 <2> %ENDIF 1838 <2> XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word 1839 <2> ;;AN000;; and Revised Low Word 1840 <2> XOR DX,DX ;;AN000;; Reset remainder 1841 <2> ; $ENDDO ;;AN000;; NEXT 1842 <2> JMP SHORT $MDO145 1843 <2> $MEN145: 1844 <2> ;;AN000;; Yes, 1845 <2> XOR DX,DX ;;AN000;; Reset remainder 1846 <2> XOR AX,AX ;;AN000;; Reset remainder 1847 <2> PUSH word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Restore Return Address 1848 <2> RET ;;AN000;; Return 1849 <2> ;; 1850 <2> $M_CONVERT2ASC ENDP ;;AN000;; 1851 <2> ;; 1852 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1853 <2> ;; 1854 <2> ;; PROC NAME: $M_DISPLAY_MESSAGE 1855 <2> ;; 1856 <2> ;; FUNCTION: Will display or write entire message (with replacable parameters) 1857 <2> ;; INPUTS: ES:DI points to beginning of message 1858 <2> ;; DS:SI points to first sublist structure in chain 1859 <2> ;; BX contains the handle to write to (if applicable) 1860 <2> ;; CX contains the length of string to write (before substitutions) 1861 <2> ;; BP contains the count of replacables 1862 <2> ;; 1863 <2> ;; OUTPUTS: 1864 <2> ;; REGS USED: All 1865 <2> ;; 1866 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1867 <2> ;; 1868 <2> $M_DISPLAY_MESSAGE PROC NEAR ;;AN000;; 1869 <2> ;; 1870 <2> ; $DO ;;AN000;; Note: DS:SI -> message 1871 <2> $MDO165: 1872 <2> XOR DX,DX ;;AN000;; Set size = 0 1873 <2> OR CX,CX ;;AN000;; Are we finished the message yet? 1874 <2> ; $IF NZ ;;AN000;; No, 1875 <2> JZ $MIF166 1876 <2> MOV AH,"%" ;;AN000;; Prepare to scan for % 1877 <2> MOV AL,0 ;;AN004;; 1878 <2> ;; 1879 <2> ; $DO ;;AN000;; Scan through string until % 1880 <2> $MDO167: 1881 <2> CMP BYTE PTR [ES:DI],AH ;;AN000;; Is this character NOT a % 1882 <2> ; $LEAVE E,AND ;;AN000;; No, 1883 <2> JNE $MLL168 1884 <2> CMP BYTE PTR [ES:DI+1],AH ;;AN000;; Is the next character also a % 1885 <2> ; $LEAVE NE,AND ;;AN000;; No, 1886 <2> JE $MLL168 1887 <2> CMP AL,AH ;;AN000;; Was the character before a % 1888 <2> ; $LEAVE NE ;;AN000;; No, GREAT found it 1889 <2> JNE $MEN167 1890 <2> $MLL168: 1891 <2> MOV AL,BYTE PTR [ES:DI] ;;AN004;; Yes, (to any of the above) 1892 <2> CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? 1893 <2> ; $IF C ;;AN004;; Yes, 1894 <2> JNC $MIF169 1895 <2> INC DI ;;AN004;; Increment past second part 1896 <2> ; $ENDIF ;;AN004;; 1897 <2> $MIF169: 1898 <2> INC DI ;;AN000;; Next character in string 1899 <2> INC DX ;;AN000;; Size = Size + 1 1900 <2> DEC CX ;;AN000;; Decrement total size 1901 <2> ; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line 1902 <2> JNZ $MDO167 1903 <2> $MEN167: 1904 <2> ; $ENDIF ;;AN000;; 1905 <2> $MIF166: 1906 <2> ;; 1907 <2> PUSH SI ;;AN000;; Save beginning of sublists 1908 <2> XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX) 1909 <2> OR BP,BP ;;AN000;; Do we have any replacables to do? 1910 <2> ; $IF NZ ;;AN000;; Yes, 1911 <2> JZ $MIF173 1912 <2> DEC BP ;;AN000;; Decrement number of replacables 1913 <2> 1914 <2> ;; Search through sublists to find applicable one 1915 <2> 1916 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 1917 <2> ; $IF E ;;AN000;; No, 1918 <2> JNE $MIF174 1919 <2> ; $SEARCH ;;AN000;; 1920 <2> $MDO175: 1921 <2> MOV AL,[$M_SL + $M_S_ID] ;;AN000;; Get ID byte 1922 <2> ADD AL,30H ;;AN000;; Convert to ASCII 1923 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Is this the right sublist? 1924 <2> ; $EXITIF E ;;AN000;; 1925 <2> JNE $MIF175 1926 <2> ; $ORELSE ;;AN000;; No, 1927 <2> JMP SHORT $MSR175 1928 <2> $MIF175: 1929 <2> CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 1930 <2> ; $LEAVE E,AND ;;AN000;; Yes, 1931 <2> JNE $MLL178 1932 <2> OR DX,DX ;;AN000;; Are we at the end of the message? 1933 <2> ; $LEAVE Z ;;AN000;; No, 1934 <2> JZ $MEN175 1935 <2> $MLL178: 1936 <2> ADD SI,WORD PTR [$M_SL + $M_S_SIZE] ;;AN000;; Next SUBLIST 1937 <2> ; $ENDLOOP ;;AN000;; Yes, 1938 <2> JMP SHORT $MDO175 1939 <2> $MEN175: 1940 <2> CMP byte [$M_RT + $M_CLASS],UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1941 <2> ; $IF E ;;AN004;; Yes, 1942 <2> JNE $MIF180 1943 <2> INC DX ;;AN000;; Remember to display CR,LF 1944 <2> INC DX ;;AN000;; at the end of the message 1945 <2> DEC CX ;;AN000;; Adjust message length 1946 <2> DEC CX ;;AN000;; 1947 <2> DEC DI ;;AN000;; Adjust ending address of message 1948 <2> DEC DI ;;AN000;; 1949 <2> ; $ELSE ;;AN004;; No, 1950 <2> JMP SHORT $MEN180 1951 <2> $MIF180: 1952 <2> MOV DX,-1 ;;AN004;; Set special case 1953 <2> ; $ENDIF ;;AN004;; 1954 <2> $MEN180: 1955 <2> ; $ENDSRCH ;;AN000;; 1956 <2> $MSR175: 1957 <2> ; $ENDIF ;;AN000;; 1958 <2> $MIF174: 1959 <2> ; $ENDIF ;;AN000;; 1960 <2> $MIF173: 1961 <2> 1962 <2> ;; Prepare and display this part of message 1963 <2> 1964 <2> PUSH DI ;;AN000;; Save pointer to replace number 1965 <2> SUB DI,CX ;;AN000;; Determine beginning of string 1966 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) 1967 <2> POP DI ;;AN000;; Get back pointer to replace number 1968 <2> POP CX ;;AN000;; Clean up stack in case error 1969 <2> ; $LEAVE C,LONG ;;AN000;; Fail if carry was set 1970 <2> JNC $MXL3 1971 <2> JMP $MEN165 1972 <2> nop ; identicalise 1973 <2> $MXL3: 1974 <2> PUSH CX ;;AN000;; 1975 <2> 1976 <2> ;; Save and reset pointer registers 1977 <2> 1978 <2> MOV CX,DX ;;AN000;; Get the size of the rest of the message 1979 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case? 1980 <2> ; $IF NE ;;AN000;; No, 1981 <2> JE $MIF187 1982 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1983 <2> ; $IF NZ ;;AN000;; No, 1984 <2> JZ $MIF188 1985 <2> DEC CX ;;AN000;; Decrement total size (%) 1986 <2> DEC CX ;;AN000;; Decrement total size (#) 1987 <2> INC DI ;;AN000;; Go past % 1988 <2> INC DI ;;AN000;; Go past replace number 1989 <2> ; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) 1990 <2> JMP SHORT $MEN188 1991 <2> $MIF188: 1992 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 1993 <2> ; $ENDIF ;;AN000;; Yes, Note this will not leave because INC 1994 <2> $MEN188: 1995 <2> ; $ELSE ;;AN000;; 1996 <2> JMP SHORT $MEN187 1997 <2> $MIF187: 1998 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1999 <2> ; $IF Z ;;AN004;; No, 2000 <2> JNZ $MIF192 2001 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 2002 <2> ; $ELSE ;;AN000;; No, 2003 <2> JMP SHORT $MEN192 2004 <2> $MIF192: 2005 <2> CMP CX,-1 ;;AN004;; Are we at the end of the message? 2006 <2> ; $IF Z ;;AN004;; No, 2007 <2> JNZ $MIF194 2008 <2> XOR CX,CX ;;AN004;; 2009 <2> ; $ENDIF ;;AN000;; 2010 <2> $MIF194: 2011 <2> OR DI,DI ;;AN004;; Turn ZF off 2012 <2> ; $ENDIF ;;AN000;; 2013 <2> $MEN192: 2014 <2> ; $ENDIF ;;AN000;; Note this will not leave because INC 2015 <2> $MEN187: 2016 <2> ; $LEAVE Z ;;AN000;; 2017 <2> JZ $MEN165 2018 <2> PUSH BP ;;AN000;; Save the replace count 2019 <2> PUSH DI ;;AN000;; Save location to complete message 2020 <2> PUSH ES ;;AN000;; 2021 <2> PUSH CX ;;AN000;; Save size of the rest of the message 2022 <2> XOR CX,CX ;;AN000;; Reset CX used for character count 2023 <2> 2024 <2> ;; Determine what action is required on parameter 2025 <2> 2026 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2027 <2> ; $IF E ;;AN000;; 2028 <2> JNE $MIF199 2029 <2> 2030 <2> %IF CHARmsg ;;AN000;; Was Char specified? 2031 <2> Char_Type equ Char_type ; NASM port equate 2032 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2033 <2> ; $IF Z ;;AN000;; 2034 <2> JNZ $MIF200 2035 <2> 2036 <2> ;; Character type requested 2037 <2> ;;AN000;; 2038 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2039 <2> CALL $M_CHAR_REPLACE ;;AN000;; 2040 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2041 <2> JMP SHORT $MEN200 2042 <2> $MIF200: 2043 <2> %ENDIF ;;AN000;; 2044 <2> %IF NUMmsg ;;AN000;; Was Nnmeric type specified? 2045 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2046 <2> ; $IF Z,OR ;;AN000;; 2047 <2> JZ $MLL202 2048 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2049 <2> ; $IF Z,OR ;;AN000;; 2050 <2> JZ $MLL202 2051 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Bin_Hex_Type & $M_TYPE_MASK ;;AN000;; 2052 <2> ; $IF Z ;;AN000;; 2053 <2> JNZ $MIF202 2054 <2> $MLL202: 2055 <2> 2056 <2> ;; Numeric type requested 2057 <2> 2058 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2059 <2> CALL $M_BIN2ASC_REPLACE ;;AN000;; 2060 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2061 <2> JMP SHORT $MEN202 2062 <2> $MIF202: 2063 <2> %ENDIF ;;AN000;; 2064 <2> %IF DATEmsg ;;AN000;; Was date specified? 2065 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Date_Type & $M_TYPE_MASK ;;AN000;; 2066 <2> ; $IF E ;;AN000;; 2067 <2> JNE $MIF204 2068 <2> 2069 <2> ;; Date type requested 2070 <2> 2071 <2> CALL $M_DATE_REPLACE ;;AN000;; 2072 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2073 <2> JMP SHORT $MEN204 2074 <2> $MIF204: 2075 <2> %ENDIF ;;AN000;; 2076 <2> %IF TIMEmsg ;;AN000;; Was time (12 hour format) specified? 2077 <2> 2078 <2> ;; Time type requested (Default if we have not matched until here) 2079 <2> 2080 <2> CALL $M_TIME_REPLACE ;;AN000;; 2081 <2> %ENDIF ;;AN000;; 2082 <2> 2083 <2> %IF DATEmsg ;;AN000;; 2084 <2> ; $ENDIF ;;AN000;; 2085 <2> $MEN204: 2086 <2> %ENDIF ;;AN000;; 2087 <2> %IF NUMmsg ;;AN000;; 2088 <2> ; $ENDIF ;;AN000;; 2089 <2> $MEN202: 2090 <2> %ENDIF ;;AN000;; 2091 <2> %IF CHARmsg ;;AN000;; 2092 <2> ; $ENDIF ;;AN000;; 2093 <2> $MEN200: 2094 <2> %ENDIF ;;AN000;; 2095 <2> 2096 <2> %IF $M_REPLACE ;;AN000;; 2097 <2> ;; With the replace information of the Stack, display the replaceable field 2098 <2> 2099 <2> CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace 2100 <2> %ENDIF ;;AN000;; 2101 <2> ;; None of the above - Extended/Parse replace 2102 <2> ; $ELSE ;;AN000;; 2103 <2> JMP SHORT $MEN199 2104 <2> $MIF199: 2105 <2> %IFN COMR 2106 <2> CALL $M_EXT_PAR_REPLACE ;;AN000;; 2107 <2> %ENDIF 2108 <2> ; $ENDIF ;;AN000;; 2109 <2> $MEN199: 2110 <2> 2111 <2> ;; We must go back and complete the message after the replacable parameter if there is any left 2112 <2> 2113 <2> ; $IF NC ;;AN000;; IF there was an error displaying then EXIT 2114 <2> JC $MIF211 2115 <2> POP CX ;;AN000;; Get size of the rest of the message 2116 <2> POP ES ;;AN000;; Get address of the rest of the message 2117 <2> POP DI ;;AN000;; 2118 <2> POP BP ;;AN000;; Get replacment count 2119 <2> POP SI ;;AN000;; ELSE get address of first sublist structure 2120 <2> ; $ELSE ;;AN000;; 2121 <2> JMP SHORT $MEN211 2122 <2> $MIF211: 2123 <2> ADD SP,10 ;;AN000;; Clean up stack if error 2124 <2> STC ;;AN000;; 2125 <2> ; $ENDIF ;;AN000;; 2126 <2> $MEN211: 2127 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2128 <2> ; $ENDDO NE,OR ;;AN000;; 2129 <2> JNE $MLL214 2130 <2> ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message 2131 <2> JC $MXL4 2132 <2> JMP $MDO165 2133 <2> $MXL4: 2134 <2> $MLL214: 2135 <2> $MEN165: 2136 <2> ;; IF there was an error displaying then EXIT 2137 <2> MOV word [$M_RT + $M_MSG_NUM],0 ;;AN000;; Reset message number to null 2138 <2> RET ;;AN000;; Return 2139 <2> ;; 2140 <2> $M_DISPLAY_MESSAGE ENDP ;;AN000;; 2141 <2> %IFN COMR 2142 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2143 <2> ;; 2144 <2> ;; PROC NAME: $M_EXT_PAR_REPLACE 2145 <2> ;; 2146 <2> ;; FUNCTION: 2147 <2> ;; INPUTS: 2148 <2> ;; OUPUTS: 2149 <2> ;; 2150 <2> ;; REGS USED: 2151 <2> ;; 2152 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2153 <2> ;; 2154 <2> $M_EXT_PAR_REPLACE PROC NEAR ;;AN000;; 2155 <2> ;; 2156 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2157 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN000;; Prepare for get binary value (LOW) 2158 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2159 <2> ;; 2160 <2> CALL $M_CONVERT2ASC ;;AN000;; 2161 <2> ;; 2162 <2> ; $DO ;;AN000;; 2163 <2> $MDO215: 2164 <2> POP AX ;;AN000;; Get character in register 2165 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2166 <2> INC BX ;;AN000;; Increase buffer count 2167 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2168 <2> ; $IF E ;;AN000;; Yes, 2169 <2> JNE $MIF216 2170 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2171 <2> ; $ENDIF ;;AN000;; 2172 <2> $MIF216: 2173 <2> DEC CL ;;AN000;; Have we completed replace? 2174 <2> ; $ENDDO Z ;;AN000;; 2175 <2> JNZ $MDO215 2176 <2> ;; 2177 <2> MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer 2178 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],AX ;;AN000;; Move char into the buffer 2179 <2> INC BX ;;AN000;; Increase buffer count 2180 <2> INC BX ;;AN000;; Increase buffer count 2181 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2182 <2> RET ;;AN000:: 2183 <2> ;; 2184 <2> $M_EXT_PAR_REPLACE ENDP ;;AN000;; 2185 <2> ;; 2186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2187 <2> %ENDIF 2188 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 2189 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 2190 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2191 <2> ;; 2192 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 2193 <2> ;; 2194 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 2195 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 2196 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2197 <2> ;; IF CX > 1 THEN DS:SI points to the specified message 2198 <2> ;; REGS CHANGED: ES,DI,CX,DS,SI 2199 <2> ;; 2200 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2201 <2> ;; 2202 <2> %IF FARmsg ;;AN000;; 2203 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 2204 <2> %ELSE ;;AN000;; 2205 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 2206 <2> %ENDIF ;;AN000;; 2207 <2> ;; 2208 <2> PUSH SI ;;AN000;; 2209 <2> PUSH BX ;;AN000;; 2210 <2> XOR SI,SI ;;AN000;; Use SI as an index 2211 <2> XOR CX,CX ;;AN000;; Use CX as an size 2212 <2> ; $DO ;;AN000;; 2213 <2> $MDO219: 2214 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 2215 <2> ; $IF E ;;AN000;; Yes, 2216 <2> JNE $MIF220 2217 <2> %IF FARmsg ;;AN000;; 2218 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2219 <2> MOV BX,ES ;;AN000; 2220 <2> %ELSE ;;AN000;; 2221 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2222 <2> MOV BX,DI ;;AN000; 2223 <2> %ENDIF ;;AN000;; 2224 <2> ; $ELSE ;;AN000;; No, 2225 <2> JMP SHORT $MEN220 2226 <2> $MIF220: 2227 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 2228 <2> ; $IF NE ;;AN000;; Yes, 2229 <2> JE $MIF222 2230 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 2231 <2> MOV BX,ES ;;AN000; 2232 <2> ; $ELSE ;;AN000;; No, extended errors were specified 2233 <2> JMP SHORT $MEN222 2234 <2> $MIF222: 2235 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 2236 <2> ; $IF AE,AND ;;AN000;; 2237 <2> JNAE $MIF224 2238 <2> CMP AX,$M_CRIT_HI ;;AN000;; 2239 <2> ; $IF BE ;;AN000;; Yes, 2240 <2> JNBE $MIF224 2241 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 2242 <2> MOV BX,ES ;;AN000; 2243 <2> ; $ELSE ;;AN000;; 2244 <2> JMP SHORT $MEN224 2245 <2> $MIF224: 2246 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 2247 <2> MOV BX,ES ;;AN000; 2248 <2> ; $ENDIF ;;AN000;; 2249 <2> $MEN224: 2250 <2> ; $ENDIF ;;AN000;; 2251 <2> $MEN222: 2252 <2> ; $ENDIF ;;AN000;; 2253 <2> $MEN220: 2254 <2> ;; 2255 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 2256 <2> ; $IF E ;;AN000;; Yes, 2257 <2> JNE $MIF229 2258 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 2259 <2> ; $IF E ;;AN000;; Yes, 2260 <2> JNE $MIF230 2261 <2> STC ;;AN000;; Set the carry flag 2262 <2> ; $ELSE ;;AN000;; No, 2263 <2> JMP SHORT $MEN230 2264 <2> $MIF230: 2265 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 2266 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 2267 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 2268 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 2269 <2> CLC ;;AN000;; 2270 <2> ; $ENDIF ;;AN000;; No, 2271 <2> $MEN230: 2272 <2> ; $ELSE ;;AN000;; 2273 <2> JMP SHORT $MEN229 2274 <2> $MIF229: 2275 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 2276 <2> ; $IF NE ;;AN001;; Yes, 2277 <2> JE $MIF234 2278 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 2279 <2> ; $ENDIF ;;AN000;; 2280 <2> $MIF234: 2281 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 2282 <2> CLC ;;AN000;; 2283 <2> ; $ENDIF ;;AN000;; 2284 <2> $MEN229: 2285 <2> ; $LEAVE C ;;AN000;; 2286 <2> JC $MEN219 2287 <2> OR CX,CX ;;AN000;; Was the message found? 2288 <2> ; $ENDDO NZ,LONG ;;AN000;; 2289 <2> JNZ $MXL5 2290 <2> JMP $MDO219 2291 <2> $MXL5: 2292 <2> $MEN219: 2293 <2> 2294 <2> PUSHF ;;AN006;; Save the flag state 2295 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 2296 <2> ; $IF E ;;AN006;; Yes, 2297 <2> JNE $MIF239 2298 <2> PUSH DX ;;AN006;; Save all needed registers 2299 <2> PUSH BP ;;AN006;; 2300 <2> PUSH CX ;;AN006;; 2301 <2> PUSH ES ;;AN006;; 2302 <2> PUSH DI ;;AN006;; 2303 <2> PUSH AX ;;AN006;; 2304 <2> 2305 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 2306 <2> INT 2FH ;;AN006;; 2307 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 2308 <2> POP AX ;;AN006;; Restore msg number 2309 <2> ; $IF E ;;AN006;; Yes, 2310 <2> JNE $MIF240 2311 <2> MOV BX,AX ;;AN006;; BX is the extended error number 2312 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 2313 <2> INT 2FH ;;AN006;; Call IFSFUNC 2314 <2> ; $ELSE ;;AN006;; No, 2315 <2> JMP SHORT $MEN240 2316 <2> $MIF240: 2317 <2> STC ;;AN006;; Carry conditon 2318 <2> ; $ENDIF ;;AN006;; 2319 <2> $MEN240: 2320 <2> 2321 <2> ; $IF C ;;AN006;; Was there an update? 2322 <2> JNC $MIF243 2323 <2> POP DI ;;AN006;; No, 2324 <2> POP ES ;;AN006;; Restore old pointer 2325 <2> POP CX ;;AN006;; 2326 <2> ; $ELSE ;;AN006;; Yes 2327 <2> JMP SHORT $MEN243 2328 <2> $MIF243: 2329 <2> ADD SP,6 ;;AN006;; Throw away old pointer 2330 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 2331 <2> ; $ENDIF ;;AN006;; 2332 <2> $MEN243: 2333 <2> POP BP ;;AN006;; Restore other Regs 2334 <2> POP DX ;;AN006;; 2335 <2> ; $ENDIF ;;AN006;; 2336 <2> $MIF239: 2337 <2> $M_POPF ;;AN006;; Restore the flag state 2338 <2> 2339 <2> POP BX ;;AN000;; 2340 <2> POP SI ;;AN000;; 2341 <2> RET ;;AN000;; Return ES:DI pointing to the message 2342 <2> ;; 2343 <2> $M_GET_MSG_ADDRESS ENDP ;; 2344 <2> ;; 2345 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 2346 <2> ;; 2347 <2> PUSH DI ;;AN006;; Save position 2348 <2> PUSH AX ;;AN006;; 2349 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 2350 <2> XOR AL,AL ;;AN006;; Prepare compare register 2351 <2> REPNE SCASB ;;AN006;; Scan for zero 2352 <2> NOT CX ;;AN006;; Change decrement into number 2353 <2> DEC CX ;;AN006;; Don't include the zero 2354 <2> POP AX ;;AN006;; 2355 <2> POP DI ;;AN006;; Restore position 2356 <2> RET ;;AN006;; 2357 <2> ;; 2358 <2> $M_SET_LEN_IN_CX ENDP ;; 2359 <2> ;; 2360 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2361 <2> ;; 2362 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 2363 <2> ;; 2364 <2> ;; FUNCTION: To scan thru message headers until message is found 2365 <2> ;; INPUTS: ES:DI points to beginning of msg headers 2366 <2> ;; CX contains the number of messages in class 2367 <2> ;; DH contains the message class 2368 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2369 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 2370 <2> ;; 2371 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2372 <2> ;; 2373 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 2374 <2> ;; 2375 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 2376 <2> ; $IF E,AND ;;AN004;; Yes, 2377 <2> JNE $MIF247 2378 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 2379 <2> ; $IF NE ;;AN004;; Yes, 2380 <2> JE $MIF247 2381 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 2382 <2> ; $IF E ;;AN004;; . . . and . . . 2383 <2> JNE $MIF248 2384 <2> PUSH AX ;;AN004;; Reset the special message number 2385 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 2386 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2387 <2> POP AX ;;AN004;; Reset the special message number 2388 <2> ; $ELSE ;;AN004;; Get the old message number 2389 <2> JMP SHORT $MEN248 2390 <2> $MIF248: 2391 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2392 <2> ; $ENDIF ;;AN004;; Get the old message number 2393 <2> $MEN248: 2394 <2> ; $ELSE ;;AN004;; 2395 <2> JMP SHORT $MEN247 2396 <2> $MIF247: 2397 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 2398 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2399 <2> ; $IF NE ;;AN001;; 2400 <2> JE $MIF252 2401 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 2402 <2> ; $ELSE ;;AN001;; 2403 <2> JMP SHORT $MEN252 2404 <2> $MIF252: 2405 <2> %IF FARmsg ;;AN001;; 2406 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2407 <2> %ELSE 2408 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2409 <2> %ENDIF 2410 <2> ; $IF E ;;AN002;; pointer (hopefully) 2411 <2> JNE $MIF254 2412 <2> %IF FARmsg ;;AN001;; 2413 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2414 <2> %ELSE 2415 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2416 <2> %ENDIF 2417 <2> ; $ENDIF ;;AN002;; go on to the next class 2418 <2> $MIF254: 2419 <2> ; $ENDIF ;;AN001;; 2420 <2> $MEN252: 2421 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 2422 <2> STC ;;AN004;; Flag that we haven't found anything yet 2423 <2> ; $ENDIF ;;AN004;; 2424 <2> $MEN247: 2425 <2> 2426 <2> ; $IF C ;;AN004;; Have we found anything yet? 2427 <2> JNC $MIF258 2428 <2> CLC ;;AN004;; No, reset carry 2429 <2> ; $SEARCH ;;AN000;; 2430 <2> $MDO259: 2431 <2> OR CX,CX ;;AN000;; Do we have any to check? 2432 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2433 <2> JZ $MEN259 2434 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2435 <2> ; $IF NE ;;AN001;; 2436 <2> JE $MIF261 2437 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 2438 <2> ; $ELSE ;;AN001;; 2439 <2> JMP SHORT $MEN261 2440 <2> $MIF261: 2441 <2> %IF FARmsg ;;AN001;; 2442 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 2443 <2> %ELSE 2444 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 2445 <2> %ENDIF 2446 <2> ; $ENDIF 2447 <2> $MEN261: 2448 <2> ; $EXITIF E ;;AN000;; 2449 <2> JNE $MIF259 2450 <2> ; $ORELSE ;;AN000; 2451 <2> JMP SHORT $MSR259 2452 <2> $MIF259: 2453 <2> DEC CX ;;AN000;; No, well do we have more to check? 2454 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2455 <2> JZ $MEN259 2456 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 2457 <2> ; $ENDLOOP ;;AN000;; 2458 <2> JMP SHORT $MDO259 2459 <2> $MEN259: 2460 <2> STC ;;AN000;; 2461 <2> ; $ENDSRCH ;;AN000;; Check next message 2462 <2> $MSR259: 2463 <2> ; $IF NC ;;AN000;; Did we find the message? 2464 <2> JC $MIF269 2465 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 2466 <2> CLC ;;AN001;; 2467 <2> ; $IF E ;;AN001;; 2468 <2> JNE $MIF270 2469 <2> %IF FARmsg ;;AN001;; 2470 <2> %ELSE ;;AN000;; 2471 <2> PUSH CS ;;AN000;; 2472 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 2473 <2> %ENDIF 2474 <2> ; $ENDIF ;;AN001;; 2475 <2> $MIF270: 2476 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 2477 <2> ; $ENDIF ;;AN004;; 2478 <2> $MIF269: 2479 <2> ; $ENDIF ;;AN004;; 2480 <2> $MIF258: 2481 <2> ;; Yes, great we can return with CX > 0 2482 <2> 2483 <2> ; $IF NC ;;AN000;; Did we find the message? 2484 <2> JC $MIF274 2485 <2> XOR CH,CH ;;AN000;; 2486 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 2487 <2> INC DI ;;AN000;; Increment past length 2488 <2> ; $ENDIF ;;AN004;; 2489 <2> $MIF274: 2490 <2> 2491 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 2492 <2> RET ;;AN000;; Return 2493 <2> ;; 2494 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 2495 <2> ;; 2496 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2497 <2> %ENDIF ;;AN000;; END of include of common subroutines 2498 <2> ; 2499 <2> %IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms 2500 <2> %iassign $M_REPLACE FALSE ;;AN000;; Tell the assembler we did 2501 <2> ;; 2502 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2503 <2> $M_DISPLAY_REPLACE PROC NEAR ;;AN000;; 2504 <2> ;; 2505 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2506 <2> %IFN COMR 2507 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII) 2508 <2> ; $IF E ;;AN000;; Yes, 2509 <2> JNE $MIF276 2510 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE_HYP ;;AN000;; Move in a " -" 2511 <2> INC BX ;;AN000;; Increment count 2512 <2> INC BX ;;AN000;; Increment count 2513 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE ;;AN000;; Move in a " " 2514 <2> INC BX ;;AN000;; Increment count 2515 <2> CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case 2516 <2> ; $ENDIF ;;AN000;; If it fails we will catch it later 2517 <2> $MIF276: 2518 <2> %ENDIF 2519 <2> 2520 <2> POP BP ;;AN000;; Remember the return address 2521 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2522 <2> XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack 2523 <2> 2524 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save size to later clear stack 2525 <2> MOV AL,BYTE PTR [$M_SL + $M_S_MINW] ;;AN000;; Get the minimum width 2526 <2> ;; 2527 <2> CMP AL,CL ;;AN000;; Do we need pad chars added? 2528 <2> ; $IF A ;;AN000;; Yes, 2529 <2> JNA $MIF278 2530 <2> SUB AL,CL ;;AN000;; Calculate how many pad chars are needed. 2531 <2> MOV DH,AL ;;AN000;; Save the number of pad characters 2532 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be right aligned? 2533 <2> ; $IF NZ ;;AN000;; Yes, 2534 <2> JZ $MIF279 2535 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2536 <2> $MDO280: 2537 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2538 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2539 <2> INC BX ;;AN000;; 2540 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2541 <2> ; $IF E ;;AN000;; Yes, 2542 <2> JNE $MIF281 2543 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2544 <2> ; $ENDIF ;;AN000;; 2545 <2> $MIF281: 2546 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2547 <2> ; $ENDDO Z ;;AN000;; No, next pad character 2548 <2> JNZ $MDO280 2549 <2> ; $ENDIF ;;AN000;; 2550 <2> $MIF279: 2551 <2> ; $ENDIF ;;AN000;; Yes, 2552 <2> $MIF278: 2553 <2> ;; 2554 <2> CMP BYTE [$M_SL + $M_S_MAXW],$M_UNLIM_W ;;AN000;; Is maximum width unlimited? 2555 <2> ; $IF NE ;;AN000;; 2556 <2> JE $MIF286 2557 <2> CMP BYTE PTR [$M_SL + $M_S_MAXW],CL ;;AN000;; Will we exceed maximum width? 2558 <2> ; $IF B ;;AN000;; Yes, 2559 <2> JNB $MIF287 2560 <2> SUB CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Calculate how many extra chars 2561 <2> MOV DL,CL ;;AN000;; Remember how many chars to pop off 2562 <2> MOV CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Set new string length 2563 <2> ; $ENDIF ;;AN000;; 2564 <2> $MIF287: 2565 <2> ; $ENDIF ;;AN000;; 2566 <2> $MIF286: 2567 <2> OR CX,CX ;;AN000;; 2568 <2> ; $IF NZ ;;AN000;; 2569 <2> JZ $MIF290 2570 <2> ; $DO ;;AN000;; Begin filling buffer with string 2571 <2> $MDO291: 2572 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2573 <2> ; $IF Z,AND ;;AN000;; 2574 <2> JNZ $MIF292 2575 <2> Char_field_ASCIIZ equ Char_Field_ASCIIZ ; NASM port equate 2576 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ; Is this replace a ASCIIZ string? 2577 <2> ; $IF NZ ;;AN000;; Yes, 2578 <2> JZ $MIF292 2579 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get first character from string 2580 <2> INC DI ;;AN000;; Next character in string 2581 <2> ; $ELSE ;;AN000;; No, 2582 <2> JMP SHORT $MEN292 2583 <2> $MIF292: 2584 <2> POP AX ;;AN000;; Get character in register 2585 <2> ; $ENDIF ;;AN000;; 2586 <2> $MEN292: 2587 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2588 <2> INC BX ;;AN000;; Increase buffer count 2589 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2590 <2> ; $IF E ;;AN000;; Yes, 2591 <2> JNE $MIF295 2592 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2593 <2> ; $ENDIF ;;AN000;; 2594 <2> $MIF295: 2595 <2> DEC CL ;;AN000;; Have we completed replace? 2596 <2> ; $ENDDO Z ;;AN000;; Test again 2597 <2> JNZ $MDO291 2598 <2> ; $ENDIF ;;AN000;; 2599 <2> $MIF290: 2600 <2> ;; 2601 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be left aligned? 2602 <2> ; $IF Z ;;AN000;; Yes, 2603 <2> JNZ $MIF299 2604 <2> OR DH,DH ;;AN000;; Do we need pad chars added? 2605 <2> ; $IF NZ ;;AN000;; Yes, 2606 <2> JZ $MIF300 2607 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2608 <2> $MDO301: 2609 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2610 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2611 <2> INC BX ;;AN000;; 2612 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2613 <2> ; $IF E ;;AN000;; Yes, 2614 <2> JNE $MIF302 2615 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2616 <2> ; $ENDIF ;;AN000;; 2617 <2> $MIF302: 2618 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2619 <2> ; $ENDDO Z ;;AN000;; Test again 2620 <2> JNZ $MDO301 2621 <2> ; $ENDIF ;;AN000;; 2622 <2> $MIF300: 2623 <2> ; $ENDIF ;;AN000;; 2624 <2> $MIF299: 2625 <2> ;; 2626 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2627 <2> ; $IF Z,AND ;;AN000;; 2628 <2> JNZ $MIF307 2629 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string? 2630 <2> ; $IF NZ ;;AN000;; Yes, 2631 <2> JZ $MIF307 2632 <2> ; $ELSE ;;AN000;; 2633 <2> JMP SHORT $MEN307 2634 <2> $MIF307: 2635 <2> OR DL,DL ;;AN000;; 2636 <2> ; $IF NE ;;AN000;; 2637 <2> JE $MIF309 2638 <2> ; $DO ;;AN000;; 2639 <2> $MDO310: 2640 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable 2641 <2> DEC DL ;;AN000;; Are we done? 2642 <2> ; $ENDDO Z ;;AN000;; 2643 <2> JNZ $MDO310 2644 <2> ; $ENDIF ;;AN000;; 2645 <2> $MIF309: 2646 <2> ; $ENDIF ;;AN000;; 2647 <2> $MEN307: 2648 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time 2649 <2> PUSH BP ;;AN000;; Restore the return address 2650 <2> ;; 2651 <2> RET ;;AN000;; 2652 <2> ;; 2653 <2> $M_DISPLAY_REPLACE ENDP ;;AN000;; 2654 <2> ;; 2655 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2656 <2> ;; 2657 <2> ;; PROC NAME: $M_FLUSH_BUFFER 2658 <2> ;; 2659 <2> ;; FUNCTION: Display the contents of the temporary buffer 2660 <2> ;; INPUTS: DI contains the number of bytes to display 2661 <2> ;; OUTPUTS: BX reset to zero 2662 <2> ;; 2663 <2> ;; REGS USED: 2664 <2> ;; 2665 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2666 <2> ;; 2667 <2> $M_FLUSH_BUF PROC NEAR ;;AN000;; 2668 <2> ;; 2669 <2> PUSH CX ;;AN000;; Save changed regs 2670 <2> PUSH ES ;;AN000;; 2671 <2> PUSH DI ;;AN000;; 2672 <2> PUSH DS ;;AN000;; Set ES pointing to buffer 2673 <2> POP ES ;;AN000;; 2674 <2> ;; 2675 <2> MOV CX,BX ;;AN000;; Set number of bytes to display 2676 <2> XOR BX,BX ;;AN000;; Reset buffer counter 2677 <2> LEA DI,[$M_RT + $M_TEMP_BUF] ;;AN000;; Reset buffer location pointer 2678 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer 2679 <2> ;; 2680 <2> ; $IF NC ;;AN000;; Error? 2681 <2> JC $MIF314 2682 <2> POP DI ;;AN000;; No, Restore changed regs 2683 <2> POP ES ;;AN000;; 2684 <2> POP CX ;;AN000;; 2685 <2> ; $ELSE ;;AN000;; Yes, 2686 <2> JMP SHORT $MEN314 2687 <2> $MIF314: 2688 <2> ADD SP,6 ;;AN000;; Fix stack 2689 <2> STC ;;AN000;; 2690 <2> ; $ENDIF ;;AN000;; Error? 2691 <2> $MEN314: 2692 <2> ;; 2693 <2> RET ;;AN000;; Return 2694 <2> ;; 2695 <2> $M_FLUSH_BUF ENDP ;;AN000;; 2696 <2> ;; 2697 <2> ;; 2698 <2> %IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace? 2699 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2700 <2> %iassign $M_CHAR_ONLY TRUE ;;AN000;; replacement code later 2701 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2702 <2> ;; 2703 <2> ;; PROC NAME: $M_CHAR_REPLACE 2704 <2> ;; 2705 <2> ;; FUNCTION: Will prepare a single char or ASCIIZ string for replace 2706 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2707 <2> ;; ES:DI contains the VALUE from SUBLIST 2708 <2> ;; OUTPUTS: CX contains number of characters on stack 2709 <2> ;; Top of stack --> Last character 2710 <2> ;; . . . 2711 <2> ;; Bot of stack --> First character 2712 <2> ;; 2713 <2> ;; OTHER REGS Revised: AX 2714 <2> ;; 2715 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2716 <2> ;; 2717 <2> $M_CHAR_REPLACE PROC NEAR ;;AN000;; 2718 <2> ;; 2719 <2> POP BP ;;AN000;; Save return address 2720 <2> TEST byte [$M_SL + $M_S_FLAG],~ Char_Field_Char & $M_SIZE_MASK ;;AN000;; Was Character specified? 2721 <2> ; $IF Z ;;AN000;; Yes, 2722 <2> JNZ $MIF317 2723 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2724 <2> PUSH AX ;;AN000;; Put it on the stack 2725 <2> INC CX ;;AN000;; Increase the count 2726 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 2727 <2> ; $IF C ;;AN000;; Yes, 2728 <2> JNC $MIF318 2729 <2> MOV AL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 2730 <2> PUSH AX ;;AN000;; Put it on the stack 2731 <2> CLC ;;AN000;; Clear the carry 2732 <2> ; $ENDIF ;;AN000;; 2733 <2> $MIF318: 2734 <2> ; $ELSE ;;AN000;; No, it was an ASCIIZ string 2735 <2> JMP SHORT $MEN317 2736 <2> $MIF317: 2737 <2> ; $DO ;;AN000;; 2738 <2> $MDO321: 2739 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2740 <2> OR AL,AL ;;AN000;; Is it the NULL? 2741 <2> ; $LEAVE Z ;;AN000;; No, 2742 <2> JZ $MEN321 2743 <2> INC DI ;;AN000;; Next character 2744 <2> INC CX ;;AN000;; Increment the count 2745 <2> ; $ENDDO ;;AN000;; Yes, 2746 <2> JMP SHORT $MDO321 2747 <2> $MEN321: 2748 <2> SUB DI,CX ;;AN000;; Set SI at the beginning of the string 2749 <2> ; $ENDIF ;;AN000;; 2750 <2> $MEN317: 2751 <2> ;;AN000;; 2752 <2> PUSH BP ;;AN000;; Restore return address 2753 <2> RET ;;AN000;; Return 2754 <2> ;; 2755 <2> $M_CHAR_REPLACE ENDP ;;AN000;; 2756 <2> ;; 2757 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2758 <2> %ENDIF ;;AN000;; END of include of CHAR replace code 2759 <2> ; 2760 <2> %IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace? 2761 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2762 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2763 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2764 <2> ;; 2765 <2> ;; PROC NAME: $M_BIN2ASC_REPLACE 2766 <2> ;; 2767 <2> ;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string 2768 <2> ;; and prepare to display 2769 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2770 <2> ;; ES:DI contains the VALUE from SUBLIST 2771 <2> ;; OUTPUTS: CX contains number of characters on stack 2772 <2> ;; Top of stack --> Last character 2773 <2> ;; . . . 2774 <2> ;; Bot of stack --> First character 2775 <2> ;; OTHER REGS Revised: BX,DX,AX 2776 <2> ;; 2777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2778 <2> ;; 2779 <2> $M_BIN2ASC_REPLACE PROC NEAR ;;AN000;; 2780 <2> ;; 2781 <2> POP BP ;;AN000;; Save return address 2782 <2> ;; 2783 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2784 <2> XOR AX,AX ;;AN000;; Prepare for get binary value (LOW) 2785 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE16 ;;AN000;; Set default divisor 2786 <2> XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable) 2787 <2> %IFN COMR 2788 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_BYTE & $M_SIZE_MASK ;;AN000;; Was BYTE specified? 2789 <2> ; $IF Z ;;AN000;; 2790 <2> JNZ $MIF325 2791 <2> MOV AL, BYTE PTR [ES:DI] ;;AN000;; Setup byte in AL 2792 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2793 <2> ; $IF Z ;;AN000;; 2794 <2> JNZ $MIF326 2795 <2> TEST AL,10000000b ;;AN000;; Is this number negative? 2796 <2> ; $IF NZ ;;AN000;; Yes, 2797 <2> JZ $MIF327 2798 <2> INC BX ;;AN000;; Remember that it was negative 2799 <2> AND AL,01111111b ;;AN000;; Make it positive 2800 <2> ; $ENDIF ;;AN000;; 2801 <2> $MIF327: 2802 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2803 <2> ; $ENDIF ;;AN000;; 2804 <2> $MIF326: 2805 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2806 <2> ; $IF Z ;;AN000;; 2807 <2> JNZ $MIF330 2808 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2809 <2> ; $ENDIF ;;AN000;; 2810 <2> $MIF330: 2811 <2> ; $ELSE ;;AN000;; 2812 <2> JMP SHORT $MEN325 2813 <2> $MIF325: 2814 <2> %ENDIF 2815 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_WORD & $M_SIZE_MASK ;;AN000;; Was WORD specified? 2816 <2> ; $IF Z ;;AN000;; 2817 <2> JNZ $MIF333 2818 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup byte in AL 2819 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;; AN000;; Was Signed binary specified? 2820 <2> ; $IF Z ;;AN000;; 2821 <2> JNZ $MIF334 2822 <2> TEST AH,10000000b ;;AN000;; Is this number negative? 2823 <2> ; $IF NZ ;;AN000;; Yes, 2824 <2> JZ $MIF335 2825 <2> INC BX ;;AN000;; Remember that it was negative 2826 <2> AND AH,01111111b ;;AN000;; Make it positive 2827 <2> ; $ENDIF ;;AN000;; 2828 <2> $MIF335: 2829 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2830 <2> ; $ENDIF ;;AN000;; 2831 <2> $MIF334: 2832 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2833 <2> ; $IF Z ;;AN000;; 2834 <2> JNZ $MIF338 2835 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2836 <2> ; $ENDIF ;;AN000;; 2837 <2> $MIF338: 2838 <2> ; $ELSE ;;AN000;; 2839 <2> JMP SHORT $MEN333 2840 <2> $MIF333: 2841 <2> %IFN COMR 2842 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup Double word in DX:AX 2843 <2> MOV DX, WORD PTR [ES:DI + 2] ;;AN000;; 2844 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2845 <2> ; $IF Z ;;AN000;; 2846 <2> JNZ $MIF341 2847 <2> TEST DH,10000000b ;;AN000;; Is this number negative? 2848 <2> ; $IF NZ ;;AN000;; Yes, 2849 <2> JZ $MIF342 2850 <2> INC BX ;;AN000;; Remember that it was negative 2851 <2> AND DH,01111111b ;;AN000;; Make it positive 2852 <2> ; $ENDIF ;;AN000;; 2853 <2> $MIF342: 2854 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2855 <2> ; $ENDIF ;;AN000;; 2856 <2> $MIF341: 2857 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2858 <2> ; $IF Z ;;AN000;; 2859 <2> JNZ $MIF345 2860 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2861 <2> ; $ENDIF ;;AN000;; 2862 <2> $MIF345: 2863 <2> %ENDIF 2864 <2> ; $ENDIF ;;AN000;; 2865 <2> $MEN333: 2866 <2> ; $ENDIF ;;AN000;; 2867 <2> $MEN325: 2868 <2> ;; 2869 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string 2870 <2> %IFN COMR 2871 <2> OR BX,BX ;;AN000;; 2872 <2> ; $IF NZ ;;AN000;; Was number negative? 2873 <2> JZ $MIF349 2874 <2> XOR DX,DX ;;AN000;; Yes, 2875 <2> MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number 2876 <2> PUSH DX ;;AN000;; 2877 <2> ; $ENDIF ;;AN000;; No, 2878 <2> $MIF349: 2879 <2> %ENDIF 2880 <2> ;; 2881 <2> PUSH BP ;;AN000;; Restore return address 2882 <2> RET ;;AN000;; Return 2883 <2> ;; 2884 <2> $M_BIN2ASC_REPLACE ENDP ;;AN000;; 2885 <2> ;; 2886 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2887 <2> %ENDIF ;;AN000;; END of include of NUM replace code 2888 <2> ; 2889 <2> %IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace? 2890 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2891 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2892 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2893 <2> ;; 2894 <2> ;; PROC NAME: $M_DATE_REPLACE 2895 <2> ;; 2896 <2> ;; FUNCTION: Convert a date to a decimal ASCII string using current 2897 <2> ;; country format and prepare to display 2898 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2899 <2> ;; ES:DI points at VALUE from SUBLIST 2900 <2> ;; OUTPUTS: CX contains number of characters on stack 2901 <2> ;; Top of stack --> Last character 2902 <2> ;; . . . 2903 <2> ;; Bot of stack --> First character 2904 <2> ;; OTHER REGS Revised: DX, AX 2905 <2> ;; 2906 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2907 <2> ;; 2908 <2> $M_DATE_REPLACE PROC NEAR ;;AN000;; 2909 <2> ;; 2910 <2> POP BP ;;AN000;; Save return address 2911 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2912 <2> CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT 2913 <2> ;;AN000;; All O.K.? 2914 <2> XOR DX,DX ;;AN000;; Reset DX value 2915 <2> XOR AX,AX ;;AN000;; Reset AX value 2916 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],0 ;;AN000;; USA Date Format 2917 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2918 <2> JNE $MIF351 2919 <2> CALL $M_YEAR ;;AN000;; Get Year 2920 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2921 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2922 <2> INC CX ;;AN000;; Increment count 2923 <2> XOR AX,AX ;;AN000;; Reset AX value 2924 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2925 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2926 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2927 <2> INC CX ;;AN000;; Increment count 2928 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2929 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2930 <2> ; $ENDIF ;;AN000;; 2931 <2> $MIF351: 2932 <2> ;; 2933 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],1 ;;AN000;; EUROPE Date Format 2934 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2935 <2> JNE $MIF353 2936 <2> CALL $M_YEAR ;;AN000;; Get Year 2937 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2938 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2939 <2> INC CX ;;AN000;; 2940 <2> XOR AX,AX ;;AN000;; Reset AX 2941 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2942 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2943 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2944 <2> INC CX ;;AN000;; 2945 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2946 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2947 <2> ; $ENDIF ;;AN000;; 2948 <2> $MIF353: 2949 <2> ;; 2950 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],2 ;;AN000;; JAPAN Date Format 2951 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2952 <2> JNE $MIF355 2953 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2954 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2955 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2956 <2> INC CX ;;AN000;; 2957 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2958 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2959 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2960 <2> INC CX ;;AN000;; 2961 <2> CALL $M_YEAR ;;AN000;; Get Year 2962 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2963 <2> ; $ENDIF ;;AN000;; 2964 <2> $MIF355: 2965 <2> ;; 2966 <2> PUSH BP ;;AN000;; Restore return address 2967 <2> RET ;;AN000;; Return 2968 <2> ;; 2969 <2> $M_DATE_REPLACE ENDP ;;AN000;; 2970 <2> ;; 2971 <2> $M_GET_DATE PROC NEAR ;;AN000;; 2972 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 2973 <2> MOV AL,0 ;;AN000;; Get current country info 2974 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 2975 <2> INT 21H ;;AN000;; 2976 <2> ; $IF C ;;AN000;; No, 2977 <2> JNC $MIF357 2978 <2> MOV WORD [$M_RT + $M_DATE_FORMAT],$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH) 2979 <2> MOV BYTE [$M_RT + $M_DATE_SEPARA],$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL) 2980 <2> ; $ENDIF ;;AN000;; 2981 <2> $MIF357: 2982 <2> RET ;;AN000;; 2983 <2> $M_GET_DATE ENDP ;;AN000;; 2984 <2> ;; 2985 <2> $M_YEAR PROC NEAR ;;AN000;; 2986 <2> MOV AX,WORD PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Year 2987 <2> TEST byte [$M_SL + $M_S_FLAG],Date_MDY_4 & $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified? 2988 <2> ; $IF Z ;;AN000;; 2989 <2> JNZ $MIF359 2990 <2> CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year 2991 <2> ; $IF A ;;AN000;; 2992 <2> JNA $MIF360 2993 <2> MOV AX,$M_MAX_2_YEAR ;;AN000;; 2994 <2> ; $ENDIF ;;AN000;; 2995 <2> $MIF360: 2996 <2> ; $ENDIF ;;AN000;; 2997 <2> $MIF359: 2998 <2> RET ;;AN000;; 2999 <2> $M_YEAR ENDP ;;AN000;; 3000 <2> ;; 3001 <2> $M_CONVERTDATE PROC NEAR ;;AN000;; 3002 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3003 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3004 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3005 <2> DEC CX ;;AN000;; Test if size only grew by 1 3006 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3007 <2> ; $IF E ;;AN000;; Yes, 3008 <2> JNE $MIF363 3009 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3010 <2> PUSH AX ;;AN000;; Save it 3011 <2> INC CX ;;AN000;; Count it 3012 <2> ; $ENDIF ;;AN000;; 3013 <2> $MIF363: 3014 <2> INC CX ;;AN000;; Restore CX 3015 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3016 <2> RET ;;AN000;; 3017 <2> $M_CONVERTDATE ENDP ;;AN000;; 3018 <2> ;; 3019 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3020 <2> %ENDIF ;;AN000;; END of include of DATE replace code 3021 <2> ; 3022 <2> %IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace? 3023 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 3024 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 3025 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3026 <2> ;; 3027 <2> ;; PROC NAME: $M_TIME_REPLACE 3028 <2> ;; 3029 <2> ;; FUNCTION: Convert a time to a decimal ASCII string 3030 <2> ;; and prepare to display 3031 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 3032 <2> ;; ES:DI points at VALUE from SUBLIST 3033 <2> ;; OUTPUTS: CX contains number of characters on stack 3034 <2> ;; Top of stack --> Last character 3035 <2> ;; . . . 3036 <2> ;; Bot of stack --> First character 3037 <2> ;; REGS USED: BP,CX,AX 3038 <2> ;; 3039 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3040 <2> ;; 3041 <2> $M_TIME_REPLACE PROC NEAR ;;AN000;; 3042 <2> ;; 3043 <2> POP BP ;;AN000;; Save return address 3044 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 3045 <2> CALL $M_GET_TIME ;;AN000;; All O.K.? 3046 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3047 <2> ; $IF NZ ;;AN000;; Yes, 3048 <2> JZ $MIF365 3049 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3050 <2> ; $IF E ;;AN000;; Yes, 3051 <2> JNE $MIF366 3052 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3053 <2> CMP AL,12 ;;AN000;; Is hour 12 or less? 3054 <2> ; $IF L,OR ;;AN000;; or 3055 <2> JL $MLL367 3056 <2> CMP AL,23 ;;AN000;; Is hour 24 or greater? 3057 <2> ; $IF G ;;AN000;; Yes, 3058 <2> JNG $MIF367 3059 <2> $MLL367: 3060 <2> MOV AL,$M_AM ;;AN000;; 3061 <2> PUSH AX ;;AN000;; Push an "a" to represent AM. 3062 <2> INC CX ;;AN000;; 3063 <2> ; $ELSE ;;AN000;; No, 3064 <2> JMP SHORT $MEN367 3065 <2> $MIF367: 3066 <2> MOV AL,$M_PM ;;AN000;; 3067 <2> PUSH AX ;;AN000;; Push an "p" to represent PM. 3068 <2> INC CX ;;AN000;; 3069 <2> ; $ENDIF ;;AN000;; 3070 <2> $MEN367: 3071 <2> ; $ENDIF ;;AN000;; 3072 <2> $MIF366: 3073 <2> ; $ENDIF ;;AN000;; 3074 <2> $MIF365: 3075 <2> ;; 3076 <2> XOR AX,AX ;;AN000;; 3077 <2> XOR DX,DX ;;AN000;; 3078 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3079 <2> ; $IF NZ ;;AN000;; 3080 <2> JZ $MIF372 3081 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Hundreds 3082 <2> CALL $M_CONVERTTIME ;;AN000;; 3083 <2> PUSH WORD [$M_RT + $M_DECI_SEPARA] ;;AN000;; 3084 <2> INC CX ;;AN000;; 3085 <2> ; $ENDIF ;;AN000;; 3086 <2> $MIF372: 3087 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3088 <2> ; $IF NZ,OR ;;AN000;; 3089 <2> JNZ $MLL374 3090 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSS_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? 3091 <2> ; $IF NZ ;;AN000;; 3092 <2> JZ $MIF374 3093 <2> $MLL374: 3094 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Seconds 3095 <2> CALL $M_CONVERTTIME ;;AN000;; 3096 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3097 <2> INC CX ;;AN000;; 3098 <2> ; $ENDIF ;;AN000;; 3099 <2> $MIF374: 3100 <2> ;; Do Hour/Min (12 Hour) 3101 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+1] ;;AN000;; Get Minutes 3102 <2> CALL $M_CONVERTTIME ;;AN000;; 3103 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3104 <2> INC CX ;;AN000;; 3105 <2> ;; 3106 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3107 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3108 <2> ; $IF NZ ;;AN000;; Yes, 3109 <2> JZ $MIF376 3110 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3111 <2> ; $IF E ;;AN000;; Yes, 3112 <2> JNE $MIF377 3113 <2> CMP AL,13 ;;AN000;; Is hour less than 12? 3114 <2> ; $IF GE ;;AN000;; Yes, 3115 <2> JNGE $MIF378 3116 <2> SUB AL,12 ;;AN000;; Set to a 12 hour value 3117 <2> ; $ENDIF ;;AN000;; 3118 <2> $MIF378: 3119 <2> CMP AL,0 ;;AN000;; Is hour less than 12? 3120 <2> ; $IF E ;;AN000;; Yes, 3121 <2> JNE $MIF380 3122 <2> MOV AL,12 ;;AN000;; Set to a 12 hour value 3123 <2> ; $ENDIF ;;AN000;; 3124 <2> $MIF380: 3125 <2> ; $ENDIF ;;AN000;; 3126 <2> $MIF377: 3127 <2> ; $ENDIF ;;AN000;; 3128 <2> $MIF376: 3129 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII 3130 <2> ;; 3131 <2> PUSH BP ;;AN000;; Restore return address 3132 <2> RET ;;AN000;; Return 3133 <2> ;; 3134 <2> $M_TIME_REPLACE ENDP ;;AN000;; 3135 <2> ;; 3136 <2> $M_GET_TIME PROC NEAR ;;AN000;; 3137 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 3138 <2> MOV AL,0 ;;AN000;; Get current country info 3139 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 3140 <2> INT 21H ;;AN000;; 3141 <2> ; $IF C ;;AN000;; No, 3142 <2> JNC $MIF384 3143 <2> MOV WORD [$M_RT + $M_TIME_FORMAT],$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH) 3144 <2> MOV BYTE [$M_RT + $M_TIME_SEPARA],$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL) 3145 <2> MOV BYTE [$M_RT + $M_DECI_SEPARA],$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL) 3146 <2> ; $ENDIF ;;AN000;; 3147 <2> $MIF384: 3148 <2> RET ;;AN000;; 3149 <2> $M_GET_TIME ENDP ;;AN000;; 3150 <2> ;; 3151 <2> $M_CONVERTTIME PROC NEAR ;;AN000;; 3152 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3153 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3154 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3155 <2> DEC CX ;;AN000;; Test if size only grew by 1 3156 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3157 <2> ; $IF E ;;AN000;; Yes, 3158 <2> JNE $MIF386 3159 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3160 <2> PUSH AX ;;AN000;; Save it 3161 <2> INC CX ;;AN000;; Count it 3162 <2> ; $ENDIF ;;AN000;; 3163 <2> $MIF386: 3164 <2> INC CX ;;AN000;; Restore CX 3165 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3166 <2> RET ;;AN000;; 3167 <2> $M_CONVERTTIME ENDP ;;AN000;; 3168 <2> ;; 3169 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3170 <2> %ENDIF ;;AN000;; END of include of TIME replace 3171 <2> %ENDIF ;;AN000;; END of include of Replacement common code 3172 <2> ; 3173 <2> %IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace? 3174 <2> INPUTmsg equ FALSE ;;AN000;; Yes, THEN include it and reset the flag 3175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3176 <2> ;; 3177 <2> ;; PROC NAME: $M_WAIT_FOR_INPUT 3178 <2> ;; 3179 <2> ;; FUNCTION: To accept keyed input and return extended key value 3180 <2> ;; in AX register 3181 <2> ;; INPUTS: DL contains the DOS function requested for input 3182 <2> ;; OUPUTS: AX contains the extended key value that was read 3183 <2> ;; REGS USED: 3184 <2> ;; 3185 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3186 <2> ;; 3187 <2> $M_WAIT_FOR_INPUT PROC NEAR ;;AN000;; 3188 <2> ;; 3189 <2> PUSH CX ;;AN000;; Save CX 3190 <2> PUSH DX ;;AN000;; Save DX 3191 <2> PUSH DS ;;AN000;; Save Data segment 3192 <2> ;; 3193 <2> CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? 3194 <2> ; $IF A ;;AN001;; Yes, 3195 <2> JNA $MIF388 3196 <2> MOV AL,DL ;;AN001;; Mov function into AL 3197 <2> AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble 3198 <2> MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function 3199 <2> ; $ELSE ;;AN001;; No, 3200 <2> JMP SHORT $MEN388 3201 <2> $MIF388: 3202 <2> MOV AH,DL ;;AN000;; Put DOS function in AH 3203 <2> ; $ENDIF ;;AN001;; 3204 <2> $MEN388: 3205 <2> PUSH ES ;;AN000;; Get output buffer segment 3206 <2> POP DS ;;AN000;; 3207 <2> MOV DX,DI ;;AN000;; Get output buffer offset in case needed 3208 <2> INT 21H ;;AN000;; Get keyboard input 3209 <2> POP DS ;;AN000;; 3210 <2> 3211 <2> CMP DL,DOS_BUF_KEYB_INP ;;AN000;; 3212 <2> CLC ;;AN000;; 3213 <2> ; $IF NE ;;AN000;; If character input 3214 <2> JE $MIF391 3215 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? 3216 <2> ; $IF C ;;AN000;; 3217 <2> JNC $MIF392 3218 <2> MOV CL,AL ;;AN000;; Save first character 3219 <2> MOV AH,DL ;;AN001;; Get back function 3220 <2> INT 21H ;;AN000;; Get keyboard input 3221 <2> MOV AH,CL ;;AN000;; Retreive first character AX = xxxx 3222 <2> CLC ;;AN000;; Clear carry condition 3223 <2> ; $ELSE ;;AN000;; 3224 <2> JMP SHORT $MEN392 3225 <2> $MIF392: 3226 <2> MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS 3227 <2> ; $ENDIF ;;AN000;; 3228 <2> $MEN392: 3229 <2> ; $ENDIF ;;AN000;; 3230 <2> $MIF391: 3231 <2> ;; 3232 <2> ; $IF NC ;;AN000;; 3233 <2> JC $MIF396 3234 <2> POP DX ;;AN000;; 3235 <2> POP CX ;;AN000;; 3236 <2> ; $ELSE ;;AN000;; 3237 <2> JMP SHORT $MEN396 3238 <2> $MIF396: 3239 <2> ADD SP,4 ;;AN000;; 3240 <2> STC ;;AN000;; Reset carry flag 3241 <2> ; $ENDIF ;;AN000;; 3242 <2> $MEN396: 3243 <2> RET ;;AN000;; Return 3244 <2> ;; 3245 <2> $M_WAIT_FOR_INPUT ENDP ;;AN000;; 3246 <2> ;; 3247 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3248 <2> %ENDIF ;;AN000;; END of include of Wait for Input 3249 <2> %ENDIF ;;AN000;; END of include of SYSDISPMSG 3250 <2> %ENDIF ;;AN000;; END of include of MSG_DATA_ONLY 3251 <2> %ENDIF ;;AN000;; END of include of Structure only 3252 <2> 3253 <2> ;=== Pop trace listing source 3254 <2> 437 <1> 438 <1> %ENDIF 439 <1> 11 ; (no prior section) ; data ends 12 13 section code 14 15 amis_sign: 16 17 Msg_Services "NEARmsg" 364 <1> %iassign $M_SERVICE FALSE 365 <1> %rep %0 366 <1> %iassign $M_INCLUDE TRUE 367 <1> %iassign MSG_SERVICES_MATCHED 0 368 <1> %ifidni %1, "MSGDATA" 369 <1> %iassign MSGDATA TRUE 370 <1> %iassign $M_SERVICE TRUE 371 <1> %iassign $M_INCLUDE FALSE 372 <1> %iassign MSG_SERVICES_MATCHED 1 373 <1> %else 374 <1> %iassign $M_MSGDATA_ONLY FALSE 375 <1> %endif 376 <1> 377 <1> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <1> 379 <1> %ifidni %1,"COMR" 380 <1> %iassign COMR TRUE 381 <1> %iassign $M_SERVICE TRUE 382 <1> %iassign $M_INCLUDE FALSE 383 <1> %iassign MSG_SERVICES_MATCHED 1 384 <1> %elifidni %1,"COMT" 385 <1> %iassign COMT TRUE 386 <1> %iassign $M_SERVICE TRUE 387 <1> %iassign $M_INCLUDE FALSE 388 <1> %iassign MSG_SERVICES_MATCHED 1 389 <1> %elifidni %1,"SETSTDIO" 390 <1> %iassign SETSTDIO TRUE 391 <1> %iassign $M_SERVICE TRUE 392 <1> %iassign $M_INCLUDE FALSE 393 <1> %iassign MSG_SERVICES_MATCHED 1 394 <1> %elifidni %1,"NOCHECKSTDIN" 395 <1> %iassign NOCHECKSTDIN TRUE 396 <1> %iassign $M_SERVICE TRUE 397 <1> %iassign $M_INCLUDE FALSE 398 <1> %iassign MSG_SERVICES_MATCHED 1 399 <1> %elifidni %1,"NOCHECKSTDOUT" 400 <1> %iassign NOCHECKSTDOUT TRUE 401 <1> %iassign $M_SERVICE TRUE 402 <1> %iassign $M_INCLUDE FALSE 403 <1> %iassign MSG_SERVICES_MATCHED 1 404 <1> %elifidni %1,"DISK_PROC" 405 <1> %iassign DISK_PROC TRUE 406 <1> %iassign $M_SERVICE TRUE 407 <1> %iassign $M_INCLUDE FALSE 408 <1> %iassign MSG_SERVICES_MATCHED 1 409 <1> %endif 410 <1> 411 <1> %IF $M_INCLUDE 412 <1> %define %%string %1 413 <1> %strlen %%length %%string 414 <1> %assign %%ii 1 415 <1> %define %%name "" 416 <1> %rep %%length 417 <1> %substr %%cc %%string %%ii 418 <1> %assign %%ii %%ii + 1 419 <1> %if %%cc >= 'A' && %%cc <= 'Z' 420 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <1> %endif 422 <1> %strcat %%name %%name,%%cc 423 <1> %endrep 424 <1> %ifidni %%name, "format.ctl" 425 <1> 426 <1> %else 427 <1> %include %%name 428 <1> %endif 429 <1> %ENDIF 430 <1> 431 <1> %rotate 1 432 <1> %endrep 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 433 <1> 434 <1> %IF $M_SERVICE 435 <1> 436 <1> %include "msgserv.nas" 1 <2> ;=== Push trace listing source: msgserv.nas 2 <2> 3 <2> ; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * * 4 <2> ; 5 <2> ; MODULE NAME: MSGSERV.SAL 6 <2> ; 7 <2> ; DESCRIPTIVE NAME: Message Services SALUT file 8 <2> ; 9 <2> ; FUNCTION: This module incorporates all the messages services and 10 <2> ; is called upon at build time to INCLUDE the code requested 11 <2> ; by a utility. Code is requested using the macro MSG_SERVICES. 12 <2> ; 13 <2> ; ENTRY POINT: Since this a collection of subroutines, entry point is at 14 <2> ; requested procedure. 15 <2> ; 16 <2> ; INPUT: Since this a collection of subroutines, input is dependent on function 17 <2> ; requested. 18 <2> ; 19 <2> ; EXIT-NORMAL: In all cases, CARRY FLAG = 0 20 <2> ; 21 <2> ; EXIT-ERROR: In all cases, CARRY FLAG = 1 22 <2> ; 23 <2> ; INTERNAL REFERENCES: (list of included subroutines) 24 <2> ; 25 <2> ; - SYSLOADMSG 26 <2> ; - SYSDISPMSG 27 <2> ; - SYSGETMSG 28 <2> ; 29 <2> ; 30 <2> ; EXTERNAL REFERENCES: None 31 <2> ; 32 <2> ; NOTES: At build time, some modules must be included. These are only included 33 <2> ; once using assembler switches. Other logic is included at the request 34 <2> ; of the utility. 35 <2> ; 36 <2> ; COMR and COMT are assembler switches to conditionally assemble code 37 <2> ; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident 38 <2> ; storage and multiple EQUates. 39 <2> ; 40 <2> ; REVISION HISTORY: Created MAY 1987 41 <2> ; 42 <2> ; Label: DOS - - Message Retriever 43 <2> ; (c) Copyright 1988 Microsoft 44 <2> ; 45 <2> ; 46 <2> ; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * * 47 <2> ; Page 48 <2> 49 <2> ; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting 50 <2> 51 <2> %IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN 52 <2> %iassign $M_STRUC FALSE ;;AN000;; Let the assembler know that we have 53 <2> ;;AN000;; and include them 54 <2> 55 <2> ; PAGE 56 <2> ; SUBTTL DOS - Message Retriever - MSGSTR.INC Module 57 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 58 <2> ;; 59 <2> ;; STRUCTURE: $M_SUBLIST_STRUC 60 <2> ;; 61 <2> ;; Replacable parameters are described by a sublist structure 62 <2> ;; 63 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 64 <2> ;; 65 <2> $M_SUBLIST_STRUC STRUC ;;AN000;; 66 <2> ;; 67 <2> $M_S_SIZE DB ? ;11 ;;AN000;; SUBLIST size (PTR to next SUBLIST) 68 <2> $M_S_RESV DB ? ;0 ;;AN000;; RESERVED 69 <2> $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item 70 <2> $M_S_ID DB ? ;;AN000;; n of %n 71 <2> $M_S_FLAG DB ? ;;AN000;; Data-type flags 72 <2> $M_S_MAXW DB ? ;;AN000;; Maximum field width 73 <2> $M_S_MINW DB ? ;;AN000;; Minimum field width 74 <2> $M_S_PAD DB ? ;;AN000;; Character for Pad field 75 <2> ;; 76 <2> $M_SUBLIST_STRUC ENDS ;;AN000;; 77 <2> ;; 78 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 79 <2> ;; 80 <2> ;; STRUCTURE: $M_CLASS_ID 81 <2> ;; 82 <2> ;; Each class will be defined by this structure. 83 <2> ;; 84 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 85 <2> ;; 86 <2> EXPECTED_VERSION equ expected_version ; NASM port equate 87 <2> 88 <2> $M_CLASS_ID STRUC ;;AN000;; 89 <2> ;; 90 <2> $M_CLS_ID DB ? ;-1 ;;AN000;; Class identifer 91 <2> $M_COMMAND_VER DW ? ;EXPECTED_VERSION ;;AN003;; COMMAND.COM version check 92 <2> $M_NUM_CLS_MSG DB ? ;0 ;;AN000;; Total number of message in class 93 <2> ;; 94 <2> $M_CLASS_ID ENDS ;; 95 <2> ;;AN000;; 96 <2> $M_CLASS_ID_SZ EQU $M_CLASS_ID_struc_size ;;AN000;; 97 <2> ;; 98 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 99 <2> ;; 100 <2> ;; STRUCTURE: $M_ID_STRUC 101 <2> ;; 102 <2> ;; Each message will be defined by this structure. 103 <2> ;; 104 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 105 <2> ;; 106 <2> $M_ID STRUC ;;AN000;; 107 <2> ;; 108 <2> $M_NUM DW ? ;-1 ;;AN000;; Message Number 109 <2> $M_TXT_PTR DW ? ;;AN000;; Pointer to message text 110 <2> ;; 111 <2> $M_ID ENDS ;;AN000;; 112 <2> ;;AN000;; Status Flag Values: 113 <2> $M_ID_SZ EQU $M_ID_struc_size ;;AN000;; 114 <2> ;; 115 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 116 <2> ;; 117 <2> ;; STRUCTURE: $M_RES_ADDRS 118 <2> ;; 119 <2> ;; Resident data area definition of variables 120 <2> ;; 121 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 122 <2> ;; 123 <2> $M_RES_ADDRS STRUC ;;AN000;; 124 <2> ;; 125 <2> $M_EXT_ERR_ADDRS DD ? ;0 ;;AN000;; Allow pointers to THREE Extended error locations 126 <2> $M_EXT_FILE DD ? ;0 ;;AN001;; 127 <2> $M_EXT_COMMAND DD ? ;0 ;;AN000;; 128 <2> $M_EXT_TERM DD ? ;-1 ;;AN000;; 129 <2> $M_PARSE_COMMAND DD ? ;0 ;;AN000;; 130 <2> $M_PARSE_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Parse error locations 131 <2> $M_PARSE_TERM DD ? ;-1 ;;AN000;; 132 <2> $M_CRIT_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Critical error locations 133 <2> $M_CRIT_COMMAND DD ? ;0 ;;AN000;; 134 <2> $M_CRIT_TERM DD ? ;-1 ;;AN000;; 135 <2> $M_DISK_PROC_ADDR DD ? ;-1 ;;AN004;; Address of READ_DISK_PROC 136 <2> $M_CLASS_ADDRS DD $M_NUM_CLS DUP (?) ;(0) ;;AN000;; Allow pointers to specified classes 137 <2> $M_CLS_TERM DD ? ;-1 ;;AN000;; 138 <2> $M_DBCS_VEC DD ? ;0 ;;AN000;; Save DBCS vector 139 <2> $M_HANDLE DW ? ;;AN000;; 140 <2> $M_SIZE DB ? ;0 ;;AN000;; 141 <2> $M_CRLF DB ?,? ;0DH,0AH ;;AN004;; CR LF message 142 <2> $M_CLASS DB ? ;;AN004;; Saved class 143 <2> $M_RETURN_ADDR DW ? ;;AN000;; 144 <2> $M_MSG_NUM DW ? ;$M_NULL ;;AN000;; 145 <2> $M_DIVISOR DW ? ;10 ;;AN000;; Default = 10 (must be a WORD for division) 146 <2> $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP (?) ;("$") ;;AN000;; Temporary buffer 147 <2> $M_BUF_TERM DB ? ;"$" ;;AN000;; 148 <2> 149 <2> $M_RES_ADDRS ENDS ;;AN000;; 150 <2> ;; 151 <2> $M_RES_ADDRS_SZ EQU $M_RES_ADDRS_struc_size ;;AN000;; 152 <2> ;; 153 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 154 <2> ;; 155 <2> ;; STRUCTURE: $M_COUNTRY_INFO 156 <2> ;; 157 <2> ;; Important fields of the Get Country Information call 158 <2> ;; 159 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 160 <2> ;; 161 <2> $M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation 162 <2> ;; 163 <2> $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc 164 <2> $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format 165 <2> $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;; 166 <2> $M_THOU_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Thou Separator 167 <2> $M_DECI_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Decimal Separator 168 <2> $M_DATE_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Date Separator 169 <2> $M_TIME_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Time Separator 170 <2> $M_CURR_FORMAT DB ? ;;AN000;; 171 <2> $M_SIG_DIGS_CU DB ? ;;AN000;; 172 <2> $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format 173 <2> ;; 174 <2> $M_COUNTRY_INFO ENDS ;;AN000;; 175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 176 <2> ;; 177 <2> %ELSE ;;AN000;; ELSE if we have already included the STRUCTURES 178 <2> ; 179 <2> ; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section 180 <2> 181 <2> %IF MSGDATA ;;AN000;; IF this is a request to include the data area 182 <2> %iassign MSGDATA FALSE ;;AN000;; Let the assembler know not to include it again 183 <2> ;;AN000;; and include it 184 <2> ; PAGE 185 <2> ; SUBTTL DOS - Message Retriever - MSGRES.TAB Module 186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 187 <2> ;; 188 <2> ;; DATA NAME: $M_RES_TABLE 189 <2> ;; 190 <2> ;; REFERENCE LABEL: $M_RT 191 <2> ;; 192 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 193 <2> 194 <2> %if 0 ; disabled for now, figure out later 195 <2> %IF COMR ;;AN000;; Since COMMAND.COM includes this twice 196 <2> $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no 197 <2> $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur 198 <2> $M_ALTLABEL equ TRUE ;;AN000;; Flag that label was changed 199 <2> %ELSE ;;AN000;; 200 <2> $M_RT LABEL BYTE ;;AN000;; 201 <2> %ENDIF 202 <2> %endif 203 <2> $M_RT: ; NASM structure instance 204 <2> $M_RES_ADDRS_size equ $M_RES_ADDRS_struc_size ; NASM port equate 205 <2> istruc $M_RES_ADDRS 206 <2> at $M_EXT_ERR_ADDRS 207 <2> dd 0 208 <2> at $M_EXT_FILE 209 <2> dd 0 210 <2> at $M_EXT_COMMAND 211 <2> dd 0 212 <2> at $M_EXT_TERM 213 <2> dd -1 214 <2> at $M_PARSE_COMMAND 215 <2> dd 0 216 <2> at $M_PARSE_ADDRS 217 <2> dd 0 218 <2> at $M_PARSE_TERM 219 <2> dd -1 220 <2> at $M_CRIT_ADDRS 221 <2> dd 0 222 <2> at $M_CRIT_COMMAND 223 <2> dd 0 224 <2> at $M_CRIT_TERM 225 <2> dd -1 226 <2> at $M_DISK_PROC_ADDR 227 <2> dd -1 228 <2> at $M_CLASS_ADDRS 229 <2> times $M_NUM_CLS dd 0 230 <2> at $M_CLS_TERM 231 <2> dd -1 232 <2> at $M_DBCS_VEC 233 <2> dd 0 234 <2> at $M_HANDLE 235 <2> dw 0 236 <2> at $M_SIZE 237 <2> db 0 238 <2> at $M_CRLF 239 <2> db 0Dh, 0Ah 240 <2> at $M_CLASS 241 <2> db 0 242 <2> at $M_RETURN_ADDR 243 <2> dw 0 244 <2> at $M_MSG_NUM 245 <2> dw 0 246 <2> at $M_DIVISOR 247 <2> dw 10 248 <2> at $M_TEMP_BUF 249 <2> times $M_TEMP_BUF_SZ db "$" 250 <2> at $M_BUF_TERM 251 <2> db "$" 252 <2> iend 253 <2> ;; 254 <2> %include "copyrigh.mac" ;;AN001;; Include Copyright 1988 Microsoft 255 <2> ;; 256 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 257 <2> %ENDIF ;;AN000;; END of include of Data table 258 <2> 259 <2> ; 260 <2> %IFN $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN 261 <2> ;; don't include any more code 262 <2> ;;AN000;; Figure out what other code to include 263 <2> %IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code 264 <2> %IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it) 265 <2> $M_RT EQU $M_RT2 ;;AN003;; 266 <2> %ENDIF 267 <2> %iassign DISK_PROC FALSE ;;AN003;; Yes, THEN include it and reset flag 268 <2> ; PAGE 269 <2> ; SUBTTL DOS - Message Retriever - DISK_PROC Module 270 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 271 <2> ;; 272 <2> ;; PROC NAME: DISK_PROC 273 <2> ;; 274 <2> ;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended 275 <2> ;; errors from disk\diskette 276 <2> ;; INPUTS: AX has the message number 277 <2> ;; DX has the message class 278 <2> ;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is 279 <2> ;; assumed to be set!! 280 <2> ;; 281 <2> ;; OUTPUTS: ES:DI points to message length (BYTE) followed by text 282 <2> ;; 283 <2> ;; 284 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 285 <2> ;; 286 <2> PUBLIC READ_DISK_PROC ;; 287 <2> ;; 288 <2> READ_DISK_PROC PROC FAR ;;AN003;; 289 <2> 290 <2> PUSH AX ;;AN003;; Save everything 291 <2> PUSH BX ;;AN003;; 292 <2> PUSH DX ;;AN003;; 293 <2> PUSH SI ;;AN003;; 294 <2> PUSH BP ;;AN003;; 295 <2> PUSH DS ;;AN003;; 296 <2> PUSH DI ;;AN003;; 297 <2> MOV BP,AX ;;AN003;; Save message number 298 <2> MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function 299 <2> LEA SI,[COMSPEC wrt RESGROUP] ;;AN003;; Get addressibilty to COMMAND.COM 300 <2> PUSH CS ;;AN003;; 301 <2> POP DS ;;AN003;; 302 <2> MOV DI,-1 ;;AN003;; No extended attribute list 303 <2> MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error 304 <2> MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag 305 <2> INT 21H ;;AN003;; Open the file 306 <2> POP DI ;;AN003;; Retreive LSEEK pointer 307 <2> ;;AN003;; Error ? 308 <2> ; $IF NC,LONG ;;AN003;; No, 309 <2> JNC $MXL1 310 <2> JMP $MIF1 311 <2> $MXL1: 312 <2> PUSH DI ;;AN003;; Save LSEEK pointer 313 <2> MOV BX,AX ;;AN003;; Set handle in BX 314 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors 315 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 316 <2> MOV DX,DI ;;AN003;; 317 <2> INT 21H ;;AN003;; LSEEK the file 318 <2> POP DX ;;AN003;; Retreive LSEEK pointer 319 <2> ;;AN003;; Error ? 320 <2> ; $IF NC ;;AN003;; No, 321 <2> JC $MIF2 322 <2> INC CX ;;AN003;; Set flag to first pass 323 <2> ; $DO ;;AN003;; 324 <2> $MDO3: 325 <2> PUSH DX ;;AN003;; Save LSEEK pointer 326 <2> PUSH CX ;;AN003;; Save first pass flag 327 <2> PUSH AX ;;AN003;; Save number of messages (if set yet) 328 <2> XOR SI,SI ;;AN003;; Reset buffer index 329 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 330 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header 331 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 332 <2> INT 21H ;;AN003;; Read it 333 <2> MOV DI,DX ;;AN003;; 334 <2> POP AX ;;AN003;; 335 <2> POP CX ;;AN003;; 336 <2> OR CX,CX ;;AN003;; 337 <2> ; $IF NZ ;;AN003;; 338 <2> JZ $MIF4 339 <2> XOR CX,CX ;;AN003;; Set flag to second pass 340 <2> XOR AH,AH ;;AN003;; Get number of messages in class 341 <2> MOV AL,[DI + $M_NUM_CLS_MSG] ;;AN003;; 342 <2> MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index 343 <2> CMP word [DI + $M_COMMAND_VER],EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM? 344 <2> ; $ENDIF ;;AN003;; 345 <2> $MIF4: 346 <2> POP DX ;;AN003;; 347 <2> ; $IF Z ;;AN003;; Yes, 348 <2> JNZ $MIF6 349 <2> ; $SEARCH ;;AN003;; 350 <2> $MDO7: 351 <2> CMP BP,WORD PTR [$M_RT + $M_TEMP_BUF + SI] ;;AN003;; Is this the message I'm looking for? 352 <2> ; $EXITIF Z ;;AN003;; Yes, (ZF=1) 353 <2> JNZ $MIF7 354 <2> CLC ;;AN003;; Reset carry, exit search 355 <2> ; $ORELSE ;;AN003;; No, (ZF=0) 356 <2> JMP SHORT $MSR7 357 <2> $MIF7: 358 <2> ADD SI,$M_ID_SZ ;;AN003;; Increment index 359 <2> ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header 360 <2> DEC AX ;;AN003;; Decrement # of messages left 361 <2> ; $LEAVE Z ;;AN003;; Have we exhausted all messages? 362 <2> JZ $MEN7 363 <2> CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer? 364 <2> ; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1) 365 <2> JNA $MDO7 366 <2> $MEN7: 367 <2> STC ;;AN003;; Yes, (ZF=0) set error (ZF=0) 368 <2> ; $ENDSRCH ;;AN003;; 369 <2> $MSR7: 370 <2> ; $ELSE ;;AN003;; No, 371 <2> JMP SHORT $MEN6 372 <2> $MIF6: 373 <2> XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop 374 <2> STC ;;AN003;; Set Carry 375 <2> ; $ENDIF ;;AN003;; 376 <2> $MEN6: 377 <2> ; $ENDDO Z ;;AN003;; Get next buffer full if needed 378 <2> JNZ $MDO3 379 <2> ;;AN003;; Error ? 380 <2> ; $IF NC ;;AN003;; No, 381 <2> JC $MIF16 382 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message 383 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 384 <2> ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header 385 <2> ADD DX,WORD PTR [$M_RT + $M_TEMP_BUF + SI + 2] ;;AN003;; Add offset from msg structure 386 <2> INT 21H ;;AN003;; LSEEK the file 387 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 388 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message 389 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 390 <2> INT 21H ;;AN003;; Read it 391 <2> MOV DI,DX ;;AN003;; into the temp buffer 392 <2> PUSH DS ;;AN003;; into the temp buffer 393 <2> POP ES ;;AN003;; into the temp buffer 394 <2> ; $ENDIF ;;AN003;; 395 <2> $MIF16: 396 <2> ; $ENDIF ;;AN003;; 397 <2> $MIF2: 398 <2> PUSHF ;;AN003;; Close file handle 399 <2> MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle 400 <2> INT 21H ;;AN003;; 401 <2> $M_POPF ;;AN003;; 402 <2> ; $ENDIF ;;AN003;; Yes there was an error, 403 <2> $MIF1: 404 <2> POP DS ;;AN003;; 405 <2> POP BP ;;AN003;; 406 <2> POP SI ;;AN003;; 407 <2> POP DX ;;AN003;; 408 <2> POP BX ;;AN003;; 409 <2> POP AX ;;AN003;; 410 <2> ;;AN003;; abort everything 411 <2> RET ;;AN003;; 412 <2> 413 <2> READ_DISK_PROC ENDP ;;AN003;; 414 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 415 <2> %ENDIF ;;AN003;; END of include for DISK_PROC 416 <2> ; 417 <2> 418 <2> %IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO 419 <2> %iassign SETSTDIO FALSE ;;AN000;; Yes, THEN include it and reset flag 420 <2> ; PAGE 421 <2> ; SUBTTL DOS - Message Retriever - SETSTDIO Module 422 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 423 <2> ;; 424 <2> ;; PROC NAME: SETSTDIO 425 <2> ;; 426 <2> ;; FUNCTION: 427 <2> ;; INPUTS: 428 <2> ;; 429 <2> ;; OUPUTS: 430 <2> ;; 431 <2> ;; 432 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 433 <2> ;; 434 <2> %IF FARmsg ;AN001; 435 <2> SETSTDINON PROC FAR ;AN001; 436 <2> %ELSE ;AN001; 437 <2> SETSTDINON PROC NEAR ;AN001; 438 <2> %ENDIF ;AN001; 439 <2> PUSH AX ;AN002; Save changed regs 440 <2> PUSH BX ;AN002; 441 <2> PUSH DX ;AN002; 442 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 443 <2> MOV BX,STDIN ;AN001; 444 <2> XOR DX,DX ;AN001; 445 <2> INT 21H ;AN001; 446 <2> 447 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 448 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 449 <2> INT 21H ;AN001; 450 <2> POP DX ;AN002; Restore Regs 451 <2> POP BX ;AN002; 452 <2> POP AX ;AN002; 453 <2> 454 <2> RET ;AN001; 455 <2> ;AN001; 456 <2> SETSTDINON ENDP ;AN001; 457 <2> 458 <2> %IF FARmsg ;AN001; 459 <2> SETSTDINOFF PROC FAR ;AN001; 460 <2> %ELSE ;AN001; 461 <2> SETSTDINOFF PROC NEAR ;AN001; 462 <2> %ENDIF ;AN001; 463 <2> 464 <2> PUSH AX ;AN002; Save changed regs 465 <2> PUSH BX ;AN002; 466 <2> PUSH DX ;AN002; 467 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 468 <2> MOV BX,STDIN ;AN001; 469 <2> XOR DX,DX ;AN001; 470 <2> INT 21H ;AN001; 471 <2> 472 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 473 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 474 <2> INT 21H ;AN001; 475 <2> POP DX ;AN002; Restore Regs 476 <2> POP BX ;AN002; 477 <2> POP AX ;AN002; 478 <2> 479 <2> RET ;AN001; 480 <2> 481 <2> SETSTDINOFF ENDP ;AN001; 482 <2> 483 <2> %IF FARmsg ;AN001; 484 <2> SETSTDOUTON PROC FAR ;AN001; 485 <2> %ELSE ;AN001; 486 <2> SETSTDOUTON PROC NEAR ;AN001; 487 <2> %ENDIF ;AN001; 488 <2> 489 <2> PUSH AX ;AN002; Save changed regs 490 <2> PUSH BX ;AN002; 491 <2> PUSH DX ;AN002; 492 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 493 <2> MOV BX,STDOUT ;AN001; 494 <2> XOR DX,DX ;AN001; 495 <2> INT 21H ;AN001; 496 <2> 497 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 498 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 499 <2> INT 21H ;AN001; 500 <2> POP DX ;AN002; Restore Regs 501 <2> POP BX ;AN002; 502 <2> POP AX ;AN002; 503 <2> 504 <2> RET ;AN001; 505 <2> 506 <2> SETSTDOUTON ENDP ;AN001; 507 <2> 508 <2> %IF FARmsg ;AN001; 509 <2> SETSTDOUTOFF PROC FAR ;AN001; 510 <2> %ELSE ;AN001; 511 <2> SETSTDOUTOFF PROC NEAR 512 <2> %ENDIF ;AN001; 513 <2> 514 <2> PUSH AX ;AN002; Save changed regs 515 <2> PUSH BX ;AN002; 516 <2> PUSH DX ;AN002; 517 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 518 <2> MOV BX,STDOUT ;AN001; 519 <2> XOR DX,DX ;AN001; 520 <2> INT 21H ;AN001; 521 <2> 522 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 523 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 524 <2> INT 21H ;AN001; 525 <2> POP DX ;AN002; Restore Regs 526 <2> POP BX ;AN002; 527 <2> POP AX ;AN002; 528 <2> 529 <2> RET ;AN001; 530 <2> 531 <2> SETSTDOUTOFF ENDP ;AN001; 532 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 533 <2> %ENDIF ;;AN000;; END of include for SETSTDIO 534 <2> ; 535 <2> %IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ? 536 <2> %IF COMR ;;AN000;; 537 <2> $M_RT EQU $M_RT2 ;;AN000;; 538 <2> %ENDIF 539 <2> %iassign LOADmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 540 <2> ; PAGE 541 <2> ; SUBTTL DOS - Message Retriever - LOADMSG.ASM Module 542 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 543 <2> ;; 544 <2> ;; PROC NAME: SYSLOADMSG 545 <2> ;; 546 <2> ;; FUNCTION: 547 <2> ;; INPUTS: 548 <2> ;; 549 <2> ;; OUPUTS: 550 <2> ;; 551 <2> ;; 552 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 553 <2> ;; 554 <2> %IF FARmsg ;;AN000;; 555 <2> SYSLOADMSG PROC FAR ;;AN000;; 556 <2> %ELSE ;;AN000;; 557 <2> SYSLOADMSG PROC NEAR ;;AN000;; 558 <2> %ENDIF ;;AN000;; 559 <2> PUSH AX ;;AN000; 560 <2> PUSH BX ;;AN000; 561 <2> PUSH DX ;;AN000; 562 <2> PUSH ES ;;AN000; 563 <2> PUSH DI ;;AN000; 564 <2> XOR CX,CX ;;AN000; Reset to zero 565 <2> MOV ES,CX ;;AN000; 566 <2> XOR DI,DI ;;AN000; 567 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 568 <2> MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM 569 <2> INT 2FH ;;AN000;; Private interface 570 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 571 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND],DI ;;AN000;; 572 <2> ;; 573 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 574 <2> MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM 575 <2> INT 2FH ;;AN000;; Private interface 576 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 577 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND],DI ;;AN000;; 578 <2> ;; 579 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 580 <2> MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM 581 <2> INT 2FH ;;AN000;; Private interface 582 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 583 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND],DI ;;AN000;; 584 <2> 585 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 586 <2> MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE 587 <2> INT 2FH ;;AN001;; Private interface 588 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE+2],ES ;;AN001;; Move into first avaliable table location 589 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE],DI ;;AN001;; 590 <2> 591 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 592 <2> Extrn READ_DISK_PROC:Far ;;AN003;; 593 <2> %ELSE ;; 594 <2> %IF FARmsg ;;AN000;; 595 <2> CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 596 <2> %ELSE ;;AN000;; 597 <2> CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 598 <2> %ENDIF ;;AN000;; 599 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 600 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS],DI ;;AN000;; 601 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 602 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS],DI ;;AN000;; 603 <2> ;; 604 <2> %IF FARmsg ;;AN000;; 605 <2> CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 606 <2> %ELSE ;;AN000;; 607 <2> CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 608 <2> %ENDIF ;;AN000;; 609 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 610 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS],DI ;;AN000;; 611 <2> %ENDIF ;; 612 <2> ;; 613 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 614 <2> MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM 615 <2> INT 2FH ;;AN001;; Private interface 616 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR+2],ES ;;AN001;; Move into first avaliable table location 617 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR],DI ;;AN001;; 618 <2> 619 <2> $M_BUILD_PTRS $M_NUM_CLS ;;AN000;; Build all utility classes 620 <2> ;;AN000;; 621 <2> CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector 622 <2> 623 <2> %IFN NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed 624 <2> CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK 625 <2> %ENDIF ;;AN000;; 626 <2> ;;AN000;; 627 <2> %IFN NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed 628 <2> CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK 629 <2> %ENDIF ;;AN000;; 630 <2> ;;AN000;; 631 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 632 <2> CLC ;;AN000;; Make sure carry is clear 633 <2> %ELSE ;;AN000;; ELSE 634 <2> PUSH CX ;;AN000;; 635 <2> CALL $M_VERSION_CHECK ;;AN000;; Check Version 636 <2> %ENDIF ;;AN000;; 637 <2> ;; Error ? 638 <2> ; $IF NC ;;AN000;; No. 639 <2> JC $MIF20 640 <2> %IFN NOVERCHECKmsg ;;AN000;; IF version check was not supressed 641 <2> POP CX ;;AN000;; Reset stack 642 <2> %ENDIF ;;AN000;; 643 <2> POP DI ;;AN000;; Restore REGS 644 <2> POP ES ;;AN000;; 645 <2> POP DX ;;AN000;; 646 <2> POP BX ;;AN000;; 647 <2> POP AX ;;AN000;; 648 <2> ; $ELSE ;;AN000;; Yes, 649 <2> JMP SHORT $MEN20 650 <2> $MIF20: 651 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 652 <2> ADD SP,10 ;;AN000;; 653 <2> STC ;;AN000;; Reset carry flag 654 <2> %ELSE ;;AN000;; IF version check is to be supressed 655 <2> ADD SP,12 ;;AN000;; 656 <2> STC ;;AN000;; Reset carry flag 657 <2> %ENDIF ;;AN000;; IF version check is to be supressed 658 <2> ; $ENDIF ;;AN000;; 659 <2> $MEN20: 660 <2> RET ;;AN000;; 661 <2> ;; 662 <2> SYSLOADMSG ENDP ;;AN000;; 663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 664 <2> ; PAGE 665 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 666 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 667 <2> ;; 668 <2> ;; Proc Name: $M_GET_DBCS_VEC 669 <2> ;; 670 <2> ;; Function: Get the DBCS vector and save it for later use 671 <2> ;; 672 <2> ;; Inputs: None 673 <2> ;; 674 <2> ;; Outputs: None 675 <2> ;; 676 <2> ;; Regs Changed: 677 <2> ;; 678 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 679 <2> ;; 680 <2> $M_GET_DBCS_VEC PROC NEAR ;;AN000;; 681 <2> ;; 682 <2> PUSH AX ;;AN000;; Save character to check 683 <2> PUSH SI ;;AN000;; 684 <2> PUSH DS ;;AN000;; 685 <2> MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment 686 <2> INT 21H ;;AN000;; Get environment pointer 687 <2> PUSH DS ;;AN000;; Get environment pointer 688 <2> POP ES ;;AN000;; Get environment pointer 689 <2> POP DS ;;AN000;; Get environment pointer 690 <2> ; $IF NC ;;AN000;; 691 <2> JC $MIF23 692 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC],SI ;;AN000;; Save DBCS Vector 693 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC+2],ES ;;AN000;; 694 <2> ; $ENDIF ;;AN000;; 695 <2> $MIF23: 696 <2> POP SI ;;AN000;; 697 <2> POP AX ;;AN000;; Retrieve character to check 698 <2> RET ;;AN000;; Return 699 <2> ;; 700 <2> $M_GET_DBCS_VEC ENDP ;; 701 <2> ;; 702 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 703 <2> %IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ? 704 <2> %ELSE ;AN001; Yes, THEN include it 705 <2> ; PAGE 706 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc 707 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 708 <2> ;; 709 <2> ;; Proc Name: $M_CHECKSTDIN 710 <2> ;; 711 <2> ;; Function: 712 <2> ;; 713 <2> ;; Inputs: None 714 <2> ;; 715 <2> ;; Outputs: 716 <2> ;; 717 <2> ;; Regs Changed: 718 <2> ;; 719 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 720 <2> ;; 721 <2> $M_CHECKSTDIN PROC NEAR ;AN001; 722 <2> 723 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 724 <2> MOV BX,STDIN ;AN001; 725 <2> XOR DX,DX ;AN001; 726 <2> INT 21H ;AN001; 727 <2> 728 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 729 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 730 <2> INT 21H ;AN001; 731 <2> 732 <2> RET ;AN001; 733 <2> 734 <2> $M_CHECKSTDIN ENDP ;AN001; 735 <2> ;; 736 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 737 <2> %ENDIF ;AN001; END of include for EOF Check 738 <2> %IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full? 739 <2> %ELSE ;AN001; Yes, THEN include it 740 <2> ; PAGE 741 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc 742 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 743 <2> ;; 744 <2> ;; Proc Name: $M_CHECKSTDOUT 745 <2> ;; 746 <2> ;; Function: 747 <2> ;; 748 <2> ;; Inputs: None 749 <2> ;; 750 <2> ;; Outputs: 751 <2> ;; 752 <2> ;; Regs Changed: 753 <2> ;; 754 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 755 <2> ;; 756 <2> $M_CHECKSTDOUT PROC NEAR ;AN001; 757 <2> 758 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 759 <2> MOV BX,STDOUT ;AN001; 760 <2> XOR DX,DX ;AN001; 761 <2> INT 21H ;AN001; 762 <2> 763 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 764 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 765 <2> INT 21H ;AN001; 766 <2> 767 <2> RET ;AN001; 768 <2> 769 <2> $M_CHECKSTDOUT ENDP ;AN001; 770 <2> ;; 771 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 772 <2> %ENDIF ;AN001; END of include for Disk Full Check 773 <2> %IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check? 774 <2> %ELSE ;;AN000;; Yes, THEN include it 775 <2> ; PAGE 776 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 778 <2> ;; 779 <2> ;; Proc Name: $M_VERSION_CHECK 780 <2> ;; 781 <2> ;; Function: Determine if DOS version is within allowable limits 782 <2> ;; 783 <2> ;; Inputs: None 784 <2> ;; 785 <2> ;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version 786 <2> ;; Registers set for SYSDISPMSG 787 <2> ;; CARRY_FLAG = 0 if Correct DOS version 788 <2> ;; 789 <2> ;; Regs Changed: AX 790 <2> ;; 791 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 792 <2> 793 <2> check_amis: 794 <2> push ax 795 <2> push ds 796 <2> push si 797 <2> push es 798 <2> push di 799 <2> push dx 800 <2> push ax ; version number, last on stack 801 <2> 802 <2> mov ah, 0 ; multiplex number = 0 803 <2> .loop: 804 <2> mov al, 0 805 <2> int 2Dh ; installation check 806 <2> cmp al, -1 ; multiplexer installed ? 807 <2> jne .next ; no --> 808 <2> push cs 809 <2> pop ds 810 <2> mov si, offset amis_sign ; ds:si -> amis_sign (for lDOS) 811 <2> mov es, dx ; es:di -> multiplexer's sign 812 <2> mov cx, 8 ; 16 bytes 813 <2> repe cmpsw ; compare 814 <2> jne .next ; not us --> 815 <2> mov dx, cs ; dx:si -> amis_id 816 <2> mov al, 11h 817 <2> int 2Dh ; CHG: al, bx, cx, dx, si, di 818 <2> cmp al, 0 ; id call supported ? 819 <2> je .unsup ; no, allow if alt version --> 820 <2> pop dx 821 <2> xor dx, dx ; 2D.MM11 supported, mark that we need it 822 <2> push dx 823 <2> cmp al, 0F0h ; CY if below 0F0h 824 <2> jmp .done 825 <2> 826 <2> .next: 827 <2> inc ah ; next multiplex number 828 <2> jnz .loop ; ZR if done, NZ if more to check --> 829 <2> .unsup: 830 <2> stc ; multiplexer not found 831 <2> ; or function not supported 832 <2> .done: 833 <2> ; CY if not an lDOS revision with our id supported, 834 <2> ; on stack: alt_expected_version if it's fine and either 835 <2> ; no multiplexer or func 11h not supported 836 <2> ; new_expected_version if not fine and either 837 <2> ; no multiplexer or func 11h not suppprted, 838 <2> ; 0 if multiplexer found, func 11h supported, but 839 <2> ; our id is unsupported 840 <2> ; NC if lDOS revision with multiplexer and our id supported 841 <2> pop bx 842 <2> pop dx 843 <2> pop di 844 <2> pop es 845 <2> pop si 846 <2> pop ds 847 <2> pop ax 848 <2> jnc alt_good_DOS ; id is supported --> 849 <2> cmp bx, alt_expected_version ; is it fine ? 850 <2> je alt_good_DOS ; yes --> (NC) 851 <2> jmp $MIF25 ; no, cancel program --> 852 <2> 853 <2> $M_VERSION_CHECK PROC NEAR ;;AN000;; 854 <2> ;; 855 <2> MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC 856 <2> INT 21H ;;AN000;; 857 <2> ;; 858 <2> cmp ax,new_expected_version ; compare with DOS version 859 <2> je check_amis 860 <2> cmp ax,alt_expected_version ; compare with DOS version 861 <2> je check_amis 862 <2> CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct 863 <2> ; $IF E ;;AN000;; 864 <2> JNE $MIF25 865 <2> alt_good_DOS: 866 <2> CLC ;;AN000;; Clear the carry flag 867 <2> ; $ELSE ;;AN000;; ELSE 868 <2> JMP SHORT $MEN25 869 <2> $MIF25: 870 <2> %IFN COMR ;; ** Special case for RESIDENT COMMAND.COM 871 <2> CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH 872 <2> ; $IF B ;;AN000;; No, 873 <2> JNB $MIF27 874 <2> MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support) 875 <2> ; $ELSE ;;AN000;; Yes, 876 <2> JMP SHORT $MEN27 877 <2> $MIF27: 878 <2> MOV BX,STDERR ;;AN000;; Standard Error 879 <2> ; $ENDIF ;;AN000;; 880 <2> $MEN27: 881 <2> %ELSE 882 <2> MOV BX,NO_HANDLE ;;AN000;; No handle 883 <2> %ENDIF 884 <2> MOV AX,1 ;;AN000;; Set message # 1 885 <2> MOV CX,NO_REPLACE ;;AN000;; No replacable parms 886 <2> MOV DL,NO_INPUT ;;AN000;; No input 887 <2> MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message 888 <2> STC ;;AN000;; Set Carry Flag 889 <2> ; $ENDIF ;;AN000;; 890 <2> $MEN25: 891 <2> ;; 892 <2> RET ;;AN000;; Return 893 <2> ;; 894 <2> $M_VERSION_CHECK ENDP ;; 895 <2> ;; 896 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 897 <2> %ENDIF ;;AN000;; END of include for DOS version check 898 <2> %ENDIF ;;AN000;; END of include for SYSLOADMSG 899 <2> ; 900 <2> %IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 901 <2> %IF COMR ;;AN000;; 902 <2> $M_RT EQU $M_RT2 ;;AN000;; 903 <2> %ENDIF ;;AN000;; 904 <2> GETmsg equ FALSE ;;AN000;; Yes, THEN include it and reset flag 905 <2> ; PAGE 906 <2> ; SUBTTL DOS - Message Retriever - GETMSG.ASM Module 907 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 908 <2> ;; 909 <2> ;; Proc Name: SYSGETMSG 910 <2> ;; 911 <2> ;; Function: The GET service returns the segment, offset and size of the 912 <2> ;; message text to the caller based on a message number. 913 <2> ;; The GET function will not display the message thus assumes 914 <2> ;; caller will handle replaceable parameters. 915 <2> ;; 916 <2> ;; Inputs: 917 <2> ;; 918 <2> ;; Outputs: 919 <2> ;; 920 <2> ;; Psuedocode: 921 <2> ;; Call $M_GET_MSG_ADDRESS 922 <2> ;; IF MSG_NUM exists THEN 923 <2> ;; Set DS:SI = MSG_TXT_PTR + 1 924 <2> ;; CARRY_FLAG = 0 925 <2> ;; ELSE 926 <2> ;; CARRY_FLAG = 1 927 <2> ;; ENDIF 928 <2> ;; 929 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 930 <2> ;; 931 <2> %IF FARmsg ;;AN000;; 932 <2> SYSGETMSG PROC FAR ;;AN000;; 933 <2> %ELSE ;;AN000;; 934 <2> SYSGETMSG PROC NEAR ;;AN000;; 935 <2> %ENDIF ;;AN000;; 936 <2> ;; 937 <2> ;; Save registers needed later 938 <2> 939 <2> PUSH AX ;;AN000;; Save changed regs 940 <2> PUSH ES ;;AN000;; 941 <2> PUSH DI ;;AN000;; 942 <2> PUSH BP ;;AN000;; 943 <2> ;; 944 <2> %IF FARmsg ;;AN000;; 945 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 946 <2> %ELSE ;;AN000;; 947 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 948 <2> %ENDIF ;;AN000;; Return message in ES:DI 949 <2> ; $IF NC ;;AN000;; Message found? 950 <2> JC $MIF31 951 <2> CMP DH,UTILITY_MSG_CLASS 952 <2> CLC ;;AN000;; 953 <2> ; $IF NE 954 <2> JE $MIF32 955 <2> PUSH ES ;;AN000;; 956 <2> POP DS ;;AN000;; Return message in DS:SI 957 <2> ; $ELSE 958 <2> JMP SHORT $MEN32 959 <2> $MIF32: 960 <2> %IF FARmsg ;;AN000;; Yes, 961 <2> PUSH ES ;;AN000;; 962 <2> POP DS ;;AN000;; Return message in DS:SI 963 <2> %ELSE ;;AN000;; 964 <2> PUSH CS ;;AN000;; Return message in DS:SI 965 <2> POP DS ;;AN000;; 966 <2> %ENDIF ;;AN000;; 967 <2> ; $ENDIF ;;AN000;; 968 <2> $MEN32: 969 <2> MOV SI,DI ;;AN000;; Return message in DS:SI 970 <2> ; $ENDIF ;;AN000;; 971 <2> $MIF31: 972 <2> ;; 973 <2> POP BP ;;AN000;; Restore changed regs 974 <2> POP DI ;;AN000;; 975 <2> POP ES ;;AN000;; 976 <2> POP AX ;;AN000;; 977 <2> ;; 978 <2> RET ;;AN000;; Return 979 <2> ;; 980 <2> SYSGETMSG ENDP ;; 981 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 982 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 983 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 984 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 985 <2> ;; 986 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 987 <2> ;; 988 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 989 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 990 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 991 <2> ;; IF CX > 1 THEN ES:DI points to the specified message 992 <2> ;; REGS CHANGED: ES,DI,CX 993 <2> ;; 994 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 995 <2> ;; 996 <2> %IF FARmsg ;;AN000;; 997 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 998 <2> %ELSE ;;AN000;; 999 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 1000 <2> %ENDIF ;;AN000;; 1001 <2> ;; 1002 <2> PUSH SI ;;AN000;; 1003 <2> PUSH BX ;;AN000;; 1004 <2> XOR SI,SI ;;AN000;; Use SI as an index 1005 <2> XOR CX,CX ;;AN000;; Use CX as an size 1006 <2> ; $DO ;;AN000;; 1007 <2> $MDO36: 1008 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 1009 <2> ; $IF E ;;AN000;; Yes, 1010 <2> JNE $MIF37 1011 <2> %IF FARmsg ;;AN000;; 1012 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1013 <2> MOV BX,ES ;;AN000; 1014 <2> %ELSE ;;AN000;; 1015 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1016 <2> MOV BX,DI ;;AN000; 1017 <2> %ENDIF ;;AN000;; 1018 <2> ; $ELSE ;;AN000;; No, 1019 <2> JMP SHORT $MEN37 1020 <2> $MIF37: 1021 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 1022 <2> ; $IF NE ;;AN000;; Yes, 1023 <2> JE $MIF39 1024 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 1025 <2> MOV BX,ES ;;AN000; 1026 <2> ; $ELSE ;;AN000;; No, extended errors were specified 1027 <2> JMP SHORT $MEN39 1028 <2> $MIF39: 1029 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 1030 <2> ; $IF AE,AND ;;AN000;; 1031 <2> JNAE $MIF41 1032 <2> CMP AX,$M_CRIT_HI ;;AN000;; 1033 <2> ; $IF BE ;;AN000;; Yes, 1034 <2> JNBE $MIF41 1035 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 1036 <2> MOV BX,ES ;;AN000; 1037 <2> ; $ELSE ;;AN000;; 1038 <2> JMP SHORT $MEN41 1039 <2> $MIF41: 1040 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 1041 <2> MOV BX,ES ;;AN000; 1042 <2> ; $ENDIF ;;AN000;; 1043 <2> $MEN41: 1044 <2> ; $ENDIF ;;AN000;; 1045 <2> $MEN39: 1046 <2> ; $ENDIF ;;AN000;; 1047 <2> $MEN37: 1048 <2> ;; 1049 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 1050 <2> ; $IF E ;;AN000;; Yes, 1051 <2> JNE $MIF46 1052 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 1053 <2> ; $IF E ;;AN000;; Yes, 1054 <2> JNE $MIF47 1055 <2> STC ;;AN000;; Set the carry flag 1056 <2> ; $ELSE ;;AN000;; No, 1057 <2> JMP SHORT $MEN47 1058 <2> $MIF47: 1059 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 1060 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 1061 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 1062 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 1063 <2> CLC ;;AN000;; 1064 <2> ; $ENDIF ;;AN000;; No, 1065 <2> $MEN47: 1066 <2> ; $ELSE ;;AN000;; 1067 <2> JMP SHORT $MEN46 1068 <2> $MIF46: 1069 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 1070 <2> ; $IF NE ;;AN001;; Yes, 1071 <2> JE $MIF51 1072 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 1073 <2> ; $ENDIF ;;AN000;; 1074 <2> $MIF51: 1075 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 1076 <2> CLC ;;AN000;; 1077 <2> ; $ENDIF ;;AN000;; 1078 <2> $MEN46: 1079 <2> ; $LEAVE C ;;AN000;; 1080 <2> JC $MEN36 1081 <2> OR CX,CX ;;AN000;; Was the message found? 1082 <2> ; $ENDDO NZ,LONG ;;AN000;; 1083 <2> JNZ $MXL2 1084 <2> JMP $MDO36 1085 <2> $MXL2: 1086 <2> $MEN36: 1087 <2> 1088 <2> PUSHF ;;AN006;; Save the flag state 1089 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 1090 <2> ; $IF E ;;AN006;; Yes, 1091 <2> JNE $MIF56 1092 <2> PUSH DX ;;AN006;; Save all needed registers 1093 <2> PUSH BP ;;AN006;; 1094 <2> PUSH CX ;;AN006;; 1095 <2> PUSH ES ;;AN006;; 1096 <2> PUSH DI ;;AN006;; 1097 <2> PUSH AX ;;AN006;; 1098 <2> 1099 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 1100 <2> INT 2FH ;;AN006;; 1101 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 1102 <2> POP AX ;;AN006;; Restore msg number 1103 <2> ; $IF E ;;AN006;; Yes, 1104 <2> JNE $MIF57 1105 <2> MOV BX,AX ;;AN006;; BX is the extended error number 1106 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 1107 <2> INT 2FH ;;AN006;; Call IFSFUNC 1108 <2> ; $ELSE ;;AN006;; No, 1109 <2> JMP SHORT $MEN57 1110 <2> $MIF57: 1111 <2> STC ;;AN006;; Carry conditon 1112 <2> ; $ENDIF ;;AN006;; 1113 <2> $MEN57: 1114 <2> 1115 <2> ; $IF C ;;AN006;; Was there an update? 1116 <2> JNC $MIF60 1117 <2> POP DI ;;AN006;; No, 1118 <2> POP ES ;;AN006;; Restore old pointer 1119 <2> POP CX ;;AN006;; 1120 <2> ; $ELSE ;;AN006;; Yes 1121 <2> JMP SHORT $MEN60 1122 <2> $MIF60: 1123 <2> ADD SP,6 ;;AN006;; Throw away old pointer 1124 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 1125 <2> ; $ENDIF ;;AN006;; 1126 <2> $MEN60: 1127 <2> POP BP ;;AN006;; Restore other Regs 1128 <2> POP DX ;;AN006;; 1129 <2> ; $ENDIF ;;AN006;; 1130 <2> $MIF56: 1131 <2> $M_POPF ;;AN006;; Restore the flag state 1132 <2> 1133 <2> POP BX ;;AN000;; 1134 <2> POP SI ;;AN000;; 1135 <2> RET ;;AN000;; Return ES:DI pointing to the message 1136 <2> ;; 1137 <2> $M_GET_MSG_ADDRESS ENDP ;; 1138 <2> ;; 1139 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 1140 <2> ;; 1141 <2> PUSH DI ;;AN006;; Save position 1142 <2> PUSH AX ;;AN006;; 1143 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 1144 <2> XOR AL,AL ;;AN006;; Prepare compare register 1145 <2> REPNE SCASB ;;AN006;; Scan for zero 1146 <2> NOT CX ;;AN006;; Change decrement into number 1147 <2> DEC CX ;;AN006;; Don't include the zero 1148 <2> POP AX ;;AN006;; 1149 <2> POP DI ;;AN006;; Restore position 1150 <2> RET ;;AN006;; 1151 <2> ;; 1152 <2> $M_SET_LEN_IN_CX ENDP ;; 1153 <2> ;; 1154 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1155 <2> ;; 1156 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 1157 <2> ;; 1158 <2> ;; FUNCTION: To scan thru message headers until message is found 1159 <2> ;; INPUTS: ES:DI points to beginning of msg headers 1160 <2> ;; CX contains the number of messages in class 1161 <2> ;; DH contains the message class 1162 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 1163 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 1164 <2> ;; 1165 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1166 <2> ;; 1167 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 1168 <2> ;; 1169 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 1170 <2> ; $IF E,AND ;;AN004;; Yes, 1171 <2> JNE $MIF64 1172 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 1173 <2> ; $IF NE ;;AN004;; Yes, 1174 <2> JE $MIF64 1175 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 1176 <2> ; $IF E ;;AN004;; . . . and . . . 1177 <2> JNE $MIF65 1178 <2> PUSH AX ;;AN004;; Reset the special message number 1179 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 1180 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1181 <2> POP AX ;;AN004;; Reset the special message number 1182 <2> ; $ELSE ;;AN004;; Get the old message number 1183 <2> JMP SHORT $MEN65 1184 <2> $MIF65: 1185 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1186 <2> ; $ENDIF ;;AN004;; Get the old message number 1187 <2> $MEN65: 1188 <2> ; $ELSE ;;AN004;; 1189 <2> JMP SHORT $MEN64 1190 <2> $MIF64: 1191 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 1192 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1193 <2> ; $IF NE ;;AN001;; 1194 <2> JE $MIF69 1195 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 1196 <2> ; $ELSE ;;AN001;; 1197 <2> JMP SHORT $MEN69 1198 <2> $MIF69: 1199 <2> %IF FARmsg ;;AN001;; 1200 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1201 <2> %ELSE 1202 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1203 <2> %ENDIF 1204 <2> ; $IF E ;;AN002;; pointer (hopefully) 1205 <2> JNE $MIF71 1206 <2> %IF FARmsg ;;AN001;; 1207 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1208 <2> %ELSE 1209 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1210 <2> %ENDIF 1211 <2> ; $ENDIF ;;AN002;; go on to the next class 1212 <2> $MIF71: 1213 <2> ; $ENDIF ;;AN001;; 1214 <2> $MEN69: 1215 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 1216 <2> STC ;;AN004;; Flag that we haven't found anything yet 1217 <2> ; $ENDIF ;;AN004;; 1218 <2> $MEN64: 1219 <2> 1220 <2> ; $IF C ;;AN004;; Have we found anything yet? 1221 <2> JNC $MIF75 1222 <2> CLC ;;AN004;; No, reset carry 1223 <2> ; $SEARCH ;;AN000;; 1224 <2> $MDO76: 1225 <2> OR CX,CX ;;AN000;; Do we have any to check? 1226 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1227 <2> JZ $MEN76 1228 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1229 <2> ; $IF NE ;;AN001;; 1230 <2> JE $MIF78 1231 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 1232 <2> ; $ELSE ;;AN001;; 1233 <2> JMP SHORT $MEN78 1234 <2> $MIF78: 1235 <2> %IF FARmsg ;;AN001;; 1236 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 1237 <2> %ELSE 1238 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 1239 <2> %ENDIF 1240 <2> ; $ENDIF 1241 <2> $MEN78: 1242 <2> ; $EXITIF E ;;AN000;; 1243 <2> JNE $MIF76 1244 <2> ; $ORELSE ;;AN000; 1245 <2> JMP SHORT $MSR76 1246 <2> $MIF76: 1247 <2> DEC CX ;;AN000;; No, well do we have more to check? 1248 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1249 <2> JZ $MEN76 1250 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 1251 <2> ; $ENDLOOP ;;AN000;; 1252 <2> JMP SHORT $MDO76 1253 <2> $MEN76: 1254 <2> STC ;;AN000;; 1255 <2> ; $ENDSRCH ;;AN000;; Check next message 1256 <2> $MSR76: 1257 <2> ; $IF NC ;;AN000;; Did we find the message? 1258 <2> JC $MIF86 1259 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 1260 <2> CLC ;;AN001;; 1261 <2> ; $IF E ;;AN001;; 1262 <2> JNE $MIF87 1263 <2> %IF FARmsg ;;AN001;; 1264 <2> %ELSE ;;AN000;; 1265 <2> PUSH CS ;;AN000;; 1266 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 1267 <2> %ENDIF 1268 <2> ; $ENDIF ;;AN001;; 1269 <2> $MIF87: 1270 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 1271 <2> ; $ENDIF ;;AN004;; 1272 <2> $MIF86: 1273 <2> ; $ENDIF ;;AN004;; 1274 <2> $MIF75: 1275 <2> ;; Yes, great we can return with CX > 0 1276 <2> 1277 <2> ; $IF NC ;;AN000;; Did we find the message? 1278 <2> JC $MIF91 1279 <2> XOR CH,CH ;;AN000;; 1280 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 1281 <2> INC DI ;;AN000;; Increment past length 1282 <2> ; $ENDIF ;;AN004;; 1283 <2> $MIF91: 1284 <2> 1285 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 1286 <2> RET ;;AN000;; Return 1287 <2> ;; 1288 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 1289 <2> ;; 1290 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1291 <2> %ENDIF ;;AN000;; END of include of common subroutines 1292 <2> %ENDIF ;;AN000;; END of include of SYSGETMSG 1293 <2> ; 1294 <2> %IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 1295 <2> %IF COMR ;;AN000;; 1296 <2> $M_RT EQU $M_RT2 ;;AN000;; 1297 <2> %ENDIF ;;AN000;; 1298 <2> %iassign DISPLAYmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 1299 <2> ; PAGE 1300 <2> ; SUBTTL DOS - Message Retriever - DISPMSG.ASM Module 1301 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1302 <2> ;; 1303 <2> ;; Proc Name: SYSDISPMSG 1304 <2> ;; 1305 <2> ;; Function: The DISPLAY service will output a defined message to a handle 1306 <2> ;; requested by the caller. It also provides function to display 1307 <2> ;; messages when handles are not applicable (ie. DOS function calls 1308 <2> ;; 00h to 0Ah) Replaceable parameters are allowed and are 1309 <2> ;; defined previous to entry. 1310 <2> ;; 1311 <2> ;; It is assumes that a PRELOAD function has already determined 1312 <2> ;; the addressibilty internally to the message retriever services. 1313 <2> ;; Inputs: 1314 <2> ;; 1315 <2> ;; Outputs: 1316 <2> ;; 1317 <2> ;; Psuedocode: 1318 <2> ;; Save registers needed later 1319 <2> ;; Get address of the message requested 1320 <2> ;; IF Message number exists THEN 1321 <2> ;; IF replacable parameters were specified THEN 1322 <2> ;; Display message with replacable parms 1323 <2> ;; ELSE 1324 <2> ;; Display string without replacable parms 1325 <2> ;; ENDIF 1326 <2> ;; IF character input was requested THEN 1327 <2> ;; Wait for character input 1328 <2> ;; ENDIF 1329 <2> ;; Clear CARRY FLAG 1330 <2> ;; ELSE 1331 <2> ;; Set CARRY FLAG 1332 <2> ;; ENDIF 1333 <2> ;; Return 1334 <2> ;; 1335 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1336 <2> ;; 1337 <2> %IF FARmsg ;;AN000;; 1338 <2> SYSDISPMSG PROC FAR ;;AN000;; 1339 <2> %ELSE ;;AN000;; 1340 <2> SYSDISPMSG PROC NEAR ;;AN000;; 1341 <2> %ENDIF ;;AN000;; 1342 <2> ;; 1343 <2> ;; Save registers and values needed later 1344 <2> 1345 <2> PUSH AX ;;AN000;; Save changed REGs 1346 <2> PUSH BX ;;AN000;; 1347 <2> PUSH CX ;;AN000;; 1348 <2> PUSH BP ;;AN000;; 1349 <2> PUSH DI ;;AN000;; Save pointer to input buffer (offset) 1350 <2> PUSH ES ;;AN000;; Save pointer to input buffer (segment) 1351 <2> PUSH DX ;;AN000;; Save Input/Class request 1352 <2> 1353 <2> MOV BP,CX ;;AN000;; Use BP to hold replace count 1354 <2> MOV WORD PTR [$M_RT + $M_HANDLE],BX ;;AN000;; Save handle 1355 <2> MOV BYTE PTR [$M_RT + $M_CLASS],DH ;;AN004;; Save class 1356 <2> 1357 <2> ;; Get address of the message requested 1358 <2> 1359 <2> %IF FARmsg ;;AN000;; 1360 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1361 <2> %ELSE ;;AN000;; 1362 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1363 <2> %ENDIF ;;AN000;; 1364 <2> OR CX,CX ;;AN000;; Was message found? 1365 <2> ; $IF NZ ;;AN000;; YES, Message address in ES:DI 1366 <2> JZ $MIF93 1367 <2> 1368 <2> ;; Test if replacable parameters were specified 1369 <2> 1370 <2> OR BP,BP ;;AN000;; Were replacable parameters requested 1371 <2> ; $IF Z ;;AN000;; 1372 <2> JNZ $MIF94 1373 <2> 1374 <2> ;; Display string without replacable parms 1375 <2> 1376 <2> CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message 1377 <2> ; $ELSE ;;AN000;; 1378 <2> JMP SHORT $MEN94 1379 <2> $MIF94: 1380 <2> %IF $M_REPLACE ;;AN000;; 1381 <2> 1382 <2> ;; Display message with replacable parms 1383 <2> 1384 <2> CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions 1385 <2> %ENDIF ;;AN000;; 1386 <2> ; $ENDIF ;;AN000;; 1387 <2> $MEN94: 1388 <2> ; $IF NC 1389 <2> JC $MIF97 1390 <2> 1391 <2> POP DX ;;AN000;; Get Input/Class request 1392 <2> 1393 <2> CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. 1394 <2> 1395 <2> POP ES ;;AN000;; Get location of input buffer (if specified) 1396 <2> POP DI ;;AN000;; 1397 <2> 1398 <2> ;; Test if character input was requested 1399 <2> 1400 <2> %IF INPUTmsg ;;AN000;; 1401 <2> OR DL,DL ;;AN000;; Was Wait-For-Input requested? 1402 <2> ; $IF NZ ;;AN000;; 1403 <2> JZ $MIF98 1404 <2> CALL $M_WAIT_FOR_INPUT ;;AN000;; 1405 <2> ; $ENDIF ;;AN000;; 1406 <2> $MIF98: 1407 <2> %ENDIF ;;AN000;; 1408 <2> ; $ELSE ;;AN000;; 1409 <2> JMP SHORT $MEN97 1410 <2> $MIF97: 1411 <2> ADD SP,6 ;;AN000;; 1412 <2> STC ;;AN000;; Reset carry flag 1413 <2> ; $ENDIF ;;AN000;; 1414 <2> $MEN97: 1415 <2> ; $ELSE ;;AN000;; No, 1416 <2> JMP SHORT $MEN93 1417 <2> $MIF93: 1418 <2> POP ES ;;AN000;; Get pointer to input buffer (segment) 1419 <2> POP DI ;;AN000;; Get base pointer to first sublist (offset) 1420 <2> POP DX ;;AN000;; Get base pointer to first sublist (segment) 1421 <2> STC ;;AN000;; Set carry flag 1422 <2> ; $ENDIF ;;AN000;; 1423 <2> $MEN93: 1424 <2> ;; 1425 <2> ; $IF NC ;;AN000;; Was there an error? 1426 <2> JC $MIF104 1427 <2> POP BP ;;AN000;; No, 1428 <2> POP CX ;;AN000;; 1429 <2> POP BX ;;AN000;; 1430 <2> %IF INPUTmsg ;;AN000;; 1431 <2> ADD SP,2 ;;AN000;; 1432 <2> %ELSE ;AN000; 1433 <2> POP AX ;;AN000;; 1434 <2> %ENDIF ;;AN000;; 1435 <2> ; $ELSE ;;AN000;; Yes, 1436 <2> JMP SHORT $MEN104 1437 <2> $MIF104: 1438 <2> ADD SP,8 ;;AN000;; Eliminate from stack 1439 <2> STC ;;AN000;; 1440 <2> ; $ENDIF ;;AN000;; 1441 <2> $MEN104: 1442 <2> ;; 1443 <2> RET ;;AN000;; Return 1444 <2> ;; 1445 <2> SYSDISPMSG ENDP ;;AN000;; 1446 <2> ;; 1447 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1448 <2> ; 1449 <2> ;; 1450 <2> ;; PROC NAME: $M_DISPLAY_STRING 1451 <2> ;; 1452 <2> ;; FUNCTION: Will display or write string 1453 <2> ;; INPUTS: ES:DI points to beginning of message 1454 <2> ;; CX contains the length of string to write (if applicable) 1455 <2> ;; OUTPUTS: None 1456 <2> ;; REGS Revised: None 1457 <2> ;; 1458 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1459 <2> ;; 1460 <2> $M_DISPLAY_STRING PROC NEAR ;;AN000;; 1461 <2> ;; 1462 <2> PUSH AX ;;AN000;; 1463 <2> PUSH BX ;;AN000;; 1464 <2> PUSH DX ;;AN000;; 1465 <2> ;; 1466 <2> MOV BX,[$M_RT + $M_HANDLE] ;;AN000;; Retrieve handle 1467 <2> ;; 1468 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 1469 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1470 <2> %ELSE 1471 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1472 <2> ; $IF E ;;AN000;; 1473 <2> JNE $MIF107 1474 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1475 <2> ; $ELSE ;;AN000;; 1476 <2> JMP SHORT $MEN107 1477 <2> $MIF107: 1478 <2> CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle 1479 <2> ; $ENDIF ;;AN000;; 1480 <2> $MEN107: 1481 <2> ;AN001; 1482 <2> ; $IF C ;;AN000;; Was there an error? 1483 <2> JNC $MIF110 1484 <2> MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes, 1485 <2> MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error 1486 <2> INT 21H ;;AN000;; 1487 <2> XOR AH,AH ;;AN000;; Clear AH 1488 <2> ADD SP,6 ;;AN000;; Clean up stack 1489 <2> STC ;;AN000;; Flag that there was an error 1490 <2> ; $ELSE ;;AN000;; No, 1491 <2> JMP SHORT $MEN110 1492 <2> $MIF110: 1493 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1494 <2> ; $IF NE ;;AN000;; 1495 <2> JE $MIF112 1496 <2> CMP AX,CX ;AN001; Was it ALL written? 1497 <2> ; $IF NE ;AN001; No, 1498 <2> JE $MIF113 1499 <2> CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error 1500 <2> ADD SP,6 ;AN001; Clean up stack 1501 <2> STC ;AN001; Flag that there was an error 1502 <2> ; $ENDIF ;AN001; 1503 <2> $MIF113: 1504 <2> ; $ENDIF ;AN001; 1505 <2> $MIF112: 1506 <2> ; $ENDIF ;;AN000;; 1507 <2> $MEN110: 1508 <2> %ENDIF 1509 <2> ; $IF NC ;;AN000;; Was there ANY error? 1510 <2> JC $MIF117 1511 <2> POP DX ;;AN000;; Restore regs 1512 <2> POP BX ;;AN000;; 1513 <2> POP AX ;;AN000;; 1514 <2> ; $ENDIF ;;AN000;; 1515 <2> $MIF117: 1516 <2> RET ;;AN000;; Return 1517 <2> ;; 1518 <2> $M_DISPLAY_STRING ENDP ;;AN000;; 1519 <2> ;; 1520 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1521 <2> ;; 1522 <2> ;; PROC NAME: $M_DISPLAY_$_STRING 1523 <2> ;; 1524 <2> ;; FUNCTION: Will display a $ terminated string 1525 <2> ;; INPUTS: ES:DI points to beginning of message text (not the length) 1526 <2> ;; OUPUTS: None 1527 <2> ;; REGS USED: AX,DX 1528 <2> ;; 1529 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1530 <2> ;; 1531 <2> $M_DISPLAY_$_STRING PROC NEAR ;;AN000;; 1532 <2> ;; 1533 <2> PUSH DS ;;AN000;; 1534 <2> PUSH ES ;;AN000;; 1535 <2> POP DS ;;AN000;; Set DS to segment of message text 1536 <2> %IFN COMR 1537 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1538 <2> ; $IF E ;;AN000;; Yes, 1539 <2> JNE $MIF119 1540 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1541 <2> MOV DL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1542 <2> INT 21H ;;AN000;; Write character 1543 <2> POP DS ;;AN000;; Set DS to segment of message text 1544 <2> MOV AL,DL ;;AN000;; Get the character in AL 1545 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1546 <2> PUSH DS ;;AN000;; 1547 <2> PUSH ES ;;AN000;; 1548 <2> POP DS ;;AN000;; Set DS to segment of message text 1549 <2> ; $IF C ;;AN000;; Yes, 1550 <2> JNC $MIF120 1551 <2> MOV DL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 1552 <2> INT 21H ;;AN000;; Write character 1553 <2> CLC ;;AN000;; Clear the DBCS indicator 1554 <2> ; $ENDIF ;;AN000;; 1555 <2> $MIF120: 1556 <2> ; $ELSE ;;AN000;; No, 1557 <2> JMP SHORT $MEN119 1558 <2> $MIF119: 1559 <2> %ENDIF 1560 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1561 <2> ; $DO ;;AN002;; No, 1562 <2> $MDO123: 1563 <2> OR CX,CX ;;AN002;; Are there any left to display? 1564 <2> ; $LEAVE Z ;;AN002;; Yes, 1565 <2> JZ $MEN123 1566 <2> MOV DL,BYTE PTR [ES:DI] ;;AN002;; Get the character 1567 <2> INT 21H ;;AN002;; Display the character 1568 <2> INC DI ;;AN002;; Set pointer to next character 1569 <2> DEC CX ;;AN002;; Count this character 1570 <2> ; $ENDDO Z ;;AN002;; No, 1571 <2> JNZ $MDO123 1572 <2> $MEN123: 1573 <2> %IFN COMR 1574 <2> ; $ENDIF ;;AN000;; 1575 <2> $MEN119: 1576 <2> %ENDIF 1577 <2> CLC ;;AN000;; Char functions used don't return carry as error 1578 <2> POP DS ;;AN000;; 1579 <2> RET ;;AN000;; 1580 <2> ;; 1581 <2> $M_DISPLAY_$_STRING ENDP ;;AN000;; 1582 <2> ;; 1583 <2> %IFN COMR 1584 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1585 <2> ;; 1586 <2> ;; PROC NAME: $M_DISPLAY_H_STRING 1587 <2> ;; 1588 <2> ;; FUNCTION: Will display a string to a specified handle 1589 <2> ;; INPUTS: ES:DI points to beginning of message 1590 <2> ;; CX contains the number of bytes to write 1591 <2> ;; BX contains the handle to write to 1592 <2> ;; OUPUTS: None 1593 <2> ;; REGS USED: AX,DX 1594 <2> ;; 1595 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1596 <2> ;; 1597 <2> $M_DISPLAY_H_STRING PROC NEAR ;;AN000;; 1598 <2> ;; 1599 <2> XOR AX,AX ;;AN002;; Set number of bytes written to 0 1600 <2> OR CX,CX ;;AN002;; For performance, don't write if not necessary 1601 <2> ; $IF NZ ;;AN002;; Any chars to write? 1602 <2> JZ $MIF127 1603 <2> PUSH DS ;;AN000;; Yes, 1604 <2> PUSH ES ;;AN000;; 1605 <2> POP DS ;;AN000;; Set DS to segment of message text 1606 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1607 <2> MOV DX,DI ;;AN000;; Pointer to data to write 1608 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1609 <2> ; $IF E ;;AN000;; Yes, 1610 <2> JNE $MIF128 1611 <2> INT 21H ;;AN000;; Write character 1612 <2> POP DS ;;AN000;; Set DS to segment of message text 1613 <2> PUSH AX ;;AN000;; 1614 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1615 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1616 <2> POP AX ;;AN000;; Set DS to segment of message text 1617 <2> PUSH DS ;;AN000;; 1618 <2> PUSH ES ;;AN000;; 1619 <2> POP DS ;;AN000;; Set DS to segment of message text 1620 <2> ; $IF C ;;AN000;; Yes, 1621 <2> JNC $MIF129 1622 <2> CLC ;;AN000;; Clear the DBCS indicator 1623 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1624 <2> INC DX ;;AN000;; Point to next character 1625 <2> INT 21H ;;AN000;; Write character 1626 <2> ; $ENDIF ;;AN000;; 1627 <2> $MIF129: 1628 <2> ; $ELSE ;;AN000;; No, 1629 <2> JMP SHORT $MEN128 1630 <2> $MIF128: 1631 <2> INT 21H ;;AN000;; Write String at DS:SI to handle 1632 <2> ; $ENDIF ;;AN000;; 1633 <2> $MEN128: 1634 <2> POP DS ;;AN000;; 1635 <2> ; $ENDIF ;;AN002;; 1636 <2> $MIF127: 1637 <2> ;; 1638 <2> RET ;;AN000;; 1639 <2> ;; 1640 <2> $M_DISPLAY_H_STRING ENDP ;;AN000;; 1641 <2> ;; 1642 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1643 <2> ;; 1644 <2> ;; PROC NAME: $M_GET_EXT_ERR_39 1645 <2> ;; 1646 <2> ;; FUNCTION: Will set registers for extended error #39 1647 <2> ;; INPUTS: None 1648 <2> ;; OUPUTS: AX,BX,CX set 1649 <2> ;; REGS USED: 1650 <2> ;; 1651 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1652 <2> ;; 1653 <2> $M_GET_EXT_ERR_39 PROC NEAR ;AN001; 1654 <2> ;; 1655 <2> MOV AX,EXT_ERR_39 ;AN001; Set AX=39 1656 <2> MOV BX,(ERROR_CLASS_39 >> 8) + ACTION_39 ;AN001; Set BH=1 BL=4 1657 <2> MOV CH,LOCUS_39 ;AN001; Set CH=1 1658 <2> ;AN001; 1659 <2> RET ;AN001; 1660 <2> ;; 1661 <2> $M_GET_EXT_ERR_39 ENDP ;AN001; 1662 <2> ;; 1663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1664 <2> %ENDIF 1665 <2> ;; 1666 <2> ;; PROC NAME: $M_ADD_CRLF 1667 <2> ;; 1668 <2> ;; FUNCTION: Will decide whether to display a CRLF 1669 <2> ;; INPUTS: DX contains the Input/Class requested 1670 <2> ;; OUTPUTS: None 1671 <2> ;; REGS Revised: CX,ES,DI 1672 <2> ;; 1673 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1674 <2> ;; 1675 <2> $M_ADD_CRLF PROC NEAR ;;AN004;; 1676 <2> ;; 1677 <2> CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1678 <2> ; $IF NE ;;AN004;; No, 1679 <2> JE $MIF134 1680 <2> TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? 1681 <2> ; $IF Z ;;AN004;; No, 1682 <2> JNZ $MIF135 1683 <2> PUSH DS ;;AN004;; 1684 <2> POP ES ;;AN004;; Set ES to data segment 1685 <2> LEA DI,[$M_RT + $M_CRLF] ;;AN004;; Point at CRLF message 1686 <2> MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size 1687 <2> CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF 1688 <2> ; $ENDIF ;;AN004;; 1689 <2> $MIF135: 1690 <2> ; $ENDIF ;;AN004;; 1691 <2> $MIF134: 1692 <2> RET ;;AN004;; Return 1693 <2> ;; 1694 <2> $M_ADD_CRLF ENDP ;;AN004;; 1695 <2> ;; 1696 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1697 <2> ;; 1698 <2> ;; PROC NAME: $M_IS_IT_DBCS 1699 <2> ;; 1700 <2> ;; FUNCTION: Will decide whether character is Single or Double Byte 1701 <2> ;; INPUTS: AL contains the byte to be checked 1702 <2> ;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range 1703 <2> ;; Carry flag = 1 if byte IS in DBCS range 1704 <2> ;; REGS USED: All restored 1705 <2> ;; 1706 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1707 <2> ;; 1708 <2> $M_IS_IT_DBCS PROC NEAR ;;AN000;; 1709 <2> ;; 1710 <2> PUSH ES ;;AN000;; Save Extra segment register 1711 <2> PUSH DI ;;AN000;; Save SI register 1712 <2> ;; 1713 <2> LES DI,[$M_RT + $M_DBCS_VEC] ;;AN000;; 1714 <2> OR DI,DI ;;AN000;; Was the DBCS vector set? 1715 <2> ; $IF NZ ;;AN000;; 1716 <2> JZ $MIF138 1717 <2> ; $DO ;;AN000;; 1718 <2> $MDO139: 1719 <2> CMP WORD PTR [ES:DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag? 1720 <2> CLC ;;AN000;; 1721 <2> ; $LEAVE E ;;AN000;; 1722 <2> JE $MEN139 1723 <2> ;; No, 1724 <2> CMP AL,BYTE PTR [ES:DI] ;;AN000;; Does the character fall in the DBCS range? 1725 <2> ; $IF AE,AND ;;AN000;; 1726 <2> JNAE $MIF141 1727 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Does the character fall in the DBCS range? 1728 <2> ; $IF BE ;;AN000;; 1729 <2> JNBE $MIF141 1730 <2> STC ;;AN000;; Yes, 1731 <2> ; $ENDIF ;;AN000;; Set carry flag 1732 <2> $MIF141: 1733 <2> INC DI ;;AN000;; No, 1734 <2> INC DI ;;AN000;; Go to next vector 1735 <2> ; $ENDDO ;;AN000;; 1736 <2> JMP SHORT $MDO139 1737 <2> $MEN139: 1738 <2> ; $ENDIF ;;AN000;; 1739 <2> $MIF138: 1740 <2> 1741 <2> POP DI ;;AN000;; 1742 <2> POP ES ;;AN000;; Restore SI register 1743 <2> RET ;;AN000;; Return 1744 <2> ;; 1745 <2> $M_IS_IT_DBCS ENDP ;;AN000;; 1746 <2> ;; 1747 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1748 <2> ;; 1749 <2> ;; PROC NAME: $M_CONVERT2ASC 1750 <2> ;; 1751 <2> ;; FUNCTION: Convert a binary number to a ASCII string 1752 <2> ;; INPUTS: DX:AX contains the number to be converted 1753 <2> ;; $M_RT_DIVISOR contains the divisor 1754 <2> ;; OUPUTS: CX contains the number of characters 1755 <2> ;; Top of stack --> Last character 1756 <2> ;; . . . 1757 <2> ;; Bot of stack --> First character 1758 <2> ;; REGS USED: 1759 <2> ;; 1760 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1761 <2> ;; 1762 <2> $M_CONVERT2ASC PROC NEAR ;;AN000;; 1763 <2> ;; 1764 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Save Return Address 1765 <2> XOR BX,BX ;;AN000;; Use BP as a swapping register 1766 <2> ;; 1767 <2> XCHG BX,AX ;;AN000;; Initialize - Low Word in BP 1768 <2> XCHG AX,DX ;;AN000;; - High Word in AX 1769 <2> ; $DO ;;AN000;; DO UNTIL Low Word becomes zero 1770 <2> $MDO145: 1771 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide High Word by divisor 1772 <2> XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder 1773 <2> ;; and save reduced High Word in BP 1774 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide Low Word by divisor 1775 <2> CMP DX,9 ;;AN000;; Make a digit of the remainder 1776 <2> ; $IF A ;;AN000;; IF 10 to 15, 1777 <2> JNA $MIF146 1778 <2> ADD DL,55 ;;AN000;; Make A to F ASCII 1779 <2> ; $ELSE ;;AN000;; IF 0 to 9, 1780 <2> JMP SHORT $MEN146 1781 <2> $MIF146: 1782 <2> ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII 1783 <2> ; $ENDIF ;;AN000;; 1784 <2> $MEN146: 1785 <2> PUSH DX ;;AN000;; Save the digit on the stack 1786 <2> INC CX ;;AN000;; Count that digit 1787 <2> OR AX,AX ;;AN000;; Are we done? 1788 <2> ; $LEAVE Z,AND ;;AN000;; 1789 <2> JNZ $MLL149 1790 <2> OR BX,BX ;;AN000;; AX and BX must be ZERO!! 1791 <2> ; $LEAVE Z ;;AN000;; No, 1792 <2> JZ $MEN145 1793 <2> $MLL149: 1794 <2> %IFN COMR 1795 <2> CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark 1796 <2> ; $IF E ;;AN000;; Yes, 1797 <2> JNE $MIF150 1798 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1799 <2> ; $IF E ;;AN000;; Yes, 1800 <2> JNE $MIF151 1801 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1802 <2> INC CX ;;AN000;; 1803 <2> ; $ENDIF ;;AN000;; 1804 <2> $MIF151: 1805 <2> ; $ELSE ;;AN000;; No, 1806 <2> JMP SHORT $MEN150 1807 <2> $MIF150: 1808 <2> CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark 1809 <2> ; $IF E ;;AN000;; Yes, 1810 <2> JNE $MIF154 1811 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1812 <2> ; $IF E ;;AN000;; Yes, 1813 <2> JNE $MIF155 1814 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1815 <2> INC CX ;;AN000;; 1816 <2> ; $ENDIF ;;AN000;; 1817 <2> $MIF155: 1818 <2> ; $ELSE ;;AN000;; No, 1819 <2> JMP SHORT $MEN154 1820 <2> $MIF154: 1821 <2> CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark 1822 <2> ; $IF E ;;AN000;; Yes, 1823 <2> JNE $MIF158 1824 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1825 <2> ; $IF E ;;AN000;; Yes, 1826 <2> JNE $MIF159 1827 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1828 <2> INC CX ;;AN000;; 1829 <2> ; $ENDIF ;;AN000;; 1830 <2> $MIF159: 1831 <2> ; $ENDIF ;;AN000;; 1832 <2> $MIF158: 1833 <2> ; $ENDIF ;;AN000;; 1834 <2> $MEN154: 1835 <2> ; $ENDIF ;;AN000;; 1836 <2> $MEN150: 1837 <2> %ENDIF 1838 <2> XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word 1839 <2> ;;AN000;; and Revised Low Word 1840 <2> XOR DX,DX ;;AN000;; Reset remainder 1841 <2> ; $ENDDO ;;AN000;; NEXT 1842 <2> JMP SHORT $MDO145 1843 <2> $MEN145: 1844 <2> ;;AN000;; Yes, 1845 <2> XOR DX,DX ;;AN000;; Reset remainder 1846 <2> XOR AX,AX ;;AN000;; Reset remainder 1847 <2> PUSH word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Restore Return Address 1848 <2> RET ;;AN000;; Return 1849 <2> ;; 1850 <2> $M_CONVERT2ASC ENDP ;;AN000;; 1851 <2> ;; 1852 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1853 <2> ;; 1854 <2> ;; PROC NAME: $M_DISPLAY_MESSAGE 1855 <2> ;; 1856 <2> ;; FUNCTION: Will display or write entire message (with replacable parameters) 1857 <2> ;; INPUTS: ES:DI points to beginning of message 1858 <2> ;; DS:SI points to first sublist structure in chain 1859 <2> ;; BX contains the handle to write to (if applicable) 1860 <2> ;; CX contains the length of string to write (before substitutions) 1861 <2> ;; BP contains the count of replacables 1862 <2> ;; 1863 <2> ;; OUTPUTS: 1864 <2> ;; REGS USED: All 1865 <2> ;; 1866 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1867 <2> ;; 1868 <2> $M_DISPLAY_MESSAGE PROC NEAR ;;AN000;; 1869 <2> ;; 1870 <2> ; $DO ;;AN000;; Note: DS:SI -> message 1871 <2> $MDO165: 1872 <2> XOR DX,DX ;;AN000;; Set size = 0 1873 <2> OR CX,CX ;;AN000;; Are we finished the message yet? 1874 <2> ; $IF NZ ;;AN000;; No, 1875 <2> JZ $MIF166 1876 <2> MOV AH,"%" ;;AN000;; Prepare to scan for % 1877 <2> MOV AL,0 ;;AN004;; 1878 <2> ;; 1879 <2> ; $DO ;;AN000;; Scan through string until % 1880 <2> $MDO167: 1881 <2> CMP BYTE PTR [ES:DI],AH ;;AN000;; Is this character NOT a % 1882 <2> ; $LEAVE E,AND ;;AN000;; No, 1883 <2> JNE $MLL168 1884 <2> CMP BYTE PTR [ES:DI+1],AH ;;AN000;; Is the next character also a % 1885 <2> ; $LEAVE NE,AND ;;AN000;; No, 1886 <2> JE $MLL168 1887 <2> CMP AL,AH ;;AN000;; Was the character before a % 1888 <2> ; $LEAVE NE ;;AN000;; No, GREAT found it 1889 <2> JNE $MEN167 1890 <2> $MLL168: 1891 <2> MOV AL,BYTE PTR [ES:DI] ;;AN004;; Yes, (to any of the above) 1892 <2> CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? 1893 <2> ; $IF C ;;AN004;; Yes, 1894 <2> JNC $MIF169 1895 <2> INC DI ;;AN004;; Increment past second part 1896 <2> ; $ENDIF ;;AN004;; 1897 <2> $MIF169: 1898 <2> INC DI ;;AN000;; Next character in string 1899 <2> INC DX ;;AN000;; Size = Size + 1 1900 <2> DEC CX ;;AN000;; Decrement total size 1901 <2> ; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line 1902 <2> JNZ $MDO167 1903 <2> $MEN167: 1904 <2> ; $ENDIF ;;AN000;; 1905 <2> $MIF166: 1906 <2> ;; 1907 <2> PUSH SI ;;AN000;; Save beginning of sublists 1908 <2> XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX) 1909 <2> OR BP,BP ;;AN000;; Do we have any replacables to do? 1910 <2> ; $IF NZ ;;AN000;; Yes, 1911 <2> JZ $MIF173 1912 <2> DEC BP ;;AN000;; Decrement number of replacables 1913 <2> 1914 <2> ;; Search through sublists to find applicable one 1915 <2> 1916 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 1917 <2> ; $IF E ;;AN000;; No, 1918 <2> JNE $MIF174 1919 <2> ; $SEARCH ;;AN000;; 1920 <2> $MDO175: 1921 <2> MOV AL,[$M_SL + $M_S_ID] ;;AN000;; Get ID byte 1922 <2> ADD AL,30H ;;AN000;; Convert to ASCII 1923 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Is this the right sublist? 1924 <2> ; $EXITIF E ;;AN000;; 1925 <2> JNE $MIF175 1926 <2> ; $ORELSE ;;AN000;; No, 1927 <2> JMP SHORT $MSR175 1928 <2> $MIF175: 1929 <2> CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 1930 <2> ; $LEAVE E,AND ;;AN000;; Yes, 1931 <2> JNE $MLL178 1932 <2> OR DX,DX ;;AN000;; Are we at the end of the message? 1933 <2> ; $LEAVE Z ;;AN000;; No, 1934 <2> JZ $MEN175 1935 <2> $MLL178: 1936 <2> ADD SI,WORD PTR [$M_SL + $M_S_SIZE] ;;AN000;; Next SUBLIST 1937 <2> ; $ENDLOOP ;;AN000;; Yes, 1938 <2> JMP SHORT $MDO175 1939 <2> $MEN175: 1940 <2> CMP byte [$M_RT + $M_CLASS],UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1941 <2> ; $IF E ;;AN004;; Yes, 1942 <2> JNE $MIF180 1943 <2> INC DX ;;AN000;; Remember to display CR,LF 1944 <2> INC DX ;;AN000;; at the end of the message 1945 <2> DEC CX ;;AN000;; Adjust message length 1946 <2> DEC CX ;;AN000;; 1947 <2> DEC DI ;;AN000;; Adjust ending address of message 1948 <2> DEC DI ;;AN000;; 1949 <2> ; $ELSE ;;AN004;; No, 1950 <2> JMP SHORT $MEN180 1951 <2> $MIF180: 1952 <2> MOV DX,-1 ;;AN004;; Set special case 1953 <2> ; $ENDIF ;;AN004;; 1954 <2> $MEN180: 1955 <2> ; $ENDSRCH ;;AN000;; 1956 <2> $MSR175: 1957 <2> ; $ENDIF ;;AN000;; 1958 <2> $MIF174: 1959 <2> ; $ENDIF ;;AN000;; 1960 <2> $MIF173: 1961 <2> 1962 <2> ;; Prepare and display this part of message 1963 <2> 1964 <2> PUSH DI ;;AN000;; Save pointer to replace number 1965 <2> SUB DI,CX ;;AN000;; Determine beginning of string 1966 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) 1967 <2> POP DI ;;AN000;; Get back pointer to replace number 1968 <2> POP CX ;;AN000;; Clean up stack in case error 1969 <2> ; $LEAVE C,LONG ;;AN000;; Fail if carry was set 1970 <2> JNC $MXL3 1971 <2> JMP $MEN165 1972 <2> nop ; identicalise 1973 <2> $MXL3: 1974 <2> PUSH CX ;;AN000;; 1975 <2> 1976 <2> ;; Save and reset pointer registers 1977 <2> 1978 <2> MOV CX,DX ;;AN000;; Get the size of the rest of the message 1979 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case? 1980 <2> ; $IF NE ;;AN000;; No, 1981 <2> JE $MIF187 1982 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1983 <2> ; $IF NZ ;;AN000;; No, 1984 <2> JZ $MIF188 1985 <2> DEC CX ;;AN000;; Decrement total size (%) 1986 <2> DEC CX ;;AN000;; Decrement total size (#) 1987 <2> INC DI ;;AN000;; Go past % 1988 <2> INC DI ;;AN000;; Go past replace number 1989 <2> ; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) 1990 <2> JMP SHORT $MEN188 1991 <2> $MIF188: 1992 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 1993 <2> ; $ENDIF ;;AN000;; Yes, Note this will not leave because INC 1994 <2> $MEN188: 1995 <2> ; $ELSE ;;AN000;; 1996 <2> JMP SHORT $MEN187 1997 <2> $MIF187: 1998 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1999 <2> ; $IF Z ;;AN004;; No, 2000 <2> JNZ $MIF192 2001 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 2002 <2> ; $ELSE ;;AN000;; No, 2003 <2> JMP SHORT $MEN192 2004 <2> $MIF192: 2005 <2> CMP CX,-1 ;;AN004;; Are we at the end of the message? 2006 <2> ; $IF Z ;;AN004;; No, 2007 <2> JNZ $MIF194 2008 <2> XOR CX,CX ;;AN004;; 2009 <2> ; $ENDIF ;;AN000;; 2010 <2> $MIF194: 2011 <2> OR DI,DI ;;AN004;; Turn ZF off 2012 <2> ; $ENDIF ;;AN000;; 2013 <2> $MEN192: 2014 <2> ; $ENDIF ;;AN000;; Note this will not leave because INC 2015 <2> $MEN187: 2016 <2> ; $LEAVE Z ;;AN000;; 2017 <2> JZ $MEN165 2018 <2> PUSH BP ;;AN000;; Save the replace count 2019 <2> PUSH DI ;;AN000;; Save location to complete message 2020 <2> PUSH ES ;;AN000;; 2021 <2> PUSH CX ;;AN000;; Save size of the rest of the message 2022 <2> XOR CX,CX ;;AN000;; Reset CX used for character count 2023 <2> 2024 <2> ;; Determine what action is required on parameter 2025 <2> 2026 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2027 <2> ; $IF E ;;AN000;; 2028 <2> JNE $MIF199 2029 <2> 2030 <2> %IF CHARmsg ;;AN000;; Was Char specified? 2031 <2> Char_Type equ Char_type ; NASM port equate 2032 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2033 <2> ; $IF Z ;;AN000;; 2034 <2> JNZ $MIF200 2035 <2> 2036 <2> ;; Character type requested 2037 <2> ;;AN000;; 2038 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2039 <2> CALL $M_CHAR_REPLACE ;;AN000;; 2040 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2041 <2> JMP SHORT $MEN200 2042 <2> $MIF200: 2043 <2> %ENDIF ;;AN000;; 2044 <2> %IF NUMmsg ;;AN000;; Was Nnmeric type specified? 2045 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2046 <2> ; $IF Z,OR ;;AN000;; 2047 <2> JZ $MLL202 2048 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2049 <2> ; $IF Z,OR ;;AN000;; 2050 <2> JZ $MLL202 2051 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Bin_Hex_Type & $M_TYPE_MASK ;;AN000;; 2052 <2> ; $IF Z ;;AN000;; 2053 <2> JNZ $MIF202 2054 <2> $MLL202: 2055 <2> 2056 <2> ;; Numeric type requested 2057 <2> 2058 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2059 <2> CALL $M_BIN2ASC_REPLACE ;;AN000;; 2060 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2061 <2> JMP SHORT $MEN202 2062 <2> $MIF202: 2063 <2> %ENDIF ;;AN000;; 2064 <2> %IF DATEmsg ;;AN000;; Was date specified? 2065 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Date_Type & $M_TYPE_MASK ;;AN000;; 2066 <2> ; $IF E ;;AN000;; 2067 <2> JNE $MIF204 2068 <2> 2069 <2> ;; Date type requested 2070 <2> 2071 <2> CALL $M_DATE_REPLACE ;;AN000;; 2072 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2073 <2> JMP SHORT $MEN204 2074 <2> $MIF204: 2075 <2> %ENDIF ;;AN000;; 2076 <2> %IF TIMEmsg ;;AN000;; Was time (12 hour format) specified? 2077 <2> 2078 <2> ;; Time type requested (Default if we have not matched until here) 2079 <2> 2080 <2> CALL $M_TIME_REPLACE ;;AN000;; 2081 <2> %ENDIF ;;AN000;; 2082 <2> 2083 <2> %IF DATEmsg ;;AN000;; 2084 <2> ; $ENDIF ;;AN000;; 2085 <2> $MEN204: 2086 <2> %ENDIF ;;AN000;; 2087 <2> %IF NUMmsg ;;AN000;; 2088 <2> ; $ENDIF ;;AN000;; 2089 <2> $MEN202: 2090 <2> %ENDIF ;;AN000;; 2091 <2> %IF CHARmsg ;;AN000;; 2092 <2> ; $ENDIF ;;AN000;; 2093 <2> $MEN200: 2094 <2> %ENDIF ;;AN000;; 2095 <2> 2096 <2> %IF $M_REPLACE ;;AN000;; 2097 <2> ;; With the replace information of the Stack, display the replaceable field 2098 <2> 2099 <2> CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace 2100 <2> %ENDIF ;;AN000;; 2101 <2> ;; None of the above - Extended/Parse replace 2102 <2> ; $ELSE ;;AN000;; 2103 <2> JMP SHORT $MEN199 2104 <2> $MIF199: 2105 <2> %IFN COMR 2106 <2> CALL $M_EXT_PAR_REPLACE ;;AN000;; 2107 <2> %ENDIF 2108 <2> ; $ENDIF ;;AN000;; 2109 <2> $MEN199: 2110 <2> 2111 <2> ;; We must go back and complete the message after the replacable parameter if there is any left 2112 <2> 2113 <2> ; $IF NC ;;AN000;; IF there was an error displaying then EXIT 2114 <2> JC $MIF211 2115 <2> POP CX ;;AN000;; Get size of the rest of the message 2116 <2> POP ES ;;AN000;; Get address of the rest of the message 2117 <2> POP DI ;;AN000;; 2118 <2> POP BP ;;AN000;; Get replacment count 2119 <2> POP SI ;;AN000;; ELSE get address of first sublist structure 2120 <2> ; $ELSE ;;AN000;; 2121 <2> JMP SHORT $MEN211 2122 <2> $MIF211: 2123 <2> ADD SP,10 ;;AN000;; Clean up stack if error 2124 <2> STC ;;AN000;; 2125 <2> ; $ENDIF ;;AN000;; 2126 <2> $MEN211: 2127 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2128 <2> ; $ENDDO NE,OR ;;AN000;; 2129 <2> JNE $MLL214 2130 <2> ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message 2131 <2> JC $MXL4 2132 <2> JMP $MDO165 2133 <2> $MXL4: 2134 <2> $MLL214: 2135 <2> $MEN165: 2136 <2> ;; IF there was an error displaying then EXIT 2137 <2> MOV word [$M_RT + $M_MSG_NUM],0 ;;AN000;; Reset message number to null 2138 <2> RET ;;AN000;; Return 2139 <2> ;; 2140 <2> $M_DISPLAY_MESSAGE ENDP ;;AN000;; 2141 <2> %IFN COMR 2142 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2143 <2> ;; 2144 <2> ;; PROC NAME: $M_EXT_PAR_REPLACE 2145 <2> ;; 2146 <2> ;; FUNCTION: 2147 <2> ;; INPUTS: 2148 <2> ;; OUPUTS: 2149 <2> ;; 2150 <2> ;; REGS USED: 2151 <2> ;; 2152 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2153 <2> ;; 2154 <2> $M_EXT_PAR_REPLACE PROC NEAR ;;AN000;; 2155 <2> ;; 2156 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2157 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN000;; Prepare for get binary value (LOW) 2158 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2159 <2> ;; 2160 <2> CALL $M_CONVERT2ASC ;;AN000;; 2161 <2> ;; 2162 <2> ; $DO ;;AN000;; 2163 <2> $MDO215: 2164 <2> POP AX ;;AN000;; Get character in register 2165 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2166 <2> INC BX ;;AN000;; Increase buffer count 2167 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2168 <2> ; $IF E ;;AN000;; Yes, 2169 <2> JNE $MIF216 2170 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2171 <2> ; $ENDIF ;;AN000;; 2172 <2> $MIF216: 2173 <2> DEC CL ;;AN000;; Have we completed replace? 2174 <2> ; $ENDDO Z ;;AN000;; 2175 <2> JNZ $MDO215 2176 <2> ;; 2177 <2> MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer 2178 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],AX ;;AN000;; Move char into the buffer 2179 <2> INC BX ;;AN000;; Increase buffer count 2180 <2> INC BX ;;AN000;; Increase buffer count 2181 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2182 <2> RET ;;AN000:: 2183 <2> ;; 2184 <2> $M_EXT_PAR_REPLACE ENDP ;;AN000;; 2185 <2> ;; 2186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2187 <2> %ENDIF 2188 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 2189 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 2190 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2191 <2> ;; 2192 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 2193 <2> ;; 2194 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 2195 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 2196 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2197 <2> ;; IF CX > 1 THEN DS:SI points to the specified message 2198 <2> ;; REGS CHANGED: ES,DI,CX,DS,SI 2199 <2> ;; 2200 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2201 <2> ;; 2202 <2> %IF FARmsg ;;AN000;; 2203 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 2204 <2> %ELSE ;;AN000;; 2205 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 2206 <2> %ENDIF ;;AN000;; 2207 <2> ;; 2208 <2> PUSH SI ;;AN000;; 2209 <2> PUSH BX ;;AN000;; 2210 <2> XOR SI,SI ;;AN000;; Use SI as an index 2211 <2> XOR CX,CX ;;AN000;; Use CX as an size 2212 <2> ; $DO ;;AN000;; 2213 <2> $MDO219: 2214 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 2215 <2> ; $IF E ;;AN000;; Yes, 2216 <2> JNE $MIF220 2217 <2> %IF FARmsg ;;AN000;; 2218 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2219 <2> MOV BX,ES ;;AN000; 2220 <2> %ELSE ;;AN000;; 2221 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2222 <2> MOV BX,DI ;;AN000; 2223 <2> %ENDIF ;;AN000;; 2224 <2> ; $ELSE ;;AN000;; No, 2225 <2> JMP SHORT $MEN220 2226 <2> $MIF220: 2227 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 2228 <2> ; $IF NE ;;AN000;; Yes, 2229 <2> JE $MIF222 2230 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 2231 <2> MOV BX,ES ;;AN000; 2232 <2> ; $ELSE ;;AN000;; No, extended errors were specified 2233 <2> JMP SHORT $MEN222 2234 <2> $MIF222: 2235 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 2236 <2> ; $IF AE,AND ;;AN000;; 2237 <2> JNAE $MIF224 2238 <2> CMP AX,$M_CRIT_HI ;;AN000;; 2239 <2> ; $IF BE ;;AN000;; Yes, 2240 <2> JNBE $MIF224 2241 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 2242 <2> MOV BX,ES ;;AN000; 2243 <2> ; $ELSE ;;AN000;; 2244 <2> JMP SHORT $MEN224 2245 <2> $MIF224: 2246 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 2247 <2> MOV BX,ES ;;AN000; 2248 <2> ; $ENDIF ;;AN000;; 2249 <2> $MEN224: 2250 <2> ; $ENDIF ;;AN000;; 2251 <2> $MEN222: 2252 <2> ; $ENDIF ;;AN000;; 2253 <2> $MEN220: 2254 <2> ;; 2255 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 2256 <2> ; $IF E ;;AN000;; Yes, 2257 <2> JNE $MIF229 2258 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 2259 <2> ; $IF E ;;AN000;; Yes, 2260 <2> JNE $MIF230 2261 <2> STC ;;AN000;; Set the carry flag 2262 <2> ; $ELSE ;;AN000;; No, 2263 <2> JMP SHORT $MEN230 2264 <2> $MIF230: 2265 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 2266 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 2267 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 2268 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 2269 <2> CLC ;;AN000;; 2270 <2> ; $ENDIF ;;AN000;; No, 2271 <2> $MEN230: 2272 <2> ; $ELSE ;;AN000;; 2273 <2> JMP SHORT $MEN229 2274 <2> $MIF229: 2275 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 2276 <2> ; $IF NE ;;AN001;; Yes, 2277 <2> JE $MIF234 2278 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 2279 <2> ; $ENDIF ;;AN000;; 2280 <2> $MIF234: 2281 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 2282 <2> CLC ;;AN000;; 2283 <2> ; $ENDIF ;;AN000;; 2284 <2> $MEN229: 2285 <2> ; $LEAVE C ;;AN000;; 2286 <2> JC $MEN219 2287 <2> OR CX,CX ;;AN000;; Was the message found? 2288 <2> ; $ENDDO NZ,LONG ;;AN000;; 2289 <2> JNZ $MXL5 2290 <2> JMP $MDO219 2291 <2> $MXL5: 2292 <2> $MEN219: 2293 <2> 2294 <2> PUSHF ;;AN006;; Save the flag state 2295 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 2296 <2> ; $IF E ;;AN006;; Yes, 2297 <2> JNE $MIF239 2298 <2> PUSH DX ;;AN006;; Save all needed registers 2299 <2> PUSH BP ;;AN006;; 2300 <2> PUSH CX ;;AN006;; 2301 <2> PUSH ES ;;AN006;; 2302 <2> PUSH DI ;;AN006;; 2303 <2> PUSH AX ;;AN006;; 2304 <2> 2305 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 2306 <2> INT 2FH ;;AN006;; 2307 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 2308 <2> POP AX ;;AN006;; Restore msg number 2309 <2> ; $IF E ;;AN006;; Yes, 2310 <2> JNE $MIF240 2311 <2> MOV BX,AX ;;AN006;; BX is the extended error number 2312 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 2313 <2> INT 2FH ;;AN006;; Call IFSFUNC 2314 <2> ; $ELSE ;;AN006;; No, 2315 <2> JMP SHORT $MEN240 2316 <2> $MIF240: 2317 <2> STC ;;AN006;; Carry conditon 2318 <2> ; $ENDIF ;;AN006;; 2319 <2> $MEN240: 2320 <2> 2321 <2> ; $IF C ;;AN006;; Was there an update? 2322 <2> JNC $MIF243 2323 <2> POP DI ;;AN006;; No, 2324 <2> POP ES ;;AN006;; Restore old pointer 2325 <2> POP CX ;;AN006;; 2326 <2> ; $ELSE ;;AN006;; Yes 2327 <2> JMP SHORT $MEN243 2328 <2> $MIF243: 2329 <2> ADD SP,6 ;;AN006;; Throw away old pointer 2330 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 2331 <2> ; $ENDIF ;;AN006;; 2332 <2> $MEN243: 2333 <2> POP BP ;;AN006;; Restore other Regs 2334 <2> POP DX ;;AN006;; 2335 <2> ; $ENDIF ;;AN006;; 2336 <2> $MIF239: 2337 <2> $M_POPF ;;AN006;; Restore the flag state 2338 <2> 2339 <2> POP BX ;;AN000;; 2340 <2> POP SI ;;AN000;; 2341 <2> RET ;;AN000;; Return ES:DI pointing to the message 2342 <2> ;; 2343 <2> $M_GET_MSG_ADDRESS ENDP ;; 2344 <2> ;; 2345 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 2346 <2> ;; 2347 <2> PUSH DI ;;AN006;; Save position 2348 <2> PUSH AX ;;AN006;; 2349 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 2350 <2> XOR AL,AL ;;AN006;; Prepare compare register 2351 <2> REPNE SCASB ;;AN006;; Scan for zero 2352 <2> NOT CX ;;AN006;; Change decrement into number 2353 <2> DEC CX ;;AN006;; Don't include the zero 2354 <2> POP AX ;;AN006;; 2355 <2> POP DI ;;AN006;; Restore position 2356 <2> RET ;;AN006;; 2357 <2> ;; 2358 <2> $M_SET_LEN_IN_CX ENDP ;; 2359 <2> ;; 2360 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2361 <2> ;; 2362 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 2363 <2> ;; 2364 <2> ;; FUNCTION: To scan thru message headers until message is found 2365 <2> ;; INPUTS: ES:DI points to beginning of msg headers 2366 <2> ;; CX contains the number of messages in class 2367 <2> ;; DH contains the message class 2368 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2369 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 2370 <2> ;; 2371 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2372 <2> ;; 2373 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 2374 <2> ;; 2375 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 2376 <2> ; $IF E,AND ;;AN004;; Yes, 2377 <2> JNE $MIF247 2378 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 2379 <2> ; $IF NE ;;AN004;; Yes, 2380 <2> JE $MIF247 2381 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 2382 <2> ; $IF E ;;AN004;; . . . and . . . 2383 <2> JNE $MIF248 2384 <2> PUSH AX ;;AN004;; Reset the special message number 2385 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 2386 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2387 <2> POP AX ;;AN004;; Reset the special message number 2388 <2> ; $ELSE ;;AN004;; Get the old message number 2389 <2> JMP SHORT $MEN248 2390 <2> $MIF248: 2391 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2392 <2> ; $ENDIF ;;AN004;; Get the old message number 2393 <2> $MEN248: 2394 <2> ; $ELSE ;;AN004;; 2395 <2> JMP SHORT $MEN247 2396 <2> $MIF247: 2397 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 2398 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2399 <2> ; $IF NE ;;AN001;; 2400 <2> JE $MIF252 2401 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 2402 <2> ; $ELSE ;;AN001;; 2403 <2> JMP SHORT $MEN252 2404 <2> $MIF252: 2405 <2> %IF FARmsg ;;AN001;; 2406 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2407 <2> %ELSE 2408 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2409 <2> %ENDIF 2410 <2> ; $IF E ;;AN002;; pointer (hopefully) 2411 <2> JNE $MIF254 2412 <2> %IF FARmsg ;;AN001;; 2413 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2414 <2> %ELSE 2415 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2416 <2> %ENDIF 2417 <2> ; $ENDIF ;;AN002;; go on to the next class 2418 <2> $MIF254: 2419 <2> ; $ENDIF ;;AN001;; 2420 <2> $MEN252: 2421 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 2422 <2> STC ;;AN004;; Flag that we haven't found anything yet 2423 <2> ; $ENDIF ;;AN004;; 2424 <2> $MEN247: 2425 <2> 2426 <2> ; $IF C ;;AN004;; Have we found anything yet? 2427 <2> JNC $MIF258 2428 <2> CLC ;;AN004;; No, reset carry 2429 <2> ; $SEARCH ;;AN000;; 2430 <2> $MDO259: 2431 <2> OR CX,CX ;;AN000;; Do we have any to check? 2432 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2433 <2> JZ $MEN259 2434 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2435 <2> ; $IF NE ;;AN001;; 2436 <2> JE $MIF261 2437 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 2438 <2> ; $ELSE ;;AN001;; 2439 <2> JMP SHORT $MEN261 2440 <2> $MIF261: 2441 <2> %IF FARmsg ;;AN001;; 2442 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 2443 <2> %ELSE 2444 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 2445 <2> %ENDIF 2446 <2> ; $ENDIF 2447 <2> $MEN261: 2448 <2> ; $EXITIF E ;;AN000;; 2449 <2> JNE $MIF259 2450 <2> ; $ORELSE ;;AN000; 2451 <2> JMP SHORT $MSR259 2452 <2> $MIF259: 2453 <2> DEC CX ;;AN000;; No, well do we have more to check? 2454 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2455 <2> JZ $MEN259 2456 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 2457 <2> ; $ENDLOOP ;;AN000;; 2458 <2> JMP SHORT $MDO259 2459 <2> $MEN259: 2460 <2> STC ;;AN000;; 2461 <2> ; $ENDSRCH ;;AN000;; Check next message 2462 <2> $MSR259: 2463 <2> ; $IF NC ;;AN000;; Did we find the message? 2464 <2> JC $MIF269 2465 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 2466 <2> CLC ;;AN001;; 2467 <2> ; $IF E ;;AN001;; 2468 <2> JNE $MIF270 2469 <2> %IF FARmsg ;;AN001;; 2470 <2> %ELSE ;;AN000;; 2471 <2> PUSH CS ;;AN000;; 2472 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 2473 <2> %ENDIF 2474 <2> ; $ENDIF ;;AN001;; 2475 <2> $MIF270: 2476 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 2477 <2> ; $ENDIF ;;AN004;; 2478 <2> $MIF269: 2479 <2> ; $ENDIF ;;AN004;; 2480 <2> $MIF258: 2481 <2> ;; Yes, great we can return with CX > 0 2482 <2> 2483 <2> ; $IF NC ;;AN000;; Did we find the message? 2484 <2> JC $MIF274 2485 <2> XOR CH,CH ;;AN000;; 2486 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 2487 <2> INC DI ;;AN000;; Increment past length 2488 <2> ; $ENDIF ;;AN004;; 2489 <2> $MIF274: 2490 <2> 2491 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 2492 <2> RET ;;AN000;; Return 2493 <2> ;; 2494 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 2495 <2> ;; 2496 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2497 <2> %ENDIF ;;AN000;; END of include of common subroutines 2498 <2> ; 2499 <2> %IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms 2500 <2> %iassign $M_REPLACE FALSE ;;AN000;; Tell the assembler we did 2501 <2> ;; 2502 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2503 <2> $M_DISPLAY_REPLACE PROC NEAR ;;AN000;; 2504 <2> ;; 2505 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2506 <2> %IFN COMR 2507 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII) 2508 <2> ; $IF E ;;AN000;; Yes, 2509 <2> JNE $MIF276 2510 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE_HYP ;;AN000;; Move in a " -" 2511 <2> INC BX ;;AN000;; Increment count 2512 <2> INC BX ;;AN000;; Increment count 2513 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE ;;AN000;; Move in a " " 2514 <2> INC BX ;;AN000;; Increment count 2515 <2> CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case 2516 <2> ; $ENDIF ;;AN000;; If it fails we will catch it later 2517 <2> $MIF276: 2518 <2> %ENDIF 2519 <2> 2520 <2> POP BP ;;AN000;; Remember the return address 2521 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2522 <2> XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack 2523 <2> 2524 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save size to later clear stack 2525 <2> MOV AL,BYTE PTR [$M_SL + $M_S_MINW] ;;AN000;; Get the minimum width 2526 <2> ;; 2527 <2> CMP AL,CL ;;AN000;; Do we need pad chars added? 2528 <2> ; $IF A ;;AN000;; Yes, 2529 <2> JNA $MIF278 2530 <2> SUB AL,CL ;;AN000;; Calculate how many pad chars are needed. 2531 <2> MOV DH,AL ;;AN000;; Save the number of pad characters 2532 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be right aligned? 2533 <2> ; $IF NZ ;;AN000;; Yes, 2534 <2> JZ $MIF279 2535 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2536 <2> $MDO280: 2537 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2538 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2539 <2> INC BX ;;AN000;; 2540 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2541 <2> ; $IF E ;;AN000;; Yes, 2542 <2> JNE $MIF281 2543 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2544 <2> ; $ENDIF ;;AN000;; 2545 <2> $MIF281: 2546 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2547 <2> ; $ENDDO Z ;;AN000;; No, next pad character 2548 <2> JNZ $MDO280 2549 <2> ; $ENDIF ;;AN000;; 2550 <2> $MIF279: 2551 <2> ; $ENDIF ;;AN000;; Yes, 2552 <2> $MIF278: 2553 <2> ;; 2554 <2> CMP BYTE [$M_SL + $M_S_MAXW],$M_UNLIM_W ;;AN000;; Is maximum width unlimited? 2555 <2> ; $IF NE ;;AN000;; 2556 <2> JE $MIF286 2557 <2> CMP BYTE PTR [$M_SL + $M_S_MAXW],CL ;;AN000;; Will we exceed maximum width? 2558 <2> ; $IF B ;;AN000;; Yes, 2559 <2> JNB $MIF287 2560 <2> SUB CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Calculate how many extra chars 2561 <2> MOV DL,CL ;;AN000;; Remember how many chars to pop off 2562 <2> MOV CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Set new string length 2563 <2> ; $ENDIF ;;AN000;; 2564 <2> $MIF287: 2565 <2> ; $ENDIF ;;AN000;; 2566 <2> $MIF286: 2567 <2> OR CX,CX ;;AN000;; 2568 <2> ; $IF NZ ;;AN000;; 2569 <2> JZ $MIF290 2570 <2> ; $DO ;;AN000;; Begin filling buffer with string 2571 <2> $MDO291: 2572 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2573 <2> ; $IF Z,AND ;;AN000;; 2574 <2> JNZ $MIF292 2575 <2> Char_field_ASCIIZ equ Char_Field_ASCIIZ ; NASM port equate 2576 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ; Is this replace a ASCIIZ string? 2577 <2> ; $IF NZ ;;AN000;; Yes, 2578 <2> JZ $MIF292 2579 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get first character from string 2580 <2> INC DI ;;AN000;; Next character in string 2581 <2> ; $ELSE ;;AN000;; No, 2582 <2> JMP SHORT $MEN292 2583 <2> $MIF292: 2584 <2> POP AX ;;AN000;; Get character in register 2585 <2> ; $ENDIF ;;AN000;; 2586 <2> $MEN292: 2587 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2588 <2> INC BX ;;AN000;; Increase buffer count 2589 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2590 <2> ; $IF E ;;AN000;; Yes, 2591 <2> JNE $MIF295 2592 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2593 <2> ; $ENDIF ;;AN000;; 2594 <2> $MIF295: 2595 <2> DEC CL ;;AN000;; Have we completed replace? 2596 <2> ; $ENDDO Z ;;AN000;; Test again 2597 <2> JNZ $MDO291 2598 <2> ; $ENDIF ;;AN000;; 2599 <2> $MIF290: 2600 <2> ;; 2601 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be left aligned? 2602 <2> ; $IF Z ;;AN000;; Yes, 2603 <2> JNZ $MIF299 2604 <2> OR DH,DH ;;AN000;; Do we need pad chars added? 2605 <2> ; $IF NZ ;;AN000;; Yes, 2606 <2> JZ $MIF300 2607 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2608 <2> $MDO301: 2609 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2610 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2611 <2> INC BX ;;AN000;; 2612 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2613 <2> ; $IF E ;;AN000;; Yes, 2614 <2> JNE $MIF302 2615 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2616 <2> ; $ENDIF ;;AN000;; 2617 <2> $MIF302: 2618 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2619 <2> ; $ENDDO Z ;;AN000;; Test again 2620 <2> JNZ $MDO301 2621 <2> ; $ENDIF ;;AN000;; 2622 <2> $MIF300: 2623 <2> ; $ENDIF ;;AN000;; 2624 <2> $MIF299: 2625 <2> ;; 2626 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2627 <2> ; $IF Z,AND ;;AN000;; 2628 <2> JNZ $MIF307 2629 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string? 2630 <2> ; $IF NZ ;;AN000;; Yes, 2631 <2> JZ $MIF307 2632 <2> ; $ELSE ;;AN000;; 2633 <2> JMP SHORT $MEN307 2634 <2> $MIF307: 2635 <2> OR DL,DL ;;AN000;; 2636 <2> ; $IF NE ;;AN000;; 2637 <2> JE $MIF309 2638 <2> ; $DO ;;AN000;; 2639 <2> $MDO310: 2640 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable 2641 <2> DEC DL ;;AN000;; Are we done? 2642 <2> ; $ENDDO Z ;;AN000;; 2643 <2> JNZ $MDO310 2644 <2> ; $ENDIF ;;AN000;; 2645 <2> $MIF309: 2646 <2> ; $ENDIF ;;AN000;; 2647 <2> $MEN307: 2648 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time 2649 <2> PUSH BP ;;AN000;; Restore the return address 2650 <2> ;; 2651 <2> RET ;;AN000;; 2652 <2> ;; 2653 <2> $M_DISPLAY_REPLACE ENDP ;;AN000;; 2654 <2> ;; 2655 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2656 <2> ;; 2657 <2> ;; PROC NAME: $M_FLUSH_BUFFER 2658 <2> ;; 2659 <2> ;; FUNCTION: Display the contents of the temporary buffer 2660 <2> ;; INPUTS: DI contains the number of bytes to display 2661 <2> ;; OUTPUTS: BX reset to zero 2662 <2> ;; 2663 <2> ;; REGS USED: 2664 <2> ;; 2665 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2666 <2> ;; 2667 <2> $M_FLUSH_BUF PROC NEAR ;;AN000;; 2668 <2> ;; 2669 <2> PUSH CX ;;AN000;; Save changed regs 2670 <2> PUSH ES ;;AN000;; 2671 <2> PUSH DI ;;AN000;; 2672 <2> PUSH DS ;;AN000;; Set ES pointing to buffer 2673 <2> POP ES ;;AN000;; 2674 <2> ;; 2675 <2> MOV CX,BX ;;AN000;; Set number of bytes to display 2676 <2> XOR BX,BX ;;AN000;; Reset buffer counter 2677 <2> LEA DI,[$M_RT + $M_TEMP_BUF] ;;AN000;; Reset buffer location pointer 2678 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer 2679 <2> ;; 2680 <2> ; $IF NC ;;AN000;; Error? 2681 <2> JC $MIF314 2682 <2> POP DI ;;AN000;; No, Restore changed regs 2683 <2> POP ES ;;AN000;; 2684 <2> POP CX ;;AN000;; 2685 <2> ; $ELSE ;;AN000;; Yes, 2686 <2> JMP SHORT $MEN314 2687 <2> $MIF314: 2688 <2> ADD SP,6 ;;AN000;; Fix stack 2689 <2> STC ;;AN000;; 2690 <2> ; $ENDIF ;;AN000;; Error? 2691 <2> $MEN314: 2692 <2> ;; 2693 <2> RET ;;AN000;; Return 2694 <2> ;; 2695 <2> $M_FLUSH_BUF ENDP ;;AN000;; 2696 <2> ;; 2697 <2> ;; 2698 <2> %IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace? 2699 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2700 <2> %iassign $M_CHAR_ONLY TRUE ;;AN000;; replacement code later 2701 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2702 <2> ;; 2703 <2> ;; PROC NAME: $M_CHAR_REPLACE 2704 <2> ;; 2705 <2> ;; FUNCTION: Will prepare a single char or ASCIIZ string for replace 2706 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2707 <2> ;; ES:DI contains the VALUE from SUBLIST 2708 <2> ;; OUTPUTS: CX contains number of characters on stack 2709 <2> ;; Top of stack --> Last character 2710 <2> ;; . . . 2711 <2> ;; Bot of stack --> First character 2712 <2> ;; 2713 <2> ;; OTHER REGS Revised: AX 2714 <2> ;; 2715 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2716 <2> ;; 2717 <2> $M_CHAR_REPLACE PROC NEAR ;;AN000;; 2718 <2> ;; 2719 <2> POP BP ;;AN000;; Save return address 2720 <2> TEST byte [$M_SL + $M_S_FLAG],~ Char_Field_Char & $M_SIZE_MASK ;;AN000;; Was Character specified? 2721 <2> ; $IF Z ;;AN000;; Yes, 2722 <2> JNZ $MIF317 2723 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2724 <2> PUSH AX ;;AN000;; Put it on the stack 2725 <2> INC CX ;;AN000;; Increase the count 2726 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 2727 <2> ; $IF C ;;AN000;; Yes, 2728 <2> JNC $MIF318 2729 <2> MOV AL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 2730 <2> PUSH AX ;;AN000;; Put it on the stack 2731 <2> CLC ;;AN000;; Clear the carry 2732 <2> ; $ENDIF ;;AN000;; 2733 <2> $MIF318: 2734 <2> ; $ELSE ;;AN000;; No, it was an ASCIIZ string 2735 <2> JMP SHORT $MEN317 2736 <2> $MIF317: 2737 <2> ; $DO ;;AN000;; 2738 <2> $MDO321: 2739 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2740 <2> OR AL,AL ;;AN000;; Is it the NULL? 2741 <2> ; $LEAVE Z ;;AN000;; No, 2742 <2> JZ $MEN321 2743 <2> INC DI ;;AN000;; Next character 2744 <2> INC CX ;;AN000;; Increment the count 2745 <2> ; $ENDDO ;;AN000;; Yes, 2746 <2> JMP SHORT $MDO321 2747 <2> $MEN321: 2748 <2> SUB DI,CX ;;AN000;; Set SI at the beginning of the string 2749 <2> ; $ENDIF ;;AN000;; 2750 <2> $MEN317: 2751 <2> ;;AN000;; 2752 <2> PUSH BP ;;AN000;; Restore return address 2753 <2> RET ;;AN000;; Return 2754 <2> ;; 2755 <2> $M_CHAR_REPLACE ENDP ;;AN000;; 2756 <2> ;; 2757 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2758 <2> %ENDIF ;;AN000;; END of include of CHAR replace code 2759 <2> ; 2760 <2> %IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace? 2761 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2762 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2763 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2764 <2> ;; 2765 <2> ;; PROC NAME: $M_BIN2ASC_REPLACE 2766 <2> ;; 2767 <2> ;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string 2768 <2> ;; and prepare to display 2769 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2770 <2> ;; ES:DI contains the VALUE from SUBLIST 2771 <2> ;; OUTPUTS: CX contains number of characters on stack 2772 <2> ;; Top of stack --> Last character 2773 <2> ;; . . . 2774 <2> ;; Bot of stack --> First character 2775 <2> ;; OTHER REGS Revised: BX,DX,AX 2776 <2> ;; 2777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2778 <2> ;; 2779 <2> $M_BIN2ASC_REPLACE PROC NEAR ;;AN000;; 2780 <2> ;; 2781 <2> POP BP ;;AN000;; Save return address 2782 <2> ;; 2783 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2784 <2> XOR AX,AX ;;AN000;; Prepare for get binary value (LOW) 2785 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE16 ;;AN000;; Set default divisor 2786 <2> XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable) 2787 <2> %IFN COMR 2788 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_BYTE & $M_SIZE_MASK ;;AN000;; Was BYTE specified? 2789 <2> ; $IF Z ;;AN000;; 2790 <2> JNZ $MIF325 2791 <2> MOV AL, BYTE PTR [ES:DI] ;;AN000;; Setup byte in AL 2792 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2793 <2> ; $IF Z ;;AN000;; 2794 <2> JNZ $MIF326 2795 <2> TEST AL,10000000b ;;AN000;; Is this number negative? 2796 <2> ; $IF NZ ;;AN000;; Yes, 2797 <2> JZ $MIF327 2798 <2> INC BX ;;AN000;; Remember that it was negative 2799 <2> AND AL,01111111b ;;AN000;; Make it positive 2800 <2> ; $ENDIF ;;AN000;; 2801 <2> $MIF327: 2802 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2803 <2> ; $ENDIF ;;AN000;; 2804 <2> $MIF326: 2805 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2806 <2> ; $IF Z ;;AN000;; 2807 <2> JNZ $MIF330 2808 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2809 <2> ; $ENDIF ;;AN000;; 2810 <2> $MIF330: 2811 <2> ; $ELSE ;;AN000;; 2812 <2> JMP SHORT $MEN325 2813 <2> $MIF325: 2814 <2> %ENDIF 2815 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_WORD & $M_SIZE_MASK ;;AN000;; Was WORD specified? 2816 <2> ; $IF Z ;;AN000;; 2817 <2> JNZ $MIF333 2818 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup byte in AL 2819 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;; AN000;; Was Signed binary specified? 2820 <2> ; $IF Z ;;AN000;; 2821 <2> JNZ $MIF334 2822 <2> TEST AH,10000000b ;;AN000;; Is this number negative? 2823 <2> ; $IF NZ ;;AN000;; Yes, 2824 <2> JZ $MIF335 2825 <2> INC BX ;;AN000;; Remember that it was negative 2826 <2> AND AH,01111111b ;;AN000;; Make it positive 2827 <2> ; $ENDIF ;;AN000;; 2828 <2> $MIF335: 2829 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2830 <2> ; $ENDIF ;;AN000;; 2831 <2> $MIF334: 2832 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2833 <2> ; $IF Z ;;AN000;; 2834 <2> JNZ $MIF338 2835 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2836 <2> ; $ENDIF ;;AN000;; 2837 <2> $MIF338: 2838 <2> ; $ELSE ;;AN000;; 2839 <2> JMP SHORT $MEN333 2840 <2> $MIF333: 2841 <2> %IFN COMR 2842 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup Double word in DX:AX 2843 <2> MOV DX, WORD PTR [ES:DI + 2] ;;AN000;; 2844 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2845 <2> ; $IF Z ;;AN000;; 2846 <2> JNZ $MIF341 2847 <2> TEST DH,10000000b ;;AN000;; Is this number negative? 2848 <2> ; $IF NZ ;;AN000;; Yes, 2849 <2> JZ $MIF342 2850 <2> INC BX ;;AN000;; Remember that it was negative 2851 <2> AND DH,01111111b ;;AN000;; Make it positive 2852 <2> ; $ENDIF ;;AN000;; 2853 <2> $MIF342: 2854 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2855 <2> ; $ENDIF ;;AN000;; 2856 <2> $MIF341: 2857 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2858 <2> ; $IF Z ;;AN000;; 2859 <2> JNZ $MIF345 2860 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2861 <2> ; $ENDIF ;;AN000;; 2862 <2> $MIF345: 2863 <2> %ENDIF 2864 <2> ; $ENDIF ;;AN000;; 2865 <2> $MEN333: 2866 <2> ; $ENDIF ;;AN000;; 2867 <2> $MEN325: 2868 <2> ;; 2869 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string 2870 <2> %IFN COMR 2871 <2> OR BX,BX ;;AN000;; 2872 <2> ; $IF NZ ;;AN000;; Was number negative? 2873 <2> JZ $MIF349 2874 <2> XOR DX,DX ;;AN000;; Yes, 2875 <2> MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number 2876 <2> PUSH DX ;;AN000;; 2877 <2> ; $ENDIF ;;AN000;; No, 2878 <2> $MIF349: 2879 <2> %ENDIF 2880 <2> ;; 2881 <2> PUSH BP ;;AN000;; Restore return address 2882 <2> RET ;;AN000;; Return 2883 <2> ;; 2884 <2> $M_BIN2ASC_REPLACE ENDP ;;AN000;; 2885 <2> ;; 2886 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2887 <2> %ENDIF ;;AN000;; END of include of NUM replace code 2888 <2> ; 2889 <2> %IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace? 2890 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2891 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2892 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2893 <2> ;; 2894 <2> ;; PROC NAME: $M_DATE_REPLACE 2895 <2> ;; 2896 <2> ;; FUNCTION: Convert a date to a decimal ASCII string using current 2897 <2> ;; country format and prepare to display 2898 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2899 <2> ;; ES:DI points at VALUE from SUBLIST 2900 <2> ;; OUTPUTS: CX contains number of characters on stack 2901 <2> ;; Top of stack --> Last character 2902 <2> ;; . . . 2903 <2> ;; Bot of stack --> First character 2904 <2> ;; OTHER REGS Revised: DX, AX 2905 <2> ;; 2906 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2907 <2> ;; 2908 <2> $M_DATE_REPLACE PROC NEAR ;;AN000;; 2909 <2> ;; 2910 <2> POP BP ;;AN000;; Save return address 2911 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2912 <2> CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT 2913 <2> ;;AN000;; All O.K.? 2914 <2> XOR DX,DX ;;AN000;; Reset DX value 2915 <2> XOR AX,AX ;;AN000;; Reset AX value 2916 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],0 ;;AN000;; USA Date Format 2917 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2918 <2> JNE $MIF351 2919 <2> CALL $M_YEAR ;;AN000;; Get Year 2920 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2921 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2922 <2> INC CX ;;AN000;; Increment count 2923 <2> XOR AX,AX ;;AN000;; Reset AX value 2924 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2925 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2926 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2927 <2> INC CX ;;AN000;; Increment count 2928 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2929 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2930 <2> ; $ENDIF ;;AN000;; 2931 <2> $MIF351: 2932 <2> ;; 2933 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],1 ;;AN000;; EUROPE Date Format 2934 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2935 <2> JNE $MIF353 2936 <2> CALL $M_YEAR ;;AN000;; Get Year 2937 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2938 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2939 <2> INC CX ;;AN000;; 2940 <2> XOR AX,AX ;;AN000;; Reset AX 2941 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2942 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2943 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2944 <2> INC CX ;;AN000;; 2945 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2946 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2947 <2> ; $ENDIF ;;AN000;; 2948 <2> $MIF353: 2949 <2> ;; 2950 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],2 ;;AN000;; JAPAN Date Format 2951 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2952 <2> JNE $MIF355 2953 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2954 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2955 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2956 <2> INC CX ;;AN000;; 2957 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2958 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2959 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2960 <2> INC CX ;;AN000;; 2961 <2> CALL $M_YEAR ;;AN000;; Get Year 2962 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2963 <2> ; $ENDIF ;;AN000;; 2964 <2> $MIF355: 2965 <2> ;; 2966 <2> PUSH BP ;;AN000;; Restore return address 2967 <2> RET ;;AN000;; Return 2968 <2> ;; 2969 <2> $M_DATE_REPLACE ENDP ;;AN000;; 2970 <2> ;; 2971 <2> $M_GET_DATE PROC NEAR ;;AN000;; 2972 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 2973 <2> MOV AL,0 ;;AN000;; Get current country info 2974 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 2975 <2> INT 21H ;;AN000;; 2976 <2> ; $IF C ;;AN000;; No, 2977 <2> JNC $MIF357 2978 <2> MOV WORD [$M_RT + $M_DATE_FORMAT],$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH) 2979 <2> MOV BYTE [$M_RT + $M_DATE_SEPARA],$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL) 2980 <2> ; $ENDIF ;;AN000;; 2981 <2> $MIF357: 2982 <2> RET ;;AN000;; 2983 <2> $M_GET_DATE ENDP ;;AN000;; 2984 <2> ;; 2985 <2> $M_YEAR PROC NEAR ;;AN000;; 2986 <2> MOV AX,WORD PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Year 2987 <2> TEST byte [$M_SL + $M_S_FLAG],Date_MDY_4 & $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified? 2988 <2> ; $IF Z ;;AN000;; 2989 <2> JNZ $MIF359 2990 <2> CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year 2991 <2> ; $IF A ;;AN000;; 2992 <2> JNA $MIF360 2993 <2> MOV AX,$M_MAX_2_YEAR ;;AN000;; 2994 <2> ; $ENDIF ;;AN000;; 2995 <2> $MIF360: 2996 <2> ; $ENDIF ;;AN000;; 2997 <2> $MIF359: 2998 <2> RET ;;AN000;; 2999 <2> $M_YEAR ENDP ;;AN000;; 3000 <2> ;; 3001 <2> $M_CONVERTDATE PROC NEAR ;;AN000;; 3002 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3003 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3004 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3005 <2> DEC CX ;;AN000;; Test if size only grew by 1 3006 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3007 <2> ; $IF E ;;AN000;; Yes, 3008 <2> JNE $MIF363 3009 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3010 <2> PUSH AX ;;AN000;; Save it 3011 <2> INC CX ;;AN000;; Count it 3012 <2> ; $ENDIF ;;AN000;; 3013 <2> $MIF363: 3014 <2> INC CX ;;AN000;; Restore CX 3015 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3016 <2> RET ;;AN000;; 3017 <2> $M_CONVERTDATE ENDP ;;AN000;; 3018 <2> ;; 3019 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3020 <2> %ENDIF ;;AN000;; END of include of DATE replace code 3021 <2> ; 3022 <2> %IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace? 3023 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 3024 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 3025 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3026 <2> ;; 3027 <2> ;; PROC NAME: $M_TIME_REPLACE 3028 <2> ;; 3029 <2> ;; FUNCTION: Convert a time to a decimal ASCII string 3030 <2> ;; and prepare to display 3031 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 3032 <2> ;; ES:DI points at VALUE from SUBLIST 3033 <2> ;; OUTPUTS: CX contains number of characters on stack 3034 <2> ;; Top of stack --> Last character 3035 <2> ;; . . . 3036 <2> ;; Bot of stack --> First character 3037 <2> ;; REGS USED: BP,CX,AX 3038 <2> ;; 3039 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3040 <2> ;; 3041 <2> $M_TIME_REPLACE PROC NEAR ;;AN000;; 3042 <2> ;; 3043 <2> POP BP ;;AN000;; Save return address 3044 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 3045 <2> CALL $M_GET_TIME ;;AN000;; All O.K.? 3046 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3047 <2> ; $IF NZ ;;AN000;; Yes, 3048 <2> JZ $MIF365 3049 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3050 <2> ; $IF E ;;AN000;; Yes, 3051 <2> JNE $MIF366 3052 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3053 <2> CMP AL,12 ;;AN000;; Is hour 12 or less? 3054 <2> ; $IF L,OR ;;AN000;; or 3055 <2> JL $MLL367 3056 <2> CMP AL,23 ;;AN000;; Is hour 24 or greater? 3057 <2> ; $IF G ;;AN000;; Yes, 3058 <2> JNG $MIF367 3059 <2> $MLL367: 3060 <2> MOV AL,$M_AM ;;AN000;; 3061 <2> PUSH AX ;;AN000;; Push an "a" to represent AM. 3062 <2> INC CX ;;AN000;; 3063 <2> ; $ELSE ;;AN000;; No, 3064 <2> JMP SHORT $MEN367 3065 <2> $MIF367: 3066 <2> MOV AL,$M_PM ;;AN000;; 3067 <2> PUSH AX ;;AN000;; Push an "p" to represent PM. 3068 <2> INC CX ;;AN000;; 3069 <2> ; $ENDIF ;;AN000;; 3070 <2> $MEN367: 3071 <2> ; $ENDIF ;;AN000;; 3072 <2> $MIF366: 3073 <2> ; $ENDIF ;;AN000;; 3074 <2> $MIF365: 3075 <2> ;; 3076 <2> XOR AX,AX ;;AN000;; 3077 <2> XOR DX,DX ;;AN000;; 3078 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3079 <2> ; $IF NZ ;;AN000;; 3080 <2> JZ $MIF372 3081 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Hundreds 3082 <2> CALL $M_CONVERTTIME ;;AN000;; 3083 <2> PUSH WORD [$M_RT + $M_DECI_SEPARA] ;;AN000;; 3084 <2> INC CX ;;AN000;; 3085 <2> ; $ENDIF ;;AN000;; 3086 <2> $MIF372: 3087 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3088 <2> ; $IF NZ,OR ;;AN000;; 3089 <2> JNZ $MLL374 3090 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSS_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? 3091 <2> ; $IF NZ ;;AN000;; 3092 <2> JZ $MIF374 3093 <2> $MLL374: 3094 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Seconds 3095 <2> CALL $M_CONVERTTIME ;;AN000;; 3096 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3097 <2> INC CX ;;AN000;; 3098 <2> ; $ENDIF ;;AN000;; 3099 <2> $MIF374: 3100 <2> ;; Do Hour/Min (12 Hour) 3101 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+1] ;;AN000;; Get Minutes 3102 <2> CALL $M_CONVERTTIME ;;AN000;; 3103 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3104 <2> INC CX ;;AN000;; 3105 <2> ;; 3106 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3107 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3108 <2> ; $IF NZ ;;AN000;; Yes, 3109 <2> JZ $MIF376 3110 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3111 <2> ; $IF E ;;AN000;; Yes, 3112 <2> JNE $MIF377 3113 <2> CMP AL,13 ;;AN000;; Is hour less than 12? 3114 <2> ; $IF GE ;;AN000;; Yes, 3115 <2> JNGE $MIF378 3116 <2> SUB AL,12 ;;AN000;; Set to a 12 hour value 3117 <2> ; $ENDIF ;;AN000;; 3118 <2> $MIF378: 3119 <2> CMP AL,0 ;;AN000;; Is hour less than 12? 3120 <2> ; $IF E ;;AN000;; Yes, 3121 <2> JNE $MIF380 3122 <2> MOV AL,12 ;;AN000;; Set to a 12 hour value 3123 <2> ; $ENDIF ;;AN000;; 3124 <2> $MIF380: 3125 <2> ; $ENDIF ;;AN000;; 3126 <2> $MIF377: 3127 <2> ; $ENDIF ;;AN000;; 3128 <2> $MIF376: 3129 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII 3130 <2> ;; 3131 <2> PUSH BP ;;AN000;; Restore return address 3132 <2> RET ;;AN000;; Return 3133 <2> ;; 3134 <2> $M_TIME_REPLACE ENDP ;;AN000;; 3135 <2> ;; 3136 <2> $M_GET_TIME PROC NEAR ;;AN000;; 3137 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 3138 <2> MOV AL,0 ;;AN000;; Get current country info 3139 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 3140 <2> INT 21H ;;AN000;; 3141 <2> ; $IF C ;;AN000;; No, 3142 <2> JNC $MIF384 3143 <2> MOV WORD [$M_RT + $M_TIME_FORMAT],$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH) 3144 <2> MOV BYTE [$M_RT + $M_TIME_SEPARA],$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL) 3145 <2> MOV BYTE [$M_RT + $M_DECI_SEPARA],$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL) 3146 <2> ; $ENDIF ;;AN000;; 3147 <2> $MIF384: 3148 <2> RET ;;AN000;; 3149 <2> $M_GET_TIME ENDP ;;AN000;; 3150 <2> ;; 3151 <2> $M_CONVERTTIME PROC NEAR ;;AN000;; 3152 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3153 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3154 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3155 <2> DEC CX ;;AN000;; Test if size only grew by 1 3156 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3157 <2> ; $IF E ;;AN000;; Yes, 3158 <2> JNE $MIF386 3159 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3160 <2> PUSH AX ;;AN000;; Save it 3161 <2> INC CX ;;AN000;; Count it 3162 <2> ; $ENDIF ;;AN000;; 3163 <2> $MIF386: 3164 <2> INC CX ;;AN000;; Restore CX 3165 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3166 <2> RET ;;AN000;; 3167 <2> $M_CONVERTTIME ENDP ;;AN000;; 3168 <2> ;; 3169 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3170 <2> %ENDIF ;;AN000;; END of include of TIME replace 3171 <2> %ENDIF ;;AN000;; END of include of Replacement common code 3172 <2> ; 3173 <2> %IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace? 3174 <2> INPUTmsg equ FALSE ;;AN000;; Yes, THEN include it and reset the flag 3175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3176 <2> ;; 3177 <2> ;; PROC NAME: $M_WAIT_FOR_INPUT 3178 <2> ;; 3179 <2> ;; FUNCTION: To accept keyed input and return extended key value 3180 <2> ;; in AX register 3181 <2> ;; INPUTS: DL contains the DOS function requested for input 3182 <2> ;; OUPUTS: AX contains the extended key value that was read 3183 <2> ;; REGS USED: 3184 <2> ;; 3185 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3186 <2> ;; 3187 <2> $M_WAIT_FOR_INPUT PROC NEAR ;;AN000;; 3188 <2> ;; 3189 <2> PUSH CX ;;AN000;; Save CX 3190 <2> PUSH DX ;;AN000;; Save DX 3191 <2> PUSH DS ;;AN000;; Save Data segment 3192 <2> ;; 3193 <2> CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? 3194 <2> ; $IF A ;;AN001;; Yes, 3195 <2> JNA $MIF388 3196 <2> MOV AL,DL ;;AN001;; Mov function into AL 3197 <2> AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble 3198 <2> MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function 3199 <2> ; $ELSE ;;AN001;; No, 3200 <2> JMP SHORT $MEN388 3201 <2> $MIF388: 3202 <2> MOV AH,DL ;;AN000;; Put DOS function in AH 3203 <2> ; $ENDIF ;;AN001;; 3204 <2> $MEN388: 3205 <2> PUSH ES ;;AN000;; Get output buffer segment 3206 <2> POP DS ;;AN000;; 3207 <2> MOV DX,DI ;;AN000;; Get output buffer offset in case needed 3208 <2> INT 21H ;;AN000;; Get keyboard input 3209 <2> POP DS ;;AN000;; 3210 <2> 3211 <2> CMP DL,DOS_BUF_KEYB_INP ;;AN000;; 3212 <2> CLC ;;AN000;; 3213 <2> ; $IF NE ;;AN000;; If character input 3214 <2> JE $MIF391 3215 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? 3216 <2> ; $IF C ;;AN000;; 3217 <2> JNC $MIF392 3218 <2> MOV CL,AL ;;AN000;; Save first character 3219 <2> MOV AH,DL ;;AN001;; Get back function 3220 <2> INT 21H ;;AN000;; Get keyboard input 3221 <2> MOV AH,CL ;;AN000;; Retreive first character AX = xxxx 3222 <2> CLC ;;AN000;; Clear carry condition 3223 <2> ; $ELSE ;;AN000;; 3224 <2> JMP SHORT $MEN392 3225 <2> $MIF392: 3226 <2> MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS 3227 <2> ; $ENDIF ;;AN000;; 3228 <2> $MEN392: 3229 <2> ; $ENDIF ;;AN000;; 3230 <2> $MIF391: 3231 <2> ;; 3232 <2> ; $IF NC ;;AN000;; 3233 <2> JC $MIF396 3234 <2> POP DX ;;AN000;; 3235 <2> POP CX ;;AN000;; 3236 <2> ; $ELSE ;;AN000;; 3237 <2> JMP SHORT $MEN396 3238 <2> $MIF396: 3239 <2> ADD SP,4 ;;AN000;; 3240 <2> STC ;;AN000;; Reset carry flag 3241 <2> ; $ENDIF ;;AN000;; 3242 <2> $MEN396: 3243 <2> RET ;;AN000;; Return 3244 <2> ;; 3245 <2> $M_WAIT_FOR_INPUT ENDP ;;AN000;; 3246 <2> ;; 3247 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3248 <2> %ENDIF ;;AN000;; END of include of Wait for Input 3249 <2> %ENDIF ;;AN000;; END of include of SYSDISPMSG 3250 <2> %ENDIF ;;AN000;; END of include of MSG_DATA_ONLY 3251 <2> %ENDIF ;;AN000;; END of include of Structure only 3252 <2> 3253 <2> ;=== Pop trace listing source 3254 <2> 437 <1> 438 <1> %ENDIF 439 <1> 18 Msg_Services "LOADmsg" 364 <1> %iassign $M_SERVICE FALSE 365 <1> %rep %0 366 <1> %iassign $M_INCLUDE TRUE 367 <1> %iassign MSG_SERVICES_MATCHED 0 368 <1> %ifidni %1, "MSGDATA" 369 <1> %iassign MSGDATA TRUE 370 <1> %iassign $M_SERVICE TRUE 371 <1> %iassign $M_INCLUDE FALSE 372 <1> %iassign MSG_SERVICES_MATCHED 1 373 <1> %else 374 <1> %iassign $M_MSGDATA_ONLY FALSE 375 <1> %endif 376 <1> 377 <1> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <1> 379 <1> %ifidni %1,"COMR" 380 <1> %iassign COMR TRUE 381 <1> %iassign $M_SERVICE TRUE 382 <1> %iassign $M_INCLUDE FALSE 383 <1> %iassign MSG_SERVICES_MATCHED 1 384 <1> %elifidni %1,"COMT" 385 <1> %iassign COMT TRUE 386 <1> %iassign $M_SERVICE TRUE 387 <1> %iassign $M_INCLUDE FALSE 388 <1> %iassign MSG_SERVICES_MATCHED 1 389 <1> %elifidni %1,"SETSTDIO" 390 <1> %iassign SETSTDIO TRUE 391 <1> %iassign $M_SERVICE TRUE 392 <1> %iassign $M_INCLUDE FALSE 393 <1> %iassign MSG_SERVICES_MATCHED 1 394 <1> %elifidni %1,"NOCHECKSTDIN" 395 <1> %iassign NOCHECKSTDIN TRUE 396 <1> %iassign $M_SERVICE TRUE 397 <1> %iassign $M_INCLUDE FALSE 398 <1> %iassign MSG_SERVICES_MATCHED 1 399 <1> %elifidni %1,"NOCHECKSTDOUT" 400 <1> %iassign NOCHECKSTDOUT TRUE 401 <1> %iassign $M_SERVICE TRUE 402 <1> %iassign $M_INCLUDE FALSE 403 <1> %iassign MSG_SERVICES_MATCHED 1 404 <1> %elifidni %1,"DISK_PROC" 405 <1> %iassign DISK_PROC TRUE 406 <1> %iassign $M_SERVICE TRUE 407 <1> %iassign $M_INCLUDE FALSE 408 <1> %iassign MSG_SERVICES_MATCHED 1 409 <1> %endif 410 <1> 411 <1> %IF $M_INCLUDE 412 <1> %define %%string %1 413 <1> %strlen %%length %%string 414 <1> %assign %%ii 1 415 <1> %define %%name "" 416 <1> %rep %%length 417 <1> %substr %%cc %%string %%ii 418 <1> %assign %%ii %%ii + 1 419 <1> %if %%cc >= 'A' && %%cc <= 'Z' 420 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <1> %endif 422 <1> %strcat %%name %%name,%%cc 423 <1> %endrep 424 <1> %ifidni %%name, "format.ctl" 425 <1> 426 <1> %else 427 <1> %include %%name 428 <1> %endif 429 <1> %ENDIF 430 <1> 431 <1> %rotate 1 432 <1> %endrep 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 433 <1> 434 <1> %IF $M_SERVICE 435 <1> 436 <1> %include "msgserv.nas" 1 <2> ;=== Push trace listing source: msgserv.nas 2 <2> 3 <2> ; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * * 4 <2> ; 5 <2> ; MODULE NAME: MSGSERV.SAL 6 <2> ; 7 <2> ; DESCRIPTIVE NAME: Message Services SALUT file 8 <2> ; 9 <2> ; FUNCTION: This module incorporates all the messages services and 10 <2> ; is called upon at build time to INCLUDE the code requested 11 <2> ; by a utility. Code is requested using the macro MSG_SERVICES. 12 <2> ; 13 <2> ; ENTRY POINT: Since this a collection of subroutines, entry point is at 14 <2> ; requested procedure. 15 <2> ; 16 <2> ; INPUT: Since this a collection of subroutines, input is dependent on function 17 <2> ; requested. 18 <2> ; 19 <2> ; EXIT-NORMAL: In all cases, CARRY FLAG = 0 20 <2> ; 21 <2> ; EXIT-ERROR: In all cases, CARRY FLAG = 1 22 <2> ; 23 <2> ; INTERNAL REFERENCES: (list of included subroutines) 24 <2> ; 25 <2> ; - SYSLOADMSG 26 <2> ; - SYSDISPMSG 27 <2> ; - SYSGETMSG 28 <2> ; 29 <2> ; 30 <2> ; EXTERNAL REFERENCES: None 31 <2> ; 32 <2> ; NOTES: At build time, some modules must be included. These are only included 33 <2> ; once using assembler switches. Other logic is included at the request 34 <2> ; of the utility. 35 <2> ; 36 <2> ; COMR and COMT are assembler switches to conditionally assemble code 37 <2> ; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident 38 <2> ; storage and multiple EQUates. 39 <2> ; 40 <2> ; REVISION HISTORY: Created MAY 1987 41 <2> ; 42 <2> ; Label: DOS - - Message Retriever 43 <2> ; (c) Copyright 1988 Microsoft 44 <2> ; 45 <2> ; 46 <2> ; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * * 47 <2> ; Page 48 <2> 49 <2> ; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting 50 <2> 51 <2> %IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN 52 <2> %iassign $M_STRUC FALSE ;;AN000;; Let the assembler know that we have 53 <2> ;;AN000;; and include them 54 <2> 55 <2> ; PAGE 56 <2> ; SUBTTL DOS - Message Retriever - MSGSTR.INC Module 57 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 58 <2> ;; 59 <2> ;; STRUCTURE: $M_SUBLIST_STRUC 60 <2> ;; 61 <2> ;; Replacable parameters are described by a sublist structure 62 <2> ;; 63 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 64 <2> ;; 65 <2> $M_SUBLIST_STRUC STRUC ;;AN000;; 66 <2> ;; 67 <2> $M_S_SIZE DB ? ;11 ;;AN000;; SUBLIST size (PTR to next SUBLIST) 68 <2> $M_S_RESV DB ? ;0 ;;AN000;; RESERVED 69 <2> $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item 70 <2> $M_S_ID DB ? ;;AN000;; n of %n 71 <2> $M_S_FLAG DB ? ;;AN000;; Data-type flags 72 <2> $M_S_MAXW DB ? ;;AN000;; Maximum field width 73 <2> $M_S_MINW DB ? ;;AN000;; Minimum field width 74 <2> $M_S_PAD DB ? ;;AN000;; Character for Pad field 75 <2> ;; 76 <2> $M_SUBLIST_STRUC ENDS ;;AN000;; 77 <2> ;; 78 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 79 <2> ;; 80 <2> ;; STRUCTURE: $M_CLASS_ID 81 <2> ;; 82 <2> ;; Each class will be defined by this structure. 83 <2> ;; 84 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 85 <2> ;; 86 <2> EXPECTED_VERSION equ expected_version ; NASM port equate 87 <2> 88 <2> $M_CLASS_ID STRUC ;;AN000;; 89 <2> ;; 90 <2> $M_CLS_ID DB ? ;-1 ;;AN000;; Class identifer 91 <2> $M_COMMAND_VER DW ? ;EXPECTED_VERSION ;;AN003;; COMMAND.COM version check 92 <2> $M_NUM_CLS_MSG DB ? ;0 ;;AN000;; Total number of message in class 93 <2> ;; 94 <2> $M_CLASS_ID ENDS ;; 95 <2> ;;AN000;; 96 <2> $M_CLASS_ID_SZ EQU $M_CLASS_ID_struc_size ;;AN000;; 97 <2> ;; 98 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 99 <2> ;; 100 <2> ;; STRUCTURE: $M_ID_STRUC 101 <2> ;; 102 <2> ;; Each message will be defined by this structure. 103 <2> ;; 104 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 105 <2> ;; 106 <2> $M_ID STRUC ;;AN000;; 107 <2> ;; 108 <2> $M_NUM DW ? ;-1 ;;AN000;; Message Number 109 <2> $M_TXT_PTR DW ? ;;AN000;; Pointer to message text 110 <2> ;; 111 <2> $M_ID ENDS ;;AN000;; 112 <2> ;;AN000;; Status Flag Values: 113 <2> $M_ID_SZ EQU $M_ID_struc_size ;;AN000;; 114 <2> ;; 115 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 116 <2> ;; 117 <2> ;; STRUCTURE: $M_RES_ADDRS 118 <2> ;; 119 <2> ;; Resident data area definition of variables 120 <2> ;; 121 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 122 <2> ;; 123 <2> $M_RES_ADDRS STRUC ;;AN000;; 124 <2> ;; 125 <2> $M_EXT_ERR_ADDRS DD ? ;0 ;;AN000;; Allow pointers to THREE Extended error locations 126 <2> $M_EXT_FILE DD ? ;0 ;;AN001;; 127 <2> $M_EXT_COMMAND DD ? ;0 ;;AN000;; 128 <2> $M_EXT_TERM DD ? ;-1 ;;AN000;; 129 <2> $M_PARSE_COMMAND DD ? ;0 ;;AN000;; 130 <2> $M_PARSE_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Parse error locations 131 <2> $M_PARSE_TERM DD ? ;-1 ;;AN000;; 132 <2> $M_CRIT_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Critical error locations 133 <2> $M_CRIT_COMMAND DD ? ;0 ;;AN000;; 134 <2> $M_CRIT_TERM DD ? ;-1 ;;AN000;; 135 <2> $M_DISK_PROC_ADDR DD ? ;-1 ;;AN004;; Address of READ_DISK_PROC 136 <2> $M_CLASS_ADDRS DD $M_NUM_CLS DUP (?) ;(0) ;;AN000;; Allow pointers to specified classes 137 <2> $M_CLS_TERM DD ? ;-1 ;;AN000;; 138 <2> $M_DBCS_VEC DD ? ;0 ;;AN000;; Save DBCS vector 139 <2> $M_HANDLE DW ? ;;AN000;; 140 <2> $M_SIZE DB ? ;0 ;;AN000;; 141 <2> $M_CRLF DB ?,? ;0DH,0AH ;;AN004;; CR LF message 142 <2> $M_CLASS DB ? ;;AN004;; Saved class 143 <2> $M_RETURN_ADDR DW ? ;;AN000;; 144 <2> $M_MSG_NUM DW ? ;$M_NULL ;;AN000;; 145 <2> $M_DIVISOR DW ? ;10 ;;AN000;; Default = 10 (must be a WORD for division) 146 <2> $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP (?) ;("$") ;;AN000;; Temporary buffer 147 <2> $M_BUF_TERM DB ? ;"$" ;;AN000;; 148 <2> 149 <2> $M_RES_ADDRS ENDS ;;AN000;; 150 <2> ;; 151 <2> $M_RES_ADDRS_SZ EQU $M_RES_ADDRS_struc_size ;;AN000;; 152 <2> ;; 153 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 154 <2> ;; 155 <2> ;; STRUCTURE: $M_COUNTRY_INFO 156 <2> ;; 157 <2> ;; Important fields of the Get Country Information call 158 <2> ;; 159 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 160 <2> ;; 161 <2> $M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation 162 <2> ;; 163 <2> $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc 164 <2> $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format 165 <2> $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;; 166 <2> $M_THOU_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Thou Separator 167 <2> $M_DECI_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Decimal Separator 168 <2> $M_DATE_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Date Separator 169 <2> $M_TIME_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Time Separator 170 <2> $M_CURR_FORMAT DB ? ;;AN000;; 171 <2> $M_SIG_DIGS_CU DB ? ;;AN000;; 172 <2> $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format 173 <2> ;; 174 <2> $M_COUNTRY_INFO ENDS ;;AN000;; 175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 176 <2> ;; 177 <2> %ELSE ;;AN000;; ELSE if we have already included the STRUCTURES 178 <2> ; 179 <2> ; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section 180 <2> 181 <2> %IF MSGDATA ;;AN000;; IF this is a request to include the data area 182 <2> %iassign MSGDATA FALSE ;;AN000;; Let the assembler know not to include it again 183 <2> ;;AN000;; and include it 184 <2> ; PAGE 185 <2> ; SUBTTL DOS - Message Retriever - MSGRES.TAB Module 186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 187 <2> ;; 188 <2> ;; DATA NAME: $M_RES_TABLE 189 <2> ;; 190 <2> ;; REFERENCE LABEL: $M_RT 191 <2> ;; 192 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 193 <2> 194 <2> %if 0 ; disabled for now, figure out later 195 <2> %IF COMR ;;AN000;; Since COMMAND.COM includes this twice 196 <2> $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no 197 <2> $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur 198 <2> $M_ALTLABEL equ TRUE ;;AN000;; Flag that label was changed 199 <2> %ELSE ;;AN000;; 200 <2> $M_RT LABEL BYTE ;;AN000;; 201 <2> %ENDIF 202 <2> %endif 203 <2> $M_RT: ; NASM structure instance 204 <2> $M_RES_ADDRS_size equ $M_RES_ADDRS_struc_size ; NASM port equate 205 <2> istruc $M_RES_ADDRS 206 <2> at $M_EXT_ERR_ADDRS 207 <2> dd 0 208 <2> at $M_EXT_FILE 209 <2> dd 0 210 <2> at $M_EXT_COMMAND 211 <2> dd 0 212 <2> at $M_EXT_TERM 213 <2> dd -1 214 <2> at $M_PARSE_COMMAND 215 <2> dd 0 216 <2> at $M_PARSE_ADDRS 217 <2> dd 0 218 <2> at $M_PARSE_TERM 219 <2> dd -1 220 <2> at $M_CRIT_ADDRS 221 <2> dd 0 222 <2> at $M_CRIT_COMMAND 223 <2> dd 0 224 <2> at $M_CRIT_TERM 225 <2> dd -1 226 <2> at $M_DISK_PROC_ADDR 227 <2> dd -1 228 <2> at $M_CLASS_ADDRS 229 <2> times $M_NUM_CLS dd 0 230 <2> at $M_CLS_TERM 231 <2> dd -1 232 <2> at $M_DBCS_VEC 233 <2> dd 0 234 <2> at $M_HANDLE 235 <2> dw 0 236 <2> at $M_SIZE 237 <2> db 0 238 <2> at $M_CRLF 239 <2> db 0Dh, 0Ah 240 <2> at $M_CLASS 241 <2> db 0 242 <2> at $M_RETURN_ADDR 243 <2> dw 0 244 <2> at $M_MSG_NUM 245 <2> dw 0 246 <2> at $M_DIVISOR 247 <2> dw 10 248 <2> at $M_TEMP_BUF 249 <2> times $M_TEMP_BUF_SZ db "$" 250 <2> at $M_BUF_TERM 251 <2> db "$" 252 <2> iend 253 <2> ;; 254 <2> %include "copyrigh.mac" ;;AN001;; Include Copyright 1988 Microsoft 255 <2> ;; 256 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 257 <2> %ENDIF ;;AN000;; END of include of Data table 258 <2> 259 <2> ; 260 <2> %IFN $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN 261 <2> ;; don't include any more code 262 <2> ;;AN000;; Figure out what other code to include 263 <2> %IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code 264 <2> %IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it) 265 <2> $M_RT EQU $M_RT2 ;;AN003;; 266 <2> %ENDIF 267 <2> %iassign DISK_PROC FALSE ;;AN003;; Yes, THEN include it and reset flag 268 <2> ; PAGE 269 <2> ; SUBTTL DOS - Message Retriever - DISK_PROC Module 270 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 271 <2> ;; 272 <2> ;; PROC NAME: DISK_PROC 273 <2> ;; 274 <2> ;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended 275 <2> ;; errors from disk\diskette 276 <2> ;; INPUTS: AX has the message number 277 <2> ;; DX has the message class 278 <2> ;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is 279 <2> ;; assumed to be set!! 280 <2> ;; 281 <2> ;; OUTPUTS: ES:DI points to message length (BYTE) followed by text 282 <2> ;; 283 <2> ;; 284 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 285 <2> ;; 286 <2> PUBLIC READ_DISK_PROC ;; 287 <2> ;; 288 <2> READ_DISK_PROC PROC FAR ;;AN003;; 289 <2> 290 <2> PUSH AX ;;AN003;; Save everything 291 <2> PUSH BX ;;AN003;; 292 <2> PUSH DX ;;AN003;; 293 <2> PUSH SI ;;AN003;; 294 <2> PUSH BP ;;AN003;; 295 <2> PUSH DS ;;AN003;; 296 <2> PUSH DI ;;AN003;; 297 <2> MOV BP,AX ;;AN003;; Save message number 298 <2> MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function 299 <2> LEA SI,[COMSPEC wrt RESGROUP] ;;AN003;; Get addressibilty to COMMAND.COM 300 <2> PUSH CS ;;AN003;; 301 <2> POP DS ;;AN003;; 302 <2> MOV DI,-1 ;;AN003;; No extended attribute list 303 <2> MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error 304 <2> MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag 305 <2> INT 21H ;;AN003;; Open the file 306 <2> POP DI ;;AN003;; Retreive LSEEK pointer 307 <2> ;;AN003;; Error ? 308 <2> ; $IF NC,LONG ;;AN003;; No, 309 <2> JNC $MXL1 310 <2> JMP $MIF1 311 <2> $MXL1: 312 <2> PUSH DI ;;AN003;; Save LSEEK pointer 313 <2> MOV BX,AX ;;AN003;; Set handle in BX 314 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors 315 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 316 <2> MOV DX,DI ;;AN003;; 317 <2> INT 21H ;;AN003;; LSEEK the file 318 <2> POP DX ;;AN003;; Retreive LSEEK pointer 319 <2> ;;AN003;; Error ? 320 <2> ; $IF NC ;;AN003;; No, 321 <2> JC $MIF2 322 <2> INC CX ;;AN003;; Set flag to first pass 323 <2> ; $DO ;;AN003;; 324 <2> $MDO3: 325 <2> PUSH DX ;;AN003;; Save LSEEK pointer 326 <2> PUSH CX ;;AN003;; Save first pass flag 327 <2> PUSH AX ;;AN003;; Save number of messages (if set yet) 328 <2> XOR SI,SI ;;AN003;; Reset buffer index 329 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 330 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header 331 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 332 <2> INT 21H ;;AN003;; Read it 333 <2> MOV DI,DX ;;AN003;; 334 <2> POP AX ;;AN003;; 335 <2> POP CX ;;AN003;; 336 <2> OR CX,CX ;;AN003;; 337 <2> ; $IF NZ ;;AN003;; 338 <2> JZ $MIF4 339 <2> XOR CX,CX ;;AN003;; Set flag to second pass 340 <2> XOR AH,AH ;;AN003;; Get number of messages in class 341 <2> MOV AL,[DI + $M_NUM_CLS_MSG] ;;AN003;; 342 <2> MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index 343 <2> CMP word [DI + $M_COMMAND_VER],EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM? 344 <2> ; $ENDIF ;;AN003;; 345 <2> $MIF4: 346 <2> POP DX ;;AN003;; 347 <2> ; $IF Z ;;AN003;; Yes, 348 <2> JNZ $MIF6 349 <2> ; $SEARCH ;;AN003;; 350 <2> $MDO7: 351 <2> CMP BP,WORD PTR [$M_RT + $M_TEMP_BUF + SI] ;;AN003;; Is this the message I'm looking for? 352 <2> ; $EXITIF Z ;;AN003;; Yes, (ZF=1) 353 <2> JNZ $MIF7 354 <2> CLC ;;AN003;; Reset carry, exit search 355 <2> ; $ORELSE ;;AN003;; No, (ZF=0) 356 <2> JMP SHORT $MSR7 357 <2> $MIF7: 358 <2> ADD SI,$M_ID_SZ ;;AN003;; Increment index 359 <2> ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header 360 <2> DEC AX ;;AN003;; Decrement # of messages left 361 <2> ; $LEAVE Z ;;AN003;; Have we exhausted all messages? 362 <2> JZ $MEN7 363 <2> CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer? 364 <2> ; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1) 365 <2> JNA $MDO7 366 <2> $MEN7: 367 <2> STC ;;AN003;; Yes, (ZF=0) set error (ZF=0) 368 <2> ; $ENDSRCH ;;AN003;; 369 <2> $MSR7: 370 <2> ; $ELSE ;;AN003;; No, 371 <2> JMP SHORT $MEN6 372 <2> $MIF6: 373 <2> XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop 374 <2> STC ;;AN003;; Set Carry 375 <2> ; $ENDIF ;;AN003;; 376 <2> $MEN6: 377 <2> ; $ENDDO Z ;;AN003;; Get next buffer full if needed 378 <2> JNZ $MDO3 379 <2> ;;AN003;; Error ? 380 <2> ; $IF NC ;;AN003;; No, 381 <2> JC $MIF16 382 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message 383 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 384 <2> ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header 385 <2> ADD DX,WORD PTR [$M_RT + $M_TEMP_BUF + SI + 2] ;;AN003;; Add offset from msg structure 386 <2> INT 21H ;;AN003;; LSEEK the file 387 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 388 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message 389 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 390 <2> INT 21H ;;AN003;; Read it 391 <2> MOV DI,DX ;;AN003;; into the temp buffer 392 <2> PUSH DS ;;AN003;; into the temp buffer 393 <2> POP ES ;;AN003;; into the temp buffer 394 <2> ; $ENDIF ;;AN003;; 395 <2> $MIF16: 396 <2> ; $ENDIF ;;AN003;; 397 <2> $MIF2: 398 <2> PUSHF ;;AN003;; Close file handle 399 <2> MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle 400 <2> INT 21H ;;AN003;; 401 <2> $M_POPF ;;AN003;; 402 <2> ; $ENDIF ;;AN003;; Yes there was an error, 403 <2> $MIF1: 404 <2> POP DS ;;AN003;; 405 <2> POP BP ;;AN003;; 406 <2> POP SI ;;AN003;; 407 <2> POP DX ;;AN003;; 408 <2> POP BX ;;AN003;; 409 <2> POP AX ;;AN003;; 410 <2> ;;AN003;; abort everything 411 <2> RET ;;AN003;; 412 <2> 413 <2> READ_DISK_PROC ENDP ;;AN003;; 414 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 415 <2> %ENDIF ;;AN003;; END of include for DISK_PROC 416 <2> ; 417 <2> 418 <2> %IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO 419 <2> %iassign SETSTDIO FALSE ;;AN000;; Yes, THEN include it and reset flag 420 <2> ; PAGE 421 <2> ; SUBTTL DOS - Message Retriever - SETSTDIO Module 422 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 423 <2> ;; 424 <2> ;; PROC NAME: SETSTDIO 425 <2> ;; 426 <2> ;; FUNCTION: 427 <2> ;; INPUTS: 428 <2> ;; 429 <2> ;; OUPUTS: 430 <2> ;; 431 <2> ;; 432 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 433 <2> ;; 434 <2> %IF FARmsg ;AN001; 435 <2> SETSTDINON PROC FAR ;AN001; 436 <2> %ELSE ;AN001; 437 <2> SETSTDINON PROC NEAR ;AN001; 438 <2> %ENDIF ;AN001; 439 <2> PUSH AX ;AN002; Save changed regs 440 <2> PUSH BX ;AN002; 441 <2> PUSH DX ;AN002; 442 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 443 <2> MOV BX,STDIN ;AN001; 444 <2> XOR DX,DX ;AN001; 445 <2> INT 21H ;AN001; 446 <2> 447 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 448 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 449 <2> INT 21H ;AN001; 450 <2> POP DX ;AN002; Restore Regs 451 <2> POP BX ;AN002; 452 <2> POP AX ;AN002; 453 <2> 454 <2> RET ;AN001; 455 <2> ;AN001; 456 <2> SETSTDINON ENDP ;AN001; 457 <2> 458 <2> %IF FARmsg ;AN001; 459 <2> SETSTDINOFF PROC FAR ;AN001; 460 <2> %ELSE ;AN001; 461 <2> SETSTDINOFF PROC NEAR ;AN001; 462 <2> %ENDIF ;AN001; 463 <2> 464 <2> PUSH AX ;AN002; Save changed regs 465 <2> PUSH BX ;AN002; 466 <2> PUSH DX ;AN002; 467 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 468 <2> MOV BX,STDIN ;AN001; 469 <2> XOR DX,DX ;AN001; 470 <2> INT 21H ;AN001; 471 <2> 472 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 473 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 474 <2> INT 21H ;AN001; 475 <2> POP DX ;AN002; Restore Regs 476 <2> POP BX ;AN002; 477 <2> POP AX ;AN002; 478 <2> 479 <2> RET ;AN001; 480 <2> 481 <2> SETSTDINOFF ENDP ;AN001; 482 <2> 483 <2> %IF FARmsg ;AN001; 484 <2> SETSTDOUTON PROC FAR ;AN001; 485 <2> %ELSE ;AN001; 486 <2> SETSTDOUTON PROC NEAR ;AN001; 487 <2> %ENDIF ;AN001; 488 <2> 489 <2> PUSH AX ;AN002; Save changed regs 490 <2> PUSH BX ;AN002; 491 <2> PUSH DX ;AN002; 492 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 493 <2> MOV BX,STDOUT ;AN001; 494 <2> XOR DX,DX ;AN001; 495 <2> INT 21H ;AN001; 496 <2> 497 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 498 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 499 <2> INT 21H ;AN001; 500 <2> POP DX ;AN002; Restore Regs 501 <2> POP BX ;AN002; 502 <2> POP AX ;AN002; 503 <2> 504 <2> RET ;AN001; 505 <2> 506 <2> SETSTDOUTON ENDP ;AN001; 507 <2> 508 <2> %IF FARmsg ;AN001; 509 <2> SETSTDOUTOFF PROC FAR ;AN001; 510 <2> %ELSE ;AN001; 511 <2> SETSTDOUTOFF PROC NEAR 512 <2> %ENDIF ;AN001; 513 <2> 514 <2> PUSH AX ;AN002; Save changed regs 515 <2> PUSH BX ;AN002; 516 <2> PUSH DX ;AN002; 517 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 518 <2> MOV BX,STDOUT ;AN001; 519 <2> XOR DX,DX ;AN001; 520 <2> INT 21H ;AN001; 521 <2> 522 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 523 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 524 <2> INT 21H ;AN001; 525 <2> POP DX ;AN002; Restore Regs 526 <2> POP BX ;AN002; 527 <2> POP AX ;AN002; 528 <2> 529 <2> RET ;AN001; 530 <2> 531 <2> SETSTDOUTOFF ENDP ;AN001; 532 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 533 <2> %ENDIF ;;AN000;; END of include for SETSTDIO 534 <2> ; 535 <2> %IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ? 536 <2> %IF COMR ;;AN000;; 537 <2> $M_RT EQU $M_RT2 ;;AN000;; 538 <2> %ENDIF 539 <2> %iassign LOADmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 540 <2> ; PAGE 541 <2> ; SUBTTL DOS - Message Retriever - LOADMSG.ASM Module 542 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 543 <2> ;; 544 <2> ;; PROC NAME: SYSLOADMSG 545 <2> ;; 546 <2> ;; FUNCTION: 547 <2> ;; INPUTS: 548 <2> ;; 549 <2> ;; OUPUTS: 550 <2> ;; 551 <2> ;; 552 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 553 <2> ;; 554 <2> %IF FARmsg ;;AN000;; 555 <2> SYSLOADMSG PROC FAR ;;AN000;; 556 <2> %ELSE ;;AN000;; 557 <2> SYSLOADMSG PROC NEAR ;;AN000;; 558 <2> %ENDIF ;;AN000;; 559 00000000 50 <2> PUSH AX ;;AN000; 560 00000001 53 <2> PUSH BX ;;AN000; 561 00000002 52 <2> PUSH DX ;;AN000; 562 00000003 06 <2> PUSH ES ;;AN000; 563 00000004 57 <2> PUSH DI ;;AN000; 564 00000005 31C9 <2> XOR CX,CX ;;AN000; Reset to zero 565 00000007 8EC1 <2> MOV ES,CX ;;AN000; 566 00000009 31FF <2> XOR DI,DI ;;AN000; 567 0000000B B82E12 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 568 0000000E B200 <2> MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM 569 00000010 CD2F <2> INT 2FH ;;AN000;; Private interface 570 00000012 8C06[0A00] <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 571 00000016 893E[0800] <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND],DI ;;AN000;; 572 <2> ;; 573 0000001A B82E12 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 574 0000001D B202 <2> MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM 575 0000001F CD2F <2> INT 2FH ;;AN000;; Private interface 576 00000021 8C06[1200] <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 577 00000025 893E[1000] <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND],DI ;;AN000;; 578 <2> ;; 579 00000029 B82E12 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 580 0000002C B204 <2> MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM 581 0000002E CD2F <2> INT 2FH ;;AN000;; Private interface 582 00000030 8C06[2200] <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 583 00000034 893E[2000] <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND],DI ;;AN000;; 584 <2> 585 00000038 B82E12 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 586 0000003B B206 <2> MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE 587 0000003D CD2F <2> INT 2FH ;;AN001;; Private interface 588 0000003F 8C06[0600] <2> MOV WORD PTR [$M_RT + $M_EXT_FILE+2],ES ;;AN001;; Move into first avaliable table location 589 00000043 893E[0400] <2> MOV WORD PTR [$M_RT + $M_EXT_FILE],DI ;;AN001;; 590 <2> 591 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 592 <2> Extrn READ_DISK_PROC:Far ;;AN003;; 593 <2> %ELSE ;; 594 <2> %IF FARmsg ;;AN000;; 595 <2> CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 596 <2> %ELSE ;;AN000;; 597 00000047 E8C30F <2> CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 598 <2> %ENDIF ;;AN000;; 599 0000004A 8C06[0200] <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 600 0000004E 893E[0000] <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS],DI ;;AN000;; 601 00000052 8C06[1E00] <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 602 00000056 893E[1C00] <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS],DI ;;AN000;; 603 <2> ;; 604 <2> %IF FARmsg ;;AN000;; 605 <2> CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 606 <2> %ELSE ;;AN000;; 607 0000005A E8D20F <2> CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 608 <2> %ENDIF ;;AN000;; 609 0000005D 8C06[1600] <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 610 00000061 893E[1400] <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS],DI ;;AN000;; 611 <2> %ENDIF ;; 612 <2> ;; 613 00000065 B82E12 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 614 00000068 B208 <2> MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM 615 0000006A CD2F <2> INT 2FH ;;AN001;; Private interface 616 0000006C 8C06[2A00] <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR+2],ES ;;AN001;; Move into first avaliable table location 617 00000070 893E[2800] <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR],DI ;;AN001;; 618 <2> 619 <2> $M_BUILD_PTRS $M_NUM_CLS ;;AN000;; Build all utility classes 448 <3> %iassign $M_INDEX 0 449 <3> %if COMR 450 <3> $M_MAKE_COMR 451 <3> %elif COMT 452 <3> $M_MAKE_COMT 453 <3> %else 454 <3> %iassign $M_INDEX 0 455 <3> %iassign $M_COUNT 0 456 <3> %rep %1 457 <3> %iassign $M_COUNT $M_COUNT + 1 458 <3> $M_MAKE $M_COUNT 459 <3> %endrep 457 <4> %iassign $M_COUNT $M_COUNT + 1 458 <4> $M_MAKE $M_COUNT 468 <5> %IF FARmsg 469 <5> CALL FAR $M_CLS_%1 470 <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX+2],ES 471 <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI 472 <5> %ELSE 473 00000074 E89709 <5> CALL $M_CLS_%1 474 00000077 893E[2C00] <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI 475 <5> %ENDIF 476 <5> %iassign $M_INDEX $M_INDEX + 4 477 <5> 457 <4> %iassign $M_COUNT $M_COUNT + 1 458 <4> $M_MAKE $M_COUNT 468 <5> %IF FARmsg 469 <5> CALL FAR $M_CLS_%1 470 <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX+2],ES 471 <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI 472 <5> %ELSE 473 0000007B E8780C <5> CALL $M_CLS_%1 474 0000007E 893E[3000] <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI 475 <5> %ENDIF 476 <5> %iassign $M_INDEX $M_INDEX + 4 477 <5> 457 <4> %iassign $M_COUNT $M_COUNT + 1 458 <4> $M_MAKE $M_COUNT 468 <5> %IF FARmsg 469 <5> CALL FAR $M_CLS_%1 470 <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX+2],ES 471 <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI 472 <5> %ELSE 473 00000082 E8D60E <5> CALL $M_CLS_%1 474 00000085 893E[3400] <5> MOV WORD PTR [$M_RT + $M_CLASS_ADDRS+$M_INDEX],DI 475 <5> %ENDIF 476 <5> %iassign $M_INDEX $M_INDEX + 4 477 <5> 460 <3> %endif 620 <2> ;;AN000;; 621 00000089 E81900 <2> CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector 622 <2> 623 <2> %IFN NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed 624 0000008C E82E00 <2> CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK 625 <2> %ENDIF ;;AN000;; 626 <2> ;;AN000;; 627 <2> %IFN NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed 628 0000008F E83E00 <2> CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK 629 <2> %ENDIF ;;AN000;; 630 <2> ;;AN000;; 631 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 632 <2> CLC ;;AN000;; Make sure carry is clear 633 <2> %ELSE ;;AN000;; ELSE 634 00000092 51 <2> PUSH CX ;;AN000;; 635 00000093 E89400 <2> CALL $M_VERSION_CHECK ;;AN000;; Check Version 636 <2> %ENDIF ;;AN000;; 637 <2> ;; Error ? 638 <2> ; $IF NC ;;AN000;; No. 639 00000096 7208 <2> JC $MIF20 640 <2> %IFN NOVERCHECKmsg ;;AN000;; IF version check was not supressed 641 00000098 59 <2> POP CX ;;AN000;; Reset stack 642 <2> %ENDIF ;;AN000;; 643 00000099 5F <2> POP DI ;;AN000;; Restore REGS 644 0000009A 07 <2> POP ES ;;AN000;; 645 0000009B 5A <2> POP DX ;;AN000;; 646 0000009C 5B <2> POP BX ;;AN000;; 647 0000009D 58 <2> POP AX ;;AN000;; 648 <2> ; $ELSE ;;AN000;; Yes, 649 0000009E EB04 <2> JMP SHORT $MEN20 650 <2> $MIF20: 651 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 652 <2> ADD SP,10 ;;AN000;; 653 <2> STC ;;AN000;; Reset carry flag 654 <2> %ELSE ;;AN000;; IF version check is to be supressed 655 000000A0 83C40C <2> ADD SP,12 ;;AN000;; 656 000000A3 F9 <2> STC ;;AN000;; Reset carry flag 657 <2> %ENDIF ;;AN000;; IF version check is to be supressed 658 <2> ; $ENDIF ;;AN000;; 659 <2> $MEN20: 660 000000A4 C3 <2> RET ;;AN000;; 661 <2> ;; 662 <2> SYSLOADMSG ENDP ;;AN000;; 663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 664 <2> ; PAGE 665 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 666 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 667 <2> ;; 668 <2> ;; Proc Name: $M_GET_DBCS_VEC 669 <2> ;; 670 <2> ;; Function: Get the DBCS vector and save it for later use 671 <2> ;; 672 <2> ;; Inputs: None 673 <2> ;; 674 <2> ;; Outputs: None 675 <2> ;; 676 <2> ;; Regs Changed: 677 <2> ;; 678 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 679 <2> ;; 680 <2> $M_GET_DBCS_VEC PROC NEAR ;;AN000;; 681 <2> ;; 682 000000A5 50 <2> PUSH AX ;;AN000;; Save character to check 683 000000A6 56 <2> PUSH SI ;;AN000;; 684 000000A7 1E <2> PUSH DS ;;AN000;; 685 000000A8 B80063 <2> MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment 686 000000AB CD21 <2> INT 21H ;;AN000;; Get environment pointer 687 000000AD 1E <2> PUSH DS ;;AN000;; Get environment pointer 688 000000AE 07 <2> POP ES ;;AN000;; Get environment pointer 689 000000AF 1F <2> POP DS ;;AN000;; Get environment pointer 690 <2> ; $IF NC ;;AN000;; 691 000000B0 7208 <2> JC $MIF23 692 000000B2 8936[3C00] <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC],SI ;;AN000;; Save DBCS Vector 693 000000B6 8C06[3E00] <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC+2],ES ;;AN000;; 694 <2> ; $ENDIF ;;AN000;; 695 <2> $MIF23: 696 000000BA 5E <2> POP SI ;;AN000;; 697 000000BB 58 <2> POP AX ;;AN000;; Retrieve character to check 698 000000BC C3 <2> RET ;;AN000;; Return 699 <2> ;; 700 <2> $M_GET_DBCS_VEC ENDP ;; 701 <2> ;; 702 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 703 <2> %IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ? 704 <2> %ELSE ;AN001; Yes, THEN include it 705 <2> ; PAGE 706 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc 707 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 708 <2> ;; 709 <2> ;; Proc Name: $M_CHECKSTDIN 710 <2> ;; 711 <2> ;; Function: 712 <2> ;; 713 <2> ;; Inputs: None 714 <2> ;; 715 <2> ;; Outputs: 716 <2> ;; 717 <2> ;; Regs Changed: 718 <2> ;; 719 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 720 <2> ;; 721 <2> $M_CHECKSTDIN PROC NEAR ;AN001; 722 <2> 723 000000BD B80044 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 724 000000C0 BB0000 <2> MOV BX,STDIN ;AN001; 725 000000C3 31D2 <2> XOR DX,DX ;AN001; 726 000000C5 CD21 <2> INT 21H ;AN001; 727 <2> 728 000000C7 80CE01 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 729 000000CA B80144 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 730 000000CD CD21 <2> INT 21H ;AN001; 731 <2> 732 000000CF C3 <2> RET ;AN001; 733 <2> 734 <2> $M_CHECKSTDIN ENDP ;AN001; 735 <2> ;; 736 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 737 <2> %ENDIF ;AN001; END of include for EOF Check 738 <2> %IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full? 739 <2> %ELSE ;AN001; Yes, THEN include it 740 <2> ; PAGE 741 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc 742 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 743 <2> ;; 744 <2> ;; Proc Name: $M_CHECKSTDOUT 745 <2> ;; 746 <2> ;; Function: 747 <2> ;; 748 <2> ;; Inputs: None 749 <2> ;; 750 <2> ;; Outputs: 751 <2> ;; 752 <2> ;; Regs Changed: 753 <2> ;; 754 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 755 <2> ;; 756 <2> $M_CHECKSTDOUT PROC NEAR ;AN001; 757 <2> 758 000000D0 B80044 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 759 000000D3 BB0100 <2> MOV BX,STDOUT ;AN001; 760 000000D6 31D2 <2> XOR DX,DX ;AN001; 761 000000D8 CD21 <2> INT 21H ;AN001; 762 <2> 763 000000DA 80CE01 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 764 000000DD B80144 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 765 000000E0 CD21 <2> INT 21H ;AN001; 766 <2> 767 000000E2 C3 <2> RET ;AN001; 768 <2> 769 <2> $M_CHECKSTDOUT ENDP ;AN001; 770 <2> ;; 771 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 772 <2> %ENDIF ;AN001; END of include for Disk Full Check 773 <2> %IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check? 774 <2> %ELSE ;;AN000;; Yes, THEN include it 775 <2> ; PAGE 776 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 778 <2> ;; 779 <2> ;; Proc Name: $M_VERSION_CHECK 780 <2> ;; 781 <2> ;; Function: Determine if DOS version is within allowable limits 782 <2> ;; 783 <2> ;; Inputs: None 784 <2> ;; 785 <2> ;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version 786 <2> ;; Registers set for SYSDISPMSG 787 <2> ;; CARRY_FLAG = 0 if Correct DOS version 788 <2> ;; 789 <2> ;; Regs Changed: AX 790 <2> ;; 791 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 792 <2> 793 <2> check_amis: 794 000000E3 50 <2> push ax 795 000000E4 1E <2> push ds 796 000000E5 56 <2> push si 797 000000E6 06 <2> push es 798 000000E7 57 <2> push di 799 000000E8 52 <2> push dx 800 000000E9 50 <2> push ax ; version number, last on stack 801 <2> 802 000000EA B400 <2> mov ah, 0 ; multiplex number = 0 803 <2> .loop: 804 000000EC B000 <2> mov al, 0 805 000000EE CD2D <2> int 2Dh ; installation check 806 000000F0 3CFF <2> cmp al, -1 ; multiplexer installed ? 807 000000F2 7520 <2> jne .next ; no --> 808 000000F4 0E <2> push cs 809 000000F5 1F <2> pop ds 810 000000F6 BE[0000] <2> mov si, offset amis_sign ; ds:si -> amis_sign (for lDOS) 811 000000F9 8EC2 <2> mov es, dx ; es:di -> multiplexer's sign 812 000000FB B90800 <2> mov cx, 8 ; 16 bytes 813 000000FE F3A7 <2> repe cmpsw ; compare 814 00000100 7512 <2> jne .next ; not us --> 815 00000102 8CCA <2> mov dx, cs ; dx:si -> amis_id 816 00000104 B011 <2> mov al, 11h 817 00000106 CD2D <2> int 2Dh ; CHG: al, bx, cx, dx, si, di 818 00000108 3C00 <2> cmp al, 0 ; id call supported ? 819 0000010A 740C <2> je .unsup ; no, allow if alt version --> 820 0000010C 5A <2> pop dx 821 0000010D 31D2 <2> xor dx, dx ; 2D.MM11 supported, mark that we need it 822 0000010F 52 <2> push dx 823 00000110 3CF0 <2> cmp al, 0F0h ; CY if below 0F0h 824 00000112 EB05 <2> jmp .done 825 <2> 826 <2> .next: 827 00000114 FEC4 <2> inc ah ; next multiplex number 828 00000116 75D4 <2> jnz .loop ; ZR if done, NZ if more to check --> 829 <2> .unsup: 830 00000118 F9 <2> stc ; multiplexer not found 831 <2> ; or function not supported 832 <2> .done: 833 <2> ; CY if not an lDOS revision with our id supported, 834 <2> ; on stack: alt_expected_version if it's fine and either 835 <2> ; no multiplexer or func 11h not supported 836 <2> ; new_expected_version if not fine and either 837 <2> ; no multiplexer or func 11h not suppprted, 838 <2> ; 0 if multiplexer found, func 11h supported, but 839 <2> ; our id is unsupported 840 <2> ; NC if lDOS revision with multiplexer and our id supported 841 00000119 5B <2> pop bx 842 0000011A 5A <2> pop dx 843 0000011B 5F <2> pop di 844 0000011C 07 <2> pop es 845 0000011D 5E <2> pop si 846 0000011E 1F <2> pop ds 847 0000011F 58 <2> pop ax 848 00000120 731B <2> jnc alt_good_DOS ; id is supported --> 849 00000122 81FB051A <2> cmp bx, alt_expected_version ; is it fine ? 850 00000126 7415 <2> je alt_good_DOS ; yes --> (NC) 851 00000128 EB16 <2> jmp $MIF25 ; no, cancel program --> 852 <2> 853 <2> $M_VERSION_CHECK PROC NEAR ;;AN000;; 854 <2> ;; 855 0000012A B430 <2> MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC 856 0000012C CD21 <2> INT 21H ;;AN000;; 857 <2> ;; 858 0000012E 3D0526 <2> cmp ax,new_expected_version ; compare with DOS version 859 00000131 74B0 <2> je check_amis 860 00000133 3D051A <2> cmp ax,alt_expected_version ; compare with DOS version 861 00000136 74AB <2> je check_amis 862 00000138 83F804 <2> CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct 863 <2> ; $IF E ;;AN000;; 864 0000013B 7503 <2> JNE $MIF25 865 <2> alt_good_DOS: 866 0000013D F8 <2> CLC ;;AN000;; Clear the carry flag 867 <2> ; $ELSE ;;AN000;; ELSE 868 0000013E EB18 <2> JMP SHORT $MEN25 869 <2> $MIF25: 870 <2> %IFN COMR ;; ** Special case for RESIDENT COMMAND.COM 871 00000140 83F802 <2> CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH 872 <2> ; $IF B ;;AN000;; No, 873 00000143 7305 <2> JNB $MIF27 874 00000145 BBFFFF <2> MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support) 875 <2> ; $ELSE ;;AN000;; Yes, 876 00000148 EB03 <2> JMP SHORT $MEN27 877 <2> $MIF27: 878 0000014A BB0200 <2> MOV BX,STDERR ;;AN000;; Standard Error 879 <2> ; $ENDIF ;;AN000;; 880 <2> $MEN27: 881 <2> %ELSE 882 <2> MOV BX,NO_HANDLE ;;AN000;; No handle 883 <2> %ENDIF 884 0000014D B80100 <2> MOV AX,1 ;;AN000;; Set message # 1 885 00000150 B90000 <2> MOV CX,NO_REPLACE ;;AN000;; No replacable parms 886 00000153 B200 <2> MOV DL,NO_INPUT ;;AN000;; No input 887 00000155 B6FF <2> MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message 888 00000157 F9 <2> STC ;;AN000;; Set Carry Flag 889 <2> ; $ENDIF ;;AN000;; 890 <2> $MEN25: 891 <2> ;; 892 00000158 C3 <2> RET ;;AN000;; Return 893 <2> ;; 894 <2> $M_VERSION_CHECK ENDP ;; 895 <2> ;; 896 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 897 <2> %ENDIF ;;AN000;; END of include for DOS version check 898 <2> %ENDIF ;;AN000;; END of include for SYSLOADMSG 899 <2> ; 900 <2> %IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 901 <2> %IF COMR ;;AN000;; 902 <2> $M_RT EQU $M_RT2 ;;AN000;; 903 <2> %ENDIF ;;AN000;; 904 <2> GETmsg equ FALSE ;;AN000;; Yes, THEN include it and reset flag 905 <2> ; PAGE 906 <2> ; SUBTTL DOS - Message Retriever - GETMSG.ASM Module 907 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 908 <2> ;; 909 <2> ;; Proc Name: SYSGETMSG 910 <2> ;; 911 <2> ;; Function: The GET service returns the segment, offset and size of the 912 <2> ;; message text to the caller based on a message number. 913 <2> ;; The GET function will not display the message thus assumes 914 <2> ;; caller will handle replaceable parameters. 915 <2> ;; 916 <2> ;; Inputs: 917 <2> ;; 918 <2> ;; Outputs: 919 <2> ;; 920 <2> ;; Psuedocode: 921 <2> ;; Call $M_GET_MSG_ADDRESS 922 <2> ;; IF MSG_NUM exists THEN 923 <2> ;; Set DS:SI = MSG_TXT_PTR + 1 924 <2> ;; CARRY_FLAG = 0 925 <2> ;; ELSE 926 <2> ;; CARRY_FLAG = 1 927 <2> ;; ENDIF 928 <2> ;; 929 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 930 <2> ;; 931 <2> %IF FARmsg ;;AN000;; 932 <2> SYSGETMSG PROC FAR ;;AN000;; 933 <2> %ELSE ;;AN000;; 934 <2> SYSGETMSG PROC NEAR ;;AN000;; 935 <2> %ENDIF ;;AN000;; 936 <2> ;; 937 <2> ;; Save registers needed later 938 <2> 939 <2> PUSH AX ;;AN000;; Save changed regs 940 <2> PUSH ES ;;AN000;; 941 <2> PUSH DI ;;AN000;; 942 <2> PUSH BP ;;AN000;; 943 <2> ;; 944 <2> %IF FARmsg ;;AN000;; 945 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 946 <2> %ELSE ;;AN000;; 947 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 948 <2> %ENDIF ;;AN000;; Return message in ES:DI 949 <2> ; $IF NC ;;AN000;; Message found? 950 <2> JC $MIF31 951 <2> CMP DH,UTILITY_MSG_CLASS 952 <2> CLC ;;AN000;; 953 <2> ; $IF NE 954 <2> JE $MIF32 955 <2> PUSH ES ;;AN000;; 956 <2> POP DS ;;AN000;; Return message in DS:SI 957 <2> ; $ELSE 958 <2> JMP SHORT $MEN32 959 <2> $MIF32: 960 <2> %IF FARmsg ;;AN000;; Yes, 961 <2> PUSH ES ;;AN000;; 962 <2> POP DS ;;AN000;; Return message in DS:SI 963 <2> %ELSE ;;AN000;; 964 <2> PUSH CS ;;AN000;; Return message in DS:SI 965 <2> POP DS ;;AN000;; 966 <2> %ENDIF ;;AN000;; 967 <2> ; $ENDIF ;;AN000;; 968 <2> $MEN32: 969 <2> MOV SI,DI ;;AN000;; Return message in DS:SI 970 <2> ; $ENDIF ;;AN000;; 971 <2> $MIF31: 972 <2> ;; 973 <2> POP BP ;;AN000;; Restore changed regs 974 <2> POP DI ;;AN000;; 975 <2> POP ES ;;AN000;; 976 <2> POP AX ;;AN000;; 977 <2> ;; 978 <2> RET ;;AN000;; Return 979 <2> ;; 980 <2> SYSGETMSG ENDP ;; 981 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 982 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 983 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 984 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 985 <2> ;; 986 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 987 <2> ;; 988 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 989 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 990 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 991 <2> ;; IF CX > 1 THEN ES:DI points to the specified message 992 <2> ;; REGS CHANGED: ES,DI,CX 993 <2> ;; 994 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 995 <2> ;; 996 <2> %IF FARmsg ;;AN000;; 997 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 998 <2> %ELSE ;;AN000;; 999 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 1000 <2> %ENDIF ;;AN000;; 1001 <2> ;; 1002 <2> PUSH SI ;;AN000;; 1003 <2> PUSH BX ;;AN000;; 1004 <2> XOR SI,SI ;;AN000;; Use SI as an index 1005 <2> XOR CX,CX ;;AN000;; Use CX as an size 1006 <2> ; $DO ;;AN000;; 1007 <2> $MDO36: 1008 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 1009 <2> ; $IF E ;;AN000;; Yes, 1010 <2> JNE $MIF37 1011 <2> %IF FARmsg ;;AN000;; 1012 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1013 <2> MOV BX,ES ;;AN000; 1014 <2> %ELSE ;;AN000;; 1015 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1016 <2> MOV BX,DI ;;AN000; 1017 <2> %ENDIF ;;AN000;; 1018 <2> ; $ELSE ;;AN000;; No, 1019 <2> JMP SHORT $MEN37 1020 <2> $MIF37: 1021 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 1022 <2> ; $IF NE ;;AN000;; Yes, 1023 <2> JE $MIF39 1024 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 1025 <2> MOV BX,ES ;;AN000; 1026 <2> ; $ELSE ;;AN000;; No, extended errors were specified 1027 <2> JMP SHORT $MEN39 1028 <2> $MIF39: 1029 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 1030 <2> ; $IF AE,AND ;;AN000;; 1031 <2> JNAE $MIF41 1032 <2> CMP AX,$M_CRIT_HI ;;AN000;; 1033 <2> ; $IF BE ;;AN000;; Yes, 1034 <2> JNBE $MIF41 1035 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 1036 <2> MOV BX,ES ;;AN000; 1037 <2> ; $ELSE ;;AN000;; 1038 <2> JMP SHORT $MEN41 1039 <2> $MIF41: 1040 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 1041 <2> MOV BX,ES ;;AN000; 1042 <2> ; $ENDIF ;;AN000;; 1043 <2> $MEN41: 1044 <2> ; $ENDIF ;;AN000;; 1045 <2> $MEN39: 1046 <2> ; $ENDIF ;;AN000;; 1047 <2> $MEN37: 1048 <2> ;; 1049 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 1050 <2> ; $IF E ;;AN000;; Yes, 1051 <2> JNE $MIF46 1052 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 1053 <2> ; $IF E ;;AN000;; Yes, 1054 <2> JNE $MIF47 1055 <2> STC ;;AN000;; Set the carry flag 1056 <2> ; $ELSE ;;AN000;; No, 1057 <2> JMP SHORT $MEN47 1058 <2> $MIF47: 1059 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 1060 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 1061 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 1062 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 1063 <2> CLC ;;AN000;; 1064 <2> ; $ENDIF ;;AN000;; No, 1065 <2> $MEN47: 1066 <2> ; $ELSE ;;AN000;; 1067 <2> JMP SHORT $MEN46 1068 <2> $MIF46: 1069 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 1070 <2> ; $IF NE ;;AN001;; Yes, 1071 <2> JE $MIF51 1072 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 1073 <2> ; $ENDIF ;;AN000;; 1074 <2> $MIF51: 1075 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 1076 <2> CLC ;;AN000;; 1077 <2> ; $ENDIF ;;AN000;; 1078 <2> $MEN46: 1079 <2> ; $LEAVE C ;;AN000;; 1080 <2> JC $MEN36 1081 <2> OR CX,CX ;;AN000;; Was the message found? 1082 <2> ; $ENDDO NZ,LONG ;;AN000;; 1083 <2> JNZ $MXL2 1084 <2> JMP $MDO36 1085 <2> $MXL2: 1086 <2> $MEN36: 1087 <2> 1088 <2> PUSHF ;;AN006;; Save the flag state 1089 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 1090 <2> ; $IF E ;;AN006;; Yes, 1091 <2> JNE $MIF56 1092 <2> PUSH DX ;;AN006;; Save all needed registers 1093 <2> PUSH BP ;;AN006;; 1094 <2> PUSH CX ;;AN006;; 1095 <2> PUSH ES ;;AN006;; 1096 <2> PUSH DI ;;AN006;; 1097 <2> PUSH AX ;;AN006;; 1098 <2> 1099 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 1100 <2> INT 2FH ;;AN006;; 1101 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 1102 <2> POP AX ;;AN006;; Restore msg number 1103 <2> ; $IF E ;;AN006;; Yes, 1104 <2> JNE $MIF57 1105 <2> MOV BX,AX ;;AN006;; BX is the extended error number 1106 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 1107 <2> INT 2FH ;;AN006;; Call IFSFUNC 1108 <2> ; $ELSE ;;AN006;; No, 1109 <2> JMP SHORT $MEN57 1110 <2> $MIF57: 1111 <2> STC ;;AN006;; Carry conditon 1112 <2> ; $ENDIF ;;AN006;; 1113 <2> $MEN57: 1114 <2> 1115 <2> ; $IF C ;;AN006;; Was there an update? 1116 <2> JNC $MIF60 1117 <2> POP DI ;;AN006;; No, 1118 <2> POP ES ;;AN006;; Restore old pointer 1119 <2> POP CX ;;AN006;; 1120 <2> ; $ELSE ;;AN006;; Yes 1121 <2> JMP SHORT $MEN60 1122 <2> $MIF60: 1123 <2> ADD SP,6 ;;AN006;; Throw away old pointer 1124 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 1125 <2> ; $ENDIF ;;AN006;; 1126 <2> $MEN60: 1127 <2> POP BP ;;AN006;; Restore other Regs 1128 <2> POP DX ;;AN006;; 1129 <2> ; $ENDIF ;;AN006;; 1130 <2> $MIF56: 1131 <2> $M_POPF ;;AN006;; Restore the flag state 1132 <2> 1133 <2> POP BX ;;AN000;; 1134 <2> POP SI ;;AN000;; 1135 <2> RET ;;AN000;; Return ES:DI pointing to the message 1136 <2> ;; 1137 <2> $M_GET_MSG_ADDRESS ENDP ;; 1138 <2> ;; 1139 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 1140 <2> ;; 1141 <2> PUSH DI ;;AN006;; Save position 1142 <2> PUSH AX ;;AN006;; 1143 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 1144 <2> XOR AL,AL ;;AN006;; Prepare compare register 1145 <2> REPNE SCASB ;;AN006;; Scan for zero 1146 <2> NOT CX ;;AN006;; Change decrement into number 1147 <2> DEC CX ;;AN006;; Don't include the zero 1148 <2> POP AX ;;AN006;; 1149 <2> POP DI ;;AN006;; Restore position 1150 <2> RET ;;AN006;; 1151 <2> ;; 1152 <2> $M_SET_LEN_IN_CX ENDP ;; 1153 <2> ;; 1154 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1155 <2> ;; 1156 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 1157 <2> ;; 1158 <2> ;; FUNCTION: To scan thru message headers until message is found 1159 <2> ;; INPUTS: ES:DI points to beginning of msg headers 1160 <2> ;; CX contains the number of messages in class 1161 <2> ;; DH contains the message class 1162 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 1163 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 1164 <2> ;; 1165 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1166 <2> ;; 1167 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 1168 <2> ;; 1169 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 1170 <2> ; $IF E,AND ;;AN004;; Yes, 1171 <2> JNE $MIF64 1172 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 1173 <2> ; $IF NE ;;AN004;; Yes, 1174 <2> JE $MIF64 1175 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 1176 <2> ; $IF E ;;AN004;; . . . and . . . 1177 <2> JNE $MIF65 1178 <2> PUSH AX ;;AN004;; Reset the special message number 1179 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 1180 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1181 <2> POP AX ;;AN004;; Reset the special message number 1182 <2> ; $ELSE ;;AN004;; Get the old message number 1183 <2> JMP SHORT $MEN65 1184 <2> $MIF65: 1185 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1186 <2> ; $ENDIF ;;AN004;; Get the old message number 1187 <2> $MEN65: 1188 <2> ; $ELSE ;;AN004;; 1189 <2> JMP SHORT $MEN64 1190 <2> $MIF64: 1191 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 1192 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1193 <2> ; $IF NE ;;AN001;; 1194 <2> JE $MIF69 1195 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 1196 <2> ; $ELSE ;;AN001;; 1197 <2> JMP SHORT $MEN69 1198 <2> $MIF69: 1199 <2> %IF FARmsg ;;AN001;; 1200 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1201 <2> %ELSE 1202 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1203 <2> %ENDIF 1204 <2> ; $IF E ;;AN002;; pointer (hopefully) 1205 <2> JNE $MIF71 1206 <2> %IF FARmsg ;;AN001;; 1207 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1208 <2> %ELSE 1209 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1210 <2> %ENDIF 1211 <2> ; $ENDIF ;;AN002;; go on to the next class 1212 <2> $MIF71: 1213 <2> ; $ENDIF ;;AN001;; 1214 <2> $MEN69: 1215 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 1216 <2> STC ;;AN004;; Flag that we haven't found anything yet 1217 <2> ; $ENDIF ;;AN004;; 1218 <2> $MEN64: 1219 <2> 1220 <2> ; $IF C ;;AN004;; Have we found anything yet? 1221 <2> JNC $MIF75 1222 <2> CLC ;;AN004;; No, reset carry 1223 <2> ; $SEARCH ;;AN000;; 1224 <2> $MDO76: 1225 <2> OR CX,CX ;;AN000;; Do we have any to check? 1226 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1227 <2> JZ $MEN76 1228 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1229 <2> ; $IF NE ;;AN001;; 1230 <2> JE $MIF78 1231 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 1232 <2> ; $ELSE ;;AN001;; 1233 <2> JMP SHORT $MEN78 1234 <2> $MIF78: 1235 <2> %IF FARmsg ;;AN001;; 1236 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 1237 <2> %ELSE 1238 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 1239 <2> %ENDIF 1240 <2> ; $ENDIF 1241 <2> $MEN78: 1242 <2> ; $EXITIF E ;;AN000;; 1243 <2> JNE $MIF76 1244 <2> ; $ORELSE ;;AN000; 1245 <2> JMP SHORT $MSR76 1246 <2> $MIF76: 1247 <2> DEC CX ;;AN000;; No, well do we have more to check? 1248 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1249 <2> JZ $MEN76 1250 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 1251 <2> ; $ENDLOOP ;;AN000;; 1252 <2> JMP SHORT $MDO76 1253 <2> $MEN76: 1254 <2> STC ;;AN000;; 1255 <2> ; $ENDSRCH ;;AN000;; Check next message 1256 <2> $MSR76: 1257 <2> ; $IF NC ;;AN000;; Did we find the message? 1258 <2> JC $MIF86 1259 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 1260 <2> CLC ;;AN001;; 1261 <2> ; $IF E ;;AN001;; 1262 <2> JNE $MIF87 1263 <2> %IF FARmsg ;;AN001;; 1264 <2> %ELSE ;;AN000;; 1265 <2> PUSH CS ;;AN000;; 1266 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 1267 <2> %ENDIF 1268 <2> ; $ENDIF ;;AN001;; 1269 <2> $MIF87: 1270 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 1271 <2> ; $ENDIF ;;AN004;; 1272 <2> $MIF86: 1273 <2> ; $ENDIF ;;AN004;; 1274 <2> $MIF75: 1275 <2> ;; Yes, great we can return with CX > 0 1276 <2> 1277 <2> ; $IF NC ;;AN000;; Did we find the message? 1278 <2> JC $MIF91 1279 <2> XOR CH,CH ;;AN000;; 1280 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 1281 <2> INC DI ;;AN000;; Increment past length 1282 <2> ; $ENDIF ;;AN004;; 1283 <2> $MIF91: 1284 <2> 1285 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 1286 <2> RET ;;AN000;; Return 1287 <2> ;; 1288 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 1289 <2> ;; 1290 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1291 <2> %ENDIF ;;AN000;; END of include of common subroutines 1292 <2> %ENDIF ;;AN000;; END of include of SYSGETMSG 1293 <2> ; 1294 <2> %IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 1295 <2> %IF COMR ;;AN000;; 1296 <2> $M_RT EQU $M_RT2 ;;AN000;; 1297 <2> %ENDIF ;;AN000;; 1298 <2> %iassign DISPLAYmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 1299 <2> ; PAGE 1300 <2> ; SUBTTL DOS - Message Retriever - DISPMSG.ASM Module 1301 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1302 <2> ;; 1303 <2> ;; Proc Name: SYSDISPMSG 1304 <2> ;; 1305 <2> ;; Function: The DISPLAY service will output a defined message to a handle 1306 <2> ;; requested by the caller. It also provides function to display 1307 <2> ;; messages when handles are not applicable (ie. DOS function calls 1308 <2> ;; 00h to 0Ah) Replaceable parameters are allowed and are 1309 <2> ;; defined previous to entry. 1310 <2> ;; 1311 <2> ;; It is assumes that a PRELOAD function has already determined 1312 <2> ;; the addressibilty internally to the message retriever services. 1313 <2> ;; Inputs: 1314 <2> ;; 1315 <2> ;; Outputs: 1316 <2> ;; 1317 <2> ;; Psuedocode: 1318 <2> ;; Save registers needed later 1319 <2> ;; Get address of the message requested 1320 <2> ;; IF Message number exists THEN 1321 <2> ;; IF replacable parameters were specified THEN 1322 <2> ;; Display message with replacable parms 1323 <2> ;; ELSE 1324 <2> ;; Display string without replacable parms 1325 <2> ;; ENDIF 1326 <2> ;; IF character input was requested THEN 1327 <2> ;; Wait for character input 1328 <2> ;; ENDIF 1329 <2> ;; Clear CARRY FLAG 1330 <2> ;; ELSE 1331 <2> ;; Set CARRY FLAG 1332 <2> ;; ENDIF 1333 <2> ;; Return 1334 <2> ;; 1335 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1336 <2> ;; 1337 <2> %IF FARmsg ;;AN000;; 1338 <2> SYSDISPMSG PROC FAR ;;AN000;; 1339 <2> %ELSE ;;AN000;; 1340 <2> SYSDISPMSG PROC NEAR ;;AN000;; 1341 <2> %ENDIF ;;AN000;; 1342 <2> ;; 1343 <2> ;; Save registers and values needed later 1344 <2> 1345 <2> PUSH AX ;;AN000;; Save changed REGs 1346 <2> PUSH BX ;;AN000;; 1347 <2> PUSH CX ;;AN000;; 1348 <2> PUSH BP ;;AN000;; 1349 <2> PUSH DI ;;AN000;; Save pointer to input buffer (offset) 1350 <2> PUSH ES ;;AN000;; Save pointer to input buffer (segment) 1351 <2> PUSH DX ;;AN000;; Save Input/Class request 1352 <2> 1353 <2> MOV BP,CX ;;AN000;; Use BP to hold replace count 1354 <2> MOV WORD PTR [$M_RT + $M_HANDLE],BX ;;AN000;; Save handle 1355 <2> MOV BYTE PTR [$M_RT + $M_CLASS],DH ;;AN004;; Save class 1356 <2> 1357 <2> ;; Get address of the message requested 1358 <2> 1359 <2> %IF FARmsg ;;AN000;; 1360 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1361 <2> %ELSE ;;AN000;; 1362 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1363 <2> %ENDIF ;;AN000;; 1364 <2> OR CX,CX ;;AN000;; Was message found? 1365 <2> ; $IF NZ ;;AN000;; YES, Message address in ES:DI 1366 <2> JZ $MIF93 1367 <2> 1368 <2> ;; Test if replacable parameters were specified 1369 <2> 1370 <2> OR BP,BP ;;AN000;; Were replacable parameters requested 1371 <2> ; $IF Z ;;AN000;; 1372 <2> JNZ $MIF94 1373 <2> 1374 <2> ;; Display string without replacable parms 1375 <2> 1376 <2> CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message 1377 <2> ; $ELSE ;;AN000;; 1378 <2> JMP SHORT $MEN94 1379 <2> $MIF94: 1380 <2> %IF $M_REPLACE ;;AN000;; 1381 <2> 1382 <2> ;; Display message with replacable parms 1383 <2> 1384 <2> CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions 1385 <2> %ENDIF ;;AN000;; 1386 <2> ; $ENDIF ;;AN000;; 1387 <2> $MEN94: 1388 <2> ; $IF NC 1389 <2> JC $MIF97 1390 <2> 1391 <2> POP DX ;;AN000;; Get Input/Class request 1392 <2> 1393 <2> CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. 1394 <2> 1395 <2> POP ES ;;AN000;; Get location of input buffer (if specified) 1396 <2> POP DI ;;AN000;; 1397 <2> 1398 <2> ;; Test if character input was requested 1399 <2> 1400 <2> %IF INPUTmsg ;;AN000;; 1401 <2> OR DL,DL ;;AN000;; Was Wait-For-Input requested? 1402 <2> ; $IF NZ ;;AN000;; 1403 <2> JZ $MIF98 1404 <2> CALL $M_WAIT_FOR_INPUT ;;AN000;; 1405 <2> ; $ENDIF ;;AN000;; 1406 <2> $MIF98: 1407 <2> %ENDIF ;;AN000;; 1408 <2> ; $ELSE ;;AN000;; 1409 <2> JMP SHORT $MEN97 1410 <2> $MIF97: 1411 <2> ADD SP,6 ;;AN000;; 1412 <2> STC ;;AN000;; Reset carry flag 1413 <2> ; $ENDIF ;;AN000;; 1414 <2> $MEN97: 1415 <2> ; $ELSE ;;AN000;; No, 1416 <2> JMP SHORT $MEN93 1417 <2> $MIF93: 1418 <2> POP ES ;;AN000;; Get pointer to input buffer (segment) 1419 <2> POP DI ;;AN000;; Get base pointer to first sublist (offset) 1420 <2> POP DX ;;AN000;; Get base pointer to first sublist (segment) 1421 <2> STC ;;AN000;; Set carry flag 1422 <2> ; $ENDIF ;;AN000;; 1423 <2> $MEN93: 1424 <2> ;; 1425 <2> ; $IF NC ;;AN000;; Was there an error? 1426 <2> JC $MIF104 1427 <2> POP BP ;;AN000;; No, 1428 <2> POP CX ;;AN000;; 1429 <2> POP BX ;;AN000;; 1430 <2> %IF INPUTmsg ;;AN000;; 1431 <2> ADD SP,2 ;;AN000;; 1432 <2> %ELSE ;AN000; 1433 <2> POP AX ;;AN000;; 1434 <2> %ENDIF ;;AN000;; 1435 <2> ; $ELSE ;;AN000;; Yes, 1436 <2> JMP SHORT $MEN104 1437 <2> $MIF104: 1438 <2> ADD SP,8 ;;AN000;; Eliminate from stack 1439 <2> STC ;;AN000;; 1440 <2> ; $ENDIF ;;AN000;; 1441 <2> $MEN104: 1442 <2> ;; 1443 <2> RET ;;AN000;; Return 1444 <2> ;; 1445 <2> SYSDISPMSG ENDP ;;AN000;; 1446 <2> ;; 1447 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1448 <2> ; 1449 <2> ;; 1450 <2> ;; PROC NAME: $M_DISPLAY_STRING 1451 <2> ;; 1452 <2> ;; FUNCTION: Will display or write string 1453 <2> ;; INPUTS: ES:DI points to beginning of message 1454 <2> ;; CX contains the length of string to write (if applicable) 1455 <2> ;; OUTPUTS: None 1456 <2> ;; REGS Revised: None 1457 <2> ;; 1458 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1459 <2> ;; 1460 <2> $M_DISPLAY_STRING PROC NEAR ;;AN000;; 1461 <2> ;; 1462 <2> PUSH AX ;;AN000;; 1463 <2> PUSH BX ;;AN000;; 1464 <2> PUSH DX ;;AN000;; 1465 <2> ;; 1466 <2> MOV BX,[$M_RT + $M_HANDLE] ;;AN000;; Retrieve handle 1467 <2> ;; 1468 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 1469 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1470 <2> %ELSE 1471 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1472 <2> ; $IF E ;;AN000;; 1473 <2> JNE $MIF107 1474 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1475 <2> ; $ELSE ;;AN000;; 1476 <2> JMP SHORT $MEN107 1477 <2> $MIF107: 1478 <2> CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle 1479 <2> ; $ENDIF ;;AN000;; 1480 <2> $MEN107: 1481 <2> ;AN001; 1482 <2> ; $IF C ;;AN000;; Was there an error? 1483 <2> JNC $MIF110 1484 <2> MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes, 1485 <2> MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error 1486 <2> INT 21H ;;AN000;; 1487 <2> XOR AH,AH ;;AN000;; Clear AH 1488 <2> ADD SP,6 ;;AN000;; Clean up stack 1489 <2> STC ;;AN000;; Flag that there was an error 1490 <2> ; $ELSE ;;AN000;; No, 1491 <2> JMP SHORT $MEN110 1492 <2> $MIF110: 1493 <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1494 <2> ; $IF NE ;;AN000;; 1495 <2> JE $MIF112 1496 <2> CMP AX,CX ;AN001; Was it ALL written? 1497 <2> ; $IF NE ;AN001; No, 1498 <2> JE $MIF113 1499 <2> CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error 1500 <2> ADD SP,6 ;AN001; Clean up stack 1501 <2> STC ;AN001; Flag that there was an error 1502 <2> ; $ENDIF ;AN001; 1503 <2> $MIF113: 1504 <2> ; $ENDIF ;AN001; 1505 <2> $MIF112: 1506 <2> ; $ENDIF ;;AN000;; 1507 <2> $MEN110: 1508 <2> %ENDIF 1509 <2> ; $IF NC ;;AN000;; Was there ANY error? 1510 <2> JC $MIF117 1511 <2> POP DX ;;AN000;; Restore regs 1512 <2> POP BX ;;AN000;; 1513 <2> POP AX ;;AN000;; 1514 <2> ; $ENDIF ;;AN000;; 1515 <2> $MIF117: 1516 <2> RET ;;AN000;; Return 1517 <2> ;; 1518 <2> $M_DISPLAY_STRING ENDP ;;AN000;; 1519 <2> ;; 1520 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1521 <2> ;; 1522 <2> ;; PROC NAME: $M_DISPLAY_$_STRING 1523 <2> ;; 1524 <2> ;; FUNCTION: Will display a $ terminated string 1525 <2> ;; INPUTS: ES:DI points to beginning of message text (not the length) 1526 <2> ;; OUPUTS: None 1527 <2> ;; REGS USED: AX,DX 1528 <2> ;; 1529 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1530 <2> ;; 1531 <2> $M_DISPLAY_$_STRING PROC NEAR ;;AN000;; 1532 <2> ;; 1533 <2> PUSH DS ;;AN000;; 1534 <2> PUSH ES ;;AN000;; 1535 <2> POP DS ;;AN000;; Set DS to segment of message text 1536 <2> %IFN COMR 1537 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1538 <2> ; $IF E ;;AN000;; Yes, 1539 <2> JNE $MIF119 1540 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1541 <2> MOV DL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1542 <2> INT 21H ;;AN000;; Write character 1543 <2> POP DS ;;AN000;; Set DS to segment of message text 1544 <2> MOV AL,DL ;;AN000;; Get the character in AL 1545 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1546 <2> PUSH DS ;;AN000;; 1547 <2> PUSH ES ;;AN000;; 1548 <2> POP DS ;;AN000;; Set DS to segment of message text 1549 <2> ; $IF C ;;AN000;; Yes, 1550 <2> JNC $MIF120 1551 <2> MOV DL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 1552 <2> INT 21H ;;AN000;; Write character 1553 <2> CLC ;;AN000;; Clear the DBCS indicator 1554 <2> ; $ENDIF ;;AN000;; 1555 <2> $MIF120: 1556 <2> ; $ELSE ;;AN000;; No, 1557 <2> JMP SHORT $MEN119 1558 <2> $MIF119: 1559 <2> %ENDIF 1560 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1561 <2> ; $DO ;;AN002;; No, 1562 <2> $MDO123: 1563 <2> OR CX,CX ;;AN002;; Are there any left to display? 1564 <2> ; $LEAVE Z ;;AN002;; Yes, 1565 <2> JZ $MEN123 1566 <2> MOV DL,BYTE PTR [ES:DI] ;;AN002;; Get the character 1567 <2> INT 21H ;;AN002;; Display the character 1568 <2> INC DI ;;AN002;; Set pointer to next character 1569 <2> DEC CX ;;AN002;; Count this character 1570 <2> ; $ENDDO Z ;;AN002;; No, 1571 <2> JNZ $MDO123 1572 <2> $MEN123: 1573 <2> %IFN COMR 1574 <2> ; $ENDIF ;;AN000;; 1575 <2> $MEN119: 1576 <2> %ENDIF 1577 <2> CLC ;;AN000;; Char functions used don't return carry as error 1578 <2> POP DS ;;AN000;; 1579 <2> RET ;;AN000;; 1580 <2> ;; 1581 <2> $M_DISPLAY_$_STRING ENDP ;;AN000;; 1582 <2> ;; 1583 <2> %IFN COMR 1584 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1585 <2> ;; 1586 <2> ;; PROC NAME: $M_DISPLAY_H_STRING 1587 <2> ;; 1588 <2> ;; FUNCTION: Will display a string to a specified handle 1589 <2> ;; INPUTS: ES:DI points to beginning of message 1590 <2> ;; CX contains the number of bytes to write 1591 <2> ;; BX contains the handle to write to 1592 <2> ;; OUPUTS: None 1593 <2> ;; REGS USED: AX,DX 1594 <2> ;; 1595 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1596 <2> ;; 1597 <2> $M_DISPLAY_H_STRING PROC NEAR ;;AN000;; 1598 <2> ;; 1599 <2> XOR AX,AX ;;AN002;; Set number of bytes written to 0 1600 <2> OR CX,CX ;;AN002;; For performance, don't write if not necessary 1601 <2> ; $IF NZ ;;AN002;; Any chars to write? 1602 <2> JZ $MIF127 1603 <2> PUSH DS ;;AN000;; Yes, 1604 <2> PUSH ES ;;AN000;; 1605 <2> POP DS ;;AN000;; Set DS to segment of message text 1606 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1607 <2> MOV DX,DI ;;AN000;; Pointer to data to write 1608 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1609 <2> ; $IF E ;;AN000;; Yes, 1610 <2> JNE $MIF128 1611 <2> INT 21H ;;AN000;; Write character 1612 <2> POP DS ;;AN000;; Set DS to segment of message text 1613 <2> PUSH AX ;;AN000;; 1614 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1615 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1616 <2> POP AX ;;AN000;; Set DS to segment of message text 1617 <2> PUSH DS ;;AN000;; 1618 <2> PUSH ES ;;AN000;; 1619 <2> POP DS ;;AN000;; Set DS to segment of message text 1620 <2> ; $IF C ;;AN000;; Yes, 1621 <2> JNC $MIF129 1622 <2> CLC ;;AN000;; Clear the DBCS indicator 1623 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1624 <2> INC DX ;;AN000;; Point to next character 1625 <2> INT 21H ;;AN000;; Write character 1626 <2> ; $ENDIF ;;AN000;; 1627 <2> $MIF129: 1628 <2> ; $ELSE ;;AN000;; No, 1629 <2> JMP SHORT $MEN128 1630 <2> $MIF128: 1631 <2> INT 21H ;;AN000;; Write String at DS:SI to handle 1632 <2> ; $ENDIF ;;AN000;; 1633 <2> $MEN128: 1634 <2> POP DS ;;AN000;; 1635 <2> ; $ENDIF ;;AN002;; 1636 <2> $MIF127: 1637 <2> ;; 1638 <2> RET ;;AN000;; 1639 <2> ;; 1640 <2> $M_DISPLAY_H_STRING ENDP ;;AN000;; 1641 <2> ;; 1642 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1643 <2> ;; 1644 <2> ;; PROC NAME: $M_GET_EXT_ERR_39 1645 <2> ;; 1646 <2> ;; FUNCTION: Will set registers for extended error #39 1647 <2> ;; INPUTS: None 1648 <2> ;; OUPUTS: AX,BX,CX set 1649 <2> ;; REGS USED: 1650 <2> ;; 1651 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1652 <2> ;; 1653 <2> $M_GET_EXT_ERR_39 PROC NEAR ;AN001; 1654 <2> ;; 1655 <2> MOV AX,EXT_ERR_39 ;AN001; Set AX=39 1656 <2> MOV BX,(ERROR_CLASS_39 >> 8) + ACTION_39 ;AN001; Set BH=1 BL=4 1657 <2> MOV CH,LOCUS_39 ;AN001; Set CH=1 1658 <2> ;AN001; 1659 <2> RET ;AN001; 1660 <2> ;; 1661 <2> $M_GET_EXT_ERR_39 ENDP ;AN001; 1662 <2> ;; 1663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1664 <2> %ENDIF 1665 <2> ;; 1666 <2> ;; PROC NAME: $M_ADD_CRLF 1667 <2> ;; 1668 <2> ;; FUNCTION: Will decide whether to display a CRLF 1669 <2> ;; INPUTS: DX contains the Input/Class requested 1670 <2> ;; OUTPUTS: None 1671 <2> ;; REGS Revised: CX,ES,DI 1672 <2> ;; 1673 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1674 <2> ;; 1675 <2> $M_ADD_CRLF PROC NEAR ;;AN004;; 1676 <2> ;; 1677 <2> CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1678 <2> ; $IF NE ;;AN004;; No, 1679 <2> JE $MIF134 1680 <2> TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? 1681 <2> ; $IF Z ;;AN004;; No, 1682 <2> JNZ $MIF135 1683 <2> PUSH DS ;;AN004;; 1684 <2> POP ES ;;AN004;; Set ES to data segment 1685 <2> LEA DI,[$M_RT + $M_CRLF] ;;AN004;; Point at CRLF message 1686 <2> MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size 1687 <2> CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF 1688 <2> ; $ENDIF ;;AN004;; 1689 <2> $MIF135: 1690 <2> ; $ENDIF ;;AN004;; 1691 <2> $MIF134: 1692 <2> RET ;;AN004;; Return 1693 <2> ;; 1694 <2> $M_ADD_CRLF ENDP ;;AN004;; 1695 <2> ;; 1696 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1697 <2> ;; 1698 <2> ;; PROC NAME: $M_IS_IT_DBCS 1699 <2> ;; 1700 <2> ;; FUNCTION: Will decide whether character is Single or Double Byte 1701 <2> ;; INPUTS: AL contains the byte to be checked 1702 <2> ;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range 1703 <2> ;; Carry flag = 1 if byte IS in DBCS range 1704 <2> ;; REGS USED: All restored 1705 <2> ;; 1706 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1707 <2> ;; 1708 <2> $M_IS_IT_DBCS PROC NEAR ;;AN000;; 1709 <2> ;; 1710 <2> PUSH ES ;;AN000;; Save Extra segment register 1711 <2> PUSH DI ;;AN000;; Save SI register 1712 <2> ;; 1713 <2> LES DI,[$M_RT + $M_DBCS_VEC] ;;AN000;; 1714 <2> OR DI,DI ;;AN000;; Was the DBCS vector set? 1715 <2> ; $IF NZ ;;AN000;; 1716 <2> JZ $MIF138 1717 <2> ; $DO ;;AN000;; 1718 <2> $MDO139: 1719 <2> CMP WORD PTR [ES:DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag? 1720 <2> CLC ;;AN000;; 1721 <2> ; $LEAVE E ;;AN000;; 1722 <2> JE $MEN139 1723 <2> ;; No, 1724 <2> CMP AL,BYTE PTR [ES:DI] ;;AN000;; Does the character fall in the DBCS range? 1725 <2> ; $IF AE,AND ;;AN000;; 1726 <2> JNAE $MIF141 1727 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Does the character fall in the DBCS range? 1728 <2> ; $IF BE ;;AN000;; 1729 <2> JNBE $MIF141 1730 <2> STC ;;AN000;; Yes, 1731 <2> ; $ENDIF ;;AN000;; Set carry flag 1732 <2> $MIF141: 1733 <2> INC DI ;;AN000;; No, 1734 <2> INC DI ;;AN000;; Go to next vector 1735 <2> ; $ENDDO ;;AN000;; 1736 <2> JMP SHORT $MDO139 1737 <2> $MEN139: 1738 <2> ; $ENDIF ;;AN000;; 1739 <2> $MIF138: 1740 <2> 1741 <2> POP DI ;;AN000;; 1742 <2> POP ES ;;AN000;; Restore SI register 1743 <2> RET ;;AN000;; Return 1744 <2> ;; 1745 <2> $M_IS_IT_DBCS ENDP ;;AN000;; 1746 <2> ;; 1747 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1748 <2> ;; 1749 <2> ;; PROC NAME: $M_CONVERT2ASC 1750 <2> ;; 1751 <2> ;; FUNCTION: Convert a binary number to a ASCII string 1752 <2> ;; INPUTS: DX:AX contains the number to be converted 1753 <2> ;; $M_RT_DIVISOR contains the divisor 1754 <2> ;; OUPUTS: CX contains the number of characters 1755 <2> ;; Top of stack --> Last character 1756 <2> ;; . . . 1757 <2> ;; Bot of stack --> First character 1758 <2> ;; REGS USED: 1759 <2> ;; 1760 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1761 <2> ;; 1762 <2> $M_CONVERT2ASC PROC NEAR ;;AN000;; 1763 <2> ;; 1764 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Save Return Address 1765 <2> XOR BX,BX ;;AN000;; Use BP as a swapping register 1766 <2> ;; 1767 <2> XCHG BX,AX ;;AN000;; Initialize - Low Word in BP 1768 <2> XCHG AX,DX ;;AN000;; - High Word in AX 1769 <2> ; $DO ;;AN000;; DO UNTIL Low Word becomes zero 1770 <2> $MDO145: 1771 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide High Word by divisor 1772 <2> XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder 1773 <2> ;; and save reduced High Word in BP 1774 <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide Low Word by divisor 1775 <2> CMP DX,9 ;;AN000;; Make a digit of the remainder 1776 <2> ; $IF A ;;AN000;; IF 10 to 15, 1777 <2> JNA $MIF146 1778 <2> ADD DL,55 ;;AN000;; Make A to F ASCII 1779 <2> ; $ELSE ;;AN000;; IF 0 to 9, 1780 <2> JMP SHORT $MEN146 1781 <2> $MIF146: 1782 <2> ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII 1783 <2> ; $ENDIF ;;AN000;; 1784 <2> $MEN146: 1785 <2> PUSH DX ;;AN000;; Save the digit on the stack 1786 <2> INC CX ;;AN000;; Count that digit 1787 <2> OR AX,AX ;;AN000;; Are we done? 1788 <2> ; $LEAVE Z,AND ;;AN000;; 1789 <2> JNZ $MLL149 1790 <2> OR BX,BX ;;AN000;; AX and BX must be ZERO!! 1791 <2> ; $LEAVE Z ;;AN000;; No, 1792 <2> JZ $MEN145 1793 <2> $MLL149: 1794 <2> %IFN COMR 1795 <2> CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark 1796 <2> ; $IF E ;;AN000;; Yes, 1797 <2> JNE $MIF150 1798 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1799 <2> ; $IF E ;;AN000;; Yes, 1800 <2> JNE $MIF151 1801 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1802 <2> INC CX ;;AN000;; 1803 <2> ; $ENDIF ;;AN000;; 1804 <2> $MIF151: 1805 <2> ; $ELSE ;;AN000;; No, 1806 <2> JMP SHORT $MEN150 1807 <2> $MIF150: 1808 <2> CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark 1809 <2> ; $IF E ;;AN000;; Yes, 1810 <2> JNE $MIF154 1811 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1812 <2> ; $IF E ;;AN000;; Yes, 1813 <2> JNE $MIF155 1814 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1815 <2> INC CX ;;AN000;; 1816 <2> ; $ENDIF ;;AN000;; 1817 <2> $MIF155: 1818 <2> ; $ELSE ;;AN000;; No, 1819 <2> JMP SHORT $MEN154 1820 <2> $MIF154: 1821 <2> CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark 1822 <2> ; $IF E ;;AN000;; Yes, 1823 <2> JNE $MIF158 1824 <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1825 <2> ; $IF E ;;AN000;; Yes, 1826 <2> JNE $MIF159 1827 <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1828 <2> INC CX ;;AN000;; 1829 <2> ; $ENDIF ;;AN000;; 1830 <2> $MIF159: 1831 <2> ; $ENDIF ;;AN000;; 1832 <2> $MIF158: 1833 <2> ; $ENDIF ;;AN000;; 1834 <2> $MEN154: 1835 <2> ; $ENDIF ;;AN000;; 1836 <2> $MEN150: 1837 <2> %ENDIF 1838 <2> XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word 1839 <2> ;;AN000;; and Revised Low Word 1840 <2> XOR DX,DX ;;AN000;; Reset remainder 1841 <2> ; $ENDDO ;;AN000;; NEXT 1842 <2> JMP SHORT $MDO145 1843 <2> $MEN145: 1844 <2> ;;AN000;; Yes, 1845 <2> XOR DX,DX ;;AN000;; Reset remainder 1846 <2> XOR AX,AX ;;AN000;; Reset remainder 1847 <2> PUSH word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Restore Return Address 1848 <2> RET ;;AN000;; Return 1849 <2> ;; 1850 <2> $M_CONVERT2ASC ENDP ;;AN000;; 1851 <2> ;; 1852 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1853 <2> ;; 1854 <2> ;; PROC NAME: $M_DISPLAY_MESSAGE 1855 <2> ;; 1856 <2> ;; FUNCTION: Will display or write entire message (with replacable parameters) 1857 <2> ;; INPUTS: ES:DI points to beginning of message 1858 <2> ;; DS:SI points to first sublist structure in chain 1859 <2> ;; BX contains the handle to write to (if applicable) 1860 <2> ;; CX contains the length of string to write (before substitutions) 1861 <2> ;; BP contains the count of replacables 1862 <2> ;; 1863 <2> ;; OUTPUTS: 1864 <2> ;; REGS USED: All 1865 <2> ;; 1866 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1867 <2> ;; 1868 <2> $M_DISPLAY_MESSAGE PROC NEAR ;;AN000;; 1869 <2> ;; 1870 <2> ; $DO ;;AN000;; Note: DS:SI -> message 1871 <2> $MDO165: 1872 <2> XOR DX,DX ;;AN000;; Set size = 0 1873 <2> OR CX,CX ;;AN000;; Are we finished the message yet? 1874 <2> ; $IF NZ ;;AN000;; No, 1875 <2> JZ $MIF166 1876 <2> MOV AH,"%" ;;AN000;; Prepare to scan for % 1877 <2> MOV AL,0 ;;AN004;; 1878 <2> ;; 1879 <2> ; $DO ;;AN000;; Scan through string until % 1880 <2> $MDO167: 1881 <2> CMP BYTE PTR [ES:DI],AH ;;AN000;; Is this character NOT a % 1882 <2> ; $LEAVE E,AND ;;AN000;; No, 1883 <2> JNE $MLL168 1884 <2> CMP BYTE PTR [ES:DI+1],AH ;;AN000;; Is the next character also a % 1885 <2> ; $LEAVE NE,AND ;;AN000;; No, 1886 <2> JE $MLL168 1887 <2> CMP AL,AH ;;AN000;; Was the character before a % 1888 <2> ; $LEAVE NE ;;AN000;; No, GREAT found it 1889 <2> JNE $MEN167 1890 <2> $MLL168: 1891 <2> MOV AL,BYTE PTR [ES:DI] ;;AN004;; Yes, (to any of the above) 1892 <2> CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? 1893 <2> ; $IF C ;;AN004;; Yes, 1894 <2> JNC $MIF169 1895 <2> INC DI ;;AN004;; Increment past second part 1896 <2> ; $ENDIF ;;AN004;; 1897 <2> $MIF169: 1898 <2> INC DI ;;AN000;; Next character in string 1899 <2> INC DX ;;AN000;; Size = Size + 1 1900 <2> DEC CX ;;AN000;; Decrement total size 1901 <2> ; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line 1902 <2> JNZ $MDO167 1903 <2> $MEN167: 1904 <2> ; $ENDIF ;;AN000;; 1905 <2> $MIF166: 1906 <2> ;; 1907 <2> PUSH SI ;;AN000;; Save beginning of sublists 1908 <2> XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX) 1909 <2> OR BP,BP ;;AN000;; Do we have any replacables to do? 1910 <2> ; $IF NZ ;;AN000;; Yes, 1911 <2> JZ $MIF173 1912 <2> DEC BP ;;AN000;; Decrement number of replacables 1913 <2> 1914 <2> ;; Search through sublists to find applicable one 1915 <2> 1916 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 1917 <2> ; $IF E ;;AN000;; No, 1918 <2> JNE $MIF174 1919 <2> ; $SEARCH ;;AN000;; 1920 <2> $MDO175: 1921 <2> MOV AL,[$M_SL + $M_S_ID] ;;AN000;; Get ID byte 1922 <2> ADD AL,30H ;;AN000;; Convert to ASCII 1923 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Is this the right sublist? 1924 <2> ; $EXITIF E ;;AN000;; 1925 <2> JNE $MIF175 1926 <2> ; $ORELSE ;;AN000;; No, 1927 <2> JMP SHORT $MSR175 1928 <2> $MIF175: 1929 <2> CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 1930 <2> ; $LEAVE E,AND ;;AN000;; Yes, 1931 <2> JNE $MLL178 1932 <2> OR DX,DX ;;AN000;; Are we at the end of the message? 1933 <2> ; $LEAVE Z ;;AN000;; No, 1934 <2> JZ $MEN175 1935 <2> $MLL178: 1936 <2> ADD SI,WORD PTR [$M_SL + $M_S_SIZE] ;;AN000;; Next SUBLIST 1937 <2> ; $ENDLOOP ;;AN000;; Yes, 1938 <2> JMP SHORT $MDO175 1939 <2> $MEN175: 1940 <2> CMP byte [$M_RT + $M_CLASS],UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1941 <2> ; $IF E ;;AN004;; Yes, 1942 <2> JNE $MIF180 1943 <2> INC DX ;;AN000;; Remember to display CR,LF 1944 <2> INC DX ;;AN000;; at the end of the message 1945 <2> DEC CX ;;AN000;; Adjust message length 1946 <2> DEC CX ;;AN000;; 1947 <2> DEC DI ;;AN000;; Adjust ending address of message 1948 <2> DEC DI ;;AN000;; 1949 <2> ; $ELSE ;;AN004;; No, 1950 <2> JMP SHORT $MEN180 1951 <2> $MIF180: 1952 <2> MOV DX,-1 ;;AN004;; Set special case 1953 <2> ; $ENDIF ;;AN004;; 1954 <2> $MEN180: 1955 <2> ; $ENDSRCH ;;AN000;; 1956 <2> $MSR175: 1957 <2> ; $ENDIF ;;AN000;; 1958 <2> $MIF174: 1959 <2> ; $ENDIF ;;AN000;; 1960 <2> $MIF173: 1961 <2> 1962 <2> ;; Prepare and display this part of message 1963 <2> 1964 <2> PUSH DI ;;AN000;; Save pointer to replace number 1965 <2> SUB DI,CX ;;AN000;; Determine beginning of string 1966 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) 1967 <2> POP DI ;;AN000;; Get back pointer to replace number 1968 <2> POP CX ;;AN000;; Clean up stack in case error 1969 <2> ; $LEAVE C,LONG ;;AN000;; Fail if carry was set 1970 <2> JNC $MXL3 1971 <2> JMP $MEN165 1972 <2> nop ; identicalise 1973 <2> $MXL3: 1974 <2> PUSH CX ;;AN000;; 1975 <2> 1976 <2> ;; Save and reset pointer registers 1977 <2> 1978 <2> MOV CX,DX ;;AN000;; Get the size of the rest of the message 1979 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case? 1980 <2> ; $IF NE ;;AN000;; No, 1981 <2> JE $MIF187 1982 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1983 <2> ; $IF NZ ;;AN000;; No, 1984 <2> JZ $MIF188 1985 <2> DEC CX ;;AN000;; Decrement total size (%) 1986 <2> DEC CX ;;AN000;; Decrement total size (#) 1987 <2> INC DI ;;AN000;; Go past % 1988 <2> INC DI ;;AN000;; Go past replace number 1989 <2> ; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) 1990 <2> JMP SHORT $MEN188 1991 <2> $MIF188: 1992 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 1993 <2> ; $ENDIF ;;AN000;; Yes, Note this will not leave because INC 1994 <2> $MEN188: 1995 <2> ; $ELSE ;;AN000;; 1996 <2> JMP SHORT $MEN187 1997 <2> $MIF187: 1998 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1999 <2> ; $IF Z ;;AN004;; No, 2000 <2> JNZ $MIF192 2001 <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 2002 <2> ; $ELSE ;;AN000;; No, 2003 <2> JMP SHORT $MEN192 2004 <2> $MIF192: 2005 <2> CMP CX,-1 ;;AN004;; Are we at the end of the message? 2006 <2> ; $IF Z ;;AN004;; No, 2007 <2> JNZ $MIF194 2008 <2> XOR CX,CX ;;AN004;; 2009 <2> ; $ENDIF ;;AN000;; 2010 <2> $MIF194: 2011 <2> OR DI,DI ;;AN004;; Turn ZF off 2012 <2> ; $ENDIF ;;AN000;; 2013 <2> $MEN192: 2014 <2> ; $ENDIF ;;AN000;; Note this will not leave because INC 2015 <2> $MEN187: 2016 <2> ; $LEAVE Z ;;AN000;; 2017 <2> JZ $MEN165 2018 <2> PUSH BP ;;AN000;; Save the replace count 2019 <2> PUSH DI ;;AN000;; Save location to complete message 2020 <2> PUSH ES ;;AN000;; 2021 <2> PUSH CX ;;AN000;; Save size of the rest of the message 2022 <2> XOR CX,CX ;;AN000;; Reset CX used for character count 2023 <2> 2024 <2> ;; Determine what action is required on parameter 2025 <2> 2026 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2027 <2> ; $IF E ;;AN000;; 2028 <2> JNE $MIF199 2029 <2> 2030 <2> %IF CHARmsg ;;AN000;; Was Char specified? 2031 <2> Char_Type equ Char_type ; NASM port equate 2032 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2033 <2> ; $IF Z ;;AN000;; 2034 <2> JNZ $MIF200 2035 <2> 2036 <2> ;; Character type requested 2037 <2> ;;AN000;; 2038 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2039 <2> CALL $M_CHAR_REPLACE ;;AN000;; 2040 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2041 <2> JMP SHORT $MEN200 2042 <2> $MIF200: 2043 <2> %ENDIF ;;AN000;; 2044 <2> %IF NUMmsg ;;AN000;; Was Nnmeric type specified? 2045 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2046 <2> ; $IF Z,OR ;;AN000;; 2047 <2> JZ $MLL202 2048 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2049 <2> ; $IF Z,OR ;;AN000;; 2050 <2> JZ $MLL202 2051 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Bin_Hex_Type & $M_TYPE_MASK ;;AN000;; 2052 <2> ; $IF Z ;;AN000;; 2053 <2> JNZ $MIF202 2054 <2> $MLL202: 2055 <2> 2056 <2> ;; Numeric type requested 2057 <2> 2058 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2059 <2> CALL $M_BIN2ASC_REPLACE ;;AN000;; 2060 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2061 <2> JMP SHORT $MEN202 2062 <2> $MIF202: 2063 <2> %ENDIF ;;AN000;; 2064 <2> %IF DATEmsg ;;AN000;; Was date specified? 2065 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Date_Type & $M_TYPE_MASK ;;AN000;; 2066 <2> ; $IF E ;;AN000;; 2067 <2> JNE $MIF204 2068 <2> 2069 <2> ;; Date type requested 2070 <2> 2071 <2> CALL $M_DATE_REPLACE ;;AN000;; 2072 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2073 <2> JMP SHORT $MEN204 2074 <2> $MIF204: 2075 <2> %ENDIF ;;AN000;; 2076 <2> %IF TIMEmsg ;;AN000;; Was time (12 hour format) specified? 2077 <2> 2078 <2> ;; Time type requested (Default if we have not matched until here) 2079 <2> 2080 <2> CALL $M_TIME_REPLACE ;;AN000;; 2081 <2> %ENDIF ;;AN000;; 2082 <2> 2083 <2> %IF DATEmsg ;;AN000;; 2084 <2> ; $ENDIF ;;AN000;; 2085 <2> $MEN204: 2086 <2> %ENDIF ;;AN000;; 2087 <2> %IF NUMmsg ;;AN000;; 2088 <2> ; $ENDIF ;;AN000;; 2089 <2> $MEN202: 2090 <2> %ENDIF ;;AN000;; 2091 <2> %IF CHARmsg ;;AN000;; 2092 <2> ; $ENDIF ;;AN000;; 2093 <2> $MEN200: 2094 <2> %ENDIF ;;AN000;; 2095 <2> 2096 <2> %IF $M_REPLACE ;;AN000;; 2097 <2> ;; With the replace information of the Stack, display the replaceable field 2098 <2> 2099 <2> CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace 2100 <2> %ENDIF ;;AN000;; 2101 <2> ;; None of the above - Extended/Parse replace 2102 <2> ; $ELSE ;;AN000;; 2103 <2> JMP SHORT $MEN199 2104 <2> $MIF199: 2105 <2> %IFN COMR 2106 <2> CALL $M_EXT_PAR_REPLACE ;;AN000;; 2107 <2> %ENDIF 2108 <2> ; $ENDIF ;;AN000;; 2109 <2> $MEN199: 2110 <2> 2111 <2> ;; We must go back and complete the message after the replacable parameter if there is any left 2112 <2> 2113 <2> ; $IF NC ;;AN000;; IF there was an error displaying then EXIT 2114 <2> JC $MIF211 2115 <2> POP CX ;;AN000;; Get size of the rest of the message 2116 <2> POP ES ;;AN000;; Get address of the rest of the message 2117 <2> POP DI ;;AN000;; 2118 <2> POP BP ;;AN000;; Get replacment count 2119 <2> POP SI ;;AN000;; ELSE get address of first sublist structure 2120 <2> ; $ELSE ;;AN000;; 2121 <2> JMP SHORT $MEN211 2122 <2> $MIF211: 2123 <2> ADD SP,10 ;;AN000;; Clean up stack if error 2124 <2> STC ;;AN000;; 2125 <2> ; $ENDIF ;;AN000;; 2126 <2> $MEN211: 2127 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2128 <2> ; $ENDDO NE,OR ;;AN000;; 2129 <2> JNE $MLL214 2130 <2> ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message 2131 <2> JC $MXL4 2132 <2> JMP $MDO165 2133 <2> $MXL4: 2134 <2> $MLL214: 2135 <2> $MEN165: 2136 <2> ;; IF there was an error displaying then EXIT 2137 <2> MOV word [$M_RT + $M_MSG_NUM],0 ;;AN000;; Reset message number to null 2138 <2> RET ;;AN000;; Return 2139 <2> ;; 2140 <2> $M_DISPLAY_MESSAGE ENDP ;;AN000;; 2141 <2> %IFN COMR 2142 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2143 <2> ;; 2144 <2> ;; PROC NAME: $M_EXT_PAR_REPLACE 2145 <2> ;; 2146 <2> ;; FUNCTION: 2147 <2> ;; INPUTS: 2148 <2> ;; OUPUTS: 2149 <2> ;; 2150 <2> ;; REGS USED: 2151 <2> ;; 2152 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2153 <2> ;; 2154 <2> $M_EXT_PAR_REPLACE PROC NEAR ;;AN000;; 2155 <2> ;; 2156 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2157 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN000;; Prepare for get binary value (LOW) 2158 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2159 <2> ;; 2160 <2> CALL $M_CONVERT2ASC ;;AN000;; 2161 <2> ;; 2162 <2> ; $DO ;;AN000;; 2163 <2> $MDO215: 2164 <2> POP AX ;;AN000;; Get character in register 2165 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2166 <2> INC BX ;;AN000;; Increase buffer count 2167 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2168 <2> ; $IF E ;;AN000;; Yes, 2169 <2> JNE $MIF216 2170 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2171 <2> ; $ENDIF ;;AN000;; 2172 <2> $MIF216: 2173 <2> DEC CL ;;AN000;; Have we completed replace? 2174 <2> ; $ENDDO Z ;;AN000;; 2175 <2> JNZ $MDO215 2176 <2> ;; 2177 <2> MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer 2178 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],AX ;;AN000;; Move char into the buffer 2179 <2> INC BX ;;AN000;; Increase buffer count 2180 <2> INC BX ;;AN000;; Increase buffer count 2181 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2182 <2> RET ;;AN000:: 2183 <2> ;; 2184 <2> $M_EXT_PAR_REPLACE ENDP ;;AN000;; 2185 <2> ;; 2186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2187 <2> %ENDIF 2188 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 2189 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 2190 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2191 <2> ;; 2192 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 2193 <2> ;; 2194 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 2195 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 2196 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2197 <2> ;; IF CX > 1 THEN DS:SI points to the specified message 2198 <2> ;; REGS CHANGED: ES,DI,CX,DS,SI 2199 <2> ;; 2200 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2201 <2> ;; 2202 <2> %IF FARmsg ;;AN000;; 2203 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 2204 <2> %ELSE ;;AN000;; 2205 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 2206 <2> %ENDIF ;;AN000;; 2207 <2> ;; 2208 <2> PUSH SI ;;AN000;; 2209 <2> PUSH BX ;;AN000;; 2210 <2> XOR SI,SI ;;AN000;; Use SI as an index 2211 <2> XOR CX,CX ;;AN000;; Use CX as an size 2212 <2> ; $DO ;;AN000;; 2213 <2> $MDO219: 2214 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 2215 <2> ; $IF E ;;AN000;; Yes, 2216 <2> JNE $MIF220 2217 <2> %IF FARmsg ;;AN000;; 2218 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2219 <2> MOV BX,ES ;;AN000; 2220 <2> %ELSE ;;AN000;; 2221 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2222 <2> MOV BX,DI ;;AN000; 2223 <2> %ENDIF ;;AN000;; 2224 <2> ; $ELSE ;;AN000;; No, 2225 <2> JMP SHORT $MEN220 2226 <2> $MIF220: 2227 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 2228 <2> ; $IF NE ;;AN000;; Yes, 2229 <2> JE $MIF222 2230 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 2231 <2> MOV BX,ES ;;AN000; 2232 <2> ; $ELSE ;;AN000;; No, extended errors were specified 2233 <2> JMP SHORT $MEN222 2234 <2> $MIF222: 2235 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 2236 <2> ; $IF AE,AND ;;AN000;; 2237 <2> JNAE $MIF224 2238 <2> CMP AX,$M_CRIT_HI ;;AN000;; 2239 <2> ; $IF BE ;;AN000;; Yes, 2240 <2> JNBE $MIF224 2241 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 2242 <2> MOV BX,ES ;;AN000; 2243 <2> ; $ELSE ;;AN000;; 2244 <2> JMP SHORT $MEN224 2245 <2> $MIF224: 2246 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 2247 <2> MOV BX,ES ;;AN000; 2248 <2> ; $ENDIF ;;AN000;; 2249 <2> $MEN224: 2250 <2> ; $ENDIF ;;AN000;; 2251 <2> $MEN222: 2252 <2> ; $ENDIF ;;AN000;; 2253 <2> $MEN220: 2254 <2> ;; 2255 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 2256 <2> ; $IF E ;;AN000;; Yes, 2257 <2> JNE $MIF229 2258 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 2259 <2> ; $IF E ;;AN000;; Yes, 2260 <2> JNE $MIF230 2261 <2> STC ;;AN000;; Set the carry flag 2262 <2> ; $ELSE ;;AN000;; No, 2263 <2> JMP SHORT $MEN230 2264 <2> $MIF230: 2265 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 2266 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 2267 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 2268 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 2269 <2> CLC ;;AN000;; 2270 <2> ; $ENDIF ;;AN000;; No, 2271 <2> $MEN230: 2272 <2> ; $ELSE ;;AN000;; 2273 <2> JMP SHORT $MEN229 2274 <2> $MIF229: 2275 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 2276 <2> ; $IF NE ;;AN001;; Yes, 2277 <2> JE $MIF234 2278 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 2279 <2> ; $ENDIF ;;AN000;; 2280 <2> $MIF234: 2281 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 2282 <2> CLC ;;AN000;; 2283 <2> ; $ENDIF ;;AN000;; 2284 <2> $MEN229: 2285 <2> ; $LEAVE C ;;AN000;; 2286 <2> JC $MEN219 2287 <2> OR CX,CX ;;AN000;; Was the message found? 2288 <2> ; $ENDDO NZ,LONG ;;AN000;; 2289 <2> JNZ $MXL5 2290 <2> JMP $MDO219 2291 <2> $MXL5: 2292 <2> $MEN219: 2293 <2> 2294 <2> PUSHF ;;AN006;; Save the flag state 2295 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 2296 <2> ; $IF E ;;AN006;; Yes, 2297 <2> JNE $MIF239 2298 <2> PUSH DX ;;AN006;; Save all needed registers 2299 <2> PUSH BP ;;AN006;; 2300 <2> PUSH CX ;;AN006;; 2301 <2> PUSH ES ;;AN006;; 2302 <2> PUSH DI ;;AN006;; 2303 <2> PUSH AX ;;AN006;; 2304 <2> 2305 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 2306 <2> INT 2FH ;;AN006;; 2307 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 2308 <2> POP AX ;;AN006;; Restore msg number 2309 <2> ; $IF E ;;AN006;; Yes, 2310 <2> JNE $MIF240 2311 <2> MOV BX,AX ;;AN006;; BX is the extended error number 2312 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 2313 <2> INT 2FH ;;AN006;; Call IFSFUNC 2314 <2> ; $ELSE ;;AN006;; No, 2315 <2> JMP SHORT $MEN240 2316 <2> $MIF240: 2317 <2> STC ;;AN006;; Carry conditon 2318 <2> ; $ENDIF ;;AN006;; 2319 <2> $MEN240: 2320 <2> 2321 <2> ; $IF C ;;AN006;; Was there an update? 2322 <2> JNC $MIF243 2323 <2> POP DI ;;AN006;; No, 2324 <2> POP ES ;;AN006;; Restore old pointer 2325 <2> POP CX ;;AN006;; 2326 <2> ; $ELSE ;;AN006;; Yes 2327 <2> JMP SHORT $MEN243 2328 <2> $MIF243: 2329 <2> ADD SP,6 ;;AN006;; Throw away old pointer 2330 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 2331 <2> ; $ENDIF ;;AN006;; 2332 <2> $MEN243: 2333 <2> POP BP ;;AN006;; Restore other Regs 2334 <2> POP DX ;;AN006;; 2335 <2> ; $ENDIF ;;AN006;; 2336 <2> $MIF239: 2337 <2> $M_POPF ;;AN006;; Restore the flag state 2338 <2> 2339 <2> POP BX ;;AN000;; 2340 <2> POP SI ;;AN000;; 2341 <2> RET ;;AN000;; Return ES:DI pointing to the message 2342 <2> ;; 2343 <2> $M_GET_MSG_ADDRESS ENDP ;; 2344 <2> ;; 2345 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 2346 <2> ;; 2347 <2> PUSH DI ;;AN006;; Save position 2348 <2> PUSH AX ;;AN006;; 2349 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 2350 <2> XOR AL,AL ;;AN006;; Prepare compare register 2351 <2> REPNE SCASB ;;AN006;; Scan for zero 2352 <2> NOT CX ;;AN006;; Change decrement into number 2353 <2> DEC CX ;;AN006;; Don't include the zero 2354 <2> POP AX ;;AN006;; 2355 <2> POP DI ;;AN006;; Restore position 2356 <2> RET ;;AN006;; 2357 <2> ;; 2358 <2> $M_SET_LEN_IN_CX ENDP ;; 2359 <2> ;; 2360 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2361 <2> ;; 2362 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 2363 <2> ;; 2364 <2> ;; FUNCTION: To scan thru message headers until message is found 2365 <2> ;; INPUTS: ES:DI points to beginning of msg headers 2366 <2> ;; CX contains the number of messages in class 2367 <2> ;; DH contains the message class 2368 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2369 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 2370 <2> ;; 2371 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2372 <2> ;; 2373 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 2374 <2> ;; 2375 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 2376 <2> ; $IF E,AND ;;AN004;; Yes, 2377 <2> JNE $MIF247 2378 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 2379 <2> ; $IF NE ;;AN004;; Yes, 2380 <2> JE $MIF247 2381 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 2382 <2> ; $IF E ;;AN004;; . . . and . . . 2383 <2> JNE $MIF248 2384 <2> PUSH AX ;;AN004;; Reset the special message number 2385 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 2386 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2387 <2> POP AX ;;AN004;; Reset the special message number 2388 <2> ; $ELSE ;;AN004;; Get the old message number 2389 <2> JMP SHORT $MEN248 2390 <2> $MIF248: 2391 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2392 <2> ; $ENDIF ;;AN004;; Get the old message number 2393 <2> $MEN248: 2394 <2> ; $ELSE ;;AN004;; 2395 <2> JMP SHORT $MEN247 2396 <2> $MIF247: 2397 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 2398 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2399 <2> ; $IF NE ;;AN001;; 2400 <2> JE $MIF252 2401 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 2402 <2> ; $ELSE ;;AN001;; 2403 <2> JMP SHORT $MEN252 2404 <2> $MIF252: 2405 <2> %IF FARmsg ;;AN001;; 2406 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2407 <2> %ELSE 2408 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2409 <2> %ENDIF 2410 <2> ; $IF E ;;AN002;; pointer (hopefully) 2411 <2> JNE $MIF254 2412 <2> %IF FARmsg ;;AN001;; 2413 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2414 <2> %ELSE 2415 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2416 <2> %ENDIF 2417 <2> ; $ENDIF ;;AN002;; go on to the next class 2418 <2> $MIF254: 2419 <2> ; $ENDIF ;;AN001;; 2420 <2> $MEN252: 2421 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 2422 <2> STC ;;AN004;; Flag that we haven't found anything yet 2423 <2> ; $ENDIF ;;AN004;; 2424 <2> $MEN247: 2425 <2> 2426 <2> ; $IF C ;;AN004;; Have we found anything yet? 2427 <2> JNC $MIF258 2428 <2> CLC ;;AN004;; No, reset carry 2429 <2> ; $SEARCH ;;AN000;; 2430 <2> $MDO259: 2431 <2> OR CX,CX ;;AN000;; Do we have any to check? 2432 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2433 <2> JZ $MEN259 2434 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2435 <2> ; $IF NE ;;AN001;; 2436 <2> JE $MIF261 2437 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 2438 <2> ; $ELSE ;;AN001;; 2439 <2> JMP SHORT $MEN261 2440 <2> $MIF261: 2441 <2> %IF FARmsg ;;AN001;; 2442 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 2443 <2> %ELSE 2444 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 2445 <2> %ENDIF 2446 <2> ; $ENDIF 2447 <2> $MEN261: 2448 <2> ; $EXITIF E ;;AN000;; 2449 <2> JNE $MIF259 2450 <2> ; $ORELSE ;;AN000; 2451 <2> JMP SHORT $MSR259 2452 <2> $MIF259: 2453 <2> DEC CX ;;AN000;; No, well do we have more to check? 2454 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2455 <2> JZ $MEN259 2456 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 2457 <2> ; $ENDLOOP ;;AN000;; 2458 <2> JMP SHORT $MDO259 2459 <2> $MEN259: 2460 <2> STC ;;AN000;; 2461 <2> ; $ENDSRCH ;;AN000;; Check next message 2462 <2> $MSR259: 2463 <2> ; $IF NC ;;AN000;; Did we find the message? 2464 <2> JC $MIF269 2465 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 2466 <2> CLC ;;AN001;; 2467 <2> ; $IF E ;;AN001;; 2468 <2> JNE $MIF270 2469 <2> %IF FARmsg ;;AN001;; 2470 <2> %ELSE ;;AN000;; 2471 <2> PUSH CS ;;AN000;; 2472 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 2473 <2> %ENDIF 2474 <2> ; $ENDIF ;;AN001;; 2475 <2> $MIF270: 2476 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 2477 <2> ; $ENDIF ;;AN004;; 2478 <2> $MIF269: 2479 <2> ; $ENDIF ;;AN004;; 2480 <2> $MIF258: 2481 <2> ;; Yes, great we can return with CX > 0 2482 <2> 2483 <2> ; $IF NC ;;AN000;; Did we find the message? 2484 <2> JC $MIF274 2485 <2> XOR CH,CH ;;AN000;; 2486 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 2487 <2> INC DI ;;AN000;; Increment past length 2488 <2> ; $ENDIF ;;AN004;; 2489 <2> $MIF274: 2490 <2> 2491 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 2492 <2> RET ;;AN000;; Return 2493 <2> ;; 2494 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 2495 <2> ;; 2496 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2497 <2> %ENDIF ;;AN000;; END of include of common subroutines 2498 <2> ; 2499 <2> %IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms 2500 <2> %iassign $M_REPLACE FALSE ;;AN000;; Tell the assembler we did 2501 <2> ;; 2502 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2503 <2> $M_DISPLAY_REPLACE PROC NEAR ;;AN000;; 2504 <2> ;; 2505 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2506 <2> %IFN COMR 2507 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII) 2508 <2> ; $IF E ;;AN000;; Yes, 2509 <2> JNE $MIF276 2510 <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE_HYP ;;AN000;; Move in a " -" 2511 <2> INC BX ;;AN000;; Increment count 2512 <2> INC BX ;;AN000;; Increment count 2513 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE ;;AN000;; Move in a " " 2514 <2> INC BX ;;AN000;; Increment count 2515 <2> CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case 2516 <2> ; $ENDIF ;;AN000;; If it fails we will catch it later 2517 <2> $MIF276: 2518 <2> %ENDIF 2519 <2> 2520 <2> POP BP ;;AN000;; Remember the return address 2521 <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2522 <2> XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack 2523 <2> 2524 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save size to later clear stack 2525 <2> MOV AL,BYTE PTR [$M_SL + $M_S_MINW] ;;AN000;; Get the minimum width 2526 <2> ;; 2527 <2> CMP AL,CL ;;AN000;; Do we need pad chars added? 2528 <2> ; $IF A ;;AN000;; Yes, 2529 <2> JNA $MIF278 2530 <2> SUB AL,CL ;;AN000;; Calculate how many pad chars are needed. 2531 <2> MOV DH,AL ;;AN000;; Save the number of pad characters 2532 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be right aligned? 2533 <2> ; $IF NZ ;;AN000;; Yes, 2534 <2> JZ $MIF279 2535 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2536 <2> $MDO280: 2537 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2538 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2539 <2> INC BX ;;AN000;; 2540 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2541 <2> ; $IF E ;;AN000;; Yes, 2542 <2> JNE $MIF281 2543 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2544 <2> ; $ENDIF ;;AN000;; 2545 <2> $MIF281: 2546 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2547 <2> ; $ENDDO Z ;;AN000;; No, next pad character 2548 <2> JNZ $MDO280 2549 <2> ; $ENDIF ;;AN000;; 2550 <2> $MIF279: 2551 <2> ; $ENDIF ;;AN000;; Yes, 2552 <2> $MIF278: 2553 <2> ;; 2554 <2> CMP BYTE [$M_SL + $M_S_MAXW],$M_UNLIM_W ;;AN000;; Is maximum width unlimited? 2555 <2> ; $IF NE ;;AN000;; 2556 <2> JE $MIF286 2557 <2> CMP BYTE PTR [$M_SL + $M_S_MAXW],CL ;;AN000;; Will we exceed maximum width? 2558 <2> ; $IF B ;;AN000;; Yes, 2559 <2> JNB $MIF287 2560 <2> SUB CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Calculate how many extra chars 2561 <2> MOV DL,CL ;;AN000;; Remember how many chars to pop off 2562 <2> MOV CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Set new string length 2563 <2> ; $ENDIF ;;AN000;; 2564 <2> $MIF287: 2565 <2> ; $ENDIF ;;AN000;; 2566 <2> $MIF286: 2567 <2> OR CX,CX ;;AN000;; 2568 <2> ; $IF NZ ;;AN000;; 2569 <2> JZ $MIF290 2570 <2> ; $DO ;;AN000;; Begin filling buffer with string 2571 <2> $MDO291: 2572 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2573 <2> ; $IF Z,AND ;;AN000;; 2574 <2> JNZ $MIF292 2575 <2> Char_field_ASCIIZ equ Char_Field_ASCIIZ ; NASM port equate 2576 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ; Is this replace a ASCIIZ string? 2577 <2> ; $IF NZ ;;AN000;; Yes, 2578 <2> JZ $MIF292 2579 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get first character from string 2580 <2> INC DI ;;AN000;; Next character in string 2581 <2> ; $ELSE ;;AN000;; No, 2582 <2> JMP SHORT $MEN292 2583 <2> $MIF292: 2584 <2> POP AX ;;AN000;; Get character in register 2585 <2> ; $ENDIF ;;AN000;; 2586 <2> $MEN292: 2587 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2588 <2> INC BX ;;AN000;; Increase buffer count 2589 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2590 <2> ; $IF E ;;AN000;; Yes, 2591 <2> JNE $MIF295 2592 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2593 <2> ; $ENDIF ;;AN000;; 2594 <2> $MIF295: 2595 <2> DEC CL ;;AN000;; Have we completed replace? 2596 <2> ; $ENDDO Z ;;AN000;; Test again 2597 <2> JNZ $MDO291 2598 <2> ; $ENDIF ;;AN000;; 2599 <2> $MIF290: 2600 <2> ;; 2601 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be left aligned? 2602 <2> ; $IF Z ;;AN000;; Yes, 2603 <2> JNZ $MIF299 2604 <2> OR DH,DH ;;AN000;; Do we need pad chars added? 2605 <2> ; $IF NZ ;;AN000;; Yes, 2606 <2> JZ $MIF300 2607 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2608 <2> $MDO301: 2609 <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2610 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2611 <2> INC BX ;;AN000;; 2612 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2613 <2> ; $IF E ;;AN000;; Yes, 2614 <2> JNE $MIF302 2615 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2616 <2> ; $ENDIF ;;AN000;; 2617 <2> $MIF302: 2618 <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2619 <2> ; $ENDDO Z ;;AN000;; Test again 2620 <2> JNZ $MDO301 2621 <2> ; $ENDIF ;;AN000;; 2622 <2> $MIF300: 2623 <2> ; $ENDIF ;;AN000;; 2624 <2> $MIF299: 2625 <2> ;; 2626 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2627 <2> ; $IF Z,AND ;;AN000;; 2628 <2> JNZ $MIF307 2629 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string? 2630 <2> ; $IF NZ ;;AN000;; Yes, 2631 <2> JZ $MIF307 2632 <2> ; $ELSE ;;AN000;; 2633 <2> JMP SHORT $MEN307 2634 <2> $MIF307: 2635 <2> OR DL,DL ;;AN000;; 2636 <2> ; $IF NE ;;AN000;; 2637 <2> JE $MIF309 2638 <2> ; $DO ;;AN000;; 2639 <2> $MDO310: 2640 <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable 2641 <2> DEC DL ;;AN000;; Are we done? 2642 <2> ; $ENDDO Z ;;AN000;; 2643 <2> JNZ $MDO310 2644 <2> ; $ENDIF ;;AN000;; 2645 <2> $MIF309: 2646 <2> ; $ENDIF ;;AN000;; 2647 <2> $MEN307: 2648 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time 2649 <2> PUSH BP ;;AN000;; Restore the return address 2650 <2> ;; 2651 <2> RET ;;AN000;; 2652 <2> ;; 2653 <2> $M_DISPLAY_REPLACE ENDP ;;AN000;; 2654 <2> ;; 2655 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2656 <2> ;; 2657 <2> ;; PROC NAME: $M_FLUSH_BUFFER 2658 <2> ;; 2659 <2> ;; FUNCTION: Display the contents of the temporary buffer 2660 <2> ;; INPUTS: DI contains the number of bytes to display 2661 <2> ;; OUTPUTS: BX reset to zero 2662 <2> ;; 2663 <2> ;; REGS USED: 2664 <2> ;; 2665 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2666 <2> ;; 2667 <2> $M_FLUSH_BUF PROC NEAR ;;AN000;; 2668 <2> ;; 2669 <2> PUSH CX ;;AN000;; Save changed regs 2670 <2> PUSH ES ;;AN000;; 2671 <2> PUSH DI ;;AN000;; 2672 <2> PUSH DS ;;AN000;; Set ES pointing to buffer 2673 <2> POP ES ;;AN000;; 2674 <2> ;; 2675 <2> MOV CX,BX ;;AN000;; Set number of bytes to display 2676 <2> XOR BX,BX ;;AN000;; Reset buffer counter 2677 <2> LEA DI,[$M_RT + $M_TEMP_BUF] ;;AN000;; Reset buffer location pointer 2678 <2> CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer 2679 <2> ;; 2680 <2> ; $IF NC ;;AN000;; Error? 2681 <2> JC $MIF314 2682 <2> POP DI ;;AN000;; No, Restore changed regs 2683 <2> POP ES ;;AN000;; 2684 <2> POP CX ;;AN000;; 2685 <2> ; $ELSE ;;AN000;; Yes, 2686 <2> JMP SHORT $MEN314 2687 <2> $MIF314: 2688 <2> ADD SP,6 ;;AN000;; Fix stack 2689 <2> STC ;;AN000;; 2690 <2> ; $ENDIF ;;AN000;; Error? 2691 <2> $MEN314: 2692 <2> ;; 2693 <2> RET ;;AN000;; Return 2694 <2> ;; 2695 <2> $M_FLUSH_BUF ENDP ;;AN000;; 2696 <2> ;; 2697 <2> ;; 2698 <2> %IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace? 2699 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2700 <2> %iassign $M_CHAR_ONLY TRUE ;;AN000;; replacement code later 2701 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2702 <2> ;; 2703 <2> ;; PROC NAME: $M_CHAR_REPLACE 2704 <2> ;; 2705 <2> ;; FUNCTION: Will prepare a single char or ASCIIZ string for replace 2706 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2707 <2> ;; ES:DI contains the VALUE from SUBLIST 2708 <2> ;; OUTPUTS: CX contains number of characters on stack 2709 <2> ;; Top of stack --> Last character 2710 <2> ;; . . . 2711 <2> ;; Bot of stack --> First character 2712 <2> ;; 2713 <2> ;; OTHER REGS Revised: AX 2714 <2> ;; 2715 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2716 <2> ;; 2717 <2> $M_CHAR_REPLACE PROC NEAR ;;AN000;; 2718 <2> ;; 2719 <2> POP BP ;;AN000;; Save return address 2720 <2> TEST byte [$M_SL + $M_S_FLAG],~ Char_Field_Char & $M_SIZE_MASK ;;AN000;; Was Character specified? 2721 <2> ; $IF Z ;;AN000;; Yes, 2722 <2> JNZ $MIF317 2723 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2724 <2> PUSH AX ;;AN000;; Put it on the stack 2725 <2> INC CX ;;AN000;; Increase the count 2726 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 2727 <2> ; $IF C ;;AN000;; Yes, 2728 <2> JNC $MIF318 2729 <2> MOV AL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 2730 <2> PUSH AX ;;AN000;; Put it on the stack 2731 <2> CLC ;;AN000;; Clear the carry 2732 <2> ; $ENDIF ;;AN000;; 2733 <2> $MIF318: 2734 <2> ; $ELSE ;;AN000;; No, it was an ASCIIZ string 2735 <2> JMP SHORT $MEN317 2736 <2> $MIF317: 2737 <2> ; $DO ;;AN000;; 2738 <2> $MDO321: 2739 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2740 <2> OR AL,AL ;;AN000;; Is it the NULL? 2741 <2> ; $LEAVE Z ;;AN000;; No, 2742 <2> JZ $MEN321 2743 <2> INC DI ;;AN000;; Next character 2744 <2> INC CX ;;AN000;; Increment the count 2745 <2> ; $ENDDO ;;AN000;; Yes, 2746 <2> JMP SHORT $MDO321 2747 <2> $MEN321: 2748 <2> SUB DI,CX ;;AN000;; Set SI at the beginning of the string 2749 <2> ; $ENDIF ;;AN000;; 2750 <2> $MEN317: 2751 <2> ;;AN000;; 2752 <2> PUSH BP ;;AN000;; Restore return address 2753 <2> RET ;;AN000;; Return 2754 <2> ;; 2755 <2> $M_CHAR_REPLACE ENDP ;;AN000;; 2756 <2> ;; 2757 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2758 <2> %ENDIF ;;AN000;; END of include of CHAR replace code 2759 <2> ; 2760 <2> %IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace? 2761 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2762 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2763 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2764 <2> ;; 2765 <2> ;; PROC NAME: $M_BIN2ASC_REPLACE 2766 <2> ;; 2767 <2> ;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string 2768 <2> ;; and prepare to display 2769 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2770 <2> ;; ES:DI contains the VALUE from SUBLIST 2771 <2> ;; OUTPUTS: CX contains number of characters on stack 2772 <2> ;; Top of stack --> Last character 2773 <2> ;; . . . 2774 <2> ;; Bot of stack --> First character 2775 <2> ;; OTHER REGS Revised: BX,DX,AX 2776 <2> ;; 2777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2778 <2> ;; 2779 <2> $M_BIN2ASC_REPLACE PROC NEAR ;;AN000;; 2780 <2> ;; 2781 <2> POP BP ;;AN000;; Save return address 2782 <2> ;; 2783 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2784 <2> XOR AX,AX ;;AN000;; Prepare for get binary value (LOW) 2785 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE16 ;;AN000;; Set default divisor 2786 <2> XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable) 2787 <2> %IFN COMR 2788 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_BYTE & $M_SIZE_MASK ;;AN000;; Was BYTE specified? 2789 <2> ; $IF Z ;;AN000;; 2790 <2> JNZ $MIF325 2791 <2> MOV AL, BYTE PTR [ES:DI] ;;AN000;; Setup byte in AL 2792 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2793 <2> ; $IF Z ;;AN000;; 2794 <2> JNZ $MIF326 2795 <2> TEST AL,10000000b ;;AN000;; Is this number negative? 2796 <2> ; $IF NZ ;;AN000;; Yes, 2797 <2> JZ $MIF327 2798 <2> INC BX ;;AN000;; Remember that it was negative 2799 <2> AND AL,01111111b ;;AN000;; Make it positive 2800 <2> ; $ENDIF ;;AN000;; 2801 <2> $MIF327: 2802 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2803 <2> ; $ENDIF ;;AN000;; 2804 <2> $MIF326: 2805 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2806 <2> ; $IF Z ;;AN000;; 2807 <2> JNZ $MIF330 2808 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2809 <2> ; $ENDIF ;;AN000;; 2810 <2> $MIF330: 2811 <2> ; $ELSE ;;AN000;; 2812 <2> JMP SHORT $MEN325 2813 <2> $MIF325: 2814 <2> %ENDIF 2815 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_WORD & $M_SIZE_MASK ;;AN000;; Was WORD specified? 2816 <2> ; $IF Z ;;AN000;; 2817 <2> JNZ $MIF333 2818 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup byte in AL 2819 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;; AN000;; Was Signed binary specified? 2820 <2> ; $IF Z ;;AN000;; 2821 <2> JNZ $MIF334 2822 <2> TEST AH,10000000b ;;AN000;; Is this number negative? 2823 <2> ; $IF NZ ;;AN000;; Yes, 2824 <2> JZ $MIF335 2825 <2> INC BX ;;AN000;; Remember that it was negative 2826 <2> AND AH,01111111b ;;AN000;; Make it positive 2827 <2> ; $ENDIF ;;AN000;; 2828 <2> $MIF335: 2829 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2830 <2> ; $ENDIF ;;AN000;; 2831 <2> $MIF334: 2832 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2833 <2> ; $IF Z ;;AN000;; 2834 <2> JNZ $MIF338 2835 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2836 <2> ; $ENDIF ;;AN000;; 2837 <2> $MIF338: 2838 <2> ; $ELSE ;;AN000;; 2839 <2> JMP SHORT $MEN333 2840 <2> $MIF333: 2841 <2> %IFN COMR 2842 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup Double word in DX:AX 2843 <2> MOV DX, WORD PTR [ES:DI + 2] ;;AN000;; 2844 <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2845 <2> ; $IF Z ;;AN000;; 2846 <2> JNZ $MIF341 2847 <2> TEST DH,10000000b ;;AN000;; Is this number negative? 2848 <2> ; $IF NZ ;;AN000;; Yes, 2849 <2> JZ $MIF342 2850 <2> INC BX ;;AN000;; Remember that it was negative 2851 <2> AND DH,01111111b ;;AN000;; Make it positive 2852 <2> ; $ENDIF ;;AN000;; 2853 <2> $MIF342: 2854 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2855 <2> ; $ENDIF ;;AN000;; 2856 <2> $MIF341: 2857 <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2858 <2> ; $IF Z ;;AN000;; 2859 <2> JNZ $MIF345 2860 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2861 <2> ; $ENDIF ;;AN000;; 2862 <2> $MIF345: 2863 <2> %ENDIF 2864 <2> ; $ENDIF ;;AN000;; 2865 <2> $MEN333: 2866 <2> ; $ENDIF ;;AN000;; 2867 <2> $MEN325: 2868 <2> ;; 2869 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string 2870 <2> %IFN COMR 2871 <2> OR BX,BX ;;AN000;; 2872 <2> ; $IF NZ ;;AN000;; Was number negative? 2873 <2> JZ $MIF349 2874 <2> XOR DX,DX ;;AN000;; Yes, 2875 <2> MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number 2876 <2> PUSH DX ;;AN000;; 2877 <2> ; $ENDIF ;;AN000;; No, 2878 <2> $MIF349: 2879 <2> %ENDIF 2880 <2> ;; 2881 <2> PUSH BP ;;AN000;; Restore return address 2882 <2> RET ;;AN000;; Return 2883 <2> ;; 2884 <2> $M_BIN2ASC_REPLACE ENDP ;;AN000;; 2885 <2> ;; 2886 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2887 <2> %ENDIF ;;AN000;; END of include of NUM replace code 2888 <2> ; 2889 <2> %IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace? 2890 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2891 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2892 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2893 <2> ;; 2894 <2> ;; PROC NAME: $M_DATE_REPLACE 2895 <2> ;; 2896 <2> ;; FUNCTION: Convert a date to a decimal ASCII string using current 2897 <2> ;; country format and prepare to display 2898 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2899 <2> ;; ES:DI points at VALUE from SUBLIST 2900 <2> ;; OUTPUTS: CX contains number of characters on stack 2901 <2> ;; Top of stack --> Last character 2902 <2> ;; . . . 2903 <2> ;; Bot of stack --> First character 2904 <2> ;; OTHER REGS Revised: DX, AX 2905 <2> ;; 2906 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2907 <2> ;; 2908 <2> $M_DATE_REPLACE PROC NEAR ;;AN000;; 2909 <2> ;; 2910 <2> POP BP ;;AN000;; Save return address 2911 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2912 <2> CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT 2913 <2> ;;AN000;; All O.K.? 2914 <2> XOR DX,DX ;;AN000;; Reset DX value 2915 <2> XOR AX,AX ;;AN000;; Reset AX value 2916 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],0 ;;AN000;; USA Date Format 2917 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2918 <2> JNE $MIF351 2919 <2> CALL $M_YEAR ;;AN000;; Get Year 2920 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2921 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2922 <2> INC CX ;;AN000;; Increment count 2923 <2> XOR AX,AX ;;AN000;; Reset AX value 2924 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2925 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2926 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2927 <2> INC CX ;;AN000;; Increment count 2928 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2929 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2930 <2> ; $ENDIF ;;AN000;; 2931 <2> $MIF351: 2932 <2> ;; 2933 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],1 ;;AN000;; EUROPE Date Format 2934 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2935 <2> JNE $MIF353 2936 <2> CALL $M_YEAR ;;AN000;; Get Year 2937 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2938 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2939 <2> INC CX ;;AN000;; 2940 <2> XOR AX,AX ;;AN000;; Reset AX 2941 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2942 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2943 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2944 <2> INC CX ;;AN000;; 2945 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2946 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2947 <2> ; $ENDIF ;;AN000;; 2948 <2> $MIF353: 2949 <2> ;; 2950 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],2 ;;AN000;; JAPAN Date Format 2951 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2952 <2> JNE $MIF355 2953 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2954 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2955 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2956 <2> INC CX ;;AN000;; 2957 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2958 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2959 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2960 <2> INC CX ;;AN000;; 2961 <2> CALL $M_YEAR ;;AN000;; Get Year 2962 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2963 <2> ; $ENDIF ;;AN000;; 2964 <2> $MIF355: 2965 <2> ;; 2966 <2> PUSH BP ;;AN000;; Restore return address 2967 <2> RET ;;AN000;; Return 2968 <2> ;; 2969 <2> $M_DATE_REPLACE ENDP ;;AN000;; 2970 <2> ;; 2971 <2> $M_GET_DATE PROC NEAR ;;AN000;; 2972 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 2973 <2> MOV AL,0 ;;AN000;; Get current country info 2974 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 2975 <2> INT 21H ;;AN000;; 2976 <2> ; $IF C ;;AN000;; No, 2977 <2> JNC $MIF357 2978 <2> MOV WORD [$M_RT + $M_DATE_FORMAT],$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH) 2979 <2> MOV BYTE [$M_RT + $M_DATE_SEPARA],$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL) 2980 <2> ; $ENDIF ;;AN000;; 2981 <2> $MIF357: 2982 <2> RET ;;AN000;; 2983 <2> $M_GET_DATE ENDP ;;AN000;; 2984 <2> ;; 2985 <2> $M_YEAR PROC NEAR ;;AN000;; 2986 <2> MOV AX,WORD PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Year 2987 <2> TEST byte [$M_SL + $M_S_FLAG],Date_MDY_4 & $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified? 2988 <2> ; $IF Z ;;AN000;; 2989 <2> JNZ $MIF359 2990 <2> CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year 2991 <2> ; $IF A ;;AN000;; 2992 <2> JNA $MIF360 2993 <2> MOV AX,$M_MAX_2_YEAR ;;AN000;; 2994 <2> ; $ENDIF ;;AN000;; 2995 <2> $MIF360: 2996 <2> ; $ENDIF ;;AN000;; 2997 <2> $MIF359: 2998 <2> RET ;;AN000;; 2999 <2> $M_YEAR ENDP ;;AN000;; 3000 <2> ;; 3001 <2> $M_CONVERTDATE PROC NEAR ;;AN000;; 3002 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3003 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3004 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3005 <2> DEC CX ;;AN000;; Test if size only grew by 1 3006 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3007 <2> ; $IF E ;;AN000;; Yes, 3008 <2> JNE $MIF363 3009 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3010 <2> PUSH AX ;;AN000;; Save it 3011 <2> INC CX ;;AN000;; Count it 3012 <2> ; $ENDIF ;;AN000;; 3013 <2> $MIF363: 3014 <2> INC CX ;;AN000;; Restore CX 3015 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3016 <2> RET ;;AN000;; 3017 <2> $M_CONVERTDATE ENDP ;;AN000;; 3018 <2> ;; 3019 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3020 <2> %ENDIF ;;AN000;; END of include of DATE replace code 3021 <2> ; 3022 <2> %IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace? 3023 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 3024 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 3025 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3026 <2> ;; 3027 <2> ;; PROC NAME: $M_TIME_REPLACE 3028 <2> ;; 3029 <2> ;; FUNCTION: Convert a time to a decimal ASCII string 3030 <2> ;; and prepare to display 3031 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 3032 <2> ;; ES:DI points at VALUE from SUBLIST 3033 <2> ;; OUTPUTS: CX contains number of characters on stack 3034 <2> ;; Top of stack --> Last character 3035 <2> ;; . . . 3036 <2> ;; Bot of stack --> First character 3037 <2> ;; REGS USED: BP,CX,AX 3038 <2> ;; 3039 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3040 <2> ;; 3041 <2> $M_TIME_REPLACE PROC NEAR ;;AN000;; 3042 <2> ;; 3043 <2> POP BP ;;AN000;; Save return address 3044 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 3045 <2> CALL $M_GET_TIME ;;AN000;; All O.K.? 3046 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3047 <2> ; $IF NZ ;;AN000;; Yes, 3048 <2> JZ $MIF365 3049 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3050 <2> ; $IF E ;;AN000;; Yes, 3051 <2> JNE $MIF366 3052 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3053 <2> CMP AL,12 ;;AN000;; Is hour 12 or less? 3054 <2> ; $IF L,OR ;;AN000;; or 3055 <2> JL $MLL367 3056 <2> CMP AL,23 ;;AN000;; Is hour 24 or greater? 3057 <2> ; $IF G ;;AN000;; Yes, 3058 <2> JNG $MIF367 3059 <2> $MLL367: 3060 <2> MOV AL,$M_AM ;;AN000;; 3061 <2> PUSH AX ;;AN000;; Push an "a" to represent AM. 3062 <2> INC CX ;;AN000;; 3063 <2> ; $ELSE ;;AN000;; No, 3064 <2> JMP SHORT $MEN367 3065 <2> $MIF367: 3066 <2> MOV AL,$M_PM ;;AN000;; 3067 <2> PUSH AX ;;AN000;; Push an "p" to represent PM. 3068 <2> INC CX ;;AN000;; 3069 <2> ; $ENDIF ;;AN000;; 3070 <2> $MEN367: 3071 <2> ; $ENDIF ;;AN000;; 3072 <2> $MIF366: 3073 <2> ; $ENDIF ;;AN000;; 3074 <2> $MIF365: 3075 <2> ;; 3076 <2> XOR AX,AX ;;AN000;; 3077 <2> XOR DX,DX ;;AN000;; 3078 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3079 <2> ; $IF NZ ;;AN000;; 3080 <2> JZ $MIF372 3081 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Hundreds 3082 <2> CALL $M_CONVERTTIME ;;AN000;; 3083 <2> PUSH WORD [$M_RT + $M_DECI_SEPARA] ;;AN000;; 3084 <2> INC CX ;;AN000;; 3085 <2> ; $ENDIF ;;AN000;; 3086 <2> $MIF372: 3087 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3088 <2> ; $IF NZ,OR ;;AN000;; 3089 <2> JNZ $MLL374 3090 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSS_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? 3091 <2> ; $IF NZ ;;AN000;; 3092 <2> JZ $MIF374 3093 <2> $MLL374: 3094 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Seconds 3095 <2> CALL $M_CONVERTTIME ;;AN000;; 3096 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3097 <2> INC CX ;;AN000;; 3098 <2> ; $ENDIF ;;AN000;; 3099 <2> $MIF374: 3100 <2> ;; Do Hour/Min (12 Hour) 3101 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+1] ;;AN000;; Get Minutes 3102 <2> CALL $M_CONVERTTIME ;;AN000;; 3103 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3104 <2> INC CX ;;AN000;; 3105 <2> ;; 3106 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3107 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3108 <2> ; $IF NZ ;;AN000;; Yes, 3109 <2> JZ $MIF376 3110 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3111 <2> ; $IF E ;;AN000;; Yes, 3112 <2> JNE $MIF377 3113 <2> CMP AL,13 ;;AN000;; Is hour less than 12? 3114 <2> ; $IF GE ;;AN000;; Yes, 3115 <2> JNGE $MIF378 3116 <2> SUB AL,12 ;;AN000;; Set to a 12 hour value 3117 <2> ; $ENDIF ;;AN000;; 3118 <2> $MIF378: 3119 <2> CMP AL,0 ;;AN000;; Is hour less than 12? 3120 <2> ; $IF E ;;AN000;; Yes, 3121 <2> JNE $MIF380 3122 <2> MOV AL,12 ;;AN000;; Set to a 12 hour value 3123 <2> ; $ENDIF ;;AN000;; 3124 <2> $MIF380: 3125 <2> ; $ENDIF ;;AN000;; 3126 <2> $MIF377: 3127 <2> ; $ENDIF ;;AN000;; 3128 <2> $MIF376: 3129 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII 3130 <2> ;; 3131 <2> PUSH BP ;;AN000;; Restore return address 3132 <2> RET ;;AN000;; Return 3133 <2> ;; 3134 <2> $M_TIME_REPLACE ENDP ;;AN000;; 3135 <2> ;; 3136 <2> $M_GET_TIME PROC NEAR ;;AN000;; 3137 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 3138 <2> MOV AL,0 ;;AN000;; Get current country info 3139 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 3140 <2> INT 21H ;;AN000;; 3141 <2> ; $IF C ;;AN000;; No, 3142 <2> JNC $MIF384 3143 <2> MOV WORD [$M_RT + $M_TIME_FORMAT],$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH) 3144 <2> MOV BYTE [$M_RT + $M_TIME_SEPARA],$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL) 3145 <2> MOV BYTE [$M_RT + $M_DECI_SEPARA],$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL) 3146 <2> ; $ENDIF ;;AN000;; 3147 <2> $MIF384: 3148 <2> RET ;;AN000;; 3149 <2> $M_GET_TIME ENDP ;;AN000;; 3150 <2> ;; 3151 <2> $M_CONVERTTIME PROC NEAR ;;AN000;; 3152 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3153 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3154 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3155 <2> DEC CX ;;AN000;; Test if size only grew by 1 3156 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3157 <2> ; $IF E ;;AN000;; Yes, 3158 <2> JNE $MIF386 3159 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3160 <2> PUSH AX ;;AN000;; Save it 3161 <2> INC CX ;;AN000;; Count it 3162 <2> ; $ENDIF ;;AN000;; 3163 <2> $MIF386: 3164 <2> INC CX ;;AN000;; Restore CX 3165 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3166 <2> RET ;;AN000;; 3167 <2> $M_CONVERTTIME ENDP ;;AN000;; 3168 <2> ;; 3169 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3170 <2> %ENDIF ;;AN000;; END of include of TIME replace 3171 <2> %ENDIF ;;AN000;; END of include of Replacement common code 3172 <2> ; 3173 <2> %IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace? 3174 <2> INPUTmsg equ FALSE ;;AN000;; Yes, THEN include it and reset the flag 3175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3176 <2> ;; 3177 <2> ;; PROC NAME: $M_WAIT_FOR_INPUT 3178 <2> ;; 3179 <2> ;; FUNCTION: To accept keyed input and return extended key value 3180 <2> ;; in AX register 3181 <2> ;; INPUTS: DL contains the DOS function requested for input 3182 <2> ;; OUPUTS: AX contains the extended key value that was read 3183 <2> ;; REGS USED: 3184 <2> ;; 3185 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3186 <2> ;; 3187 <2> $M_WAIT_FOR_INPUT PROC NEAR ;;AN000;; 3188 <2> ;; 3189 <2> PUSH CX ;;AN000;; Save CX 3190 <2> PUSH DX ;;AN000;; Save DX 3191 <2> PUSH DS ;;AN000;; Save Data segment 3192 <2> ;; 3193 <2> CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? 3194 <2> ; $IF A ;;AN001;; Yes, 3195 <2> JNA $MIF388 3196 <2> MOV AL,DL ;;AN001;; Mov function into AL 3197 <2> AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble 3198 <2> MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function 3199 <2> ; $ELSE ;;AN001;; No, 3200 <2> JMP SHORT $MEN388 3201 <2> $MIF388: 3202 <2> MOV AH,DL ;;AN000;; Put DOS function in AH 3203 <2> ; $ENDIF ;;AN001;; 3204 <2> $MEN388: 3205 <2> PUSH ES ;;AN000;; Get output buffer segment 3206 <2> POP DS ;;AN000;; 3207 <2> MOV DX,DI ;;AN000;; Get output buffer offset in case needed 3208 <2> INT 21H ;;AN000;; Get keyboard input 3209 <2> POP DS ;;AN000;; 3210 <2> 3211 <2> CMP DL,DOS_BUF_KEYB_INP ;;AN000;; 3212 <2> CLC ;;AN000;; 3213 <2> ; $IF NE ;;AN000;; If character input 3214 <2> JE $MIF391 3215 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? 3216 <2> ; $IF C ;;AN000;; 3217 <2> JNC $MIF392 3218 <2> MOV CL,AL ;;AN000;; Save first character 3219 <2> MOV AH,DL ;;AN001;; Get back function 3220 <2> INT 21H ;;AN000;; Get keyboard input 3221 <2> MOV AH,CL ;;AN000;; Retreive first character AX = xxxx 3222 <2> CLC ;;AN000;; Clear carry condition 3223 <2> ; $ELSE ;;AN000;; 3224 <2> JMP SHORT $MEN392 3225 <2> $MIF392: 3226 <2> MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS 3227 <2> ; $ENDIF ;;AN000;; 3228 <2> $MEN392: 3229 <2> ; $ENDIF ;;AN000;; 3230 <2> $MIF391: 3231 <2> ;; 3232 <2> ; $IF NC ;;AN000;; 3233 <2> JC $MIF396 3234 <2> POP DX ;;AN000;; 3235 <2> POP CX ;;AN000;; 3236 <2> ; $ELSE ;;AN000;; 3237 <2> JMP SHORT $MEN396 3238 <2> $MIF396: 3239 <2> ADD SP,4 ;;AN000;; 3240 <2> STC ;;AN000;; Reset carry flag 3241 <2> ; $ENDIF ;;AN000;; 3242 <2> $MEN396: 3243 <2> RET ;;AN000;; Return 3244 <2> ;; 3245 <2> $M_WAIT_FOR_INPUT ENDP ;;AN000;; 3246 <2> ;; 3247 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3248 <2> %ENDIF ;;AN000;; END of include of Wait for Input 3249 <2> %ENDIF ;;AN000;; END of include of SYSDISPMSG 3250 <2> %ENDIF ;;AN000;; END of include of MSG_DATA_ONLY 3251 <2> %ENDIF ;;AN000;; END of include of Structure only 3252 <2> 3253 <2> ;=== Pop trace listing source 3254 <2> 437 <1> 438 <1> %ENDIF 439 <1> 19 Msg_Services "DISPLAYmsg","CHARmsg","NUMmsg" 364 <1> %iassign $M_SERVICE FALSE 365 <1> %rep %0 366 <1> %iassign $M_INCLUDE TRUE 367 <1> %iassign MSG_SERVICES_MATCHED 0 368 <1> %ifidni %1, "MSGDATA" 369 <1> %iassign MSGDATA TRUE 370 <1> %iassign $M_SERVICE TRUE 371 <1> %iassign $M_INCLUDE FALSE 372 <1> %iassign MSG_SERVICES_MATCHED 1 373 <1> %else 374 <1> %iassign $M_MSGDATA_ONLY FALSE 375 <1> %endif 376 <1> 377 <1> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <1> 379 <1> %ifidni %1,"COMR" 380 <1> %iassign COMR TRUE 381 <1> %iassign $M_SERVICE TRUE 382 <1> %iassign $M_INCLUDE FALSE 383 <1> %iassign MSG_SERVICES_MATCHED 1 384 <1> %elifidni %1,"COMT" 385 <1> %iassign COMT TRUE 386 <1> %iassign $M_SERVICE TRUE 387 <1> %iassign $M_INCLUDE FALSE 388 <1> %iassign MSG_SERVICES_MATCHED 1 389 <1> %elifidni %1,"SETSTDIO" 390 <1> %iassign SETSTDIO TRUE 391 <1> %iassign $M_SERVICE TRUE 392 <1> %iassign $M_INCLUDE FALSE 393 <1> %iassign MSG_SERVICES_MATCHED 1 394 <1> %elifidni %1,"NOCHECKSTDIN" 395 <1> %iassign NOCHECKSTDIN TRUE 396 <1> %iassign $M_SERVICE TRUE 397 <1> %iassign $M_INCLUDE FALSE 398 <1> %iassign MSG_SERVICES_MATCHED 1 399 <1> %elifidni %1,"NOCHECKSTDOUT" 400 <1> %iassign NOCHECKSTDOUT TRUE 401 <1> %iassign $M_SERVICE TRUE 402 <1> %iassign $M_INCLUDE FALSE 403 <1> %iassign MSG_SERVICES_MATCHED 1 404 <1> %elifidni %1,"DISK_PROC" 405 <1> %iassign DISK_PROC TRUE 406 <1> %iassign $M_SERVICE TRUE 407 <1> %iassign $M_INCLUDE FALSE 408 <1> %iassign MSG_SERVICES_MATCHED 1 409 <1> %endif 410 <1> 411 <1> %IF $M_INCLUDE 412 <1> %define %%string %1 413 <1> %strlen %%length %%string 414 <1> %assign %%ii 1 415 <1> %define %%name "" 416 <1> %rep %%length 417 <1> %substr %%cc %%string %%ii 418 <1> %assign %%ii %%ii + 1 419 <1> %if %%cc >= 'A' && %%cc <= 'Z' 420 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <1> %endif 422 <1> %strcat %%name %%name,%%cc 423 <1> %endrep 424 <1> %ifidni %%name, "format.ctl" 425 <1> 426 <1> %else 427 <1> %include %%name 428 <1> %endif 429 <1> %ENDIF 430 <1> 431 <1> %rotate 1 432 <1> %endrep 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 433 <1> 434 <1> %IF $M_SERVICE 435 <1> 436 <1> %include "msgserv.nas" 1 <2> ;=== Push trace listing source: msgserv.nas 2 <2> 3 <2> ; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * * 4 <2> ; 5 <2> ; MODULE NAME: MSGSERV.SAL 6 <2> ; 7 <2> ; DESCRIPTIVE NAME: Message Services SALUT file 8 <2> ; 9 <2> ; FUNCTION: This module incorporates all the messages services and 10 <2> ; is called upon at build time to INCLUDE the code requested 11 <2> ; by a utility. Code is requested using the macro MSG_SERVICES. 12 <2> ; 13 <2> ; ENTRY POINT: Since this a collection of subroutines, entry point is at 14 <2> ; requested procedure. 15 <2> ; 16 <2> ; INPUT: Since this a collection of subroutines, input is dependent on function 17 <2> ; requested. 18 <2> ; 19 <2> ; EXIT-NORMAL: In all cases, CARRY FLAG = 0 20 <2> ; 21 <2> ; EXIT-ERROR: In all cases, CARRY FLAG = 1 22 <2> ; 23 <2> ; INTERNAL REFERENCES: (list of included subroutines) 24 <2> ; 25 <2> ; - SYSLOADMSG 26 <2> ; - SYSDISPMSG 27 <2> ; - SYSGETMSG 28 <2> ; 29 <2> ; 30 <2> ; EXTERNAL REFERENCES: None 31 <2> ; 32 <2> ; NOTES: At build time, some modules must be included. These are only included 33 <2> ; once using assembler switches. Other logic is included at the request 34 <2> ; of the utility. 35 <2> ; 36 <2> ; COMR and COMT are assembler switches to conditionally assemble code 37 <2> ; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident 38 <2> ; storage and multiple EQUates. 39 <2> ; 40 <2> ; REVISION HISTORY: Created MAY 1987 41 <2> ; 42 <2> ; Label: DOS - - Message Retriever 43 <2> ; (c) Copyright 1988 Microsoft 44 <2> ; 45 <2> ; 46 <2> ; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * * 47 <2> ; Page 48 <2> 49 <2> ; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting 50 <2> 51 <2> %IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN 52 <2> %iassign $M_STRUC FALSE ;;AN000;; Let the assembler know that we have 53 <2> ;;AN000;; and include them 54 <2> 55 <2> ; PAGE 56 <2> ; SUBTTL DOS - Message Retriever - MSGSTR.INC Module 57 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 58 <2> ;; 59 <2> ;; STRUCTURE: $M_SUBLIST_STRUC 60 <2> ;; 61 <2> ;; Replacable parameters are described by a sublist structure 62 <2> ;; 63 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 64 <2> ;; 65 <2> $M_SUBLIST_STRUC STRUC ;;AN000;; 66 <2> ;; 67 <2> $M_S_SIZE DB ? ;11 ;;AN000;; SUBLIST size (PTR to next SUBLIST) 68 <2> $M_S_RESV DB ? ;0 ;;AN000;; RESERVED 69 <2> $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item 70 <2> $M_S_ID DB ? ;;AN000;; n of %n 71 <2> $M_S_FLAG DB ? ;;AN000;; Data-type flags 72 <2> $M_S_MAXW DB ? ;;AN000;; Maximum field width 73 <2> $M_S_MINW DB ? ;;AN000;; Minimum field width 74 <2> $M_S_PAD DB ? ;;AN000;; Character for Pad field 75 <2> ;; 76 <2> $M_SUBLIST_STRUC ENDS ;;AN000;; 77 <2> ;; 78 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 79 <2> ;; 80 <2> ;; STRUCTURE: $M_CLASS_ID 81 <2> ;; 82 <2> ;; Each class will be defined by this structure. 83 <2> ;; 84 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 85 <2> ;; 86 <2> EXPECTED_VERSION equ expected_version ; NASM port equate 87 <2> 88 <2> $M_CLASS_ID STRUC ;;AN000;; 89 <2> ;; 90 <2> $M_CLS_ID DB ? ;-1 ;;AN000;; Class identifer 91 <2> $M_COMMAND_VER DW ? ;EXPECTED_VERSION ;;AN003;; COMMAND.COM version check 92 <2> $M_NUM_CLS_MSG DB ? ;0 ;;AN000;; Total number of message in class 93 <2> ;; 94 <2> $M_CLASS_ID ENDS ;; 95 <2> ;;AN000;; 96 <2> $M_CLASS_ID_SZ EQU $M_CLASS_ID_struc_size ;;AN000;; 97 <2> ;; 98 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 99 <2> ;; 100 <2> ;; STRUCTURE: $M_ID_STRUC 101 <2> ;; 102 <2> ;; Each message will be defined by this structure. 103 <2> ;; 104 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 105 <2> ;; 106 <2> $M_ID STRUC ;;AN000;; 107 <2> ;; 108 <2> $M_NUM DW ? ;-1 ;;AN000;; Message Number 109 <2> $M_TXT_PTR DW ? ;;AN000;; Pointer to message text 110 <2> ;; 111 <2> $M_ID ENDS ;;AN000;; 112 <2> ;;AN000;; Status Flag Values: 113 <2> $M_ID_SZ EQU $M_ID_struc_size ;;AN000;; 114 <2> ;; 115 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 116 <2> ;; 117 <2> ;; STRUCTURE: $M_RES_ADDRS 118 <2> ;; 119 <2> ;; Resident data area definition of variables 120 <2> ;; 121 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 122 <2> ;; 123 <2> $M_RES_ADDRS STRUC ;;AN000;; 124 <2> ;; 125 <2> $M_EXT_ERR_ADDRS DD ? ;0 ;;AN000;; Allow pointers to THREE Extended error locations 126 <2> $M_EXT_FILE DD ? ;0 ;;AN001;; 127 <2> $M_EXT_COMMAND DD ? ;0 ;;AN000;; 128 <2> $M_EXT_TERM DD ? ;-1 ;;AN000;; 129 <2> $M_PARSE_COMMAND DD ? ;0 ;;AN000;; 130 <2> $M_PARSE_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Parse error locations 131 <2> $M_PARSE_TERM DD ? ;-1 ;;AN000;; 132 <2> $M_CRIT_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Critical error locations 133 <2> $M_CRIT_COMMAND DD ? ;0 ;;AN000;; 134 <2> $M_CRIT_TERM DD ? ;-1 ;;AN000;; 135 <2> $M_DISK_PROC_ADDR DD ? ;-1 ;;AN004;; Address of READ_DISK_PROC 136 <2> $M_CLASS_ADDRS DD $M_NUM_CLS DUP (?) ;(0) ;;AN000;; Allow pointers to specified classes 137 <2> $M_CLS_TERM DD ? ;-1 ;;AN000;; 138 <2> $M_DBCS_VEC DD ? ;0 ;;AN000;; Save DBCS vector 139 <2> $M_HANDLE DW ? ;;AN000;; 140 <2> $M_SIZE DB ? ;0 ;;AN000;; 141 <2> $M_CRLF DB ?,? ;0DH,0AH ;;AN004;; CR LF message 142 <2> $M_CLASS DB ? ;;AN004;; Saved class 143 <2> $M_RETURN_ADDR DW ? ;;AN000;; 144 <2> $M_MSG_NUM DW ? ;$M_NULL ;;AN000;; 145 <2> $M_DIVISOR DW ? ;10 ;;AN000;; Default = 10 (must be a WORD for division) 146 <2> $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP (?) ;("$") ;;AN000;; Temporary buffer 147 <2> $M_BUF_TERM DB ? ;"$" ;;AN000;; 148 <2> 149 <2> $M_RES_ADDRS ENDS ;;AN000;; 150 <2> ;; 151 <2> $M_RES_ADDRS_SZ EQU $M_RES_ADDRS_struc_size ;;AN000;; 152 <2> ;; 153 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 154 <2> ;; 155 <2> ;; STRUCTURE: $M_COUNTRY_INFO 156 <2> ;; 157 <2> ;; Important fields of the Get Country Information call 158 <2> ;; 159 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 160 <2> ;; 161 <2> $M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation 162 <2> ;; 163 <2> $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc 164 <2> $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format 165 <2> $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;; 166 <2> $M_THOU_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Thou Separator 167 <2> $M_DECI_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Decimal Separator 168 <2> $M_DATE_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Date Separator 169 <2> $M_TIME_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Time Separator 170 <2> $M_CURR_FORMAT DB ? ;;AN000;; 171 <2> $M_SIG_DIGS_CU DB ? ;;AN000;; 172 <2> $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format 173 <2> ;; 174 <2> $M_COUNTRY_INFO ENDS ;;AN000;; 175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 176 <2> ;; 177 <2> %ELSE ;;AN000;; ELSE if we have already included the STRUCTURES 178 <2> ; 179 <2> ; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section 180 <2> 181 <2> %IF MSGDATA ;;AN000;; IF this is a request to include the data area 182 <2> %iassign MSGDATA FALSE ;;AN000;; Let the assembler know not to include it again 183 <2> ;;AN000;; and include it 184 <2> ; PAGE 185 <2> ; SUBTTL DOS - Message Retriever - MSGRES.TAB Module 186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 187 <2> ;; 188 <2> ;; DATA NAME: $M_RES_TABLE 189 <2> ;; 190 <2> ;; REFERENCE LABEL: $M_RT 191 <2> ;; 192 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 193 <2> 194 <2> %if 0 ; disabled for now, figure out later 195 <2> %IF COMR ;;AN000;; Since COMMAND.COM includes this twice 196 <2> $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no 197 <2> $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur 198 <2> $M_ALTLABEL equ TRUE ;;AN000;; Flag that label was changed 199 <2> %ELSE ;;AN000;; 200 <2> $M_RT LABEL BYTE ;;AN000;; 201 <2> %ENDIF 202 <2> %endif 203 <2> $M_RT: ; NASM structure instance 204 <2> $M_RES_ADDRS_size equ $M_RES_ADDRS_struc_size ; NASM port equate 205 <2> istruc $M_RES_ADDRS 206 <2> at $M_EXT_ERR_ADDRS 207 <2> dd 0 208 <2> at $M_EXT_FILE 209 <2> dd 0 210 <2> at $M_EXT_COMMAND 211 <2> dd 0 212 <2> at $M_EXT_TERM 213 <2> dd -1 214 <2> at $M_PARSE_COMMAND 215 <2> dd 0 216 <2> at $M_PARSE_ADDRS 217 <2> dd 0 218 <2> at $M_PARSE_TERM 219 <2> dd -1 220 <2> at $M_CRIT_ADDRS 221 <2> dd 0 222 <2> at $M_CRIT_COMMAND 223 <2> dd 0 224 <2> at $M_CRIT_TERM 225 <2> dd -1 226 <2> at $M_DISK_PROC_ADDR 227 <2> dd -1 228 <2> at $M_CLASS_ADDRS 229 <2> times $M_NUM_CLS dd 0 230 <2> at $M_CLS_TERM 231 <2> dd -1 232 <2> at $M_DBCS_VEC 233 <2> dd 0 234 <2> at $M_HANDLE 235 <2> dw 0 236 <2> at $M_SIZE 237 <2> db 0 238 <2> at $M_CRLF 239 <2> db 0Dh, 0Ah 240 <2> at $M_CLASS 241 <2> db 0 242 <2> at $M_RETURN_ADDR 243 <2> dw 0 244 <2> at $M_MSG_NUM 245 <2> dw 0 246 <2> at $M_DIVISOR 247 <2> dw 10 248 <2> at $M_TEMP_BUF 249 <2> times $M_TEMP_BUF_SZ db "$" 250 <2> at $M_BUF_TERM 251 <2> db "$" 252 <2> iend 253 <2> ;; 254 <2> %include "copyrigh.mac" ;;AN001;; Include Copyright 1988 Microsoft 255 <2> ;; 256 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 257 <2> %ENDIF ;;AN000;; END of include of Data table 258 <2> 259 <2> ; 260 <2> %IFN $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN 261 <2> ;; don't include any more code 262 <2> ;;AN000;; Figure out what other code to include 263 <2> %IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code 264 <2> %IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it) 265 <2> $M_RT EQU $M_RT2 ;;AN003;; 266 <2> %ENDIF 267 <2> %iassign DISK_PROC FALSE ;;AN003;; Yes, THEN include it and reset flag 268 <2> ; PAGE 269 <2> ; SUBTTL DOS - Message Retriever - DISK_PROC Module 270 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 271 <2> ;; 272 <2> ;; PROC NAME: DISK_PROC 273 <2> ;; 274 <2> ;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended 275 <2> ;; errors from disk\diskette 276 <2> ;; INPUTS: AX has the message number 277 <2> ;; DX has the message class 278 <2> ;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is 279 <2> ;; assumed to be set!! 280 <2> ;; 281 <2> ;; OUTPUTS: ES:DI points to message length (BYTE) followed by text 282 <2> ;; 283 <2> ;; 284 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 285 <2> ;; 286 <2> PUBLIC READ_DISK_PROC ;; 287 <2> ;; 288 <2> READ_DISK_PROC PROC FAR ;;AN003;; 289 <2> 290 <2> PUSH AX ;;AN003;; Save everything 291 <2> PUSH BX ;;AN003;; 292 <2> PUSH DX ;;AN003;; 293 <2> PUSH SI ;;AN003;; 294 <2> PUSH BP ;;AN003;; 295 <2> PUSH DS ;;AN003;; 296 <2> PUSH DI ;;AN003;; 297 <2> MOV BP,AX ;;AN003;; Save message number 298 <2> MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function 299 <2> LEA SI,[COMSPEC wrt RESGROUP] ;;AN003;; Get addressibilty to COMMAND.COM 300 <2> PUSH CS ;;AN003;; 301 <2> POP DS ;;AN003;; 302 <2> MOV DI,-1 ;;AN003;; No extended attribute list 303 <2> MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error 304 <2> MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag 305 <2> INT 21H ;;AN003;; Open the file 306 <2> POP DI ;;AN003;; Retreive LSEEK pointer 307 <2> ;;AN003;; Error ? 308 <2> ; $IF NC,LONG ;;AN003;; No, 309 <2> JNC $MXL1 310 <2> JMP $MIF1 311 <2> $MXL1: 312 <2> PUSH DI ;;AN003;; Save LSEEK pointer 313 <2> MOV BX,AX ;;AN003;; Set handle in BX 314 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors 315 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 316 <2> MOV DX,DI ;;AN003;; 317 <2> INT 21H ;;AN003;; LSEEK the file 318 <2> POP DX ;;AN003;; Retreive LSEEK pointer 319 <2> ;;AN003;; Error ? 320 <2> ; $IF NC ;;AN003;; No, 321 <2> JC $MIF2 322 <2> INC CX ;;AN003;; Set flag to first pass 323 <2> ; $DO ;;AN003;; 324 <2> $MDO3: 325 <2> PUSH DX ;;AN003;; Save LSEEK pointer 326 <2> PUSH CX ;;AN003;; Save first pass flag 327 <2> PUSH AX ;;AN003;; Save number of messages (if set yet) 328 <2> XOR SI,SI ;;AN003;; Reset buffer index 329 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 330 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header 331 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 332 <2> INT 21H ;;AN003;; Read it 333 <2> MOV DI,DX ;;AN003;; 334 <2> POP AX ;;AN003;; 335 <2> POP CX ;;AN003;; 336 <2> OR CX,CX ;;AN003;; 337 <2> ; $IF NZ ;;AN003;; 338 <2> JZ $MIF4 339 <2> XOR CX,CX ;;AN003;; Set flag to second pass 340 <2> XOR AH,AH ;;AN003;; Get number of messages in class 341 <2> MOV AL,[DI + $M_NUM_CLS_MSG] ;;AN003;; 342 <2> MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index 343 <2> CMP word [DI + $M_COMMAND_VER],EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM? 344 <2> ; $ENDIF ;;AN003;; 345 <2> $MIF4: 346 <2> POP DX ;;AN003;; 347 <2> ; $IF Z ;;AN003;; Yes, 348 <2> JNZ $MIF6 349 <2> ; $SEARCH ;;AN003;; 350 <2> $MDO7: 351 <2> CMP BP,WORD PTR [$M_RT + $M_TEMP_BUF + SI] ;;AN003;; Is this the message I'm looking for? 352 <2> ; $EXITIF Z ;;AN003;; Yes, (ZF=1) 353 <2> JNZ $MIF7 354 <2> CLC ;;AN003;; Reset carry, exit search 355 <2> ; $ORELSE ;;AN003;; No, (ZF=0) 356 <2> JMP SHORT $MSR7 357 <2> $MIF7: 358 <2> ADD SI,$M_ID_SZ ;;AN003;; Increment index 359 <2> ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header 360 <2> DEC AX ;;AN003;; Decrement # of messages left 361 <2> ; $LEAVE Z ;;AN003;; Have we exhausted all messages? 362 <2> JZ $MEN7 363 <2> CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer? 364 <2> ; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1) 365 <2> JNA $MDO7 366 <2> $MEN7: 367 <2> STC ;;AN003;; Yes, (ZF=0) set error (ZF=0) 368 <2> ; $ENDSRCH ;;AN003;; 369 <2> $MSR7: 370 <2> ; $ELSE ;;AN003;; No, 371 <2> JMP SHORT $MEN6 372 <2> $MIF6: 373 <2> XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop 374 <2> STC ;;AN003;; Set Carry 375 <2> ; $ENDIF ;;AN003;; 376 <2> $MEN6: 377 <2> ; $ENDDO Z ;;AN003;; Get next buffer full if needed 378 <2> JNZ $MDO3 379 <2> ;;AN003;; Error ? 380 <2> ; $IF NC ;;AN003;; No, 381 <2> JC $MIF16 382 <2> MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message 383 <2> XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM 384 <2> ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header 385 <2> ADD DX,WORD PTR [$M_RT + $M_TEMP_BUF + SI + 2] ;;AN003;; Add offset from msg structure 386 <2> INT 21H ;;AN003;; LSEEK the file 387 <2> MOV AH,DOS_READ_BYTE ;;AN003;; Read 388 <2> MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message 389 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN003;; into the temp buffer 390 <2> INT 21H ;;AN003;; Read it 391 <2> MOV DI,DX ;;AN003;; into the temp buffer 392 <2> PUSH DS ;;AN003;; into the temp buffer 393 <2> POP ES ;;AN003;; into the temp buffer 394 <2> ; $ENDIF ;;AN003;; 395 <2> $MIF16: 396 <2> ; $ENDIF ;;AN003;; 397 <2> $MIF2: 398 <2> PUSHF ;;AN003;; Close file handle 399 <2> MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle 400 <2> INT 21H ;;AN003;; 401 <2> $M_POPF ;;AN003;; 402 <2> ; $ENDIF ;;AN003;; Yes there was an error, 403 <2> $MIF1: 404 <2> POP DS ;;AN003;; 405 <2> POP BP ;;AN003;; 406 <2> POP SI ;;AN003;; 407 <2> POP DX ;;AN003;; 408 <2> POP BX ;;AN003;; 409 <2> POP AX ;;AN003;; 410 <2> ;;AN003;; abort everything 411 <2> RET ;;AN003;; 412 <2> 413 <2> READ_DISK_PROC ENDP ;;AN003;; 414 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 415 <2> %ENDIF ;;AN003;; END of include for DISK_PROC 416 <2> ; 417 <2> 418 <2> %IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO 419 <2> %iassign SETSTDIO FALSE ;;AN000;; Yes, THEN include it and reset flag 420 <2> ; PAGE 421 <2> ; SUBTTL DOS - Message Retriever - SETSTDIO Module 422 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 423 <2> ;; 424 <2> ;; PROC NAME: SETSTDIO 425 <2> ;; 426 <2> ;; FUNCTION: 427 <2> ;; INPUTS: 428 <2> ;; 429 <2> ;; OUPUTS: 430 <2> ;; 431 <2> ;; 432 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 433 <2> ;; 434 <2> %IF FARmsg ;AN001; 435 <2> SETSTDINON PROC FAR ;AN001; 436 <2> %ELSE ;AN001; 437 <2> SETSTDINON PROC NEAR ;AN001; 438 <2> %ENDIF ;AN001; 439 <2> PUSH AX ;AN002; Save changed regs 440 <2> PUSH BX ;AN002; 441 <2> PUSH DX ;AN002; 442 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 443 <2> MOV BX,STDIN ;AN001; 444 <2> XOR DX,DX ;AN001; 445 <2> INT 21H ;AN001; 446 <2> 447 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 448 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 449 <2> INT 21H ;AN001; 450 <2> POP DX ;AN002; Restore Regs 451 <2> POP BX ;AN002; 452 <2> POP AX ;AN002; 453 <2> 454 <2> RET ;AN001; 455 <2> ;AN001; 456 <2> SETSTDINON ENDP ;AN001; 457 <2> 458 <2> %IF FARmsg ;AN001; 459 <2> SETSTDINOFF PROC FAR ;AN001; 460 <2> %ELSE ;AN001; 461 <2> SETSTDINOFF PROC NEAR ;AN001; 462 <2> %ENDIF ;AN001; 463 <2> 464 <2> PUSH AX ;AN002; Save changed regs 465 <2> PUSH BX ;AN002; 466 <2> PUSH DX ;AN002; 467 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 468 <2> MOV BX,STDIN ;AN001; 469 <2> XOR DX,DX ;AN001; 470 <2> INT 21H ;AN001; 471 <2> 472 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 473 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 474 <2> INT 21H ;AN001; 475 <2> POP DX ;AN002; Restore Regs 476 <2> POP BX ;AN002; 477 <2> POP AX ;AN002; 478 <2> 479 <2> RET ;AN001; 480 <2> 481 <2> SETSTDINOFF ENDP ;AN001; 482 <2> 483 <2> %IF FARmsg ;AN001; 484 <2> SETSTDOUTON PROC FAR ;AN001; 485 <2> %ELSE ;AN001; 486 <2> SETSTDOUTON PROC NEAR ;AN001; 487 <2> %ENDIF ;AN001; 488 <2> 489 <2> PUSH AX ;AN002; Save changed regs 490 <2> PUSH BX ;AN002; 491 <2> PUSH DX ;AN002; 492 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 493 <2> MOV BX,STDOUT ;AN001; 494 <2> XOR DX,DX ;AN001; 495 <2> INT 21H ;AN001; 496 <2> 497 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 498 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 499 <2> INT 21H ;AN001; 500 <2> POP DX ;AN002; Restore Regs 501 <2> POP BX ;AN002; 502 <2> POP AX ;AN002; 503 <2> 504 <2> RET ;AN001; 505 <2> 506 <2> SETSTDOUTON ENDP ;AN001; 507 <2> 508 <2> %IF FARmsg ;AN001; 509 <2> SETSTDOUTOFF PROC FAR ;AN001; 510 <2> %ELSE ;AN001; 511 <2> SETSTDOUTOFF PROC NEAR 512 <2> %ENDIF ;AN001; 513 <2> 514 <2> PUSH AX ;AN002; Save changed regs 515 <2> PUSH BX ;AN002; 516 <2> PUSH DX ;AN002; 517 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 518 <2> MOV BX,STDOUT ;AN001; 519 <2> XOR DX,DX ;AN001; 520 <2> INT 21H ;AN001; 521 <2> 522 <2> AND DH,~ $M_CRIT_ERR_MASK ;AN001; Turn off bit 523 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 524 <2> INT 21H ;AN001; 525 <2> POP DX ;AN002; Restore Regs 526 <2> POP BX ;AN002; 527 <2> POP AX ;AN002; 528 <2> 529 <2> RET ;AN001; 530 <2> 531 <2> SETSTDOUTOFF ENDP ;AN001; 532 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 533 <2> %ENDIF ;;AN000;; END of include for SETSTDIO 534 <2> ; 535 <2> %IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ? 536 <2> %IF COMR ;;AN000;; 537 <2> $M_RT EQU $M_RT2 ;;AN000;; 538 <2> %ENDIF 539 <2> %iassign LOADmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 540 <2> ; PAGE 541 <2> ; SUBTTL DOS - Message Retriever - LOADMSG.ASM Module 542 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 543 <2> ;; 544 <2> ;; PROC NAME: SYSLOADMSG 545 <2> ;; 546 <2> ;; FUNCTION: 547 <2> ;; INPUTS: 548 <2> ;; 549 <2> ;; OUPUTS: 550 <2> ;; 551 <2> ;; 552 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 553 <2> ;; 554 <2> %IF FARmsg ;;AN000;; 555 <2> SYSLOADMSG PROC FAR ;;AN000;; 556 <2> %ELSE ;;AN000;; 557 <2> SYSLOADMSG PROC NEAR ;;AN000;; 558 <2> %ENDIF ;;AN000;; 559 <2> PUSH AX ;;AN000; 560 <2> PUSH BX ;;AN000; 561 <2> PUSH DX ;;AN000; 562 <2> PUSH ES ;;AN000; 563 <2> PUSH DI ;;AN000; 564 <2> XOR CX,CX ;;AN000; Reset to zero 565 <2> MOV ES,CX ;;AN000; 566 <2> XOR DI,DI ;;AN000; 567 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 568 <2> MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM 569 <2> INT 2FH ;;AN000;; Private interface 570 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 571 <2> MOV WORD PTR [$M_RT + $M_EXT_COMMAND],DI ;;AN000;; 572 <2> ;; 573 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 574 <2> MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM 575 <2> INT 2FH ;;AN000;; Private interface 576 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 577 <2> MOV WORD PTR [$M_RT + $M_PARSE_COMMAND],DI ;;AN000;; 578 <2> ;; 579 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 580 <2> MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM 581 <2> INT 2FH ;;AN000;; Private interface 582 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 583 <2> MOV WORD PTR [$M_RT + $M_CRIT_COMMAND],DI ;;AN000;; 584 <2> 585 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 586 <2> MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE 587 <2> INT 2FH ;;AN001;; Private interface 588 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE+2],ES ;;AN001;; Move into first avaliable table location 589 <2> MOV WORD PTR [$M_RT + $M_EXT_FILE],DI ;;AN001;; 590 <2> 591 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 592 <2> Extrn READ_DISK_PROC:Far ;;AN003;; 593 <2> %ELSE ;; 594 <2> %IF FARmsg ;;AN000;; 595 <2> CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 596 <2> %ELSE ;;AN000;; 597 <2> CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 598 <2> %ENDIF ;;AN000;; 599 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 600 <2> MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS],DI ;;AN000;; 601 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 602 <2> MOV WORD PTR [$M_RT + $M_CRIT_ADDRS],DI ;;AN000;; 603 <2> ;; 604 <2> %IF FARmsg ;;AN000;; 605 <2> CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 606 <2> %ELSE ;;AN000;; 607 <2> CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 608 <2> %ENDIF ;;AN000;; 609 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 610 <2> MOV WORD PTR [$M_RT + $M_PARSE_ADDRS],DI ;;AN000;; 611 <2> %ENDIF ;; 612 <2> ;; 613 <2> MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 614 <2> MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM 615 <2> INT 2FH ;;AN001;; Private interface 616 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR+2],ES ;;AN001;; Move into first avaliable table location 617 <2> MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR],DI ;;AN001;; 618 <2> 619 <2> $M_BUILD_PTRS $M_NUM_CLS ;;AN000;; Build all utility classes 620 <2> ;;AN000;; 621 <2> CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector 622 <2> 623 <2> %IFN NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed 624 <2> CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK 625 <2> %ENDIF ;;AN000;; 626 <2> ;;AN000;; 627 <2> %IFN NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed 628 <2> CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK 629 <2> %ENDIF ;;AN000;; 630 <2> ;;AN000;; 631 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 632 <2> CLC ;;AN000;; Make sure carry is clear 633 <2> %ELSE ;;AN000;; ELSE 634 <2> PUSH CX ;;AN000;; 635 <2> CALL $M_VERSION_CHECK ;;AN000;; Check Version 636 <2> %ENDIF ;;AN000;; 637 <2> ;; Error ? 638 <2> ; $IF NC ;;AN000;; No. 639 <2> JC $MIF20 640 <2> %IFN NOVERCHECKmsg ;;AN000;; IF version check was not supressed 641 <2> POP CX ;;AN000;; Reset stack 642 <2> %ENDIF ;;AN000;; 643 <2> POP DI ;;AN000;; Restore REGS 644 <2> POP ES ;;AN000;; 645 <2> POP DX ;;AN000;; 646 <2> POP BX ;;AN000;; 647 <2> POP AX ;;AN000;; 648 <2> ; $ELSE ;;AN000;; Yes, 649 <2> JMP SHORT $MEN20 650 <2> $MIF20: 651 <2> %IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed 652 <2> ADD SP,10 ;;AN000;; 653 <2> STC ;;AN000;; Reset carry flag 654 <2> %ELSE ;;AN000;; IF version check is to be supressed 655 <2> ADD SP,12 ;;AN000;; 656 <2> STC ;;AN000;; Reset carry flag 657 <2> %ENDIF ;;AN000;; IF version check is to be supressed 658 <2> ; $ENDIF ;;AN000;; 659 <2> $MEN20: 660 <2> RET ;;AN000;; 661 <2> ;; 662 <2> SYSLOADMSG ENDP ;;AN000;; 663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 664 <2> ; PAGE 665 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 666 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 667 <2> ;; 668 <2> ;; Proc Name: $M_GET_DBCS_VEC 669 <2> ;; 670 <2> ;; Function: Get the DBCS vector and save it for later use 671 <2> ;; 672 <2> ;; Inputs: None 673 <2> ;; 674 <2> ;; Outputs: None 675 <2> ;; 676 <2> ;; Regs Changed: 677 <2> ;; 678 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 679 <2> ;; 680 <2> $M_GET_DBCS_VEC PROC NEAR ;;AN000;; 681 <2> ;; 682 <2> PUSH AX ;;AN000;; Save character to check 683 <2> PUSH SI ;;AN000;; 684 <2> PUSH DS ;;AN000;; 685 <2> MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment 686 <2> INT 21H ;;AN000;; Get environment pointer 687 <2> PUSH DS ;;AN000;; Get environment pointer 688 <2> POP ES ;;AN000;; Get environment pointer 689 <2> POP DS ;;AN000;; Get environment pointer 690 <2> ; $IF NC ;;AN000;; 691 <2> JC $MIF23 692 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC],SI ;;AN000;; Save DBCS Vector 693 <2> MOV WORD PTR [$M_RT + $M_DBCS_VEC+2],ES ;;AN000;; 694 <2> ; $ENDIF ;;AN000;; 695 <2> $MIF23: 696 <2> POP SI ;;AN000;; 697 <2> POP AX ;;AN000;; Retrieve character to check 698 <2> RET ;;AN000;; Return 699 <2> ;; 700 <2> $M_GET_DBCS_VEC ENDP ;; 701 <2> ;; 702 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 703 <2> %IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ? 704 <2> %ELSE ;AN001; Yes, THEN include it 705 <2> ; PAGE 706 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc 707 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 708 <2> ;; 709 <2> ;; Proc Name: $M_CHECKSTDIN 710 <2> ;; 711 <2> ;; Function: 712 <2> ;; 713 <2> ;; Inputs: None 714 <2> ;; 715 <2> ;; Outputs: 716 <2> ;; 717 <2> ;; Regs Changed: 718 <2> ;; 719 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 720 <2> ;; 721 <2> $M_CHECKSTDIN PROC NEAR ;AN001; 722 <2> 723 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 724 <2> MOV BX,STDIN ;AN001; 725 <2> XOR DX,DX ;AN001; 726 <2> INT 21H ;AN001; 727 <2> 728 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 729 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 730 <2> INT 21H ;AN001; 731 <2> 732 <2> RET ;AN001; 733 <2> 734 <2> $M_CHECKSTDIN ENDP ;AN001; 735 <2> ;; 736 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 737 <2> %ENDIF ;AN001; END of include for EOF Check 738 <2> %IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full? 739 <2> %ELSE ;AN001; Yes, THEN include it 740 <2> ; PAGE 741 <2> ; SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc 742 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 743 <2> ;; 744 <2> ;; Proc Name: $M_CHECKSTDOUT 745 <2> ;; 746 <2> ;; Function: 747 <2> ;; 748 <2> ;; Inputs: None 749 <2> ;; 750 <2> ;; Outputs: 751 <2> ;; 752 <2> ;; Regs Changed: 753 <2> ;; 754 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 755 <2> ;; 756 <2> $M_CHECKSTDOUT PROC NEAR ;AN001; 757 <2> 758 <2> MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 759 <2> MOV BX,STDOUT ;AN001; 760 <2> XOR DX,DX ;AN001; 761 <2> INT 21H ;AN001; 762 <2> 763 <2> OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 764 <2> MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 765 <2> INT 21H ;AN001; 766 <2> 767 <2> RET ;AN001; 768 <2> 769 <2> $M_CHECKSTDOUT ENDP ;AN001; 770 <2> ;; 771 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 772 <2> %ENDIF ;AN001; END of include for Disk Full Check 773 <2> %IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check? 774 <2> %ELSE ;;AN000;; Yes, THEN include it 775 <2> ; PAGE 776 <2> ; SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc 777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 778 <2> ;; 779 <2> ;; Proc Name: $M_VERSION_CHECK 780 <2> ;; 781 <2> ;; Function: Determine if DOS version is within allowable limits 782 <2> ;; 783 <2> ;; Inputs: None 784 <2> ;; 785 <2> ;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version 786 <2> ;; Registers set for SYSDISPMSG 787 <2> ;; CARRY_FLAG = 0 if Correct DOS version 788 <2> ;; 789 <2> ;; Regs Changed: AX 790 <2> ;; 791 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 792 <2> 793 <2> check_amis: 794 <2> push ax 795 <2> push ds 796 <2> push si 797 <2> push es 798 <2> push di 799 <2> push dx 800 <2> push ax ; version number, last on stack 801 <2> 802 <2> mov ah, 0 ; multiplex number = 0 803 <2> .loop: 804 <2> mov al, 0 805 <2> int 2Dh ; installation check 806 <2> cmp al, -1 ; multiplexer installed ? 807 <2> jne .next ; no --> 808 <2> push cs 809 <2> pop ds 810 <2> mov si, offset amis_sign ; ds:si -> amis_sign (for lDOS) 811 <2> mov es, dx ; es:di -> multiplexer's sign 812 <2> mov cx, 8 ; 16 bytes 813 <2> repe cmpsw ; compare 814 <2> jne .next ; not us --> 815 <2> mov dx, cs ; dx:si -> amis_id 816 <2> mov al, 11h 817 <2> int 2Dh ; CHG: al, bx, cx, dx, si, di 818 <2> cmp al, 0 ; id call supported ? 819 <2> je .unsup ; no, allow if alt version --> 820 <2> pop dx 821 <2> xor dx, dx ; 2D.MM11 supported, mark that we need it 822 <2> push dx 823 <2> cmp al, 0F0h ; CY if below 0F0h 824 <2> jmp .done 825 <2> 826 <2> .next: 827 <2> inc ah ; next multiplex number 828 <2> jnz .loop ; ZR if done, NZ if more to check --> 829 <2> .unsup: 830 <2> stc ; multiplexer not found 831 <2> ; or function not supported 832 <2> .done: 833 <2> ; CY if not an lDOS revision with our id supported, 834 <2> ; on stack: alt_expected_version if it's fine and either 835 <2> ; no multiplexer or func 11h not supported 836 <2> ; new_expected_version if not fine and either 837 <2> ; no multiplexer or func 11h not suppprted, 838 <2> ; 0 if multiplexer found, func 11h supported, but 839 <2> ; our id is unsupported 840 <2> ; NC if lDOS revision with multiplexer and our id supported 841 <2> pop bx 842 <2> pop dx 843 <2> pop di 844 <2> pop es 845 <2> pop si 846 <2> pop ds 847 <2> pop ax 848 <2> jnc alt_good_DOS ; id is supported --> 849 <2> cmp bx, alt_expected_version ; is it fine ? 850 <2> je alt_good_DOS ; yes --> (NC) 851 <2> jmp $MIF25 ; no, cancel program --> 852 <2> 853 <2> $M_VERSION_CHECK PROC NEAR ;;AN000;; 854 <2> ;; 855 <2> MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC 856 <2> INT 21H ;;AN000;; 857 <2> ;; 858 <2> cmp ax,new_expected_version ; compare with DOS version 859 <2> je check_amis 860 <2> cmp ax,alt_expected_version ; compare with DOS version 861 <2> je check_amis 862 <2> CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct 863 <2> ; $IF E ;;AN000;; 864 <2> JNE $MIF25 865 <2> alt_good_DOS: 866 <2> CLC ;;AN000;; Clear the carry flag 867 <2> ; $ELSE ;;AN000;; ELSE 868 <2> JMP SHORT $MEN25 869 <2> $MIF25: 870 <2> %IFN COMR ;; ** Special case for RESIDENT COMMAND.COM 871 <2> CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH 872 <2> ; $IF B ;;AN000;; No, 873 <2> JNB $MIF27 874 <2> MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support) 875 <2> ; $ELSE ;;AN000;; Yes, 876 <2> JMP SHORT $MEN27 877 <2> $MIF27: 878 <2> MOV BX,STDERR ;;AN000;; Standard Error 879 <2> ; $ENDIF ;;AN000;; 880 <2> $MEN27: 881 <2> %ELSE 882 <2> MOV BX,NO_HANDLE ;;AN000;; No handle 883 <2> %ENDIF 884 <2> MOV AX,1 ;;AN000;; Set message # 1 885 <2> MOV CX,NO_REPLACE ;;AN000;; No replacable parms 886 <2> MOV DL,NO_INPUT ;;AN000;; No input 887 <2> MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message 888 <2> STC ;;AN000;; Set Carry Flag 889 <2> ; $ENDIF ;;AN000;; 890 <2> $MEN25: 891 <2> ;; 892 <2> RET ;;AN000;; Return 893 <2> ;; 894 <2> $M_VERSION_CHECK ENDP ;; 895 <2> ;; 896 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 897 <2> %ENDIF ;;AN000;; END of include for DOS version check 898 <2> %ENDIF ;;AN000;; END of include for SYSLOADMSG 899 <2> ; 900 <2> %IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 901 <2> %IF COMR ;;AN000;; 902 <2> $M_RT EQU $M_RT2 ;;AN000;; 903 <2> %ENDIF ;;AN000;; 904 <2> GETmsg equ FALSE ;;AN000;; Yes, THEN include it and reset flag 905 <2> ; PAGE 906 <2> ; SUBTTL DOS - Message Retriever - GETMSG.ASM Module 907 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 908 <2> ;; 909 <2> ;; Proc Name: SYSGETMSG 910 <2> ;; 911 <2> ;; Function: The GET service returns the segment, offset and size of the 912 <2> ;; message text to the caller based on a message number. 913 <2> ;; The GET function will not display the message thus assumes 914 <2> ;; caller will handle replaceable parameters. 915 <2> ;; 916 <2> ;; Inputs: 917 <2> ;; 918 <2> ;; Outputs: 919 <2> ;; 920 <2> ;; Psuedocode: 921 <2> ;; Call $M_GET_MSG_ADDRESS 922 <2> ;; IF MSG_NUM exists THEN 923 <2> ;; Set DS:SI = MSG_TXT_PTR + 1 924 <2> ;; CARRY_FLAG = 0 925 <2> ;; ELSE 926 <2> ;; CARRY_FLAG = 1 927 <2> ;; ENDIF 928 <2> ;; 929 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 930 <2> ;; 931 <2> %IF FARmsg ;;AN000;; 932 <2> SYSGETMSG PROC FAR ;;AN000;; 933 <2> %ELSE ;;AN000;; 934 <2> SYSGETMSG PROC NEAR ;;AN000;; 935 <2> %ENDIF ;;AN000;; 936 <2> ;; 937 <2> ;; Save registers needed later 938 <2> 939 <2> PUSH AX ;;AN000;; Save changed regs 940 <2> PUSH ES ;;AN000;; 941 <2> PUSH DI ;;AN000;; 942 <2> PUSH BP ;;AN000;; 943 <2> ;; 944 <2> %IF FARmsg ;;AN000;; 945 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 946 <2> %ELSE ;;AN000;; 947 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 948 <2> %ENDIF ;;AN000;; Return message in ES:DI 949 <2> ; $IF NC ;;AN000;; Message found? 950 <2> JC $MIF31 951 <2> CMP DH,UTILITY_MSG_CLASS 952 <2> CLC ;;AN000;; 953 <2> ; $IF NE 954 <2> JE $MIF32 955 <2> PUSH ES ;;AN000;; 956 <2> POP DS ;;AN000;; Return message in DS:SI 957 <2> ; $ELSE 958 <2> JMP SHORT $MEN32 959 <2> $MIF32: 960 <2> %IF FARmsg ;;AN000;; Yes, 961 <2> PUSH ES ;;AN000;; 962 <2> POP DS ;;AN000;; Return message in DS:SI 963 <2> %ELSE ;;AN000;; 964 <2> PUSH CS ;;AN000;; Return message in DS:SI 965 <2> POP DS ;;AN000;; 966 <2> %ENDIF ;;AN000;; 967 <2> ; $ENDIF ;;AN000;; 968 <2> $MEN32: 969 <2> MOV SI,DI ;;AN000;; Return message in DS:SI 970 <2> ; $ENDIF ;;AN000;; 971 <2> $MIF31: 972 <2> ;; 973 <2> POP BP ;;AN000;; Restore changed regs 974 <2> POP DI ;;AN000;; 975 <2> POP ES ;;AN000;; 976 <2> POP AX ;;AN000;; 977 <2> ;; 978 <2> RET ;;AN000;; Return 979 <2> ;; 980 <2> SYSGETMSG ENDP ;; 981 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 982 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 983 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 984 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 985 <2> ;; 986 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 987 <2> ;; 988 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 989 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 990 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 991 <2> ;; IF CX > 1 THEN ES:DI points to the specified message 992 <2> ;; REGS CHANGED: ES,DI,CX 993 <2> ;; 994 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 995 <2> ;; 996 <2> %IF FARmsg ;;AN000;; 997 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 998 <2> %ELSE ;;AN000;; 999 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 1000 <2> %ENDIF ;;AN000;; 1001 <2> ;; 1002 <2> PUSH SI ;;AN000;; 1003 <2> PUSH BX ;;AN000;; 1004 <2> XOR SI,SI ;;AN000;; Use SI as an index 1005 <2> XOR CX,CX ;;AN000;; Use CX as an size 1006 <2> ; $DO ;;AN000;; 1007 <2> $MDO36: 1008 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 1009 <2> ; $IF E ;;AN000;; Yes, 1010 <2> JNE $MIF37 1011 <2> %IF FARmsg ;;AN000;; 1012 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1013 <2> MOV BX,ES ;;AN000; 1014 <2> %ELSE ;;AN000;; 1015 <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 1016 <2> MOV BX,DI ;;AN000; 1017 <2> %ENDIF ;;AN000;; 1018 <2> ; $ELSE ;;AN000;; No, 1019 <2> JMP SHORT $MEN37 1020 <2> $MIF37: 1021 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 1022 <2> ; $IF NE ;;AN000;; Yes, 1023 <2> JE $MIF39 1024 <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 1025 <2> MOV BX,ES ;;AN000; 1026 <2> ; $ELSE ;;AN000;; No, extended errors were specified 1027 <2> JMP SHORT $MEN39 1028 <2> $MIF39: 1029 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 1030 <2> ; $IF AE,AND ;;AN000;; 1031 <2> JNAE $MIF41 1032 <2> CMP AX,$M_CRIT_HI ;;AN000;; 1033 <2> ; $IF BE ;;AN000;; Yes, 1034 <2> JNBE $MIF41 1035 <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 1036 <2> MOV BX,ES ;;AN000; 1037 <2> ; $ELSE ;;AN000;; 1038 <2> JMP SHORT $MEN41 1039 <2> $MIF41: 1040 <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 1041 <2> MOV BX,ES ;;AN000; 1042 <2> ; $ENDIF ;;AN000;; 1043 <2> $MEN41: 1044 <2> ; $ENDIF ;;AN000;; 1045 <2> $MEN39: 1046 <2> ; $ENDIF ;;AN000;; 1047 <2> $MEN37: 1048 <2> ;; 1049 <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 1050 <2> ; $IF E ;;AN000;; Yes, 1051 <2> JNE $MIF46 1052 <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 1053 <2> ; $IF E ;;AN000;; Yes, 1054 <2> JNE $MIF47 1055 <2> STC ;;AN000;; Set the carry flag 1056 <2> ; $ELSE ;;AN000;; No, 1057 <2> JMP SHORT $MEN47 1058 <2> $MIF47: 1059 <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 1060 <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 1061 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 1062 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 1063 <2> CLC ;;AN000;; 1064 <2> ; $ENDIF ;;AN000;; No, 1065 <2> $MEN47: 1066 <2> ; $ELSE ;;AN000;; 1067 <2> JMP SHORT $MEN46 1068 <2> $MIF46: 1069 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 1070 <2> ; $IF NE ;;AN001;; Yes, 1071 <2> JE $MIF51 1072 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 1073 <2> ; $ENDIF ;;AN000;; 1074 <2> $MIF51: 1075 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 1076 <2> CLC ;;AN000;; 1077 <2> ; $ENDIF ;;AN000;; 1078 <2> $MEN46: 1079 <2> ; $LEAVE C ;;AN000;; 1080 <2> JC $MEN36 1081 <2> OR CX,CX ;;AN000;; Was the message found? 1082 <2> ; $ENDDO NZ,LONG ;;AN000;; 1083 <2> JNZ $MXL2 1084 <2> JMP $MDO36 1085 <2> $MXL2: 1086 <2> $MEN36: 1087 <2> 1088 <2> PUSHF ;;AN006;; Save the flag state 1089 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 1090 <2> ; $IF E ;;AN006;; Yes, 1091 <2> JNE $MIF56 1092 <2> PUSH DX ;;AN006;; Save all needed registers 1093 <2> PUSH BP ;;AN006;; 1094 <2> PUSH CX ;;AN006;; 1095 <2> PUSH ES ;;AN006;; 1096 <2> PUSH DI ;;AN006;; 1097 <2> PUSH AX ;;AN006;; 1098 <2> 1099 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 1100 <2> INT 2FH ;;AN006;; 1101 <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 1102 <2> POP AX ;;AN006;; Restore msg number 1103 <2> ; $IF E ;;AN006;; Yes, 1104 <2> JNE $MIF57 1105 <2> MOV BX,AX ;;AN006;; BX is the extended error number 1106 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 1107 <2> INT 2FH ;;AN006;; Call IFSFUNC 1108 <2> ; $ELSE ;;AN006;; No, 1109 <2> JMP SHORT $MEN57 1110 <2> $MIF57: 1111 <2> STC ;;AN006;; Carry conditon 1112 <2> ; $ENDIF ;;AN006;; 1113 <2> $MEN57: 1114 <2> 1115 <2> ; $IF C ;;AN006;; Was there an update? 1116 <2> JNC $MIF60 1117 <2> POP DI ;;AN006;; No, 1118 <2> POP ES ;;AN006;; Restore old pointer 1119 <2> POP CX ;;AN006;; 1120 <2> ; $ELSE ;;AN006;; Yes 1121 <2> JMP SHORT $MEN60 1122 <2> $MIF60: 1123 <2> ADD SP,6 ;;AN006;; Throw away old pointer 1124 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 1125 <2> ; $ENDIF ;;AN006;; 1126 <2> $MEN60: 1127 <2> POP BP ;;AN006;; Restore other Regs 1128 <2> POP DX ;;AN006;; 1129 <2> ; $ENDIF ;;AN006;; 1130 <2> $MIF56: 1131 <2> $M_POPF ;;AN006;; Restore the flag state 1132 <2> 1133 <2> POP BX ;;AN000;; 1134 <2> POP SI ;;AN000;; 1135 <2> RET ;;AN000;; Return ES:DI pointing to the message 1136 <2> ;; 1137 <2> $M_GET_MSG_ADDRESS ENDP ;; 1138 <2> ;; 1139 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 1140 <2> ;; 1141 <2> PUSH DI ;;AN006;; Save position 1142 <2> PUSH AX ;;AN006;; 1143 <2> MOV CX,-1 ;;AN006;; Set CX for decrements 1144 <2> XOR AL,AL ;;AN006;; Prepare compare register 1145 <2> REPNE SCASB ;;AN006;; Scan for zero 1146 <2> NOT CX ;;AN006;; Change decrement into number 1147 <2> DEC CX ;;AN006;; Don't include the zero 1148 <2> POP AX ;;AN006;; 1149 <2> POP DI ;;AN006;; Restore position 1150 <2> RET ;;AN006;; 1151 <2> ;; 1152 <2> $M_SET_LEN_IN_CX ENDP ;; 1153 <2> ;; 1154 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1155 <2> ;; 1156 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 1157 <2> ;; 1158 <2> ;; FUNCTION: To scan thru message headers until message is found 1159 <2> ;; INPUTS: ES:DI points to beginning of msg headers 1160 <2> ;; CX contains the number of messages in class 1161 <2> ;; DH contains the message class 1162 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 1163 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 1164 <2> ;; 1165 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1166 <2> ;; 1167 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 1168 <2> ;; 1169 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 1170 <2> ; $IF E,AND ;;AN004;; Yes, 1171 <2> JNE $MIF64 1172 <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 1173 <2> ; $IF NE ;;AN004;; Yes, 1174 <2> JE $MIF64 1175 <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 1176 <2> ; $IF E ;;AN004;; . . . and . . . 1177 <2> JNE $MIF65 1178 <2> PUSH AX ;;AN004;; Reset the special message number 1179 <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 1180 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1181 <2> POP AX ;;AN004;; Reset the special message number 1182 <2> ; $ELSE ;;AN004;; Get the old message number 1183 <2> JMP SHORT $MEN65 1184 <2> $MIF65: 1185 <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 1186 <2> ; $ENDIF ;;AN004;; Get the old message number 1187 <2> $MEN65: 1188 <2> ; $ELSE ;;AN004;; 1189 <2> JMP SHORT $MEN64 1190 <2> $MIF64: 1191 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 1192 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1193 <2> ; $IF NE ;;AN001;; 1194 <2> JE $MIF69 1195 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 1196 <2> ; $ELSE ;;AN001;; 1197 <2> JMP SHORT $MEN69 1198 <2> $MIF69: 1199 <2> %IF FARmsg ;;AN001;; 1200 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1201 <2> %ELSE 1202 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 1203 <2> %ENDIF 1204 <2> ; $IF E ;;AN002;; pointer (hopefully) 1205 <2> JNE $MIF71 1206 <2> %IF FARmsg ;;AN001;; 1207 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1208 <2> %ELSE 1209 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 1210 <2> %ENDIF 1211 <2> ; $ENDIF ;;AN002;; go on to the next class 1212 <2> $MIF71: 1213 <2> ; $ENDIF ;;AN001;; 1214 <2> $MEN69: 1215 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 1216 <2> STC ;;AN004;; Flag that we haven't found anything yet 1217 <2> ; $ENDIF ;;AN004;; 1218 <2> $MEN64: 1219 <2> 1220 <2> ; $IF C ;;AN004;; Have we found anything yet? 1221 <2> JNC $MIF75 1222 <2> CLC ;;AN004;; No, reset carry 1223 <2> ; $SEARCH ;;AN000;; 1224 <2> $MDO76: 1225 <2> OR CX,CX ;;AN000;; Do we have any to check? 1226 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1227 <2> JZ $MEN76 1228 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 1229 <2> ; $IF NE ;;AN001;; 1230 <2> JE $MIF78 1231 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 1232 <2> ; $ELSE ;;AN001;; 1233 <2> JMP SHORT $MEN78 1234 <2> $MIF78: 1235 <2> %IF FARmsg ;;AN001;; 1236 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 1237 <2> %ELSE 1238 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 1239 <2> %ENDIF 1240 <2> ; $ENDIF 1241 <2> $MEN78: 1242 <2> ; $EXITIF E ;;AN000;; 1243 <2> JNE $MIF76 1244 <2> ; $ORELSE ;;AN000; 1245 <2> JMP SHORT $MSR76 1246 <2> $MIF76: 1247 <2> DEC CX ;;AN000;; No, well do we have more to check? 1248 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 1249 <2> JZ $MEN76 1250 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 1251 <2> ; $ENDLOOP ;;AN000;; 1252 <2> JMP SHORT $MDO76 1253 <2> $MEN76: 1254 <2> STC ;;AN000;; 1255 <2> ; $ENDSRCH ;;AN000;; Check next message 1256 <2> $MSR76: 1257 <2> ; $IF NC ;;AN000;; Did we find the message? 1258 <2> JC $MIF86 1259 <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 1260 <2> CLC ;;AN001;; 1261 <2> ; $IF E ;;AN001;; 1262 <2> JNE $MIF87 1263 <2> %IF FARmsg ;;AN001;; 1264 <2> %ELSE ;;AN000;; 1265 <2> PUSH CS ;;AN000;; 1266 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 1267 <2> %ENDIF 1268 <2> ; $ENDIF ;;AN001;; 1269 <2> $MIF87: 1270 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 1271 <2> ; $ENDIF ;;AN004;; 1272 <2> $MIF86: 1273 <2> ; $ENDIF ;;AN004;; 1274 <2> $MIF75: 1275 <2> ;; Yes, great we can return with CX > 0 1276 <2> 1277 <2> ; $IF NC ;;AN000;; Did we find the message? 1278 <2> JC $MIF91 1279 <2> XOR CH,CH ;;AN000;; 1280 <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 1281 <2> INC DI ;;AN000;; Increment past length 1282 <2> ; $ENDIF ;;AN004;; 1283 <2> $MIF91: 1284 <2> 1285 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 1286 <2> RET ;;AN000;; Return 1287 <2> ;; 1288 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 1289 <2> ;; 1290 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1291 <2> %ENDIF ;;AN000;; END of include of common subroutines 1292 <2> %ENDIF ;;AN000;; END of include of SYSGETMSG 1293 <2> ; 1294 <2> %IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? 1295 <2> %IF COMR ;;AN000;; 1296 <2> $M_RT EQU $M_RT2 ;;AN000;; 1297 <2> %ENDIF ;;AN000;; 1298 <2> %iassign DISPLAYmsg FALSE ;;AN000;; Yes, THEN include it and reset flag 1299 <2> ; PAGE 1300 <2> ; SUBTTL DOS - Message Retriever - DISPMSG.ASM Module 1301 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1302 <2> ;; 1303 <2> ;; Proc Name: SYSDISPMSG 1304 <2> ;; 1305 <2> ;; Function: The DISPLAY service will output a defined message to a handle 1306 <2> ;; requested by the caller. It also provides function to display 1307 <2> ;; messages when handles are not applicable (ie. DOS function calls 1308 <2> ;; 00h to 0Ah) Replaceable parameters are allowed and are 1309 <2> ;; defined previous to entry. 1310 <2> ;; 1311 <2> ;; It is assumes that a PRELOAD function has already determined 1312 <2> ;; the addressibilty internally to the message retriever services. 1313 <2> ;; Inputs: 1314 <2> ;; 1315 <2> ;; Outputs: 1316 <2> ;; 1317 <2> ;; Psuedocode: 1318 <2> ;; Save registers needed later 1319 <2> ;; Get address of the message requested 1320 <2> ;; IF Message number exists THEN 1321 <2> ;; IF replacable parameters were specified THEN 1322 <2> ;; Display message with replacable parms 1323 <2> ;; ELSE 1324 <2> ;; Display string without replacable parms 1325 <2> ;; ENDIF 1326 <2> ;; IF character input was requested THEN 1327 <2> ;; Wait for character input 1328 <2> ;; ENDIF 1329 <2> ;; Clear CARRY FLAG 1330 <2> ;; ELSE 1331 <2> ;; Set CARRY FLAG 1332 <2> ;; ENDIF 1333 <2> ;; Return 1334 <2> ;; 1335 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1336 <2> ;; 1337 <2> %IF FARmsg ;;AN000;; 1338 <2> SYSDISPMSG PROC FAR ;;AN000;; 1339 <2> %ELSE ;;AN000;; 1340 <2> SYSDISPMSG PROC NEAR ;;AN000;; 1341 <2> %ENDIF ;;AN000;; 1342 <2> ;; 1343 <2> ;; Save registers and values needed later 1344 <2> 1345 00000159 50 <2> PUSH AX ;;AN000;; Save changed REGs 1346 0000015A 53 <2> PUSH BX ;;AN000;; 1347 0000015B 51 <2> PUSH CX ;;AN000;; 1348 0000015C 55 <2> PUSH BP ;;AN000;; 1349 0000015D 57 <2> PUSH DI ;;AN000;; Save pointer to input buffer (offset) 1350 0000015E 06 <2> PUSH ES ;;AN000;; Save pointer to input buffer (segment) 1351 0000015F 52 <2> PUSH DX ;;AN000;; Save Input/Class request 1352 <2> 1353 00000160 89CD <2> MOV BP,CX ;;AN000;; Use BP to hold replace count 1354 00000162 891E[4000] <2> MOV WORD PTR [$M_RT + $M_HANDLE],BX ;;AN000;; Save handle 1355 00000166 8836[4500] <2> MOV BYTE PTR [$M_RT + $M_CLASS],DH ;;AN004;; Save class 1356 <2> 1357 <2> ;; Get address of the message requested 1358 <2> 1359 <2> %IF FARmsg ;;AN000;; 1360 <2> CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1361 <2> %ELSE ;;AN000;; 1362 0000016A E89D02 <2> CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1363 <2> %ENDIF ;;AN000;; 1364 0000016D 09C9 <2> OR CX,CX ;;AN000;; Was message found? 1365 <2> ; $IF NZ ;;AN000;; YES, Message address in ES:DI 1366 0000016F 741C <2> JZ $MIF93 1367 <2> 1368 <2> ;; Test if replacable parameters were specified 1369 <2> 1370 00000171 09ED <2> OR BP,BP ;;AN000;; Were replacable parameters requested 1371 <2> ; $IF Z ;;AN000;; 1372 00000173 7505 <2> JNZ $MIF94 1373 <2> 1374 <2> ;; Display string without replacable parms 1375 <2> 1376 00000175 E82600 <2> CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message 1377 <2> ; $ELSE ;;AN000;; 1378 00000178 EB03 <2> JMP SHORT $MEN94 1379 <2> $MIF94: 1380 <2> %IF $M_REPLACE ;;AN000;; 1381 <2> 1382 <2> ;; Display message with replacable parms 1383 <2> 1384 0000017A E86D01 <2> CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions 1385 <2> %ENDIF ;;AN000;; 1386 <2> ; $ENDIF ;;AN000;; 1387 <2> $MEN94: 1388 <2> ; $IF NC 1389 0000017D 7208 <2> JC $MIF97 1390 <2> 1391 0000017F 5A <2> POP DX ;;AN000;; Get Input/Class request 1392 <2> 1393 00000180 E8C200 <2> CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. 1394 <2> 1395 00000183 07 <2> POP ES ;;AN000;; Get location of input buffer (if specified) 1396 00000184 5F <2> POP DI ;;AN000;; 1397 <2> 1398 <2> ;; Test if character input was requested 1399 <2> 1400 <2> %IF INPUTmsg ;;AN000;; 1401 <2> OR DL,DL ;;AN000;; Was Wait-For-Input requested? 1402 <2> ; $IF NZ ;;AN000;; 1403 <2> JZ $MIF98 1404 <2> CALL $M_WAIT_FOR_INPUT ;;AN000;; 1405 <2> ; $ENDIF ;;AN000;; 1406 <2> $MIF98: 1407 <2> %ENDIF ;;AN000;; 1408 <2> ; $ELSE ;;AN000;; 1409 00000185 EB04 <2> JMP SHORT $MEN97 1410 <2> $MIF97: 1411 00000187 83C406 <2> ADD SP,6 ;;AN000;; 1412 0000018A F9 <2> STC ;;AN000;; Reset carry flag 1413 <2> ; $ENDIF ;;AN000;; 1414 <2> $MEN97: 1415 <2> ; $ELSE ;;AN000;; No, 1416 0000018B EB04 <2> JMP SHORT $MEN93 1417 <2> $MIF93: 1418 0000018D 07 <2> POP ES ;;AN000;; Get pointer to input buffer (segment) 1419 0000018E 5F <2> POP DI ;;AN000;; Get base pointer to first sublist (offset) 1420 0000018F 5A <2> POP DX ;;AN000;; Get base pointer to first sublist (segment) 1421 00000190 F9 <2> STC ;;AN000;; Set carry flag 1422 <2> ; $ENDIF ;;AN000;; 1423 <2> $MEN93: 1424 <2> ;; 1425 <2> ; $IF NC ;;AN000;; Was there an error? 1426 00000191 7206 <2> JC $MIF104 1427 00000193 5D <2> POP BP ;;AN000;; No, 1428 00000194 59 <2> POP CX ;;AN000;; 1429 00000195 5B <2> POP BX ;;AN000;; 1430 <2> %IF INPUTmsg ;;AN000;; 1431 <2> ADD SP,2 ;;AN000;; 1432 <2> %ELSE ;AN000; 1433 00000196 58 <2> POP AX ;;AN000;; 1434 <2> %ENDIF ;;AN000;; 1435 <2> ; $ELSE ;;AN000;; Yes, 1436 00000197 EB04 <2> JMP SHORT $MEN104 1437 <2> $MIF104: 1438 00000199 83C408 <2> ADD SP,8 ;;AN000;; Eliminate from stack 1439 0000019C F9 <2> STC ;;AN000;; 1440 <2> ; $ENDIF ;;AN000;; 1441 <2> $MEN104: 1442 <2> ;; 1443 0000019D C3 <2> RET ;;AN000;; Return 1444 <2> ;; 1445 <2> SYSDISPMSG ENDP ;;AN000;; 1446 <2> ;; 1447 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1448 <2> ; 1449 <2> ;; 1450 <2> ;; PROC NAME: $M_DISPLAY_STRING 1451 <2> ;; 1452 <2> ;; FUNCTION: Will display or write string 1453 <2> ;; INPUTS: ES:DI points to beginning of message 1454 <2> ;; CX contains the length of string to write (if applicable) 1455 <2> ;; OUTPUTS: None 1456 <2> ;; REGS Revised: None 1457 <2> ;; 1458 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1459 <2> ;; 1460 <2> $M_DISPLAY_STRING PROC NEAR ;;AN000;; 1461 <2> ;; 1462 0000019E 50 <2> PUSH AX ;;AN000;; 1463 0000019F 53 <2> PUSH BX ;;AN000;; 1464 000001A0 52 <2> PUSH DX ;;AN000;; 1465 <2> ;; 1466 000001A1 8B1E[4000] <2> MOV BX,[$M_RT + $M_HANDLE] ;;AN000;; Retrieve handle 1467 <2> ;; 1468 <2> %IF COMR ;; ** Special case for RESIDENT COMMAND.COM 1469 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1470 <2> %ELSE 1471 000001A5 83FBFF <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1472 <2> ; $IF E ;;AN000;; 1473 000001A8 7505 <2> JNE $MIF107 1474 000001AA E82C00 <2> CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1475 <2> ; $ELSE ;;AN000;; 1476 000001AD EB03 <2> JMP SHORT $MEN107 1477 <2> $MIF107: 1478 000001AF E85C00 <2> CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle 1479 <2> ; $ENDIF ;;AN000;; 1480 <2> $MEN107: 1481 <2> ;AN001; 1482 <2> ; $IF C ;;AN000;; Was there an error? 1483 000001B2 730F <2> JNC $MIF110 1484 000001B4 B459 <2> MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes, 1485 000001B6 BB0000 <2> MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error 1486 000001B9 CD21 <2> INT 21H ;;AN000;; 1487 000001BB 30E4 <2> XOR AH,AH ;;AN000;; Clear AH 1488 000001BD 83C406 <2> ADD SP,6 ;;AN000;; Clean up stack 1489 000001C0 F9 <2> STC ;;AN000;; Flag that there was an error 1490 <2> ; $ELSE ;;AN000;; No, 1491 000001C1 EB10 <2> JMP SHORT $MEN110 1492 <2> $MIF110: 1493 000001C3 83FBFF <2> CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1494 <2> ; $IF NE ;;AN000;; 1495 000001C6 740B <2> JE $MIF112 1496 000001C8 39C8 <2> CMP AX,CX ;AN001; Was it ALL written? 1497 <2> ; $IF NE ;AN001; No, 1498 000001CA 7407 <2> JE $MIF113 1499 000001CC E86D00 <2> CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error 1500 000001CF 83C406 <2> ADD SP,6 ;AN001; Clean up stack 1501 000001D2 F9 <2> STC ;AN001; Flag that there was an error 1502 <2> ; $ENDIF ;AN001; 1503 <2> $MIF113: 1504 <2> ; $ENDIF ;AN001; 1505 <2> $MIF112: 1506 <2> ; $ENDIF ;;AN000;; 1507 <2> $MEN110: 1508 <2> %ENDIF 1509 <2> ; $IF NC ;;AN000;; Was there ANY error? 1510 000001D3 7203 <2> JC $MIF117 1511 000001D5 5A <2> POP DX ;;AN000;; Restore regs 1512 000001D6 5B <2> POP BX ;;AN000;; 1513 000001D7 58 <2> POP AX ;;AN000;; 1514 <2> ; $ENDIF ;;AN000;; 1515 <2> $MIF117: 1516 000001D8 C3 <2> RET ;;AN000;; Return 1517 <2> ;; 1518 <2> $M_DISPLAY_STRING ENDP ;;AN000;; 1519 <2> ;; 1520 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1521 <2> ;; 1522 <2> ;; PROC NAME: $M_DISPLAY_$_STRING 1523 <2> ;; 1524 <2> ;; FUNCTION: Will display a $ terminated string 1525 <2> ;; INPUTS: ES:DI points to beginning of message text (not the length) 1526 <2> ;; OUPUTS: None 1527 <2> ;; REGS USED: AX,DX 1528 <2> ;; 1529 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1530 <2> ;; 1531 <2> $M_DISPLAY_$_STRING PROC NEAR ;;AN000;; 1532 <2> ;; 1533 000001D9 1E <2> PUSH DS ;;AN000;; 1534 000001DA 06 <2> PUSH ES ;;AN000;; 1535 000001DB 1F <2> POP DS ;;AN000;; Set DS to segment of message text 1536 <2> %IFN COMR 1537 000001DC 83F901 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1538 <2> ; $IF E ;;AN000;; Yes, 1539 000001DF 751B <2> JNE $MIF119 1540 000001E1 B402 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1541 000001E3 268A15 <2> MOV DL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1542 000001E6 CD21 <2> INT 21H ;;AN000;; Write character 1543 000001E8 1F <2> POP DS ;;AN000;; Set DS to segment of message text 1544 000001E9 88D0 <2> MOV AL,DL ;;AN000;; Get the character in AL 1545 000001EB E86E00 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1546 000001EE 1E <2> PUSH DS ;;AN000;; 1547 000001EF 06 <2> PUSH ES ;;AN000;; 1548 000001F0 1F <2> POP DS ;;AN000;; Set DS to segment of message text 1549 <2> ; $IF C ;;AN000;; Yes, 1550 000001F1 7307 <2> JNC $MIF120 1551 000001F3 268A5501 <2> MOV DL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 1552 000001F7 CD21 <2> INT 21H ;;AN000;; Write character 1553 000001F9 F8 <2> CLC ;;AN000;; Clear the DBCS indicator 1554 <2> ; $ENDIF ;;AN000;; 1555 <2> $MIF120: 1556 <2> ; $ELSE ;;AN000;; No, 1557 000001FA EB0F <2> JMP SHORT $MEN119 1558 <2> $MIF119: 1559 <2> %ENDIF 1560 000001FC B402 <2> MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1561 <2> ; $DO ;;AN002;; No, 1562 <2> $MDO123: 1563 000001FE 09C9 <2> OR CX,CX ;;AN002;; Are there any left to display? 1564 <2> ; $LEAVE Z ;;AN002;; Yes, 1565 00000200 7409 <2> JZ $MEN123 1566 00000202 268A15 <2> MOV DL,BYTE PTR [ES:DI] ;;AN002;; Get the character 1567 00000205 CD21 <2> INT 21H ;;AN002;; Display the character 1568 00000207 47 <2> INC DI ;;AN002;; Set pointer to next character 1569 00000208 49 <2> DEC CX ;;AN002;; Count this character 1570 <2> ; $ENDDO Z ;;AN002;; No, 1571 00000209 75F3 <2> JNZ $MDO123 1572 <2> $MEN123: 1573 <2> %IFN COMR 1574 <2> ; $ENDIF ;;AN000;; 1575 <2> $MEN119: 1576 <2> %ENDIF 1577 0000020B F8 <2> CLC ;;AN000;; Char functions used don't return carry as error 1578 0000020C 1F <2> POP DS ;;AN000;; 1579 0000020D C3 <2> RET ;;AN000;; 1580 <2> ;; 1581 <2> $M_DISPLAY_$_STRING ENDP ;;AN000;; 1582 <2> ;; 1583 <2> %IFN COMR 1584 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1585 <2> ;; 1586 <2> ;; PROC NAME: $M_DISPLAY_H_STRING 1587 <2> ;; 1588 <2> ;; FUNCTION: Will display a string to a specified handle 1589 <2> ;; INPUTS: ES:DI points to beginning of message 1590 <2> ;; CX contains the number of bytes to write 1591 <2> ;; BX contains the handle to write to 1592 <2> ;; OUPUTS: None 1593 <2> ;; REGS USED: AX,DX 1594 <2> ;; 1595 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1596 <2> ;; 1597 <2> $M_DISPLAY_H_STRING PROC NEAR ;;AN000;; 1598 <2> ;; 1599 0000020E 31C0 <2> XOR AX,AX ;;AN002;; Set number of bytes written to 0 1600 00000210 09C9 <2> OR CX,CX ;;AN002;; For performance, don't write if not necessary 1601 <2> ; $IF NZ ;;AN002;; Any chars to write? 1602 00000212 7427 <2> JZ $MIF127 1603 00000214 1E <2> PUSH DS ;;AN000;; Yes, 1604 00000215 06 <2> PUSH ES ;;AN000;; 1605 00000216 1F <2> POP DS ;;AN000;; Set DS to segment of message text 1606 00000217 B440 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1607 00000219 89FA <2> MOV DX,DI ;;AN000;; Pointer to data to write 1608 0000021B 83F901 <2> CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1609 <2> ; $IF E ;;AN000;; Yes, 1610 0000021E 7518 <2> JNE $MIF128 1611 00000220 CD21 <2> INT 21H ;;AN000;; Write character 1612 00000222 1F <2> POP DS ;;AN000;; Set DS to segment of message text 1613 00000223 50 <2> PUSH AX ;;AN000;; 1614 00000224 268A05 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 1615 00000227 E83200 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 1616 0000022A 58 <2> POP AX ;;AN000;; Set DS to segment of message text 1617 0000022B 1E <2> PUSH DS ;;AN000;; 1618 0000022C 06 <2> PUSH ES ;;AN000;; 1619 0000022D 1F <2> POP DS ;;AN000;; Set DS to segment of message text 1620 <2> ; $IF C ;;AN000;; Yes, 1621 0000022E 7306 <2> JNC $MIF129 1622 00000230 F8 <2> CLC ;;AN000;; Clear the DBCS indicator 1623 00000231 B440 <2> MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 1624 00000233 42 <2> INC DX ;;AN000;; Point to next character 1625 00000234 CD21 <2> INT 21H ;;AN000;; Write character 1626 <2> ; $ENDIF ;;AN000;; 1627 <2> $MIF129: 1628 <2> ; $ELSE ;;AN000;; No, 1629 00000236 EB02 <2> JMP SHORT $MEN128 1630 <2> $MIF128: 1631 00000238 CD21 <2> INT 21H ;;AN000;; Write String at DS:SI to handle 1632 <2> ; $ENDIF ;;AN000;; 1633 <2> $MEN128: 1634 0000023A 1F <2> POP DS ;;AN000;; 1635 <2> ; $ENDIF ;;AN002;; 1636 <2> $MIF127: 1637 <2> ;; 1638 0000023B C3 <2> RET ;;AN000;; 1639 <2> ;; 1640 <2> $M_DISPLAY_H_STRING ENDP ;;AN000;; 1641 <2> ;; 1642 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1643 <2> ;; 1644 <2> ;; PROC NAME: $M_GET_EXT_ERR_39 1645 <2> ;; 1646 <2> ;; FUNCTION: Will set registers for extended error #39 1647 <2> ;; INPUTS: None 1648 <2> ;; OUPUTS: AX,BX,CX set 1649 <2> ;; REGS USED: 1650 <2> ;; 1651 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1652 <2> ;; 1653 <2> $M_GET_EXT_ERR_39 PROC NEAR ;AN001; 1654 <2> ;; 1655 0000023C B82700 <2> MOV AX,EXT_ERR_39 ;AN001; Set AX=39 1656 0000023F BB0400 <2> MOV BX,(ERROR_CLASS_39 >> 8) + ACTION_39 ;AN001; Set BH=1 BL=4 1657 00000242 B501 <2> MOV CH,LOCUS_39 ;AN001; Set CH=1 1658 <2> ;AN001; 1659 00000244 C3 <2> RET ;AN001; 1660 <2> ;; 1661 <2> $M_GET_EXT_ERR_39 ENDP ;AN001; 1662 <2> ;; 1663 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1664 <2> %ENDIF 1665 <2> ;; 1666 <2> ;; PROC NAME: $M_ADD_CRLF 1667 <2> ;; 1668 <2> ;; FUNCTION: Will decide whether to display a CRLF 1669 <2> ;; INPUTS: DX contains the Input/Class requested 1670 <2> ;; OUTPUTS: None 1671 <2> ;; REGS Revised: CX,ES,DI 1672 <2> ;; 1673 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1674 <2> ;; 1675 <2> $M_ADD_CRLF PROC NEAR ;;AN004;; 1676 <2> ;; 1677 00000245 80FEFF <2> CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1678 <2> ; $IF NE ;;AN004;; No, 1679 00000248 7411 <2> JE $MIF134 1680 0000024A F6C680 <2> TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? 1681 <2> ; $IF Z ;;AN004;; No, 1682 0000024D 750C <2> JNZ $MIF135 1683 0000024F 1E <2> PUSH DS ;;AN004;; 1684 00000250 07 <2> POP ES ;;AN004;; Set ES to data segment 1685 00000251 8D3E[4300] <2> LEA DI,[$M_RT + $M_CRLF] ;;AN004;; Point at CRLF message 1686 00000255 B90200 <2> MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size 1687 00000258 E843FF <2> CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF 1688 <2> ; $ENDIF ;;AN004;; 1689 <2> $MIF135: 1690 <2> ; $ENDIF ;;AN004;; 1691 <2> $MIF134: 1692 0000025B C3 <2> RET ;;AN004;; Return 1693 <2> ;; 1694 <2> $M_ADD_CRLF ENDP ;;AN004;; 1695 <2> ;; 1696 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1697 <2> ;; 1698 <2> ;; PROC NAME: $M_IS_IT_DBCS 1699 <2> ;; 1700 <2> ;; FUNCTION: Will decide whether character is Single or Double Byte 1701 <2> ;; INPUTS: AL contains the byte to be checked 1702 <2> ;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range 1703 <2> ;; Carry flag = 1 if byte IS in DBCS range 1704 <2> ;; REGS USED: All restored 1705 <2> ;; 1706 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1707 <2> ;; 1708 <2> $M_IS_IT_DBCS PROC NEAR ;;AN000;; 1709 <2> ;; 1710 0000025C 06 <2> PUSH ES ;;AN000;; Save Extra segment register 1711 0000025D 57 <2> PUSH DI ;;AN000;; Save SI register 1712 <2> ;; 1713 0000025E C43E[3C00] <2> LES DI,[$M_RT + $M_DBCS_VEC] ;;AN000;; 1714 00000262 09FF <2> OR DI,DI ;;AN000;; Was the DBCS vector set? 1715 <2> ; $IF NZ ;;AN000;; 1716 00000264 7417 <2> JZ $MIF138 1717 <2> ; $DO ;;AN000;; 1718 <2> $MDO139: 1719 00000266 26833D00 <2> CMP WORD PTR [ES:DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag? 1720 0000026A F8 <2> CLC ;;AN000;; 1721 <2> ; $LEAVE E ;;AN000;; 1722 0000026B 7410 <2> JE $MEN139 1723 <2> ;; No, 1724 0000026D 263A05 <2> CMP AL,BYTE PTR [ES:DI] ;;AN000;; Does the character fall in the DBCS range? 1725 <2> ; $IF AE,AND ;;AN000;; 1726 00000270 7207 <2> JNAE $MIF141 1727 00000272 263A4501 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Does the character fall in the DBCS range? 1728 <2> ; $IF BE ;;AN000;; 1729 00000276 7701 <2> JNBE $MIF141 1730 00000278 F9 <2> STC ;;AN000;; Yes, 1731 <2> ; $ENDIF ;;AN000;; Set carry flag 1732 <2> $MIF141: 1733 00000279 47 <2> INC DI ;;AN000;; No, 1734 0000027A 47 <2> INC DI ;;AN000;; Go to next vector 1735 <2> ; $ENDDO ;;AN000;; 1736 0000027B EBE9 <2> JMP SHORT $MDO139 1737 <2> $MEN139: 1738 <2> ; $ENDIF ;;AN000;; 1739 <2> $MIF138: 1740 <2> 1741 0000027D 5F <2> POP DI ;;AN000;; 1742 0000027E 07 <2> POP ES ;;AN000;; Restore SI register 1743 0000027F C3 <2> RET ;;AN000;; Return 1744 <2> ;; 1745 <2> $M_IS_IT_DBCS ENDP ;;AN000;; 1746 <2> ;; 1747 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1748 <2> ;; 1749 <2> ;; PROC NAME: $M_CONVERT2ASC 1750 <2> ;; 1751 <2> ;; FUNCTION: Convert a binary number to a ASCII string 1752 <2> ;; INPUTS: DX:AX contains the number to be converted 1753 <2> ;; $M_RT_DIVISOR contains the divisor 1754 <2> ;; OUPUTS: CX contains the number of characters 1755 <2> ;; Top of stack --> Last character 1756 <2> ;; . . . 1757 <2> ;; Bot of stack --> First character 1758 <2> ;; REGS USED: 1759 <2> ;; 1760 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1761 <2> ;; 1762 <2> $M_CONVERT2ASC PROC NEAR ;;AN000;; 1763 <2> ;; 1764 00000280 8F06[4600] <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Save Return Address 1765 00000284 31DB <2> XOR BX,BX ;;AN000;; Use BP as a swapping register 1766 <2> ;; 1767 00000286 93 <2> XCHG BX,AX ;;AN000;; Initialize - Low Word in BP 1768 00000287 92 <2> XCHG AX,DX ;;AN000;; - High Word in AX 1769 <2> ; $DO ;;AN000;; DO UNTIL Low Word becomes zero 1770 <2> $MDO145: 1771 00000288 F736[4A00] <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide High Word by divisor 1772 0000028C 93 <2> XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder 1773 <2> ;; and save reduced High Word in BP 1774 0000028D F736[4A00] <2> DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide Low Word by divisor 1775 00000291 83FA09 <2> CMP DX,9 ;;AN000;; Make a digit of the remainder 1776 <2> ; $IF A ;;AN000;; IF 10 to 15, 1777 00000294 7605 <2> JNA $MIF146 1778 00000296 80C237 <2> ADD DL,55 ;;AN000;; Make A to F ASCII 1779 <2> ; $ELSE ;;AN000;; IF 0 to 9, 1780 00000299 EB03 <2> JMP SHORT $MEN146 1781 <2> $MIF146: 1782 0000029B 80C230 <2> ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII 1783 <2> ; $ENDIF ;;AN000;; 1784 <2> $MEN146: 1785 0000029E 52 <2> PUSH DX ;;AN000;; Save the digit on the stack 1786 0000029F 41 <2> INC CX ;;AN000;; Count that digit 1787 000002A0 09C0 <2> OR AX,AX ;;AN000;; Are we done? 1788 <2> ; $LEAVE Z,AND ;;AN000;; 1789 000002A2 7504 <2> JNZ $MLL149 1790 000002A4 09DB <2> OR BX,BX ;;AN000;; AX and BX must be ZERO!! 1791 <2> ; $LEAVE Z ;;AN000;; No, 1792 000002A6 7439 <2> JZ $MEN145 1793 <2> $MLL149: 1794 <2> %IFN COMR 1795 000002A8 83F903 <2> CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark 1796 <2> ; $IF E ;;AN000;; Yes, 1797 000002AB 750D <2> JNE $MIF150 1798 000002AD 807C0A2C <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1799 <2> ; $IF E ;;AN000;; Yes, 1800 000002B1 7505 <2> JNE $MIF151 1801 000002B3 FF36[5300] <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1802 000002B7 41 <2> INC CX ;;AN000;; 1803 <2> ; $ENDIF ;;AN000;; 1804 <2> $MIF151: 1805 <2> ; $ELSE ;;AN000;; No, 1806 000002B8 EB22 <2> JMP SHORT $MEN150 1807 <2> $MIF150: 1808 000002BA 83F906 <2> CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark 1809 <2> ; $IF E ;;AN000;; Yes, 1810 000002BD 750D <2> JNE $MIF154 1811 000002BF 807C0A2C <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1812 <2> ; $IF E ;;AN000;; Yes, 1813 000002C3 7505 <2> JNE $MIF155 1814 000002C5 FF36[5300] <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1815 000002C9 41 <2> INC CX ;;AN000;; 1816 <2> ; $ENDIF ;;AN000;; 1817 <2> $MIF155: 1818 <2> ; $ELSE ;;AN000;; No, 1819 000002CA EB10 <2> JMP SHORT $MEN154 1820 <2> $MIF154: 1821 000002CC 83F909 <2> CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark 1822 <2> ; $IF E ;;AN000;; Yes, 1823 000002CF 750B <2> JNE $MIF158 1824 000002D1 807C0A2C <2> CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1825 <2> ; $IF E ;;AN000;; Yes, 1826 000002D5 7505 <2> JNE $MIF159 1827 000002D7 FF36[5300] <2> PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 1828 000002DB 41 <2> INC CX ;;AN000;; 1829 <2> ; $ENDIF ;;AN000;; 1830 <2> $MIF159: 1831 <2> ; $ENDIF ;;AN000;; 1832 <2> $MIF158: 1833 <2> ; $ENDIF ;;AN000;; 1834 <2> $MEN154: 1835 <2> ; $ENDIF ;;AN000;; 1836 <2> $MEN150: 1837 <2> %ENDIF 1838 000002DC 93 <2> XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word 1839 <2> ;;AN000;; and Revised Low Word 1840 000002DD 31D2 <2> XOR DX,DX ;;AN000;; Reset remainder 1841 <2> ; $ENDDO ;;AN000;; NEXT 1842 000002DF EBA7 <2> JMP SHORT $MDO145 1843 <2> $MEN145: 1844 <2> ;;AN000;; Yes, 1845 000002E1 31D2 <2> XOR DX,DX ;;AN000;; Reset remainder 1846 000002E3 31C0 <2> XOR AX,AX ;;AN000;; Reset remainder 1847 000002E5 FF36[4600] <2> PUSH word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Restore Return Address 1848 000002E9 C3 <2> RET ;;AN000;; Return 1849 <2> ;; 1850 <2> $M_CONVERT2ASC ENDP ;;AN000;; 1851 <2> ;; 1852 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1853 <2> ;; 1854 <2> ;; PROC NAME: $M_DISPLAY_MESSAGE 1855 <2> ;; 1856 <2> ;; FUNCTION: Will display or write entire message (with replacable parameters) 1857 <2> ;; INPUTS: ES:DI points to beginning of message 1858 <2> ;; DS:SI points to first sublist structure in chain 1859 <2> ;; BX contains the handle to write to (if applicable) 1860 <2> ;; CX contains the length of string to write (before substitutions) 1861 <2> ;; BP contains the count of replacables 1862 <2> ;; 1863 <2> ;; OUTPUTS: 1864 <2> ;; REGS USED: All 1865 <2> ;; 1866 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1867 <2> ;; 1868 <2> $M_DISPLAY_MESSAGE PROC NEAR ;;AN000;; 1869 <2> ;; 1870 <2> ; $DO ;;AN000;; Note: DS:SI -> message 1871 <2> $MDO165: 1872 000002EA 31D2 <2> XOR DX,DX ;;AN000;; Set size = 0 1873 000002EC 09C9 <2> OR CX,CX ;;AN000;; Are we finished the message yet? 1874 <2> ; $IF NZ ;;AN000;; No, 1875 000002EE 7421 <2> JZ $MIF166 1876 000002F0 B425 <2> MOV AH,"%" ;;AN000;; Prepare to scan for % 1877 000002F2 B000 <2> MOV AL,0 ;;AN004;; 1878 <2> ;; 1879 <2> ; $DO ;;AN000;; Scan through string until % 1880 <2> $MDO167: 1881 000002F4 263825 <2> CMP BYTE PTR [ES:DI],AH ;;AN000;; Is this character NOT a % 1882 <2> ; $LEAVE E,AND ;;AN000;; No, 1883 000002F7 750A <2> JNE $MLL168 1884 000002F9 26386501 <2> CMP BYTE PTR [ES:DI+1],AH ;;AN000;; Is the next character also a % 1885 <2> ; $LEAVE NE,AND ;;AN000;; No, 1886 000002FD 7404 <2> JE $MLL168 1887 000002FF 38E0 <2> CMP AL,AH ;;AN000;; Was the character before a % 1888 <2> ; $LEAVE NE ;;AN000;; No, GREAT found it 1889 00000301 750E <2> JNE $MEN167 1890 <2> $MLL168: 1891 00000303 268A05 <2> MOV AL,BYTE PTR [ES:DI] ;;AN004;; Yes, (to any of the above) 1892 00000306 E853FF <2> CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? 1893 <2> ; $IF C ;;AN004;; Yes, 1894 00000309 7301 <2> JNC $MIF169 1895 0000030B 47 <2> INC DI ;;AN004;; Increment past second part 1896 <2> ; $ENDIF ;;AN004;; 1897 <2> $MIF169: 1898 0000030C 47 <2> INC DI ;;AN000;; Next character in string 1899 0000030D 42 <2> INC DX ;;AN000;; Size = Size + 1 1900 0000030E 49 <2> DEC CX ;;AN000;; Decrement total size 1901 <2> ; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line 1902 0000030F 75E3 <2> JNZ $MDO167 1903 <2> $MEN167: 1904 <2> ; $ENDIF ;;AN000;; 1905 <2> $MIF166: 1906 <2> ;; 1907 00000311 56 <2> PUSH SI ;;AN000;; Save beginning of sublists 1908 00000312 87CA <2> XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX) 1909 00000314 09ED <2> OR BP,BP ;;AN000;; Do we have any replacables to do? 1910 <2> ; $IF NZ ;;AN000;; Yes, 1911 00000316 7433 <2> JZ $MIF173 1912 00000318 4D <2> DEC BP ;;AN000;; Decrement number of replacables 1913 <2> 1914 <2> ;; Search through sublists to find applicable one 1915 <2> 1916 00000319 833E[4800]00 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 1917 <2> ; $IF E ;;AN000;; No, 1918 0000031E 752B <2> JNE $MIF174 1919 <2> ; $SEARCH ;;AN000;; 1920 <2> $MDO175: 1921 00000320 8A4406 <2> MOV AL,[$M_SL + $M_S_ID] ;;AN000;; Get ID byte 1922 00000323 0430 <2> ADD AL,30H ;;AN000;; Convert to ASCII 1923 00000325 263A4501 <2> CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Is this the right sublist? 1924 <2> ; $EXITIF E ;;AN000;; 1925 00000329 7502 <2> JNE $MIF175 1926 <2> ; $ORELSE ;;AN000;; No, 1927 0000032B EB1E <2> JMP SHORT $MSR175 1928 <2> $MIF175: 1929 0000032D 3C30 <2> CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 1930 <2> ; $LEAVE E,AND ;;AN000;; Yes, 1931 0000032F 7504 <2> JNE $MLL178 1932 00000331 09D2 <2> OR DX,DX ;;AN000;; Are we at the end of the message? 1933 <2> ; $LEAVE Z ;;AN000;; No, 1934 00000333 7404 <2> JZ $MEN175 1935 <2> $MLL178: 1936 00000335 0334 <2> ADD SI,WORD PTR [$M_SL + $M_S_SIZE] ;;AN000;; Next SUBLIST 1937 <2> ; $ENDLOOP ;;AN000;; Yes, 1938 00000337 EBE7 <2> JMP SHORT $MDO175 1939 <2> $MEN175: 1940 00000339 803E[4500]FF <2> CMP byte [$M_RT + $M_CLASS],UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1941 <2> ; $IF E ;;AN004;; Yes, 1942 0000033E 7508 <2> JNE $MIF180 1943 00000340 42 <2> INC DX ;;AN000;; Remember to display CR,LF 1944 00000341 42 <2> INC DX ;;AN000;; at the end of the message 1945 00000342 49 <2> DEC CX ;;AN000;; Adjust message length 1946 00000343 49 <2> DEC CX ;;AN000;; 1947 00000344 4F <2> DEC DI ;;AN000;; Adjust ending address of message 1948 00000345 4F <2> DEC DI ;;AN000;; 1949 <2> ; $ELSE ;;AN004;; No, 1950 00000346 EB03 <2> JMP SHORT $MEN180 1951 <2> $MIF180: 1952 00000348 BAFFFF <2> MOV DX,-1 ;;AN004;; Set special case 1953 <2> ; $ENDIF ;;AN004;; 1954 <2> $MEN180: 1955 <2> ; $ENDSRCH ;;AN000;; 1956 <2> $MSR175: 1957 <2> ; $ENDIF ;;AN000;; 1958 <2> $MIF174: 1959 <2> ; $ENDIF ;;AN000;; 1960 <2> $MIF173: 1961 <2> 1962 <2> ;; Prepare and display this part of message 1963 <2> 1964 0000034B 57 <2> PUSH DI ;;AN000;; Save pointer to replace number 1965 0000034C 29CF <2> SUB DI,CX ;;AN000;; Determine beginning of string 1966 0000034E E84DFE <2> CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) 1967 00000351 5F <2> POP DI ;;AN000;; Get back pointer to replace number 1968 00000352 59 <2> POP CX ;;AN000;; Clean up stack in case error 1969 <2> ; $LEAVE C,LONG ;;AN000;; Fail if carry was set 1970 00000353 7303 <2> JNC $MXL3 1971 00000355 EB7F <2> JMP $MEN165 1972 00000357 90 <2> nop ; identicalise 1973 <2> $MXL3: 1974 00000358 51 <2> PUSH CX ;;AN000;; 1975 <2> 1976 <2> ;; Save and reset pointer registers 1977 <2> 1978 00000359 89D1 <2> MOV CX,DX ;;AN000;; Get the size of the rest of the message 1979 0000035B 807C0600 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case? 1980 <2> ; $IF NE ;;AN000;; No, 1981 0000035F 740D <2> JE $MIF187 1982 00000361 09C9 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1983 <2> ; $IF NZ ;;AN000;; No, 1984 00000363 7406 <2> JZ $MIF188 1985 00000365 49 <2> DEC CX ;;AN000;; Decrement total size (%) 1986 00000366 49 <2> DEC CX ;;AN000;; Decrement total size (#) 1987 00000367 47 <2> INC DI ;;AN000;; Go past % 1988 00000368 47 <2> INC DI ;;AN000;; Go past replace number 1989 <2> ; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) 1990 00000369 EB01 <2> JMP SHORT $MEN188 1991 <2> $MIF188: 1992 0000036B 5E <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 1993 <2> ; $ENDIF ;;AN000;; Yes, Note this will not leave because INC 1994 <2> $MEN188: 1995 <2> ; $ELSE ;;AN000;; 1996 0000036C EB10 <2> JMP SHORT $MEN187 1997 <2> $MIF187: 1998 0000036E 09C9 <2> OR CX,CX ;;AN000;; Are we finished the whole message? 1999 <2> ; $IF Z ;;AN004;; No, 2000 00000370 7503 <2> JNZ $MIF192 2001 00000372 5E <2> POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 2002 <2> ; $ELSE ;;AN000;; No, 2003 00000373 EB09 <2> JMP SHORT $MEN192 2004 <2> $MIF192: 2005 00000375 83F9FF <2> CMP CX,-1 ;;AN004;; Are we at the end of the message? 2006 <2> ; $IF Z ;;AN004;; No, 2007 00000378 7502 <2> JNZ $MIF194 2008 0000037A 31C9 <2> XOR CX,CX ;;AN004;; 2009 <2> ; $ENDIF ;;AN000;; 2010 <2> $MIF194: 2011 0000037C 09FF <2> OR DI,DI ;;AN004;; Turn ZF off 2012 <2> ; $ENDIF ;;AN000;; 2013 <2> $MEN192: 2014 <2> ; $ENDIF ;;AN000;; Note this will not leave because INC 2015 <2> $MEN187: 2016 <2> ; $LEAVE Z ;;AN000;; 2017 0000037E 7456 <2> JZ $MEN165 2018 00000380 55 <2> PUSH BP ;;AN000;; Save the replace count 2019 00000381 57 <2> PUSH DI ;;AN000;; Save location to complete message 2020 00000382 06 <2> PUSH ES ;;AN000;; 2021 00000383 51 <2> PUSH CX ;;AN000;; Save size of the rest of the message 2022 00000384 31C9 <2> XOR CX,CX ;;AN000;; Reset CX used for character count 2023 <2> 2024 <2> ;; Determine what action is required on parameter 2025 <2> 2026 00000386 833E[4800]00 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2027 <2> ; $IF E ;;AN000;; 2028 0000038B 752D <2> JNE $MIF199 2029 <2> 2030 <2> %IF CHARmsg ;;AN000;; Was Char specified? 2031 <2> Char_Type equ Char_type ; NASM port equate 2032 0000038D F644070F <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2033 <2> ; $IF Z ;;AN000;; 2034 00000391 7508 <2> JNZ $MIF200 2035 <2> 2036 <2> ;; Character type requested 2037 <2> ;;AN000;; 2038 00000393 C47C02 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2039 00000396 E87402 <2> CALL $M_CHAR_REPLACE ;;AN000;; 2040 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2041 00000399 EB1A <2> JMP SHORT $MEN200 2042 <2> $MIF200: 2043 <2> %ENDIF ;;AN000;; 2044 <2> %IF NUMmsg ;;AN000;; Was Nnmeric type specified? 2045 0000039B F644070D <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2046 <2> ; $IF Z,OR ;;AN000;; 2047 0000039F 740C <2> JZ $MLL202 2048 000003A1 F644070E <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2049 <2> ; $IF Z,OR ;;AN000;; 2050 000003A5 7406 <2> JZ $MLL202 2051 000003A7 F644070C <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Bin_Hex_Type & $M_TYPE_MASK ;;AN000;; 2052 <2> ; $IF Z ;;AN000;; 2053 000003AB 7508 <2> JNZ $MIF202 2054 <2> $MLL202: 2055 <2> 2056 <2> ;; Numeric type requested 2057 <2> 2058 000003AD C47C02 <2> LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 2059 000003B0 E88202 <2> CALL $M_BIN2ASC_REPLACE ;;AN000;; 2060 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2061 000003B3 EB00 <2> JMP SHORT $MEN202 2062 <2> $MIF202: 2063 <2> %ENDIF ;;AN000;; 2064 <2> %IF DATEmsg ;;AN000;; Was date specified? 2065 <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Date_Type & $M_TYPE_MASK ;;AN000;; 2066 <2> ; $IF E ;;AN000;; 2067 <2> JNE $MIF204 2068 <2> 2069 <2> ;; Date type requested 2070 <2> 2071 <2> CALL $M_DATE_REPLACE ;;AN000;; 2072 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 2073 <2> JMP SHORT $MEN204 2074 <2> $MIF204: 2075 <2> %ENDIF ;;AN000;; 2076 <2> %IF TIMEmsg ;;AN000;; Was time (12 hour format) specified? 2077 <2> 2078 <2> ;; Time type requested (Default if we have not matched until here) 2079 <2> 2080 <2> CALL $M_TIME_REPLACE ;;AN000;; 2081 <2> %ENDIF ;;AN000;; 2082 <2> 2083 <2> %IF DATEmsg ;;AN000;; 2084 <2> ; $ENDIF ;;AN000;; 2085 <2> $MEN204: 2086 <2> %ENDIF ;;AN000;; 2087 <2> %IF NUMmsg ;;AN000;; 2088 <2> ; $ENDIF ;;AN000;; 2089 <2> $MEN202: 2090 <2> %ENDIF ;;AN000;; 2091 <2> %IF CHARmsg ;;AN000;; 2092 <2> ; $ENDIF ;;AN000;; 2093 <2> $MEN200: 2094 <2> %ENDIF ;;AN000;; 2095 <2> 2096 <2> %IF $M_REPLACE ;;AN000;; 2097 <2> ;; With the replace information of the Stack, display the replaceable field 2098 <2> 2099 000003B5 E87A01 <2> CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace 2100 <2> %ENDIF ;;AN000;; 2101 <2> ;; None of the above - Extended/Parse replace 2102 <2> ; $ELSE ;;AN000;; 2103 000003B8 EB03 <2> JMP SHORT $MEN199 2104 <2> $MIF199: 2105 <2> %IFN COMR 2106 000003BA E82000 <2> CALL $M_EXT_PAR_REPLACE ;;AN000;; 2107 <2> %ENDIF 2108 <2> ; $ENDIF ;;AN000;; 2109 <2> $MEN199: 2110 <2> 2111 <2> ;; We must go back and complete the message after the replacable parameter if there is any left 2112 <2> 2113 <2> ; $IF NC ;;AN000;; IF there was an error displaying then EXIT 2114 000003BD 7207 <2> JC $MIF211 2115 000003BF 59 <2> POP CX ;;AN000;; Get size of the rest of the message 2116 000003C0 07 <2> POP ES ;;AN000;; Get address of the rest of the message 2117 000003C1 5F <2> POP DI ;;AN000;; 2118 000003C2 5D <2> POP BP ;;AN000;; Get replacment count 2119 000003C3 5E <2> POP SI ;;AN000;; ELSE get address of first sublist structure 2120 <2> ; $ELSE ;;AN000;; 2121 000003C4 EB04 <2> JMP SHORT $MEN211 2122 <2> $MIF211: 2123 000003C6 83C40A <2> ADD SP,10 ;;AN000;; Clean up stack if error 2124 000003C9 F9 <2> STC ;;AN000;; 2125 <2> ; $ENDIF ;;AN000;; 2126 <2> $MEN211: 2127 000003CA 833E[4800]00 <2> CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2128 <2> ; $ENDDO NE,OR ;;AN000;; 2129 000003CF 7505 <2> JNE $MLL214 2130 <2> ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message 2131 000003D1 7203 <2> JC $MXL4 2132 000003D3 E914FF <2> JMP $MDO165 2133 <2> $MXL4: 2134 <2> $MLL214: 2135 <2> $MEN165: 2136 <2> ;; IF there was an error displaying then EXIT 2137 000003D6 C706[4800]0000 <2> MOV word [$M_RT + $M_MSG_NUM],0 ;;AN000;; Reset message number to null 2138 000003DC C3 <2> RET ;;AN000;; Return 2139 <2> ;; 2140 <2> $M_DISPLAY_MESSAGE ENDP ;;AN000;; 2141 <2> %IFN COMR 2142 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2143 <2> ;; 2144 <2> ;; PROC NAME: $M_EXT_PAR_REPLACE 2145 <2> ;; 2146 <2> ;; FUNCTION: 2147 <2> ;; INPUTS: 2148 <2> ;; OUPUTS: 2149 <2> ;; 2150 <2> ;; REGS USED: 2151 <2> ;; 2152 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2153 <2> ;; 2154 <2> $M_EXT_PAR_REPLACE PROC NEAR ;;AN000;; 2155 <2> ;; 2156 000003DD 31D2 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2157 000003DF A1[4800] <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN000;; Prepare for get binary value (LOW) 2158 000003E2 C706[4A00]0A00 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2159 <2> ;; 2160 000003E8 E895FE <2> CALL $M_CONVERT2ASC ;;AN000;; 2161 <2> ;; 2162 <2> ; $DO ;;AN000;; 2163 <2> $MDO215: 2164 000003EB 58 <2> POP AX ;;AN000;; Get character in register 2165 000003EC 8887[4C00] <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2166 000003F0 43 <2> INC BX ;;AN000;; Increase buffer count 2167 000003F1 83FB40 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2168 <2> ; $IF E ;;AN000;; Yes, 2169 000003F4 7503 <2> JNE $MIF216 2170 000003F6 E8F801 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2171 <2> ; $ENDIF ;;AN000;; 2172 <2> $MIF216: 2173 000003F9 FEC9 <2> DEC CL ;;AN000;; Have we completed replace? 2174 <2> ; $ENDDO Z ;;AN000;; 2175 000003FB 75EE <2> JNZ $MDO215 2176 <2> ;; 2177 000003FD B80D0A <2> MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer 2178 00000400 8987[4C00] <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],AX ;;AN000;; Move char into the buffer 2179 00000404 43 <2> INC BX ;;AN000;; Increase buffer count 2180 00000405 43 <2> INC BX ;;AN000;; Increase buffer count 2181 00000406 E8E801 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2182 00000409 C3 <2> RET ;;AN000:: 2183 <2> ;; 2184 <2> $M_EXT_PAR_REPLACE ENDP ;;AN000;; 2185 <2> ;; 2186 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2187 <2> %ENDIF 2188 <2> %IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet 2189 <2> %iassign $M_SUBS FALSE ;;AN000;; No, then include and reset the flag 2190 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2191 <2> ;; 2192 <2> ;; PROC NAME: $M_GET_MSG_ADDRESS 2193 <2> ;; 2194 <2> ;; FUNCTION: To scan thru classes to return pointer to the message header 2195 <2> ;; INPUTS: Access to $M_RES_ADDRESSES 2196 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2197 <2> ;; IF CX > 1 THEN DS:SI points to the specified message 2198 <2> ;; REGS CHANGED: ES,DI,CX,DS,SI 2199 <2> ;; 2200 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2201 <2> ;; 2202 <2> %IF FARmsg ;;AN000;; 2203 <2> $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; 2204 <2> %ELSE ;;AN000;; 2205 <2> $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; 2206 <2> %ENDIF ;;AN000;; 2207 <2> ;; 2208 0000040A 56 <2> PUSH SI ;;AN000;; 2209 0000040B 53 <2> PUSH BX ;;AN000;; 2210 0000040C 31F6 <2> XOR SI,SI ;;AN000;; Use SI as an index 2211 0000040E 31C9 <2> XOR CX,CX ;;AN000;; Use CX as an size 2212 <2> ; $DO ;;AN000;; 2213 <2> $MDO219: 2214 00000410 80FEFF <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 2215 <2> ; $IF E ;;AN000;; Yes, 2216 00000413 7508 <2> JNE $MIF220 2217 <2> %IF FARmsg ;;AN000;; 2218 <2> LES DI,[$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2219 <2> MOV BX,ES ;;AN000; 2220 <2> %ELSE ;;AN000;; 2221 00000415 8BBC[2C00] <2> MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 2222 00000419 89FB <2> MOV BX,DI ;;AN000; 2223 <2> %ENDIF ;;AN000;; 2224 <2> ; $ELSE ;;AN000;; No, 2225 0000041B EB25 <2> JMP SHORT $MEN220 2226 <2> $MIF220: 2227 0000041D F6C602 <2> TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 2228 <2> ; $IF NE ;;AN000;; Yes, 2229 00000420 7408 <2> JE $MIF222 2230 00000422 C4BC[1000] <2> LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 2231 00000426 8CC3 <2> MOV BX,ES ;;AN000; 2232 <2> ; $ELSE ;;AN000;; No, extended errors were specified 2233 00000428 EB18 <2> JMP SHORT $MEN222 2234 <2> $MIF222: 2235 0000042A 83F813 <2> CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 2236 <2> ; $IF AE,AND ;;AN000;; 2237 0000042D 720D <2> JNAE $MIF224 2238 0000042F 83F827 <2> CMP AX,$M_CRIT_HI ;;AN000;; 2239 <2> ; $IF BE ;;AN000;; Yes, 2240 00000432 7708 <2> JNBE $MIF224 2241 00000434 C4BC[1C00] <2> LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 2242 00000438 8CC3 <2> MOV BX,ES ;;AN000; 2243 <2> ; $ELSE ;;AN000;; 2244 0000043A EB06 <2> JMP SHORT $MEN224 2245 <2> $MIF224: 2246 0000043C C4BC[0000] <2> LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 2247 00000440 8CC3 <2> MOV BX,ES ;;AN000; 2248 <2> ; $ENDIF ;;AN000;; 2249 <2> $MEN224: 2250 <2> ; $ENDIF ;;AN000;; 2251 <2> $MEN222: 2252 <2> ; $ENDIF ;;AN000;; 2253 <2> $MEN220: 2254 <2> ;; 2255 00000442 83FBFF <2> CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 2256 <2> ; $IF E ;;AN000;; Yes, 2257 00000445 7516 <2> JNE $MIF229 2258 00000447 80FEFF <2> CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 2259 <2> ; $IF E ;;AN000;; Yes, 2260 0000044A 7503 <2> JNE $MIF230 2261 0000044C F9 <2> STC ;;AN000;; Set the carry flag 2262 <2> ; $ELSE ;;AN000;; No, 2263 0000044D EB0C <2> JMP SHORT $MEN230 2264 <2> $MIF230: 2265 0000044F A3[4800] <2> MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 2266 00000452 B8FFFF <2> MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 2267 00000455 BD0100 <2> MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 2268 00000458 31F6 <2> XOR SI,SI ;;AN000;; Reset the SI index to start again 2269 0000045A F8 <2> CLC ;;AN000;; 2270 <2> ; $ENDIF ;;AN000;; No, 2271 <2> $MEN230: 2272 <2> ; $ELSE ;;AN000;; 2273 0000045B EB0C <2> JMP SHORT $MEN229 2274 <2> $MIF229: 2275 0000045D 83FB00 <2> CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 2276 <2> ; $IF NE ;;AN001;; Yes, 2277 00000460 7403 <2> JE $MIF234 2278 00000462 E85400 <2> CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 2279 <2> ; $ENDIF ;;AN000;; 2280 <2> $MIF234: 2281 00000465 83C604 <2> ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 2282 00000468 F8 <2> CLC ;;AN000;; 2283 <2> ; $ENDIF ;;AN000;; 2284 <2> $MEN229: 2285 <2> ; $LEAVE C ;;AN000;; 2286 00000469 7206 <2> JC $MEN219 2287 0000046B 09C9 <2> OR CX,CX ;;AN000;; Was the message found? 2288 <2> ; $ENDDO NZ,LONG ;;AN000;; 2289 0000046D 7502 <2> JNZ $MXL5 2290 0000046F EB9F <2> JMP $MDO219 2291 <2> $MXL5: 2292 <2> $MEN219: 2293 <2> 2294 00000471 9C <2> PUSHF ;;AN006;; Save the flag state 2295 00000472 80FE01 <2> CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 2296 <2> ; $IF E ;;AN006;; Yes, 2297 00000475 7529 <2> JNE $MIF239 2298 00000477 52 <2> PUSH DX ;;AN006;; Save all needed registers 2299 00000478 55 <2> PUSH BP ;;AN006;; 2300 00000479 51 <2> PUSH CX ;;AN006;; 2301 0000047A 06 <2> PUSH ES ;;AN006;; 2302 0000047B 57 <2> PUSH DI ;;AN006;; 2303 0000047C 50 <2> PUSH AX ;;AN006;; 2304 <2> 2305 0000047D B80005 <2> MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 2306 00000480 CD2F <2> INT 2FH ;;AN006;; 2307 00000482 3CFF <2> CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 2308 00000484 58 <2> POP AX ;;AN006;; Restore msg number 2309 <2> ; $IF E ;;AN006;; Yes, 2310 00000485 7509 <2> JNE $MIF240 2311 00000487 89C3 <2> MOV BX,AX ;;AN006;; BX is the extended error number 2312 00000489 B80205 <2> MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 2313 0000048C CD2F <2> INT 2FH ;;AN006;; Call IFSFUNC 2314 <2> ; $ELSE ;;AN006;; No, 2315 0000048E EB01 <2> JMP SHORT $MEN240 2316 <2> $MIF240: 2317 00000490 F9 <2> STC ;;AN006;; Carry conditon 2318 <2> ; $ENDIF ;;AN006;; 2319 <2> $MEN240: 2320 <2> 2321 <2> ; $IF C ;;AN006;; Was there an update? 2322 00000491 7305 <2> JNC $MIF243 2323 00000493 5F <2> POP DI ;;AN006;; No, 2324 00000494 07 <2> POP ES ;;AN006;; Restore old pointer 2325 00000495 59 <2> POP CX ;;AN006;; 2326 <2> ; $ELSE ;;AN006;; Yes 2327 00000496 EB06 <2> JMP SHORT $MEN243 2328 <2> $MIF243: 2329 00000498 83C406 <2> ADD SP,6 ;;AN006;; Throw away old pointer 2330 0000049B E80C00 <2> CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 2331 <2> ; $ENDIF ;;AN006;; 2332 <2> $MEN243: 2333 0000049E 5D <2> POP BP ;;AN006;; Restore other Regs 2334 0000049F 5A <2> POP DX ;;AN006;; 2335 <2> ; $ENDIF ;;AN006;; 2336 <2> $MIF239: 2337 000004A0 EB01CF0EE8FBFF <2> $M_POPF ;;AN006;; Restore the flag state 2338 <2> 2339 000004A7 5B <2> POP BX ;;AN000;; 2340 000004A8 5E <2> POP SI ;;AN000;; 2341 000004A9 C3 <2> RET ;;AN000;; Return ES:DI pointing to the message 2342 <2> ;; 2343 <2> $M_GET_MSG_ADDRESS ENDP ;; 2344 <2> ;; 2345 <2> $M_SET_LEN_IN_CX PROC NEAR ;; 2346 <2> ;; 2347 000004AA 57 <2> PUSH DI ;;AN006;; Save position 2348 000004AB 50 <2> PUSH AX ;;AN006;; 2349 000004AC B9FFFF <2> MOV CX,-1 ;;AN006;; Set CX for decrements 2350 000004AF 30C0 <2> XOR AL,AL ;;AN006;; Prepare compare register 2351 000004B1 F2AE <2> REPNE SCASB ;;AN006;; Scan for zero 2352 000004B3 F7D1 <2> NOT CX ;;AN006;; Change decrement into number 2353 000004B5 49 <2> DEC CX ;;AN006;; Don't include the zero 2354 000004B6 58 <2> POP AX ;;AN006;; 2355 000004B7 5F <2> POP DI ;;AN006;; Restore position 2356 000004B8 C3 <2> RET ;;AN006;; 2357 <2> ;; 2358 <2> $M_SET_LEN_IN_CX ENDP ;; 2359 <2> ;; 2360 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2361 <2> ;; 2362 <2> ;; PROC NAME: $M_FIND_SPECIFIED_MSG 2363 <2> ;; 2364 <2> ;; FUNCTION: To scan thru message headers until message is found 2365 <2> ;; INPUTS: ES:DI points to beginning of msg headers 2366 <2> ;; CX contains the number of messages in class 2367 <2> ;; DH contains the message class 2368 <2> ;; OUPUTS: IF CX = 0 THEN Message was not found 2369 <2> ;; IF CX > 1 THEN ES:DI points to header of specified message 2370 <2> ;; 2371 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2372 <2> ;; 2373 <2> $M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; 2374 <2> ;; 2375 000004B9 83FB01 <2> CMP BX,1 ;;AN004;; Do we have an address to CALL? 2376 <2> ; $IF E,AND ;;AN004;; Yes, 2377 000004BC 751D <2> JNE $MIF247 2378 000004BE 833E[2800]FF <2> CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 2379 <2> ; $IF NE ;;AN004;; Yes, 2380 000004C3 7416 <2> JE $MIF247 2381 000004C5 83F8FF <2> CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 2382 <2> ; $IF E ;;AN004;; . . . and . . . 2383 000004C8 750B <2> JNE $MIF248 2384 000004CA 50 <2> PUSH AX ;;AN004;; Reset the special message number 2385 000004CB A1[4800] <2> MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 2386 000004CE FF1E[2800] <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2387 000004D2 58 <2> POP AX ;;AN004;; Reset the special message number 2388 <2> ; $ELSE ;;AN004;; Get the old message number 2389 000004D3 EB04 <2> JMP SHORT $MEN248 2390 <2> $MIF248: 2391 000004D5 FF1E[2800] <2> CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 2392 <2> ; $ENDIF ;;AN004;; Get the old message number 2393 <2> $MEN248: 2394 <2> ; $ELSE ;;AN004;; 2395 000004D9 EB1A <2> JMP SHORT $MEN247 2396 <2> $MIF247: 2397 000004DB 31C9 <2> XOR CX,CX ;;AN002;; CX = 0 will allow us to 2398 000004DD 80FEFF <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2399 <2> ; $IF NE ;;AN001;; 2400 000004E0 7406 <2> JE $MIF252 2401 000004E2 268A4D03 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 2402 <2> ; $ELSE ;;AN001;; 2403 000004E6 EB09 <2> JMP SHORT $MEN252 2404 <2> $MIF252: 2405 <2> %IF FARmsg ;;AN001;; 2406 <2> CMP BYTE PTR [ES:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2407 <2> %ELSE 2408 000004E8 2E3835 <2> CMP BYTE PTR [CS:DI + $M_CLASS_ID],DH ;;AN002;; Check if class still exists at 2409 <2> %ENDIF 2410 <2> ; $IF E ;;AN002;; pointer (hopefully) 2411 000004EB 7504 <2> JNE $MIF254 2412 <2> %IF FARmsg ;;AN001;; 2413 <2> MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2414 <2> %ELSE 2415 000004ED 2E8A4D03 <2> MOV CL,BYTE PTR [CS:DI + $M_NUM_CLS_MSG] ;;AN000;; Get number of messages in class 2416 <2> %ENDIF 2417 <2> ; $ENDIF ;;AN002;; go on to the next class 2418 <2> $MIF254: 2419 <2> ; $ENDIF ;;AN001;; 2420 <2> $MEN252: 2421 000004F1 83C704 <2> ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 2422 000004F4 F9 <2> STC ;;AN004;; Flag that we haven't found anything yet 2423 <2> ; $ENDIF ;;AN004;; 2424 <2> $MEN247: 2425 <2> 2426 <2> ; $IF C ;;AN004;; Have we found anything yet? 2427 000004F5 732D <2> JNC $MIF258 2428 000004F7 F8 <2> CLC ;;AN004;; No, reset carry 2429 <2> ; $SEARCH ;;AN000;; 2430 <2> $MDO259: 2431 000004F8 09C9 <2> OR CX,CX ;;AN000;; Do we have any to check? 2432 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2433 000004FA 7419 <2> JZ $MEN259 2434 000004FC 80FEFF <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2435 <2> ; $IF NE ;;AN001;; 2436 000004FF 7405 <2> JE $MIF261 2437 00000501 263B05 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 2438 <2> ; $ELSE ;;AN001;; 2439 00000504 EB03 <2> JMP SHORT $MEN261 2440 <2> $MIF261: 2441 <2> %IF FARmsg ;;AN001;; 2442 <2> CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN000;; Is this the message requested? 2443 <2> %ELSE 2444 00000506 2E3B05 <2> CMP AX,WORD PTR [CS:DI + $M_NUM] ;;AN000;; Is this the message requested? 2445 <2> %ENDIF 2446 <2> ; $ENDIF 2447 <2> $MEN261: 2448 <2> ; $EXITIF E ;;AN000;; 2449 00000509 7502 <2> JNE $MIF259 2450 <2> ; $ORELSE ;;AN000; 2451 0000050B EB09 <2> JMP SHORT $MSR259 2452 <2> $MIF259: 2453 0000050D 49 <2> DEC CX ;;AN000;; No, well do we have more to check? 2454 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 2455 0000050E 7405 <2> JZ $MEN259 2456 00000510 83C704 <2> ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 2457 <2> ; $ENDLOOP ;;AN000;; 2458 00000513 EBE3 <2> JMP SHORT $MDO259 2459 <2> $MEN259: 2460 00000515 F9 <2> STC ;;AN000;; 2461 <2> ; $ENDSRCH ;;AN000;; Check next message 2462 <2> $MSR259: 2463 <2> ; $IF NC ;;AN000;; Did we find the message? 2464 00000516 720C <2> JC $MIF269 2465 00000518 80FEFF <2> CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 2466 0000051B F8 <2> CLC ;;AN001;; 2467 <2> ; $IF E ;;AN001;; 2468 0000051C 7502 <2> JNE $MIF270 2469 <2> %IF FARmsg ;;AN001;; 2470 <2> %ELSE ;;AN000;; 2471 0000051E 0E <2> PUSH CS ;;AN000;; 2472 0000051F 07 <2> POP ES ;;AN000;; Return ES:DI pointing to the message 2473 <2> %ENDIF 2474 <2> ; $ENDIF ;;AN001;; 2475 <2> $MIF270: 2476 00000520 26037D02 <2> ADD DI,WORD PTR [ES:DI + $M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message 2477 <2> ; $ENDIF ;;AN004;; 2478 <2> $MIF269: 2479 <2> ; $ENDIF ;;AN004;; 2480 <2> $MIF258: 2481 <2> ;; Yes, great we can return with CX > 0 2482 <2> 2483 <2> ; $IF NC ;;AN000;; Did we find the message? 2484 00000524 7206 <2> JC $MIF274 2485 00000526 30ED <2> XOR CH,CH ;;AN000;; 2486 00000528 268A0D <2> MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 2487 0000052B 47 <2> INC DI ;;AN000;; Increment past length 2488 <2> ; $ENDIF ;;AN004;; 2489 <2> $MIF274: 2490 <2> 2491 0000052C C606[4200]00 <2> MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 2492 00000531 C3 <2> RET ;;AN000;; Return 2493 <2> ;; 2494 <2> $M_FIND_SPECIFIED_MSG ENDP ;;AN000;; 2495 <2> ;; 2496 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2497 <2> %ENDIF ;;AN000;; END of include of common subroutines 2498 <2> ; 2499 <2> %IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms 2500 <2> %iassign $M_REPLACE FALSE ;;AN000;; Tell the assembler we did 2501 <2> ;; 2502 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2503 <2> $M_DISPLAY_REPLACE PROC NEAR ;;AN000;; 2504 <2> ;; 2505 00000532 31DB <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2506 <2> %IFN COMR 2507 00000534 807C0600 <2> CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII) 2508 <2> ; $IF E ;;AN000;; Yes, 2509 00000538 7511 <2> JNE $MIF276 2510 0000053A C787[4C00]202D <2> MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE_HYP ;;AN000;; Move in a " -" 2511 00000540 43 <2> INC BX ;;AN000;; Increment count 2512 00000541 43 <2> INC BX ;;AN000;; Increment count 2513 00000542 C687[4C00]20 <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE ;;AN000;; Move in a " " 2514 00000547 43 <2> INC BX ;;AN000;; Increment count 2515 00000548 E8A600 <2> CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case 2516 <2> ; $ENDIF ;;AN000;; If it fails we will catch it later 2517 <2> $MIF276: 2518 <2> %ENDIF 2519 <2> 2520 0000054B 5D <2> POP BP ;;AN000;; Remember the return address 2521 0000054C 31DB <2> XOR BX,BX ;;AN000;; Use BX for buffer count 2522 0000054E 31D2 <2> XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack 2523 <2> 2524 00000550 880E[4200] <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save size to later clear stack 2525 00000554 8A4409 <2> MOV AL,BYTE PTR [$M_SL + $M_S_MINW] ;;AN000;; Get the minimum width 2526 <2> ;; 2527 00000557 38C8 <2> CMP AL,CL ;;AN000;; Do we need pad chars added? 2528 <2> ; $IF A ;;AN000;; Yes, 2529 00000559 761E <2> JNA $MIF278 2530 0000055B 28C8 <2> SUB AL,CL ;;AN000;; Calculate how many pad chars are needed. 2531 0000055D 88C6 <2> MOV DH,AL ;;AN000;; Save the number of pad characters 2532 0000055F F6440780 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be right aligned? 2533 <2> ; $IF NZ ;;AN000;; Yes, 2534 00000563 7414 <2> JZ $MIF279 2535 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2536 <2> $MDO280: 2537 00000565 8A440A <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2538 00000568 8887[4C00] <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2539 0000056C 43 <2> INC BX ;;AN000;; 2540 0000056D 83FB40 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2541 <2> ; $IF E ;;AN000;; Yes, 2542 00000570 7503 <2> JNE $MIF281 2543 00000572 E87C00 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2544 <2> ; $ENDIF ;;AN000;; 2545 <2> $MIF281: 2546 00000575 FECE <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2547 <2> ; $ENDDO Z ;;AN000;; No, next pad character 2548 00000577 75EC <2> JNZ $MDO280 2549 <2> ; $ENDIF ;;AN000;; 2550 <2> $MIF279: 2551 <2> ; $ENDIF ;;AN000;; Yes, 2552 <2> $MIF278: 2553 <2> ;; 2554 00000579 807C0800 <2> CMP BYTE [$M_SL + $M_S_MAXW],$M_UNLIM_W ;;AN000;; Is maximum width unlimited? 2555 <2> ; $IF NE ;;AN000;; 2556 0000057D 740D <2> JE $MIF286 2557 0000057F 384C08 <2> CMP BYTE PTR [$M_SL + $M_S_MAXW],CL ;;AN000;; Will we exceed maximum width? 2558 <2> ; $IF B ;;AN000;; Yes, 2559 00000582 7308 <2> JNB $MIF287 2560 00000584 2A4C08 <2> SUB CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Calculate how many extra chars 2561 00000587 88CA <2> MOV DL,CL ;;AN000;; Remember how many chars to pop off 2562 00000589 8A4C08 <2> MOV CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Set new string length 2563 <2> ; $ENDIF ;;AN000;; 2564 <2> $MIF287: 2565 <2> ; $ENDIF ;;AN000;; 2566 <2> $MIF286: 2567 0000058C 09C9 <2> OR CX,CX ;;AN000;; 2568 <2> ; $IF NZ ;;AN000;; 2569 0000058E 7424 <2> JZ $MIF290 2570 <2> ; $DO ;;AN000;; Begin filling buffer with string 2571 <2> $MDO291: 2572 00000590 F644070F <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2573 <2> ; $IF Z,AND ;;AN000;; 2574 00000594 750C <2> JNZ $MIF292 2575 <2> Char_field_ASCIIZ equ Char_Field_ASCIIZ ; NASM port equate 2576 00000596 F6440710 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ; Is this replace a ASCIIZ string? 2577 <2> ; $IF NZ ;;AN000;; Yes, 2578 0000059A 7406 <2> JZ $MIF292 2579 0000059C 268A05 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get first character from string 2580 0000059F 47 <2> INC DI ;;AN000;; Next character in string 2581 <2> ; $ELSE ;;AN000;; No, 2582 000005A0 EB01 <2> JMP SHORT $MEN292 2583 <2> $MIF292: 2584 000005A2 58 <2> POP AX ;;AN000;; Get character in register 2585 <2> ; $ENDIF ;;AN000;; 2586 <2> $MEN292: 2587 000005A3 8887[4C00] <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 2588 000005A7 43 <2> INC BX ;;AN000;; Increase buffer count 2589 000005A8 83FB40 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2590 <2> ; $IF E ;;AN000;; Yes, 2591 000005AB 7503 <2> JNE $MIF295 2592 000005AD E84100 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2593 <2> ; $ENDIF ;;AN000;; 2594 <2> $MIF295: 2595 000005B0 FEC9 <2> DEC CL ;;AN000;; Have we completed replace? 2596 <2> ; $ENDDO Z ;;AN000;; Test again 2597 000005B2 75DC <2> JNZ $MDO291 2598 <2> ; $ENDIF ;;AN000;; 2599 <2> $MIF290: 2600 <2> ;; 2601 000005B4 F6440780 <2> TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be left aligned? 2602 <2> ; $IF Z ;;AN000;; Yes, 2603 000005B8 7518 <2> JNZ $MIF299 2604 000005BA 08F6 <2> OR DH,DH ;;AN000;; Do we need pad chars added? 2605 <2> ; $IF NZ ;;AN000;; Yes, 2606 000005BC 7414 <2> JZ $MIF300 2607 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2608 <2> $MDO301: 2609 000005BE 8A440A <2> MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 2610 000005C1 8887[4C00] <2> MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 2611 000005C5 43 <2> INC BX ;;AN000;; 2612 000005C6 83FB40 <2> CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2613 <2> ; $IF E ;;AN000;; Yes, 2614 000005C9 7503 <2> JNE $MIF302 2615 000005CB E82300 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2616 <2> ; $ENDIF ;;AN000;; 2617 <2> $MIF302: 2618 000005CE FECE <2> DEC DH ;;AN000;; Have we filled with enough pad chars? 2619 <2> ; $ENDDO Z ;;AN000;; Test again 2620 000005D0 75EC <2> JNZ $MDO301 2621 <2> ; $ENDIF ;;AN000;; 2622 <2> $MIF300: 2623 <2> ; $ENDIF ;;AN000;; 2624 <2> $MIF299: 2625 <2> ;; 2626 000005D2 F644070F <2> TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2627 <2> ; $IF Z,AND ;;AN000;; 2628 000005D6 7508 <2> JNZ $MIF307 2629 000005D8 F6440710 <2> TEST byte [$M_SL + $M_S_FLAG],Char_field_ASCIIZ & $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string? 2630 <2> ; $IF NZ ;;AN000;; Yes, 2631 000005DC 7402 <2> JZ $MIF307 2632 <2> ; $ELSE ;;AN000;; 2633 000005DE EB0C <2> JMP SHORT $MEN307 2634 <2> $MIF307: 2635 000005E0 08D2 <2> OR DL,DL ;;AN000;; 2636 <2> ; $IF NE ;;AN000;; 2637 000005E2 7408 <2> JE $MIF309 2638 <2> ; $DO ;;AN000;; 2639 <2> $MDO310: 2640 000005E4 8F06[4600] <2> POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable 2641 000005E8 FECA <2> DEC DL ;;AN000;; Are we done? 2642 <2> ; $ENDDO Z ;;AN000;; 2643 000005EA 75F8 <2> JNZ $MDO310 2644 <2> ; $ENDIF ;;AN000;; 2645 <2> $MIF309: 2646 <2> ; $ENDIF ;;AN000;; 2647 <2> $MEN307: 2648 000005EC E80200 <2> CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time 2649 000005EF 55 <2> PUSH BP ;;AN000;; Restore the return address 2650 <2> ;; 2651 000005F0 C3 <2> RET ;;AN000;; 2652 <2> ;; 2653 <2> $M_DISPLAY_REPLACE ENDP ;;AN000;; 2654 <2> ;; 2655 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2656 <2> ;; 2657 <2> ;; PROC NAME: $M_FLUSH_BUFFER 2658 <2> ;; 2659 <2> ;; FUNCTION: Display the contents of the temporary buffer 2660 <2> ;; INPUTS: DI contains the number of bytes to display 2661 <2> ;; OUTPUTS: BX reset to zero 2662 <2> ;; 2663 <2> ;; REGS USED: 2664 <2> ;; 2665 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2666 <2> ;; 2667 <2> $M_FLUSH_BUF PROC NEAR ;;AN000;; 2668 <2> ;; 2669 000005F1 51 <2> PUSH CX ;;AN000;; Save changed regs 2670 000005F2 06 <2> PUSH ES ;;AN000;; 2671 000005F3 57 <2> PUSH DI ;;AN000;; 2672 000005F4 1E <2> PUSH DS ;;AN000;; Set ES pointing to buffer 2673 000005F5 07 <2> POP ES ;;AN000;; 2674 <2> ;; 2675 000005F6 89D9 <2> MOV CX,BX ;;AN000;; Set number of bytes to display 2676 000005F8 31DB <2> XOR BX,BX ;;AN000;; Reset buffer counter 2677 000005FA 8D3E[4C00] <2> LEA DI,[$M_RT + $M_TEMP_BUF] ;;AN000;; Reset buffer location pointer 2678 000005FE E89DFB <2> CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer 2679 <2> ;; 2680 <2> ; $IF NC ;;AN000;; Error? 2681 00000601 7205 <2> JC $MIF314 2682 00000603 5F <2> POP DI ;;AN000;; No, Restore changed regs 2683 00000604 07 <2> POP ES ;;AN000;; 2684 00000605 59 <2> POP CX ;;AN000;; 2685 <2> ; $ELSE ;;AN000;; Yes, 2686 00000606 EB04 <2> JMP SHORT $MEN314 2687 <2> $MIF314: 2688 00000608 83C406 <2> ADD SP,6 ;;AN000;; Fix stack 2689 0000060B F9 <2> STC ;;AN000;; 2690 <2> ; $ENDIF ;;AN000;; Error? 2691 <2> $MEN314: 2692 <2> ;; 2693 0000060C C3 <2> RET ;;AN000;; Return 2694 <2> ;; 2695 <2> $M_FLUSH_BUF ENDP ;;AN000;; 2696 <2> ;; 2697 <2> ;; 2698 <2> %IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace? 2699 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2700 <2> %iassign $M_CHAR_ONLY TRUE ;;AN000;; replacement code later 2701 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2702 <2> ;; 2703 <2> ;; PROC NAME: $M_CHAR_REPLACE 2704 <2> ;; 2705 <2> ;; FUNCTION: Will prepare a single char or ASCIIZ string for replace 2706 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2707 <2> ;; ES:DI contains the VALUE from SUBLIST 2708 <2> ;; OUTPUTS: CX contains number of characters on stack 2709 <2> ;; Top of stack --> Last character 2710 <2> ;; . . . 2711 <2> ;; Bot of stack --> First character 2712 <2> ;; 2713 <2> ;; OTHER REGS Revised: AX 2714 <2> ;; 2715 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2716 <2> ;; 2717 <2> $M_CHAR_REPLACE PROC NEAR ;;AN000;; 2718 <2> ;; 2719 0000060D 5D <2> POP BP ;;AN000;; Save return address 2720 0000060E F6440730 <2> TEST byte [$M_SL + $M_S_FLAG],~ Char_Field_Char & $M_SIZE_MASK ;;AN000;; Was Character specified? 2721 <2> ; $IF Z ;;AN000;; Yes, 2722 00000612 7512 <2> JNZ $MIF317 2723 00000614 268A05 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2724 00000617 50 <2> PUSH AX ;;AN000;; Put it on the stack 2725 00000618 41 <2> INC CX ;;AN000;; Increase the count 2726 00000619 E840FC <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 2727 <2> ; $IF C ;;AN000;; Yes, 2728 0000061C 7306 <2> JNC $MIF318 2729 0000061E 268A4501 <2> MOV AL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 2730 00000622 50 <2> PUSH AX ;;AN000;; Put it on the stack 2731 00000623 F8 <2> CLC ;;AN000;; Clear the carry 2732 <2> ; $ENDIF ;;AN000;; 2733 <2> $MIF318: 2734 <2> ; $ELSE ;;AN000;; No, it was an ASCIIZ string 2735 00000624 EB0D <2> JMP SHORT $MEN317 2736 <2> $MIF317: 2737 <2> ; $DO ;;AN000;; 2738 <2> $MDO321: 2739 00000626 268A05 <2> MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 2740 00000629 08C0 <2> OR AL,AL ;;AN000;; Is it the NULL? 2741 <2> ; $LEAVE Z ;;AN000;; No, 2742 0000062B 7404 <2> JZ $MEN321 2743 0000062D 47 <2> INC DI ;;AN000;; Next character 2744 0000062E 41 <2> INC CX ;;AN000;; Increment the count 2745 <2> ; $ENDDO ;;AN000;; Yes, 2746 0000062F EBF5 <2> JMP SHORT $MDO321 2747 <2> $MEN321: 2748 00000631 29CF <2> SUB DI,CX ;;AN000;; Set SI at the beginning of the string 2749 <2> ; $ENDIF ;;AN000;; 2750 <2> $MEN317: 2751 <2> ;;AN000;; 2752 00000633 55 <2> PUSH BP ;;AN000;; Restore return address 2753 00000634 C3 <2> RET ;;AN000;; Return 2754 <2> ;; 2755 <2> $M_CHAR_REPLACE ENDP ;;AN000;; 2756 <2> ;; 2757 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2758 <2> %ENDIF ;;AN000;; END of include of CHAR replace code 2759 <2> ; 2760 <2> %IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace? 2761 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2762 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2763 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2764 <2> ;; 2765 <2> ;; PROC NAME: $M_BIN2ASC_REPLACE 2766 <2> ;; 2767 <2> ;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string 2768 <2> ;; and prepare to display 2769 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2770 <2> ;; ES:DI contains the VALUE from SUBLIST 2771 <2> ;; OUTPUTS: CX contains number of characters on stack 2772 <2> ;; Top of stack --> Last character 2773 <2> ;; . . . 2774 <2> ;; Bot of stack --> First character 2775 <2> ;; OTHER REGS Revised: BX,DX,AX 2776 <2> ;; 2777 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2778 <2> ;; 2779 <2> $M_BIN2ASC_REPLACE PROC NEAR ;;AN000;; 2780 <2> ;; 2781 00000635 5D <2> POP BP ;;AN000;; Save return address 2782 <2> ;; 2783 00000636 31D2 <2> XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 2784 00000638 31C0 <2> XOR AX,AX ;;AN000;; Prepare for get binary value (LOW) 2785 0000063A C706[4A00]1000 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE16 ;;AN000;; Set default divisor 2786 00000640 31DB <2> XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable) 2787 <2> %IFN COMR 2788 00000642 F6440720 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_BYTE & $M_SIZE_MASK ;;AN000;; Was BYTE specified? 2789 <2> ; $IF Z ;;AN000;; 2790 00000646 7524 <2> JNZ $MIF325 2791 00000648 268A05 <2> MOV AL, BYTE PTR [ES:DI] ;;AN000;; Setup byte in AL 2792 0000064B F644070D <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2793 <2> ; $IF Z ;;AN000;; 2794 0000064F 750D <2> JNZ $MIF326 2795 00000651 A880 <2> TEST AL,10000000b ;;AN000;; Is this number negative? 2796 <2> ; $IF NZ ;;AN000;; Yes, 2797 00000653 7403 <2> JZ $MIF327 2798 00000655 43 <2> INC BX ;;AN000;; Remember that it was negative 2799 00000656 247F <2> AND AL,01111111b ;;AN000;; Make it positive 2800 <2> ; $ENDIF ;;AN000;; 2801 <2> $MIF327: 2802 00000658 C706[4A00]0A00 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2803 <2> ; $ENDIF ;;AN000;; 2804 <2> $MIF326: 2805 0000065E F644070E <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2806 <2> ; $IF Z ;;AN000;; 2807 00000662 7506 <2> JNZ $MIF330 2808 00000664 C706[4A00]0A00 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2809 <2> ; $ENDIF ;;AN000;; 2810 <2> $MIF330: 2811 <2> ; $ELSE ;;AN000;; 2812 0000066A EB54 <2> JMP SHORT $MEN325 2813 <2> $MIF325: 2814 <2> %ENDIF 2815 0000066C F6440710 <2> TEST byte [$M_SL + $M_S_FLAG],~ $M_WORD & $M_SIZE_MASK ;;AN000;; Was WORD specified? 2816 <2> ; $IF Z ;;AN000;; 2817 00000670 7526 <2> JNZ $MIF333 2818 00000672 268B05 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup byte in AL 2819 00000675 F644070D <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;; AN000;; Was Signed binary specified? 2820 <2> ; $IF Z ;;AN000;; 2821 00000679 750F <2> JNZ $MIF334 2822 0000067B F6C480 <2> TEST AH,10000000b ;;AN000;; Is this number negative? 2823 <2> ; $IF NZ ;;AN000;; Yes, 2824 0000067E 7404 <2> JZ $MIF335 2825 00000680 43 <2> INC BX ;;AN000;; Remember that it was negative 2826 00000681 80E47F <2> AND AH,01111111b ;;AN000;; Make it positive 2827 <2> ; $ENDIF ;;AN000;; 2828 <2> $MIF335: 2829 00000684 C706[4A00]0A00 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2830 <2> ; $ENDIF ;;AN000;; 2831 <2> $MIF334: 2832 0000068A F644070E <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2833 <2> ; $IF Z ;;AN000;; 2834 0000068E 7506 <2> JNZ $MIF338 2835 00000690 C706[4A00]0A00 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2836 <2> ; $ENDIF ;;AN000;; 2837 <2> $MIF338: 2838 <2> ; $ELSE ;;AN000;; 2839 00000696 EB28 <2> JMP SHORT $MEN333 2840 <2> $MIF333: 2841 <2> %IFN COMR 2842 00000698 268B05 <2> MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup Double word in DX:AX 2843 0000069B 268B5502 <2> MOV DX, WORD PTR [ES:DI + 2] ;;AN000;; 2844 0000069F F644070D <2> TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2845 <2> ; $IF Z ;;AN000;; 2846 000006A3 750F <2> JNZ $MIF341 2847 000006A5 F6C680 <2> TEST DH,10000000b ;;AN000;; Is this number negative? 2848 <2> ; $IF NZ ;;AN000;; Yes, 2849 000006A8 7404 <2> JZ $MIF342 2850 000006AA 43 <2> INC BX ;;AN000;; Remember that it was negative 2851 000006AB 80E67F <2> AND DH,01111111b ;;AN000;; Make it positive 2852 <2> ; $ENDIF ;;AN000;; 2853 <2> $MIF342: 2854 000006AE C706[4A00]0A00 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2855 <2> ; $ENDIF ;;AN000;; 2856 <2> $MIF341: 2857 000006B4 F644070E <2> TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2858 <2> ; $IF Z ;;AN000;; 2859 000006B8 7506 <2> JNZ $MIF345 2860 000006BA C706[4A00]0A00 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2861 <2> ; $ENDIF ;;AN000;; 2862 <2> $MIF345: 2863 <2> %ENDIF 2864 <2> ; $ENDIF ;;AN000;; 2865 <2> $MEN333: 2866 <2> ; $ENDIF ;;AN000;; 2867 <2> $MEN325: 2868 <2> ;; 2869 000006C0 E8BDFB <2> CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string 2870 <2> %IFN COMR 2871 000006C3 09DB <2> OR BX,BX ;;AN000;; 2872 <2> ; $IF NZ ;;AN000;; Was number negative? 2873 000006C5 7405 <2> JZ $MIF349 2874 000006C7 31D2 <2> XOR DX,DX ;;AN000;; Yes, 2875 000006C9 B22D <2> MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number 2876 000006CB 52 <2> PUSH DX ;;AN000;; 2877 <2> ; $ENDIF ;;AN000;; No, 2878 <2> $MIF349: 2879 <2> %ENDIF 2880 <2> ;; 2881 000006CC 55 <2> PUSH BP ;;AN000;; Restore return address 2882 000006CD C3 <2> RET ;;AN000;; Return 2883 <2> ;; 2884 <2> $M_BIN2ASC_REPLACE ENDP ;;AN000;; 2885 <2> ;; 2886 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2887 <2> %ENDIF ;;AN000;; END of include of NUM replace code 2888 <2> ; 2889 <2> %IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace? 2890 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 2891 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 2892 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2893 <2> ;; 2894 <2> ;; PROC NAME: $M_DATE_REPLACE 2895 <2> ;; 2896 <2> ;; FUNCTION: Convert a date to a decimal ASCII string using current 2897 <2> ;; country format and prepare to display 2898 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 2899 <2> ;; ES:DI points at VALUE from SUBLIST 2900 <2> ;; OUTPUTS: CX contains number of characters on stack 2901 <2> ;; Top of stack --> Last character 2902 <2> ;; . . . 2903 <2> ;; Bot of stack --> First character 2904 <2> ;; OTHER REGS Revised: DX, AX 2905 <2> ;; 2906 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2907 <2> ;; 2908 <2> $M_DATE_REPLACE PROC NEAR ;;AN000;; 2909 <2> ;; 2910 <2> POP BP ;;AN000;; Save return address 2911 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2912 <2> CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT 2913 <2> ;;AN000;; All O.K.? 2914 <2> XOR DX,DX ;;AN000;; Reset DX value 2915 <2> XOR AX,AX ;;AN000;; Reset AX value 2916 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],0 ;;AN000;; USA Date Format 2917 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2918 <2> JNE $MIF351 2919 <2> CALL $M_YEAR ;;AN000;; Get Year 2920 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2921 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2922 <2> INC CX ;;AN000;; Increment count 2923 <2> XOR AX,AX ;;AN000;; Reset AX value 2924 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2925 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2926 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2927 <2> INC CX ;;AN000;; Increment count 2928 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2929 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2930 <2> ; $ENDIF ;;AN000;; 2931 <2> $MIF351: 2932 <2> ;; 2933 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],1 ;;AN000;; EUROPE Date Format 2934 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2935 <2> JNE $MIF353 2936 <2> CALL $M_YEAR ;;AN000;; Get Year 2937 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2938 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2939 <2> INC CX ;;AN000;; 2940 <2> XOR AX,AX ;;AN000;; Reset AX 2941 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2942 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2943 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2944 <2> INC CX ;;AN000;; 2945 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2946 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2947 <2> ; $ENDIF ;;AN000;; 2948 <2> $MIF353: 2949 <2> ;; 2950 <2> CMP WORD [$M_RT + $M_DATE_FORMAT],2 ;;AN000;; JAPAN Date Format 2951 <2> ; $IF E ;;AN000;; Beginning from end: (saved on the stack) 2952 <2> JNE $MIF355 2953 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Day 2954 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2955 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2956 <2> INC CX ;;AN000;; 2957 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Month 2958 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2959 <2> PUSH WORD [$M_RT + $M_DATE_SEPARA] ;;AN000;; 2960 <2> INC CX ;;AN000;; 2961 <2> CALL $M_YEAR ;;AN000;; Get Year 2962 <2> CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 2963 <2> ; $ENDIF ;;AN000;; 2964 <2> $MIF355: 2965 <2> ;; 2966 <2> PUSH BP ;;AN000;; Restore return address 2967 <2> RET ;;AN000;; Return 2968 <2> ;; 2969 <2> $M_DATE_REPLACE ENDP ;;AN000;; 2970 <2> ;; 2971 <2> $M_GET_DATE PROC NEAR ;;AN000;; 2972 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 2973 <2> MOV AL,0 ;;AN000;; Get current country info 2974 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 2975 <2> INT 21H ;;AN000;; 2976 <2> ; $IF C ;;AN000;; No, 2977 <2> JNC $MIF357 2978 <2> MOV WORD [$M_RT + $M_DATE_FORMAT],$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH) 2979 <2> MOV BYTE [$M_RT + $M_DATE_SEPARA],$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL) 2980 <2> ; $ENDIF ;;AN000;; 2981 <2> $MIF357: 2982 <2> RET ;;AN000;; 2983 <2> $M_GET_DATE ENDP ;;AN000;; 2984 <2> ;; 2985 <2> $M_YEAR PROC NEAR ;;AN000;; 2986 <2> MOV AX,WORD PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Year 2987 <2> TEST byte [$M_SL + $M_S_FLAG],Date_MDY_4 & $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified? 2988 <2> ; $IF Z ;;AN000;; 2989 <2> JNZ $MIF359 2990 <2> CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year 2991 <2> ; $IF A ;;AN000;; 2992 <2> JNA $MIF360 2993 <2> MOV AX,$M_MAX_2_YEAR ;;AN000;; 2994 <2> ; $ENDIF ;;AN000;; 2995 <2> $MIF360: 2996 <2> ; $ENDIF ;;AN000;; 2997 <2> $MIF359: 2998 <2> RET ;;AN000;; 2999 <2> $M_YEAR ENDP ;;AN000;; 3000 <2> ;; 3001 <2> $M_CONVERTDATE PROC NEAR ;;AN000;; 3002 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3003 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3004 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3005 <2> DEC CX ;;AN000;; Test if size only grew by 1 3006 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3007 <2> ; $IF E ;;AN000;; Yes, 3008 <2> JNE $MIF363 3009 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3010 <2> PUSH AX ;;AN000;; Save it 3011 <2> INC CX ;;AN000;; Count it 3012 <2> ; $ENDIF ;;AN000;; 3013 <2> $MIF363: 3014 <2> INC CX ;;AN000;; Restore CX 3015 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3016 <2> RET ;;AN000;; 3017 <2> $M_CONVERTDATE ENDP ;;AN000;; 3018 <2> ;; 3019 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3020 <2> %ENDIF ;;AN000;; END of include of DATE replace code 3021 <2> ; 3022 <2> %IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace? 3023 <2> %iassign $M_REPLACE TRUE ;;AN000;; Yes, THEN include it and flag that we will need common 3024 <2> %iassign $M_CHAR_ONLY FALSE ;;AN000;; replacement code later 3025 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3026 <2> ;; 3027 <2> ;; PROC NAME: $M_TIME_REPLACE 3028 <2> ;; 3029 <2> ;; FUNCTION: Convert a time to a decimal ASCII string 3030 <2> ;; and prepare to display 3031 <2> ;; INPUTS: DS:SI points at corresponding SUBLIST 3032 <2> ;; ES:DI points at VALUE from SUBLIST 3033 <2> ;; OUTPUTS: CX contains number of characters on stack 3034 <2> ;; Top of stack --> Last character 3035 <2> ;; . . . 3036 <2> ;; Bot of stack --> First character 3037 <2> ;; REGS USED: BP,CX,AX 3038 <2> ;; 3039 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3040 <2> ;; 3041 <2> $M_TIME_REPLACE PROC NEAR ;;AN000;; 3042 <2> ;; 3043 <2> POP BP ;;AN000;; Save return address 3044 <2> MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 3045 <2> CALL $M_GET_TIME ;;AN000;; All O.K.? 3046 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3047 <2> ; $IF NZ ;;AN000;; Yes, 3048 <2> JZ $MIF365 3049 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3050 <2> ; $IF E ;;AN000;; Yes, 3051 <2> JNE $MIF366 3052 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3053 <2> CMP AL,12 ;;AN000;; Is hour 12 or less? 3054 <2> ; $IF L,OR ;;AN000;; or 3055 <2> JL $MLL367 3056 <2> CMP AL,23 ;;AN000;; Is hour 24 or greater? 3057 <2> ; $IF G ;;AN000;; Yes, 3058 <2> JNG $MIF367 3059 <2> $MLL367: 3060 <2> MOV AL,$M_AM ;;AN000;; 3061 <2> PUSH AX ;;AN000;; Push an "a" to represent AM. 3062 <2> INC CX ;;AN000;; 3063 <2> ; $ELSE ;;AN000;; No, 3064 <2> JMP SHORT $MEN367 3065 <2> $MIF367: 3066 <2> MOV AL,$M_PM ;;AN000;; 3067 <2> PUSH AX ;;AN000;; Push an "p" to represent PM. 3068 <2> INC CX ;;AN000;; 3069 <2> ; $ENDIF ;;AN000;; 3070 <2> $MEN367: 3071 <2> ; $ENDIF ;;AN000;; 3072 <2> $MIF366: 3073 <2> ; $ENDIF ;;AN000;; 3074 <2> $MIF365: 3075 <2> ;; 3076 <2> XOR AX,AX ;;AN000;; 3077 <2> XOR DX,DX ;;AN000;; 3078 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3079 <2> ; $IF NZ ;;AN000;; 3080 <2> JZ $MIF372 3081 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+3] ;;AN000;; Get Hundreds 3082 <2> CALL $M_CONVERTTIME ;;AN000;; 3083 <2> PUSH WORD [$M_RT + $M_DECI_SEPARA] ;;AN000;; 3084 <2> INC CX ;;AN000;; 3085 <2> ; $ENDIF ;;AN000;; 3086 <2> $MIF372: 3087 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSSHH_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? 3088 <2> ; $IF NZ,OR ;;AN000;; 3089 <2> JNZ $MLL374 3090 <2> TEST byte [$M_SL + $M_S_FLAG],Time_HHMMSS_Cty & $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? 3091 <2> ; $IF NZ ;;AN000;; 3092 <2> JZ $MIF374 3093 <2> $MLL374: 3094 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+2] ;;AN000;; Get Seconds 3095 <2> CALL $M_CONVERTTIME ;;AN000;; 3096 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3097 <2> INC CX ;;AN000;; 3098 <2> ; $ENDIF ;;AN000;; 3099 <2> $MIF374: 3100 <2> ;; Do Hour/Min (12 Hour) 3101 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE+1] ;;AN000;; Get Minutes 3102 <2> CALL $M_CONVERTTIME ;;AN000;; 3103 <2> PUSH WORD [$M_RT + $M_TIME_SEPARA] ;;AN000;; 3104 <2> INC CX ;;AN000;; 3105 <2> ;; 3106 <2> MOV AL,BYTE PTR [$M_SL + $M_S_VALUE] ;;AN000;; Get Hours 3107 <2> TEST byte [$M_SL + $M_S_FLAG],Time_Cty_Type & $M_TIME_MASK ;;AN000;; Is this a request for current country info? 3108 <2> ; $IF NZ ;;AN000;; Yes, 3109 <2> JZ $MIF376 3110 <2> CMP BYTE [$M_RT + $M_TIME_FORMAT],0 ;;AN000;; Is the current country format 12 Hour? 3111 <2> ; $IF E ;;AN000;; Yes, 3112 <2> JNE $MIF377 3113 <2> CMP AL,13 ;;AN000;; Is hour less than 12? 3114 <2> ; $IF GE ;;AN000;; Yes, 3115 <2> JNGE $MIF378 3116 <2> SUB AL,12 ;;AN000;; Set to a 12 hour value 3117 <2> ; $ENDIF ;;AN000;; 3118 <2> $MIF378: 3119 <2> CMP AL,0 ;;AN000;; Is hour less than 12? 3120 <2> ; $IF E ;;AN000;; Yes, 3121 <2> JNE $MIF380 3122 <2> MOV AL,12 ;;AN000;; Set to a 12 hour value 3123 <2> ; $ENDIF ;;AN000;; 3124 <2> $MIF380: 3125 <2> ; $ENDIF ;;AN000;; 3126 <2> $MIF377: 3127 <2> ; $ENDIF ;;AN000;; 3128 <2> $MIF376: 3129 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII 3130 <2> ;; 3131 <2> PUSH BP ;;AN000;; Restore return address 3132 <2> RET ;;AN000;; Return 3133 <2> ;; 3134 <2> $M_TIME_REPLACE ENDP ;;AN000;; 3135 <2> ;; 3136 <2> $M_GET_TIME PROC NEAR ;;AN000;; 3137 <2> MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info 3138 <2> MOV AL,0 ;;AN000;; Get current country info 3139 <2> LEA DX,[$M_RT + $M_TEMP_BUF] ;;AN000;; Set up addressibility to buffer 3140 <2> INT 21H ;;AN000;; 3141 <2> ; $IF C ;;AN000;; No, 3142 <2> JNC $MIF384 3143 <2> MOV WORD [$M_RT + $M_TIME_FORMAT],$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH) 3144 <2> MOV BYTE [$M_RT + $M_TIME_SEPARA],$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL) 3145 <2> MOV BYTE [$M_RT + $M_DECI_SEPARA],$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL) 3146 <2> ; $ENDIF ;;AN000;; 3147 <2> $MIF384: 3148 <2> RET ;;AN000;; 3149 <2> $M_GET_TIME ENDP ;;AN000;; 3150 <2> ;; 3151 <2> $M_CONVERTTIME PROC NEAR ;;AN000;; 3152 <2> POP WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3153 <2> MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save the size before conversion 3154 <2> CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string 3155 <2> DEC CX ;;AN000;; Test if size only grew by 1 3156 <2> CMP CL,[$M_RT + $M_SIZE] ;;AN000;; Did size only grow by one 3157 <2> ; $IF E ;;AN000;; Yes, 3158 <2> JNE $MIF386 3159 <2> MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) 3160 <2> PUSH AX ;;AN000;; Save it 3161 <2> INC CX ;;AN000;; Count it 3162 <2> ; $ENDIF ;;AN000;; 3163 <2> $MIF386: 3164 <2> INC CX ;;AN000;; Restore CX 3165 <2> PUSH WORD [$M_RT + $M_TEMP_BUF] ;;AN000;; Save return address 3166 <2> RET ;;AN000;; 3167 <2> $M_CONVERTTIME ENDP ;;AN000;; 3168 <2> ;; 3169 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3170 <2> %ENDIF ;;AN000;; END of include of TIME replace 3171 <2> %ENDIF ;;AN000;; END of include of Replacement common code 3172 <2> ; 3173 <2> %IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace? 3174 <2> INPUTmsg equ FALSE ;;AN000;; Yes, THEN include it and reset the flag 3175 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3176 <2> ;; 3177 <2> ;; PROC NAME: $M_WAIT_FOR_INPUT 3178 <2> ;; 3179 <2> ;; FUNCTION: To accept keyed input and return extended key value 3180 <2> ;; in AX register 3181 <2> ;; INPUTS: DL contains the DOS function requested for input 3182 <2> ;; OUPUTS: AX contains the extended key value that was read 3183 <2> ;; REGS USED: 3184 <2> ;; 3185 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3186 <2> ;; 3187 <2> $M_WAIT_FOR_INPUT PROC NEAR ;;AN000;; 3188 <2> ;; 3189 <2> PUSH CX ;;AN000;; Save CX 3190 <2> PUSH DX ;;AN000;; Save DX 3191 <2> PUSH DS ;;AN000;; Save Data segment 3192 <2> ;; 3193 <2> CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? 3194 <2> ; $IF A ;;AN001;; Yes, 3195 <2> JNA $MIF388 3196 <2> MOV AL,DL ;;AN001;; Mov function into AL 3197 <2> AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble 3198 <2> MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function 3199 <2> ; $ELSE ;;AN001;; No, 3200 <2> JMP SHORT $MEN388 3201 <2> $MIF388: 3202 <2> MOV AH,DL ;;AN000;; Put DOS function in AH 3203 <2> ; $ENDIF ;;AN001;; 3204 <2> $MEN388: 3205 <2> PUSH ES ;;AN000;; Get output buffer segment 3206 <2> POP DS ;;AN000;; 3207 <2> MOV DX,DI ;;AN000;; Get output buffer offset in case needed 3208 <2> INT 21H ;;AN000;; Get keyboard input 3209 <2> POP DS ;;AN000;; 3210 <2> 3211 <2> CMP DL,DOS_BUF_KEYB_INP ;;AN000;; 3212 <2> CLC ;;AN000;; 3213 <2> ; $IF NE ;;AN000;; If character input 3214 <2> JE $MIF391 3215 <2> CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? 3216 <2> ; $IF C ;;AN000;; 3217 <2> JNC $MIF392 3218 <2> MOV CL,AL ;;AN000;; Save first character 3219 <2> MOV AH,DL ;;AN001;; Get back function 3220 <2> INT 21H ;;AN000;; Get keyboard input 3221 <2> MOV AH,CL ;;AN000;; Retreive first character AX = xxxx 3222 <2> CLC ;;AN000;; Clear carry condition 3223 <2> ; $ELSE ;;AN000;; 3224 <2> JMP SHORT $MEN392 3225 <2> $MIF392: 3226 <2> MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS 3227 <2> ; $ENDIF ;;AN000;; 3228 <2> $MEN392: 3229 <2> ; $ENDIF ;;AN000;; 3230 <2> $MIF391: 3231 <2> ;; 3232 <2> ; $IF NC ;;AN000;; 3233 <2> JC $MIF396 3234 <2> POP DX ;;AN000;; 3235 <2> POP CX ;;AN000;; 3236 <2> ; $ELSE ;;AN000;; 3237 <2> JMP SHORT $MEN396 3238 <2> $MIF396: 3239 <2> ADD SP,4 ;;AN000;; 3240 <2> STC ;;AN000;; Reset carry flag 3241 <2> ; $ENDIF ;;AN000;; 3242 <2> $MEN396: 3243 <2> RET ;;AN000;; Return 3244 <2> ;; 3245 <2> $M_WAIT_FOR_INPUT ENDP ;;AN000;; 3246 <2> ;; 3247 <2> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3248 <2> %ENDIF ;;AN000;; END of include of Wait for Input 3249 <2> %ENDIF ;;AN000;; END of include of SYSDISPMSG 3250 <2> %ENDIF ;;AN000;; END of include of MSG_DATA_ONLY 3251 <2> %ENDIF ;;AN000;; END of include of Structure only 3252 <2> 3253 <2> ;=== Pop trace listing source 3254 <2> 437 <1> 438 <1> %ENDIF 439 <1> 20 Msg_Services "FORMAT.CLA","FORMAT.CLB","FORMAT.CLC","FORMAT.CL1","FORMAT.CL2","FORMAT.CTL" 364 <1> %iassign $M_SERVICE FALSE 365 <1> %rep %0 366 <1> %iassign $M_INCLUDE TRUE 367 <1> %iassign MSG_SERVICES_MATCHED 0 368 <1> %ifidni %1, "MSGDATA" 369 <1> %iassign MSGDATA TRUE 370 <1> %iassign $M_SERVICE TRUE 371 <1> %iassign $M_INCLUDE FALSE 372 <1> %iassign MSG_SERVICES_MATCHED 1 373 <1> %else 374 <1> %iassign $M_MSGDATA_ONLY FALSE 375 <1> %endif 376 <1> 377 <1> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <1> 379 <1> %ifidni %1,"COMR" 380 <1> %iassign COMR TRUE 381 <1> %iassign $M_SERVICE TRUE 382 <1> %iassign $M_INCLUDE FALSE 383 <1> %iassign MSG_SERVICES_MATCHED 1 384 <1> %elifidni %1,"COMT" 385 <1> %iassign COMT TRUE 386 <1> %iassign $M_SERVICE TRUE 387 <1> %iassign $M_INCLUDE FALSE 388 <1> %iassign MSG_SERVICES_MATCHED 1 389 <1> %elifidni %1,"SETSTDIO" 390 <1> %iassign SETSTDIO TRUE 391 <1> %iassign $M_SERVICE TRUE 392 <1> %iassign $M_INCLUDE FALSE 393 <1> %iassign MSG_SERVICES_MATCHED 1 394 <1> %elifidni %1,"NOCHECKSTDIN" 395 <1> %iassign NOCHECKSTDIN TRUE 396 <1> %iassign $M_SERVICE TRUE 397 <1> %iassign $M_INCLUDE FALSE 398 <1> %iassign MSG_SERVICES_MATCHED 1 399 <1> %elifidni %1,"NOCHECKSTDOUT" 400 <1> %iassign NOCHECKSTDOUT TRUE 401 <1> %iassign $M_SERVICE TRUE 402 <1> %iassign $M_INCLUDE FALSE 403 <1> %iassign MSG_SERVICES_MATCHED 1 404 <1> %elifidni %1,"DISK_PROC" 405 <1> %iassign DISK_PROC TRUE 406 <1> %iassign $M_SERVICE TRUE 407 <1> %iassign $M_INCLUDE FALSE 408 <1> %iassign MSG_SERVICES_MATCHED 1 409 <1> %endif 410 <1> 411 <1> %IF $M_INCLUDE 412 <1> %define %%string %1 413 <1> %strlen %%length %%string 414 <1> %assign %%ii 1 415 <1> %define %%name "" 416 <1> %rep %%length 417 <1> %substr %%cc %%string %%ii 418 <1> %assign %%ii %%ii + 1 419 <1> %if %%cc >= 'A' && %%cc <= 'Z' 420 <1> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <1> %endif 422 <1> %strcat %%name %%name,%%cc 423 <1> %endrep 424 <1> %ifidni %%name, "format.ctl" 425 <1> 426 <1> %else 427 <1> %include %%name 428 <1> %endif 429 <1> %ENDIF 430 <1> 431 <1> %rotate 1 432 <1> %endrep 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 1 <3> 2 <3> ; ---------------------------------------------------------- 3 <3> 4 <3> PUBLIC $M_CLS_1 5 <3> %IF 1 6 <3> %warning out: ... Including message Class A 6 ****************** <3> warning: out: ... Including message Class A [-w+user] 7 <3> %ENDIF 8 <3> 9 <3> ; ---------------------------------------------------------- 10 <3> 11 <3> $M_CLASS_A_STRUC LABEL BYTE 12 <3> $M_CLASS_ID_size equ $M_CLASS_ID_struc_size ; NASM port equate 13 <3> istruc $M_CLASS_ID 14 <3> at $M_CLS_ID 15 000006CE FF <3> db 0FFH 16 <3> at $M_COMMAND_VER 17 000006CF 0400 <3> dw EXPECTED_VERSION 18 <3> at $M_NUM_CLS_MSG 19 000006D1 14 <3> db Class_A_MessageCount 20 <3> iend 21 <3> 22 <3> ; ---------------------------------------------------------- 23 <3> 24 <3> 25 <3> $M_A_00001H_STRUC LABEL BYTE 26 <3> $M_ID_size equ $M_ID_struc_size ; NASM port equate 27 <3> istruc $M_ID 28 <3> at $M_NUM 29 000006D2 0100 <3> dw 00001H 30 <3> at $M_TXT_PTR 31 000006D4 5000 <3> dw $M_A_00001H_MSG-$M_A_00001H_STRUC 32 <3> iend 33 <3> 34 <3> $M_A_00002H_STRUC LABEL BYTE 35 <3> istruc $M_ID 36 <3> at $M_NUM 37 000006D6 0200 <3> dw 00002H 38 <3> at $M_TXT_PTR 39 000006D8 6400 <3> dw $M_A_00002H_MSG-$M_A_00002H_STRUC 40 <3> iend 41 <3> 42 <3> $M_A_00003H_STRUC LABEL BYTE 43 <3> istruc $M_ID 44 <3> at $M_NUM 45 000006DA 0300 <3> dw 00003H 46 <3> at $M_TXT_PTR 47 000006DC A700 <3> dw $M_A_00003H_MSG-$M_A_00003H_STRUC 48 <3> iend 49 <3> 50 <3> $M_A_00004H_STRUC LABEL BYTE 51 <3> istruc $M_ID 52 <3> at $M_NUM 53 000006DE 0400 <3> dw 00004H 54 <3> at $M_TXT_PTR 55 000006E0 C000 <3> dw $M_A_00004H_MSG-$M_A_00004H_STRUC 56 <3> iend 57 <3> 58 <3> $M_A_00005H_STRUC LABEL BYTE 59 <3> istruc $M_ID 60 <3> at $M_NUM 61 000006E2 0500 <3> dw 00005H 62 <3> at $M_TXT_PTR 63 000006E4 0401 <3> dw $M_A_00005H_MSG-$M_A_00005H_STRUC 64 <3> iend 65 <3> 66 <3> $M_A_00006H_STRUC LABEL BYTE 67 <3> istruc $M_ID 68 <3> at $M_NUM 69 000006E6 0600 <3> dw 00006H 70 <3> at $M_TXT_PTR 71 000006E8 1A01 <3> dw $M_A_00006H_MSG-$M_A_00006H_STRUC 72 <3> iend 73 <3> 74 <3> $M_A_00007H_STRUC LABEL BYTE 75 <3> istruc $M_ID 76 <3> at $M_NUM 77 000006EA 0700 <3> dw 00007H 78 <3> at $M_TXT_PTR 79 000006EC 3201 <3> dw $M_A_00007H_MSG-$M_A_00007H_STRUC 80 <3> iend 81 <3> 82 <3> $M_A_00008H_STRUC LABEL BYTE 83 <3> istruc $M_ID 84 <3> at $M_NUM 85 000006EE 0800 <3> dw 00008H 86 <3> at $M_TXT_PTR 87 000006F0 5201 <3> dw $M_A_00008H_MSG-$M_A_00008H_STRUC 88 <3> iend 89 <3> 90 <3> $M_A_00009H_STRUC LABEL BYTE 91 <3> istruc $M_ID 92 <3> at $M_NUM 93 000006F2 0900 <3> dw 00009H 94 <3> at $M_TXT_PTR 95 000006F4 6801 <3> dw $M_A_00009H_MSG-$M_A_00009H_STRUC 96 <3> iend 97 <3> 98 <3> $M_A_0000AH_STRUC LABEL BYTE 99 <3> istruc $M_ID 100 <3> at $M_NUM 101 000006F6 0A00 <3> dw 0000AH 102 <3> at $M_TXT_PTR 103 000006F8 8701 <3> dw $M_A_0000AH_MSG-$M_A_0000AH_STRUC 104 <3> iend 105 <3> 106 <3> $M_A_0000BH_STRUC LABEL BYTE 107 <3> istruc $M_ID 108 <3> at $M_NUM 109 000006FA 0B00 <3> dw 0000BH 110 <3> at $M_TXT_PTR 111 000006FC B201 <3> dw $M_A_0000BH_MSG-$M_A_0000BH_STRUC 112 <3> iend 113 <3> 114 <3> $M_A_0000CH_STRUC LABEL BYTE 115 <3> istruc $M_ID 116 <3> at $M_NUM 117 000006FE 0C00 <3> dw 0000CH 118 <3> at $M_TXT_PTR 119 00000700 D301 <3> dw $M_A_0000CH_MSG-$M_A_0000CH_STRUC 120 <3> iend 121 <3> 122 <3> $M_A_0000DH_STRUC LABEL BYTE 123 <3> istruc $M_ID 124 <3> at $M_NUM 125 00000702 0D00 <3> dw 0000DH 126 <3> at $M_TXT_PTR 127 00000704 FF01 <3> dw $M_A_0000DH_MSG-$M_A_0000DH_STRUC 128 <3> iend 129 <3> 130 <3> $M_A_0000EH_STRUC LABEL BYTE 131 <3> istruc $M_ID 132 <3> at $M_NUM 133 00000706 0E00 <3> dw 0000EH 134 <3> at $M_TXT_PTR 135 00000708 1B02 <3> dw $M_A_0000EH_MSG-$M_A_0000EH_STRUC 136 <3> iend 137 <3> 138 <3> $M_A_0000FH_STRUC LABEL BYTE 139 <3> istruc $M_ID 140 <3> at $M_NUM 141 0000070A 0F00 <3> dw 0000FH 142 <3> at $M_TXT_PTR 143 0000070C 3702 <3> dw $M_A_0000FH_MSG-$M_A_0000FH_STRUC 144 <3> iend 145 <3> 146 <3> $M_A_00010H_STRUC LABEL BYTE 147 <3> istruc $M_ID 148 <3> at $M_NUM 149 0000070E 1000 <3> dw 00010H 150 <3> at $M_TXT_PTR 151 00000710 5302 <3> dw $M_A_00010H_MSG-$M_A_00010H_STRUC 152 <3> iend 153 <3> 154 <3> $M_A_00011H_STRUC LABEL BYTE 155 <3> istruc $M_ID 156 <3> at $M_NUM 157 00000712 1100 <3> dw 00011H 158 <3> at $M_TXT_PTR 159 00000714 6A02 <3> dw $M_A_00011H_MSG-$M_A_00011H_STRUC 160 <3> iend 161 <3> 162 <3> $M_A_00012H_STRUC LABEL BYTE 163 <3> istruc $M_ID 164 <3> at $M_NUM 165 00000716 1200 <3> dw 00012H 166 <3> at $M_TXT_PTR 167 00000718 9602 <3> dw $M_A_00012H_MSG-$M_A_00012H_STRUC 168 <3> iend 169 <3> 170 <3> $M_A_00013H_STRUC LABEL BYTE 171 <3> istruc $M_ID 172 <3> at $M_NUM 173 0000071A 1300 <3> dw 00013H 174 <3> at $M_TXT_PTR 175 0000071C AE02 <3> dw $M_A_00013H_MSG-$M_A_00013H_STRUC 176 <3> iend 177 <3> 178 <3> $M_A_00014H_STRUC LABEL BYTE 179 <3> istruc $M_ID 180 <3> at $M_NUM 181 0000071E 1400 <3> dw 00014H 182 <3> at $M_TXT_PTR 183 00000720 CB02 <3> dw $M_A_00014H_MSG-$M_A_00014H_STRUC 184 <3> iend 185 <3> 186 <3> ; ---------------------------------------------------------- 187 <3> 188 <3> 189 <3> $M_A_00001H_MSG LABEL BYTE 190 00000722 17 <3> DB $M_A_00001H_END-$M_A_00001H_MSG-1 191 00000723 496E636F7272656374- <3> DB "Incorrect DOS version",CR,LF 191 0000072C 20444F532076657273- <3> 191 00000735 696F6E0D0A <3> 192 <3> $M_A_00001H_END LABEL BYTE 193 <3> 194 <3> $M_A_00002H_MSG LABEL BYTE 195 0000073A 46 <3> DB $M_A_00002H_END-$M_A_00002H_MSG-1 196 0000073B 0D2531207065726365- <3> DB CR,"%1 percent of disk formatted ",CR 196 00000744 6E74206F6620646973- <3> 196 0000074D 6B20666F726D617474- <3> 196 00000756 656420202020202020- <3> 196 0000075F 202020202020202020- <3> 196 00000768 202020202020202020- <3> 196 00000771 202020202020202020- <3> 196 0000077A 2020202020200D <3> 197 <3> $M_A_00002H_END LABEL BYTE 198 <3> 199 <3> $M_A_00003H_MSG LABEL BYTE 200 00000781 1C <3> DB $M_A_00003H_END-$M_A_00003H_MSG-1 201 00000782 253120627974657320- <3> DB "%1 bytes available on disk",CR,LF 201 0000078B 617661696C61626C65- <3> 201 00000794 206F6E206469736B0D- <3> 201 0000079D 0A <3> 202 <3> $M_A_00003H_END LABEL BYTE 203 <3> 204 <3> $M_A_00004H_MSG LABEL BYTE 205 0000079E 47 <3> DB $M_A_00004H_END-$M_A_00004H_MSG-1 206 0000079F 0D466F726D61742063- <3> DB CR,"Format complete ",CR,LF 206 000007A8 6F6D706C6574652020- <3> 206 000007B1 202020202020202020- <3> 206 000007BA 202020202020202020- <3> 206 000007C3 202020202020202020- <3> 206 000007CC 202020202020202020- <3> 206 000007D5 202020202020202020- <3> 206 000007DE 2020202020200D0A <3> 207 <3> $M_A_00004H_END LABEL BYTE 208 <3> 209 <3> $M_A_00005H_MSG LABEL BYTE 210 000007E6 19 <3> DB $M_A_00005H_END-$M_A_00005H_MSG-1 211 000007E7 253120627974657320- <3> DB "%1 bytes in bad sectors",CR,LF 211 000007F0 696E20626164207365- <3> 211 000007F9 63746F72730D0A <3> 212 <3> $M_A_00005H_END LABEL BYTE 213 <3> 214 <3> $M_A_00006H_MSG LABEL BYTE 215 00000800 1B <3> DB $M_A_00006H_END-$M_A_00006H_MSG-1 216 00000801 253120627974657320- <3> DB "%1 bytes total disk space",CR,LF 216 0000080A 746F74616C20646973- <3> 216 00000813 6B2073706163650D0A <3> 217 <3> $M_A_00006H_END LABEL BYTE 218 <3> 219 <3> $M_A_00007H_MSG LABEL BYTE 220 0000081C 23 <3> DB $M_A_00007H_END-$M_A_00007H_MSG-1 221 0000081D 496E73657274206E65- <3> DB "Insert new diskette for drive %1:",CR,LF 221 00000826 77206469736B657474- <3> 221 0000082F 6520666F7220647269- <3> 221 00000838 76652025313A0D0A <3> 222 <3> $M_A_00007H_END LABEL BYTE 223 <3> 224 <3> $M_A_00008H_MSG LABEL BYTE 225 00000840 19 <3> DB $M_A_00008H_END-$M_A_00008H_MSG-1 226 00000841 253120627974657320- <3> DB "%1 bytes used by system",CR,LF 226 0000084A 757365642062792073- <3> 226 00000853 797374656D0D0A <3> 227 <3> $M_A_00008H_END LABEL BYTE 228 <3> 229 <3> $M_A_00009H_MSG LABEL BYTE 230 0000085A 22 <3> DB $M_A_00009H_END-$M_A_00009H_MSG-1 231 0000085B 52652D696E73657274- <3> DB "Re-insert diskette for drive %1:",CR,LF 231 00000864 206469736B65747465- <3> 231 0000086D 20666F722064726976- <3> 231 00000876 652025313A0D0A <3> 232 <3> $M_A_00009H_END LABEL BYTE 233 <3> 234 <3> $M_A_0000AH_MSG LABEL BYTE 235 0000087D 2E <3> DB $M_A_0000AH_END-$M_A_0000AH_MSG-1 236 0000087E 566F6C756D65206C61- <3> DB "Volume label (11 characters, ENTER for none)? " 236 00000887 62656C202831312063- <3> 236 00000890 686172616374657273- <3> 236 00000899 2C20454E5445522066- <3> 236 000008A2 6F72206E6F6E65293F- <3> 236 000008AB 20 <3> 237 <3> $M_A_0000AH_END LABEL BYTE 238 <3> 239 <3> $M_A_0000BH_MSG LABEL BYTE 240 000008AC 24 <3> DB $M_A_0000BH_END-$M_A_0000BH_MSG-1 241 000008AD 0D466F726D6174206E- <3> DB CR,"Format not supported on drive %1:", CR,LF 241 000008B6 6F7420737570706F72- <3> 241 000008BF 746564206F6E206472- <3> 241 000008C8 6976652025313A0D0A <3> 242 <3> $M_A_0000BH_END LABEL BYTE 243 <3> 244 <3> $M_A_0000CH_MSG LABEL BYTE 245 000008D1 2F <3> DB $M_A_0000CH_END-$M_A_0000CH_MSG-1 246 000008D2 0D496E76616C696420- <3> DB CR,"Invalid device parameters from device driver",CR,LF 246 000008DB 646576696365207061- <3> 246 000008E4 72616D657465727320- <3> 246 000008ED 66726F6D2064657669- <3> 246 000008F6 636520647269766572- <3> 246 000008FF 0D0A <3> 247 <3> $M_A_0000CH_END LABEL BYTE 248 <3> 249 <3> $M_A_0000DH_MSG LABEL BYTE 250 00000901 1F <3> DB $M_A_0000DH_END-$M_A_0000DH_MSG-1 251 00000902 0D4572726F7220696E- <3> DB CR,"Error in IOCTL call ",CR,LF 251 0000090B 20494F43544C206361- <3> 251 00000914 6C6C20202020202020- <3> 251 0000091D 20200D0A <3> 252 <3> $M_A_0000DH_END LABEL BYTE 253 <3> 254 <3> $M_A_0000EH_MSG LABEL BYTE 255 00000921 1F <3> DB $M_A_0000EH_END-$M_A_0000EH_MSG-1 256 00000922 0D4E6F74206120626C- <3> DB CR,"Not a block device ",CR,LF 256 0000092B 6F636B206465766963- <3> 256 00000934 652020202020202020- <3> 256 0000093D 20200D0A <3> 257 <3> $M_A_0000EH_END LABEL BYTE 258 <3> 259 <3> $M_A_0000FH_MSG LABEL BYTE 260 00000941 1F <3> DB $M_A_0000FH_END-$M_A_0000FH_MSG-1 261 00000942 0D4572726F72207772- <3> DB CR,"Error writing FAT ",CR,LF 261 0000094B 6974696E6720464154- <3> 261 00000954 202020202020202020- <3> 261 0000095D 20200D0A <3> 262 <3> $M_A_0000FH_END LABEL BYTE 263 <3> 264 <3> $M_A_00010H_MSG LABEL BYTE 265 00000961 1A <3> DB $M_A_00010H_END-$M_A_00010H_MSG-1 266 00000962 0D4572726F72207772- <3> DB CR,"Error writing directory",CR,LF 266 0000096B 6974696E6720646972- <3> 266 00000974 6563746F72790D0A <3> 267 <3> $M_A_00010H_END LABEL BYTE 268 <3> 269 <3> $M_A_00011H_MSG LABEL BYTE 270 0000097C 2F <3> DB $M_A_00011H_END-$M_A_00011H_MSG-1 271 0000097D 0D43616E6E6F742066- <3> DB CR,"Cannot format an ASSIGNed or SUBSTed drive. ",CR,LF 271 00000986 6F726D617420616E20- <3> 271 0000098F 41535349474E656420- <3> 271 00000998 6F7220535542535465- <3> 271 000009A1 642064726976652E20- <3> 271 000009AA 0D0A <3> 272 <3> $M_A_00011H_END LABEL BYTE 273 <3> 274 <3> $M_A_00012H_MSG LABEL BYTE 275 000009AC 1B <3> DB $M_A_00012H_END-$M_A_00012H_MSG-1 276 000009AD 0D43616E6E6F742066- <3> DB CR,"Cannot find System Files",CR,LF 276 000009B6 696E64205379737465- <3> 276 000009BF 6D2046696C65730D0A <3> 277 <3> $M_A_00012H_END LABEL BYTE 278 <3> 279 <3> $M_A_00013H_MSG LABEL BYTE 280 000009C8 20 <3> DB $M_A_00013H_END-$M_A_00013H_MSG-1 281 000009C9 0D43616E6E6F742046- <3> DB CR,"Cannot FORMAT a network drive",CR,LF 281 000009D2 4F524D41542061206E- <3> 281 000009DB 6574776F726B206472- <3> 281 000009E4 6976650D0A <3> 282 <3> $M_A_00013H_END LABEL BYTE 283 <3> 284 <3> $M_A_00014H_MSG LABEL BYTE 285 000009E9 24 <3> DB $M_A_00014H_END-$M_A_00014H_MSG-1 286 000009EA 496E76616C69642063- <3> DB "Invalid characters in volume label",CR,LF 286 000009F3 686172616374657273- <3> 286 000009FC 20696E20766F6C756D- <3> 286 00000A05 65206C6162656C0D0A <3> 287 <3> $M_A_00014H_END LABEL BYTE 288 <3> 289 <3> ; ---------------------------------------------------------- 290 <3> 291 <3> Class_A_MessageCount EQU 20 292 <3> 293 <3> ; ---------------------------------------------------------- 294 <3> 295 <3> %IF FARmsg 296 <3> $M_CLS_1 PROC FAR 297 <3> %ELSE 298 <3> $M_CLS_1 PROC NEAR 299 <3> %ENDIF 300 <3> 301 00000A0E 0E <3> PUSH CS 302 00000A0F 07 <3> POP ES 303 00000A10 8D3E[CE06] <3> LEA DI,[$M_CLASS_A_STRUC] 304 00000A14 81C14603 <3> ADD CX,$-$M_CLASS_A_STRUC 305 00000A18 C3 <3> RET 306 <3> 307 <3> $M_CLS_1 ENDP 308 <3> 309 <3> ; ---------------------------------------------------------- 310 <3> 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 1 <3> 2 <3> ; ---------------------------------------------------------- 3 <3> 4 <3> PUBLIC $M_CLS_2 5 <3> %IF 1 6 <3> %warning out: ... Including message Class B 6 ****************** <3> warning: out: ... Including message Class B [-w+user] 7 <3> %ENDIF 8 <3> 9 <3> ; ---------------------------------------------------------- 10 <3> 11 <3> $M_CLASS_B_STRUC LABEL BYTE 12 <3> istruc $M_CLASS_ID 13 <3> at $M_CLS_ID 14 00000A19 FF <3> db 0FFH 15 <3> at $M_COMMAND_VER 16 00000A1A 0400 <3> dw EXPECTED_VERSION 17 <3> at $M_NUM_CLS_MSG 18 00000A1C 12 <3> db Class_B_MessageCount 19 <3> iend 20 <3> 21 <3> ; ---------------------------------------------------------- 22 <3> 23 <3> 24 <3> $M_B_00015H_STRUC LABEL BYTE 25 <3> istruc $M_ID 26 <3> at $M_NUM 27 00000A1D 1500 <3> dw 00015H 28 <3> at $M_TXT_PTR 29 00000A1F 4800 <3> dw $M_B_00015H_MSG-$M_B_00015H_STRUC 30 <3> iend 31 <3> 32 <3> $M_B_00016H_STRUC LABEL BYTE 33 <3> istruc $M_ID 34 <3> at $M_NUM 35 00000A21 1600 <3> dw 00016H 36 <3> at $M_TXT_PTR 37 00000A23 6000 <3> dw $M_B_00016H_MSG-$M_B_00016H_STRUC 38 <3> iend 39 <3> 40 <3> $M_B_00017H_STRUC LABEL BYTE 41 <3> istruc $M_ID 42 <3> at $M_NUM 43 00000A25 1700 <3> dw 00017H 44 <3> at $M_TXT_PTR 45 00000A27 A400 <3> dw $M_B_00017H_MSG-$M_B_00017H_STRUC 46 <3> iend 47 <3> 48 <3> $M_B_00018H_STRUC LABEL BYTE 49 <3> istruc $M_ID 50 <3> at $M_NUM 51 00000A29 1800 <3> dw 00018H 52 <3> at $M_TXT_PTR 53 00000A2B C300 <3> dw $M_B_00018H_MSG-$M_B_00018H_STRUC 54 <3> iend 55 <3> 56 <3> $M_B_00019H_STRUC LABEL BYTE 57 <3> istruc $M_ID 58 <3> at $M_NUM 59 00000A2D 1900 <3> dw 00019H 60 <3> at $M_TXT_PTR 61 00000A2F EF00 <3> dw $M_B_00019H_MSG-$M_B_00019H_STRUC 62 <3> iend 63 <3> 64 <3> $M_B_0001AH_STRUC LABEL BYTE 65 <3> istruc $M_ID 66 <3> at $M_NUM 67 00000A31 1A00 <3> dw 0001AH 68 <3> at $M_TXT_PTR 69 00000A33 1B01 <3> dw $M_B_0001AH_MSG-$M_B_0001AH_STRUC 70 <3> iend 71 <3> 72 <3> $M_B_0001BH_STRUC LABEL BYTE 73 <3> istruc $M_ID 74 <3> at $M_NUM 75 00000A35 1B00 <3> dw 0001BH 76 <3> at $M_TXT_PTR 77 00000A37 3201 <3> dw $M_B_0001BH_MSG-$M_B_0001BH_STRUC 78 <3> iend 79 <3> 80 <3> $M_B_0001CH_STRUC LABEL BYTE 81 <3> istruc $M_ID 82 <3> at $M_NUM 83 00000A39 1C00 <3> dw 0001CH 84 <3> at $M_TXT_PTR 85 00000A3B 4A01 <3> dw $M_B_0001CH_MSG-$M_B_0001CH_STRUC 86 <3> iend 87 <3> 88 <3> $M_B_0001DH_STRUC LABEL BYTE 89 <3> istruc $M_ID 90 <3> at $M_NUM 91 00000A3D 1D00 <3> dw 0001DH 92 <3> at $M_TXT_PTR 93 00000A3F 6501 <3> dw $M_B_0001DH_MSG-$M_B_0001DH_STRUC 94 <3> iend 95 <3> 96 <3> $M_B_0001EH_STRUC LABEL BYTE 97 <3> istruc $M_ID 98 <3> at $M_NUM 99 00000A41 1E00 <3> dw 0001EH 100 <3> at $M_TXT_PTR 101 00000A43 9101 <3> dw $M_B_0001EH_MSG-$M_B_0001EH_STRUC 102 <3> iend 103 <3> 104 <3> $M_B_0001FH_STRUC LABEL BYTE 105 <3> istruc $M_ID 106 <3> at $M_NUM 107 00000A45 1F00 <3> dw 0001FH 108 <3> at $M_TXT_PTR 109 00000A47 A201 <3> dw $M_B_0001FH_MSG-$M_B_0001FH_STRUC 110 <3> iend 111 <3> 112 <3> $M_B_00020H_STRUC LABEL BYTE 113 <3> istruc $M_ID 114 <3> at $M_NUM 115 00000A49 2000 <3> dw 00020H 116 <3> at $M_TXT_PTR 117 00000A4B C901 <3> dw $M_B_00020H_MSG-$M_B_00020H_STRUC 118 <3> iend 119 <3> 120 <3> $M_B_00023H_STRUC LABEL BYTE 121 <3> istruc $M_ID 122 <3> at $M_NUM 123 00000A4D 2300 <3> dw 00023H 124 <3> at $M_TXT_PTR 125 00000A4F F301 <3> dw $M_B_00023H_MSG-$M_B_00023H_STRUC 126 <3> iend 127 <3> 128 <3> $M_B_00024H_STRUC LABEL BYTE 129 <3> istruc $M_ID 130 <3> at $M_NUM 131 00000A51 2400 <3> dw 00024H 132 <3> at $M_TXT_PTR 133 00000A53 1002 <3> dw $M_B_00024H_MSG-$M_B_00024H_STRUC 134 <3> iend 135 <3> 136 <3> $M_B_00025H_STRUC LABEL BYTE 137 <3> istruc $M_ID 138 <3> at $M_NUM 139 00000A55 2500 <3> dw 00025H 140 <3> at $M_TXT_PTR 141 00000A57 2C02 <3> dw $M_B_00025H_MSG-$M_B_00025H_STRUC 142 <3> iend 143 <3> 144 <3> $M_B_00026H_STRUC LABEL BYTE 145 <3> istruc $M_ID 146 <3> at $M_NUM 147 00000A59 2600 <3> dw 00026H 148 <3> at $M_TXT_PTR 149 00000A5B 3902 <3> dw $M_B_00026H_MSG-$M_B_00026H_STRUC 150 <3> iend 151 <3> 152 <3> $M_B_00027H_STRUC LABEL BYTE 153 <3> istruc $M_ID 154 <3> at $M_NUM 155 00000A5D 2700 <3> dw 00027H 156 <3> at $M_TXT_PTR 157 00000A5F 5902 <3> dw $M_B_00027H_MSG-$M_B_00027H_STRUC 158 <3> iend 159 <3> 160 <3> $M_B_00028H_STRUC LABEL BYTE 161 <3> istruc $M_ID 162 <3> at $M_NUM 163 00000A61 2800 <3> dw 00028H 164 <3> at $M_TXT_PTR 165 00000A63 7602 <3> dw $M_B_00028H_MSG-$M_B_00028H_STRUC 166 <3> iend 167 <3> 168 <3> ; ---------------------------------------------------------- 169 <3> 170 <3> 171 <3> $M_B_00015H_MSG LABEL BYTE 172 00000A65 1B <3> DB $M_B_00015H_END-$M_B_00015H_MSG-1 173 00000A66 0D506172616D657465- <3> DB CR,"Parameters not supported",CR,LF 173 00000A6F 7273206E6F74207375- <3> 173 00000A78 70706F727465640D0A <3> 174 <3> $M_B_00015H_END LABEL BYTE 175 <3> 176 <3> $M_B_00016H_MSG LABEL BYTE 177 00000A81 47 <3> DB $M_B_00016H_END-$M_B_00016H_MSG-1 178 00000A82 0D466F726D61742074- <3> DB CR,"Format terminated ",CR,LF 178 00000A8B 65726D696E61746564- <3> 178 00000A94 202020202020202020- <3> 178 00000A9D 202020202020202020- <3> 178 00000AA6 202020202020202020- <3> 178 00000AAF 202020202020202020- <3> 178 00000AB8 202020202020202020- <3> 178 00000AC1 2020202020200D0A <3> 179 <3> $M_B_00016H_END LABEL BYTE 180 <3> 181 <3> $M_B_00017H_MSG LABEL BYTE 182 00000AC9 22 <3> DB $M_B_00017H_END-$M_B_00017H_MSG-1 183 00000ACA 0D4469736B20756E73- <3> DB CR,"Disk unsuitable for system disk",CR,LF 183 00000AD3 75697461626C652066- <3> 183 00000ADC 6F722073797374656D- <3> 183 00000AE5 206469736B0D0A <3> 184 <3> $M_B_00017H_END LABEL BYTE 185 <3> 186 <3> $M_B_00018H_MSG LABEL BYTE 187 00000AEC 2F <3> DB $M_B_00018H_END-$M_B_00018H_MSG-1 188 00000AED 0D496E76616C696420- <3> DB CR,"Invalid media or Track 0 bad - disk unusable",CR,LF 188 00000AF6 6D65646961206F7220- <3> 188 00000AFF 547261636B20302062- <3> 188 00000B08 6164202D206469736B- <3> 188 00000B11 20756E757361626C65- <3> 188 00000B1A 0D0A <3> 189 <3> $M_B_00018H_END LABEL BYTE 190 <3> 191 <3> $M_B_00019H_MSG LABEL BYTE 192 00000B1C 2F <3> DB $M_B_00019H_END-$M_B_00019H_MSG-1 193 00000B1D 0D556E61626C652074- <3> DB CR,"Unable to write BOOT ",CR,LF 193 00000B26 6F2077726974652042- <3> 193 00000B2F 4F4F54202020202020- <3> 193 00000B38 202020202020202020- <3> 193 00000B41 202020202020202020- <3> 193 00000B4A 0D0A <3> 194 <3> $M_B_00019H_END LABEL BYTE 195 <3> 196 <3> $M_B_0001AH_MSG LABEL BYTE 197 00000B4C 1A <3> DB $M_B_0001AH_END-$M_B_0001AH_MSG-1 198 00000B4D 0D4572726F72207265- <3> DB CR,"Error reading directory",CR,LF 198 00000B56 6164696E6720646972- <3> 198 00000B5F 6563746F72790D0A <3> 199 <3> $M_B_0001AH_END LABEL BYTE 200 <3> 201 <3> $M_B_0001BH_MSG LABEL BYTE 202 00000B67 1B <3> DB $M_B_0001BH_END-$M_B_0001BH_MSG-1 203 00000B68 4E6F20746172676574- <3> DB "No target drive specified",CR,LF 203 00000B71 206472697665207370- <3> 203 00000B7A 656369666965640D0A <3> 204 <3> $M_B_0001BH_END LABEL BYTE 205 <3> 206 <3> $M_B_0001CH_MSG LABEL BYTE 207 00000B83 1E <3> DB $M_B_0001CH_END-$M_B_0001CH_MSG-1 208 00000B84 0D616E642070726573- <3> DB CR,"and press ENTER when ready..." 208 00000B8D 7320454E5445522077- <3> 208 00000B96 68656E207265616479- <3> 208 00000B9F 2E2E2E <3> 209 <3> $M_B_0001CH_END LABEL BYTE 210 <3> 211 <3> $M_B_0001DH_MSG LABEL BYTE 212 00000BA2 2F <3> DB $M_B_0001DH_END-$M_B_0001DH_MSG-1 213 00000BA3 0D496E76616C696420- <3> DB CR,"Invalid Volume ID ",CR,LF 213 00000BAC 566F6C756D65204944- <3> 213 00000BB5 202020202020202020- <3> 213 00000BBE 202020202020202020- <3> 213 00000BC7 202020202020202020- <3> 213 00000BD0 0D0A <3> 214 <3> $M_B_0001DH_END LABEL BYTE 215 <3> 216 <3> $M_B_0001EH_MSG LABEL BYTE 217 00000BD2 14 <3> DB $M_B_0001EH_END-$M_B_0001EH_MSG-1 218 00000BD3 53797374656D207472- <3> DB "System transferred",CR,LF 218 00000BDC 616E73666572726564- <3> 218 00000BE5 0D0A <3> 219 <3> $M_B_0001EH_END LABEL BYTE 220 <3> 221 <3> $M_B_0001FH_MSG LABEL BYTE 222 00000BE7 2A <3> DB $M_B_0001FH_END-$M_B_0001FH_MSG-1 223 00000BE8 0D456E746572206375- <3> DB CR,"Enter current volume label for drive %1: " 223 00000BF1 7272656E7420766F6C- <3> 223 00000BFA 756D65206C6162656C- <3> 223 00000C03 20666F722064726976- <3> 223 00000C0C 652025313A20 <3> 224 <3> $M_B_0001FH_END LABEL BYTE 225 <3> 226 <3> $M_B_00020H_MSG LABEL BYTE 227 00000C12 2D <3> DB $M_B_00020H_END-$M_B_00020H_MSG-1 228 00000C13 0D506172616D657465- <3> DB CR,"Parameters not compatible",CR,LF,"with fixed disk",CR,LF 228 00000C1C 7273206E6F7420636F- <3> 228 00000C25 6D70617469626C650D- <3> 228 00000C2E 0A7769746820666978- <3> 228 00000C37 6564206469736B0D0A <3> 229 <3> $M_B_00020H_END LABEL BYTE 230 <3> 231 <3> $M_B_00023H_MSG LABEL BYTE 232 00000C40 20 <3> DB $M_B_00023H_END-$M_B_00023H_MSG-1 233 00000C41 0D4572726F72207265- <3> DB CR,"Error reading partition table",CR,LF 233 00000C4A 6164696E6720706172- <3> 233 00000C53 746974696F6E207461- <3> 233 00000C5C 626C650D0A <3> 234 <3> $M_B_00023H_END LABEL BYTE 235 <3> 236 <3> $M_B_00024H_MSG LABEL BYTE 237 00000C61 1F <3> DB $M_B_00024H_END-$M_B_00024H_MSG-1 238 00000C62 566F6C756D65205365- <3> DB "Volume Serial Number is %1-%2",CR,LF 238 00000C6B 7269616C204E756D62- <3> 238 00000C74 65722069732025312D- <3> 238 00000C7D 25320D0A <3> 239 <3> $M_B_00024H_END LABEL BYTE 240 <3> 241 <3> $M_B_00025H_MSG LABEL BYTE 242 00000C81 10 <3> DB $M_B_00025H_END-$M_B_00025H_MSG-1 243 00000C82 0D466F726D61742062- <3> DB CR,"Format broken",CR,LF 243 00000C8B 726F6B656E0D0A <3> 244 <3> $M_B_00025H_END LABEL BYTE 245 <3> 246 <3> $M_B_00026H_MSG LABEL BYTE 247 00000C92 23 <3> DB $M_B_00026H_END-$M_B_00026H_MSG-1 248 00000C93 0D466F726D6174206E- <3> DB CR,"Format not available on drive %1",CR,LF 248 00000C9C 6F7420617661696C61- <3> 248 00000CA5 626C65206F6E206472- <3> 248 00000CAE 6976652025310D0A <3> 249 <3> $M_B_00026H_END LABEL BYTE 250 <3> 251 <3> $M_B_00027H_MSG LABEL BYTE 252 00000CB6 20 <3> DB $M_B_00027H_END-$M_B_00027H_MSG-1 253 00000CB7 0D4E6F6E2D53797374- <3> DB CR,"Non-System disk or disk error",CR,LF 253 00000CC0 656D206469736B206F- <3> 253 00000CC9 72206469736B206572- <3> 253 00000CD2 726F720D0A <3> 254 <3> $M_B_00027H_END LABEL BYTE 255 <3> 256 <3> $M_B_00028H_MSG LABEL BYTE 257 00000CD7 1E <3> DB $M_B_00028H_END-$M_B_00028H_MSG-1 258 00000CD8 0D4261642050617274- <3> DB CR,"Bad Partition Table ",CR,LF 258 00000CE1 6974696F6E20546162- <3> 258 00000CEA 6C6520202020202020- <3> 258 00000CF3 200D0A <3> 259 <3> $M_B_00028H_END LABEL BYTE 260 <3> 261 <3> ; ---------------------------------------------------------- 262 <3> 263 <3> Class_B_MessageCount EQU 18 264 <3> 265 <3> ; ---------------------------------------------------------- 266 <3> 267 <3> %IF FARmsg 268 <3> $M_CLS_2 PROC FAR 269 <3> %ELSE 270 <3> $M_CLS_2 PROC NEAR 271 <3> %ENDIF 272 <3> 273 00000CF6 0E <3> PUSH CS 274 00000CF7 07 <3> POP ES 275 00000CF8 8D3E[190A] <3> LEA DI,[$M_CLASS_B_STRUC] 276 00000CFC 81C1E302 <3> ADD CX,$-$M_CLASS_B_STRUC 277 00000D00 C3 <3> RET 278 <3> 279 <3> $M_CLS_2 ENDP 280 <3> 281 <3> ; ---------------------------------------------------------- 282 <3> 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 1 <3> 2 <3> ; ---------------------------------------------------------- 3 <3> 4 <3> PUBLIC $M_CLS_3 5 <3> %IF 1 6 <3> %warning out: ... Including message Class C 6 ****************** <3> warning: out: ... Including message Class C [-w+user] 7 <3> %ENDIF 8 <3> 9 <3> ; ---------------------------------------------------------- 10 <3> 11 <3> $M_CLASS_C_STRUC LABEL BYTE 12 <3> istruc $M_CLASS_ID 13 <3> at $M_CLS_ID 14 00000D01 FF <3> db 0FFH 15 <3> at $M_COMMAND_VER 16 00000D02 0400 <3> dw EXPECTED_VERSION 17 <3> at $M_NUM_CLS_MSG 18 00000D04 0F <3> db Class_C_MessageCount 19 <3> iend 20 <3> 21 <3> ; ---------------------------------------------------------- 22 <3> 23 <3> 24 <3> $M_C_00029H_STRUC LABEL BYTE 25 <3> istruc $M_ID 26 <3> at $M_NUM 27 00000D05 2900 <3> dw 00029H 28 <3> at $M_TXT_PTR 29 00000D07 3C00 <3> dw $M_C_00029H_MSG-$M_C_00029H_STRUC 30 <3> iend 31 <3> 32 <3> $M_C_0002AH_STRUC LABEL BYTE 33 <3> istruc $M_ID 34 <3> at $M_NUM 35 00000D09 2A00 <3> dw 0002AH 36 <3> at $M_TXT_PTR 37 00000D0B 5D00 <3> dw $M_C_0002AH_MSG-$M_C_0002AH_STRUC 38 <3> iend 39 <3> 40 <3> $M_C_0002BH_STRUC LABEL BYTE 41 <3> istruc $M_ID 42 <3> at $M_NUM 43 00000D0D 2B00 <3> dw 0002BH 44 <3> at $M_TXT_PTR 45 00000D0F 5C00 <3> dw $M_C_0002BH_MSG-$M_C_0002BH_STRUC 46 <3> iend 47 <3> 48 <3> $M_C_0002CH_STRUC LABEL BYTE 49 <3> istruc $M_ID 50 <3> at $M_NUM 51 00000D11 2C00 <3> dw 0002CH 52 <3> at $M_TXT_PTR 53 00000D13 5C00 <3> dw $M_C_0002CH_MSG-$M_C_0002CH_STRUC 54 <3> iend 55 <3> 56 <3> $M_C_0002DH_STRUC LABEL BYTE 57 <3> istruc $M_ID 58 <3> at $M_NUM 59 00000D15 2D00 <3> dw 0002DH 60 <3> at $M_TXT_PTR 61 00000D17 7800 <3> dw $M_C_0002DH_MSG-$M_C_0002DH_STRUC 62 <3> iend 63 <3> 64 <3> $M_C_0002EH_STRUC LABEL BYTE 65 <3> istruc $M_ID 66 <3> at $M_NUM 67 00000D19 2E00 <3> dw 0002EH 68 <3> at $M_TXT_PTR 69 00000D1B D300 <3> dw $M_C_0002EH_MSG-$M_C_0002EH_STRUC 70 <3> iend 71 <3> 72 <3> $M_C_0002FH_STRUC LABEL BYTE 73 <3> istruc $M_ID 74 <3> at $M_NUM 75 00000D1D 2F00 <3> dw 0002FH 76 <3> at $M_TXT_PTR 77 00000D1F E600 <3> dw $M_C_0002FH_MSG-$M_C_0002FH_STRUC 78 <3> iend 79 <3> 80 <3> $M_C_00030H_STRUC LABEL BYTE 81 <3> istruc $M_ID 82 <3> at $M_NUM 83 00000D21 3000 <3> dw 00030H 84 <3> at $M_TXT_PTR 85 00000D23 0301 <3> dw $M_C_00030H_MSG-$M_C_00030H_STRUC 86 <3> iend 87 <3> 88 <3> $M_C_00031H_STRUC LABEL BYTE 89 <3> istruc $M_ID 90 <3> at $M_NUM 91 00000D25 3100 <3> dw 00031H 92 <3> at $M_TXT_PTR 93 00000D27 2001 <3> dw $M_C_00031H_MSG-$M_C_00031H_STRUC 94 <3> iend 95 <3> 96 <3> $M_C_00032H_STRUC LABEL BYTE 97 <3> istruc $M_ID 98 <3> at $M_NUM 99 00000D29 3200 <3> dw 00032H 100 <3> at $M_TXT_PTR 101 00000D2B 3901 <3> dw $M_C_00032H_MSG-$M_C_00032H_STRUC 102 <3> iend 103 <3> 104 <3> $M_C_00033H_STRUC LABEL BYTE 105 <3> istruc $M_ID 106 <3> at $M_NUM 107 00000D2D 3300 <3> dw 00033H 108 <3> at $M_TXT_PTR 109 00000D2F 5D01 <3> dw $M_C_00033H_MSG-$M_C_00033H_STRUC 110 <3> iend 111 <3> 112 <3> $M_C_00034H_STRUC LABEL BYTE 113 <3> istruc $M_ID 114 <3> at $M_NUM 115 00000D31 3400 <3> dw 00034H 116 <3> at $M_TXT_PTR 117 00000D33 7C01 <3> dw $M_C_00034H_MSG-$M_C_00034H_STRUC 118 <3> iend 119 <3> 120 <3> $M_C_00035H_STRUC LABEL BYTE 121 <3> istruc $M_ID 122 <3> at $M_NUM 123 00000D35 3500 <3> dw 00035H 124 <3> at $M_TXT_PTR 125 00000D37 9901 <3> dw $M_C_00035H_MSG-$M_C_00035H_STRUC 126 <3> iend 127 <3> 128 <3> $M_C_00036H_STRUC LABEL BYTE 129 <3> istruc $M_ID 130 <3> at $M_NUM 131 00000D39 3600 <3> dw 00036H 132 <3> at $M_TXT_PTR 133 00000D3B B501 <3> dw $M_C_00036H_MSG-$M_C_00036H_STRUC 134 <3> iend 135 <3> 136 <3> $M_C_00037H_STRUC LABEL BYTE 137 <3> istruc $M_ID 138 <3> at $M_NUM 139 00000D3D 3700 <3> dw 00037H 140 <3> at $M_TXT_PTR 141 00000D3F D901 <3> dw $M_C_00037H_MSG-$M_C_00037H_STRUC 142 <3> iend 143 <3> 144 <3> ; ---------------------------------------------------------- 145 <3> 146 <3> 147 <3> $M_C_00029H_MSG LABEL BYTE 148 00000D41 24 <3> DB $M_C_00029H_END-$M_C_00029H_MSG-1 149 00000D42 0D506172616D657465- <3> DB CR,"Parameters not supported by drive",CR,LF 149 00000D4B 7273206E6F74207375- <3> 149 00000D54 70706F727465642062- <3> 149 00000D5D 792064726976650D0A <3> 150 <3> $M_C_00029H_END LABEL BYTE 151 <3> 152 <3> $M_C_0002AH_MSG LABEL BYTE 153 00000D66 02 <3> DB $M_C_0002AH_END-$M_C_0002AH_MSG-1 154 00000D67 0D0A <3> DB CR,LF 155 <3> $M_C_0002AH_END LABEL BYTE 156 <3> 157 <3> $M_C_0002BH_MSG LABEL BYTE 158 00000D69 03 <3> DB $M_C_0002BH_END-$M_C_0002BH_MSG-1 159 00000D6A 0D0A0A <3> DB CR,LF,LF 160 <3> $M_C_0002BH_END LABEL BYTE 161 <3> 162 <3> $M_C_0002CH_MSG LABEL BYTE 163 00000D6D 1F <3> DB $M_C_0002CH_END-$M_C_0002CH_MSG-1 164 00000D6E 0D496E736572742044- <3> DB CR,"Insert DOS disk in drive %1:",CR,LF 164 00000D77 4F53206469736B2069- <3> 164 00000D80 6E2064726976652025- <3> 164 00000D89 313A0D0A <3> 165 <3> $M_C_0002CH_END LABEL BYTE 166 <3> 167 <3> $M_C_0002DH_MSG LABEL BYTE 168 00000D8D 5E <3> DB $M_C_0002DH_END-$M_C_0002DH_MSG-1 169 00000D8E 0D0A5741524E494E47- <3> DB CR,LF,"WARNING, ALL DATA ON NON-REMOVABLE DISK",CR,LF 169 00000D97 2C20414C4C20444154- <3> 169 00000DA0 41204F4E204E4F4E2D- <3> 169 00000DA9 52454D4F5641424C45- <3> 169 00000DB2 204449534B0D0A <3> 170 00000DB9 44524956452025313A- <3> DB "DRIVE %1: WILL BE LOST!",CR,LF 170 00000DC2 2057494C4C20424520- <3> 170 00000DCB 4C4F5354210D0A <3> 171 00000DD2 50726F636565642077- <3> DB "Proceed with Format (Y/N)?" 171 00000DDB 69746820466F726D61- <3> 171 00000DE4 742028592F4E293F <3> 172 <3> $M_C_0002DH_END LABEL BYTE 173 <3> 174 <3> $M_C_0002EH_MSG LABEL BYTE 175 00000DEC 16 <3> DB $M_C_0002EH_END-$M_C_0002EH_MSG-1 176 00000DED 0D466F726D61742061- <3> DB CR,"Format another (Y/N)?" 176 00000DF6 6E6F74686572202859- <3> 176 00000DFF 2F4E293F <3> 177 <3> $M_C_0002EH_END LABEL BYTE 178 <3> 179 <3> $M_C_0002FH_MSG LABEL BYTE 180 00000E03 20 <3> DB $M_C_0002FH_END-$M_C_0002FH_MSG-1 181 00000E04 0D4572726F72207265- <3> DB CR,"Error reading partition table",CR,LF 181 00000E0D 6164696E6720706172- <3> 181 00000E16 746974696F6E207461- <3> 181 00000E1F 626C650D0A <3> 182 <3> $M_C_0002FH_END LABEL BYTE 183 <3> 184 <3> $M_C_00030H_MSG LABEL BYTE 185 00000E24 20 <3> DB $M_C_00030H_END-$M_C_00030H_MSG-1 186 00000E25 0D4572726F72207772- <3> DB CR,"Error writing partition table",CR,LF 186 00000E2E 6974696E6720706172- <3> 186 00000E37 746974696F6E207461- <3> 186 00000E40 626C650D0A <3> 187 <3> $M_C_00030H_END LABEL BYTE 188 <3> 189 <3> $M_C_00031H_MSG LABEL BYTE 190 00000E45 1C <3> DB $M_C_00031H_END-$M_C_00031H_MSG-1 191 00000E46 0D506172616D657465- <3> DB CR,"Parameters not compatible", CR,LF 191 00000E4F 7273206E6F7420636F- <3> 191 00000E58 6D70617469626C650D- <3> 191 00000E61 0A <3> 192 <3> $M_C_00031H_END LABEL BYTE 193 <3> 194 <3> $M_C_00032H_MSG LABEL BYTE 195 00000E62 27 <3> DB $M_C_00032H_END-$M_C_00032H_MSG-1 196 00000E63 253120616C6C6F6361- <3> DB "%1 allocation units available on disk",CR,LF 196 00000E6C 74696F6E20756E6974- <3> 196 00000E75 7320617661696C6162- <3> 196 00000E7E 6C65206F6E20646973- <3> 196 00000E87 6B0D0A <3> 197 <3> $M_C_00032H_END LABEL BYTE 198 <3> 199 <3> $M_C_00033H_MSG LABEL BYTE 200 00000E8A 22 <3> DB $M_C_00033H_END-$M_C_00033H_MSG-1 201 00000E8B 253120627974657320- <3> DB "%1 bytes in each allocation unit",CR,LF 201 00000E94 696E20656163682061- <3> 201 00000E9D 6C6C6F636174696F6E- <3> 201 00000EA6 20756E69740D0A <3> 202 <3> $M_C_00033H_END LABEL BYTE 203 <3> 204 <3> $M_C_00034H_MSG LABEL BYTE 205 00000EAD 20 <3> DB $M_C_00034H_END-$M_C_00034H_MSG-1 206 00000EAE 0D4572726F72207772- <3> DB CR, "Error writing partition table",CR,LF 206 00000EB7 6974696E6720706172- <3> 206 00000EC0 746974696F6E207461- <3> 206 00000EC9 626C650D0A <3> 207 <3> $M_C_00034H_END LABEL BYTE 208 <3> 209 <3> $M_C_00035H_MSG LABEL BYTE 210 00000ECE 1F <3> DB $M_C_00035H_END-$M_C_00035H_MSG-1 211 00000ECF 0D53616D6520706172- <3> DB CR,"Same parameter entered twice",CR,LF 211 00000ED8 616D6574657220656E- <3> 211 00000EE1 746572656420747769- <3> 211 00000EEA 63650D0A <3> 212 <3> $M_C_00035H_END LABEL BYTE 213 <3> 214 <3> $M_C_00036H_MSG LABEL BYTE 215 00000EEE 27 <3> DB $M_C_00036H_END-$M_C_00036H_MSG-1 216 00000EEF 0D4D75737420656E74- <3> DB CR,"Must enter both /T and /N parameters",CR,LF 216 00000EF8 657220626F7468202F- <3> 216 00000F01 5420616E64202F4E20- <3> 216 00000F0A 706172616D65746572- <3> 216 00000F13 730D0A <3> 217 <3> $M_C_00036H_END LABEL BYTE 218 <3> 219 <3> $M_C_00037H_MSG LABEL BYTE 220 00000F16 44 <3> DB $M_C_00037H_END-$M_C_00037H_MSG-1 221 00000F17 0D417474656D707469- <3> DB CR,"Attempting to recover allocation unit %1 ",CR 221 00000F20 6E6720746F20726563- <3> 221 00000F29 6F76657220616C6C6F- <3> 221 00000F32 636174696F6E20756E- <3> 221 00000F3B 697420253120202020- <3> 221 00000F44 202020202020202020- <3> 221 00000F4D 202020202020202020- <3> 221 00000F56 202020200D <3> 222 <3> $M_C_00037H_END LABEL BYTE 223 <3> 224 <3> ; ---------------------------------------------------------- 225 <3> 226 <3> Class_C_MessageCount EQU 15 227 <3> 228 <3> ; ---------------------------------------------------------- 229 <3> 230 <3> %IF FARmsg 231 <3> $M_CLS_3 PROC FAR 232 <3> %ELSE 233 <3> $M_CLS_3 PROC NEAR 234 <3> %ENDIF 235 <3> 236 00000F5B 0E <3> PUSH CS 237 00000F5C 07 <3> POP ES 238 00000F5D 8D3E[010D] <3> LEA DI,[$M_CLASS_C_STRUC] 239 00000F61 81C16002 <3> ADD CX,$-$M_CLASS_C_STRUC 240 00000F65 C3 <3> RET 241 <3> 242 <3> $M_CLS_3 ENDP 243 <3> 244 <3> ; ---------------------------------------------------------- 245 <3> 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 1 <3> 2 <3> ; ---------------------------------------------------------- 3 <3> 4 <3> PUBLIC $M_MSGSERV_1 5 <3> %IF 1 6 <3> %warning out: ... Including message Class 1 6 ****************** <3> warning: out: ... Including message Class 1 [-w+user] 7 <3> %ENDIF 8 <3> 9 <3> ; ---------------------------------------------------------- 10 <3> 11 <3> $M_CLASS_1_STRUC LABEL BYTE 12 <3> $M_CLASS_ID_size equ $M_CLASS_ID_struc_size ; NASM port equate 13 <3> istruc $M_CLASS_ID 14 <3> at $M_CLS_ID 15 00000F66 01 <3> db 001H 16 <3> at $M_COMMAND_VER 17 00000F67 0400 <3> dw EXPECTED_VERSION 18 <3> at $M_NUM_CLS_MSG 19 00000F69 07 <3> db Class_1_MessageCount 20 <3> iend 21 <3> 22 <3> ; ---------------------------------------------------------- 23 <3> 24 <3> 25 <3> $M_1_00002H_STRUC LABEL BYTE 26 <3> $M_ID_size equ $M_ID_struc_size ; NASM port equate 27 <3> istruc $M_ID 28 <3> at $M_NUM 29 00000F6A 0200 <3> dw 00002H 30 <3> at $M_TXT_PTR 31 00000F6C 1C00 <3> dw $M_1_00002H_MSG-$M_1_00002H_STRUC 32 <3> iend 33 <3> 34 <3> $M_1_00004H_STRUC LABEL BYTE 35 <3> istruc $M_ID 36 <3> at $M_NUM 37 00000F6E 0400 <3> dw 00004H 38 <3> at $M_TXT_PTR 39 00000F70 2700 <3> dw $M_1_00004H_MSG-$M_1_00004H_STRUC 40 <3> iend 41 <3> 42 <3> $M_1_00005H_STRUC LABEL BYTE 43 <3> istruc $M_ID 44 <3> at $M_NUM 45 00000F72 0500 <3> dw 00005H 46 <3> at $M_TXT_PTR 47 00000F74 3700 <3> dw $M_1_00005H_MSG-$M_1_00005H_STRUC 48 <3> iend 49 <3> 50 <3> $M_1_00008H_STRUC LABEL BYTE 51 <3> istruc $M_ID 52 <3> at $M_NUM 53 00000F76 0800 <3> dw 00008H 54 <3> at $M_TXT_PTR 55 00000F78 4200 <3> dw $M_1_00008H_MSG-$M_1_00008H_STRUC 56 <3> iend 57 <3> 58 <3> $M_1_0000FH_STRUC LABEL BYTE 59 <3> istruc $M_ID 60 <3> at $M_NUM 61 00000F7A 0F00 <3> dw 0000FH 62 <3> at $M_TXT_PTR 63 00000F7C 5200 <3> dw $M_1_0000FH_MSG-$M_1_0000FH_STRUC 64 <3> iend 65 <3> 66 <3> $M_1_0001AH_STRUC LABEL BYTE 67 <3> istruc $M_ID 68 <3> at $M_NUM 69 00000F7E 1A00 <3> dw 0001AH 70 <3> at $M_TXT_PTR 71 00000F80 6A00 <3> dw $M_1_0001AH_MSG-$M_1_0001AH_STRUC 72 <3> iend 73 <3> 74 <3> ; ---------------------------------------------------------- 75 <3> 76 <3> $M_1_FF_STRUC LABEL BYTE 77 <3> istruc $M_ID 78 <3> at $M_NUM 79 00000F82 FFFF <3> dw 0FFFFH 80 <3> at $M_TXT_PTR 81 00000F84 7900 <3> dw $M_1_FF_MSG-$M_1_FF_STRUC 82 <3> iend 83 <3> 84 <3> ; ---------------------------------------------------------- 85 <3> 86 <3> 87 <3> $M_1_00002H_MSG LABEL BYTE 88 00000F86 0E <3> DB $M_1_00002H_END-$M_1_00002H_MSG-1 89 00000F87 46696C65206E6F7420- <3> DB "File not found" 89 00000F90 666F756E64 <3> 90 <3> $M_1_00002H_END LABEL BYTE 91 <3> 92 <3> $M_1_00004H_MSG LABEL BYTE 93 00000F95 13 <3> DB $M_1_00004H_END-$M_1_00004H_MSG-1 94 00000F96 546F6F206D616E7920- <3> DB "Too many open files" 94 00000F9F 6F70656E2066696C65- <3> 94 00000FA8 73 <3> 95 <3> $M_1_00004H_END LABEL BYTE 96 <3> 97 <3> $M_1_00005H_MSG LABEL BYTE 98 00000FA9 0E <3> DB $M_1_00005H_END-$M_1_00005H_MSG-1 99 00000FAA 416363657373206465- <3> DB "Access denied " 99 00000FB3 6E69656420 <3> 100 <3> $M_1_00005H_END LABEL BYTE 101 <3> 102 <3> $M_1_00008H_MSG LABEL BYTE 103 00000FB8 13 <3> DB $M_1_00008H_END-$M_1_00008H_MSG-1 104 00000FB9 496E73756666696369- <3> DB "Insufficient memory" 104 00000FC2 656E74206D656D6F72- <3> 104 00000FCB 79 <3> 105 <3> $M_1_00008H_END LABEL BYTE 106 <3> 107 <3> $M_1_0000FH_MSG LABEL BYTE 108 00000FCC 1B <3> DB $M_1_0000FH_END-$M_1_0000FH_MSG-1 109 00000FCD 496E76616C69642064- <3> DB "Invalid drive specification" 109 00000FD6 726976652073706563- <3> 109 00000FDF 696669636174696F6E <3> 110 <3> $M_1_0000FH_END LABEL BYTE 111 <3> 112 <3> $M_1_0001AH_MSG LABEL BYTE 113 00000FE8 12 <3> DB $M_1_0001AH_END-$M_1_0001AH_MSG-1 114 00000FE9 496E76616C6964206D- <3> DB "Invalid media type" 114 00000FF2 656469612074797065 <3> 115 <3> $M_1_0001AH_END LABEL BYTE 116 <3> 117 <3> ; ---------------------------------------------------------- 118 <3> 119 <3> $M_1_FF_MSG LABEL BYTE 120 00000FFB 11 <3> DB $M_1_FF_END-$M_1_FF_MSG-1 121 00000FFC 457874656E64656420- <3> DB "Extended Error %1" 121 00001005 4572726F72202531 <3> 122 <3> $M_1_FF_END LABEL BYTE 123 <3> 124 <3> ; ---------------------------------------------------------- 125 <3> 126 <3> Class_1_MessageCount EQU 7 127 <3> 128 <3> ; ---------------------------------------------------------- 129 <3> 130 <3> %IF FARmsg 131 <3> $M_MSGSERV_1 PROC FAR 132 <3> %ELSE 133 <3> $M_MSGSERV_1 PROC NEAR 134 <3> %ENDIF 135 <3> 136 0000100D 0E <3> PUSH CS 137 0000100E 07 <3> POP ES 138 0000100F 8D3E[660F] <3> LEA DI,[$M_CLASS_1_STRUC] 139 00001013 81C1AD00 <3> ADD CX,$-$M_CLASS_1_STRUC 140 00001017 C3 <3> RET 141 <3> 142 <3> $M_MSGSERV_1 Endp 143 <3> 144 <3> ; ---------------------------------------------------------- 145 <3> 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 1 <3> 2 <3> ; ---------------------------------------------------------- 3 <3> 4 <3> PUBLIC $M_MSGSERV_2 5 <3> %IF 1 6 <3> %warning out: ... Including message Class 2 6 ****************** <3> warning: out: ... Including message Class 2 [-w+user] 7 <3> %ENDIF 8 <3> 9 <3> ; ---------------------------------------------------------- 10 <3> 11 <3> $M_CLASS_2_STRUC LABEL BYTE 12 <3> istruc $M_CLASS_ID 13 <3> at $M_CLS_ID 14 00001018 02 <3> db 002H 15 <3> at $M_COMMAND_VER 16 00001019 0400 <3> dw EXPECTED_VERSION 17 <3> at $M_NUM_CLS_MSG 18 0000101B 01 <3> db Class_2_MessageCount 19 <3> iend 20 <3> 21 <3> ; ---------------------------------------------------------- 22 <3> 23 <3> 24 <3> ; ---------------------------------------------------------- 25 <3> 26 <3> $M_2_FF_STRUC LABEL BYTE 27 <3> istruc $M_ID 28 <3> at $M_NUM 29 0000101C FFFF <3> dw 0FFFFH 30 <3> at $M_TXT_PTR 31 0000101E 0400 <3> dw $M_2_FF_MSG-$M_2_FF_STRUC 32 <3> iend 33 <3> 34 <3> ; ---------------------------------------------------------- 35 <3> 36 <3> 37 <3> ; ---------------------------------------------------------- 38 <3> 39 <3> $M_2_FF_MSG LABEL BYTE 40 00001020 0E <3> DB $M_2_FF_END-$M_2_FF_MSG-1 41 00001021 506172736520457272- <3> DB "Parse Error %1" 41 0000102A 6F72202531 <3> 42 <3> $M_2_FF_END LABEL BYTE 43 <3> 44 <3> ; ---------------------------------------------------------- 45 <3> 46 <3> Class_2_MessageCount EQU 1 47 <3> 48 <3> ; ---------------------------------------------------------- 49 <3> 50 <3> %IF FARmsg 51 <3> $M_MSGSERV_2 PROC FAR 52 <3> %ELSE 53 <3> $M_MSGSERV_2 PROC NEAR 54 <3> %ENDIF 55 <3> 56 0000102F 0E <3> PUSH CS 57 00001030 07 <3> POP ES 58 00001031 8D3E[1810] <3> LEA DI,[$M_CLASS_2_STRUC] 59 00001035 83C11D <3> ADD CX,$-$M_CLASS_2_STRUC 60 00001038 C3 <3> RET 61 <3> 62 <3> $M_MSGSERV_2 Endp 63 <3> 64 <3> ; ---------------------------------------------------------- 65 <3> 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 366 <2> %iassign $M_INCLUDE TRUE 367 <2> %iassign MSG_SERVICES_MATCHED 0 368 <2> %ifidni %1, "MSGDATA" 369 <2> %iassign MSGDATA TRUE 370 <2> %iassign $M_SERVICE TRUE 371 <2> %iassign $M_INCLUDE FALSE 372 <2> %iassign MSG_SERVICES_MATCHED 1 373 <2> %else 374 <2> %iassign $M_MSGDATA_ONLY FALSE 375 <2> %endif 376 <2> 377 <2> MSG_SERVICES_list1 %1,"LOAD","NOVERCHECK","DISPLAY","GET","INPUT","CHAR","NUM","TIME","DATE","NEAR","FAR" 378 <2> 379 <2> %ifidni %1,"COMR" 380 <2> %iassign COMR TRUE 381 <2> %iassign $M_SERVICE TRUE 382 <2> %iassign $M_INCLUDE FALSE 383 <2> %iassign MSG_SERVICES_MATCHED 1 384 <2> %elifidni %1,"COMT" 385 <2> %iassign COMT TRUE 386 <2> %iassign $M_SERVICE TRUE 387 <2> %iassign $M_INCLUDE FALSE 388 <2> %iassign MSG_SERVICES_MATCHED 1 389 <2> %elifidni %1,"SETSTDIO" 390 <2> %iassign SETSTDIO TRUE 391 <2> %iassign $M_SERVICE TRUE 392 <2> %iassign $M_INCLUDE FALSE 393 <2> %iassign MSG_SERVICES_MATCHED 1 394 <2> %elifidni %1,"NOCHECKSTDIN" 395 <2> %iassign NOCHECKSTDIN TRUE 396 <2> %iassign $M_SERVICE TRUE 397 <2> %iassign $M_INCLUDE FALSE 398 <2> %iassign MSG_SERVICES_MATCHED 1 399 <2> %elifidni %1,"NOCHECKSTDOUT" 400 <2> %iassign NOCHECKSTDOUT TRUE 401 <2> %iassign $M_SERVICE TRUE 402 <2> %iassign $M_INCLUDE FALSE 403 <2> %iassign MSG_SERVICES_MATCHED 1 404 <2> %elifidni %1,"DISK_PROC" 405 <2> %iassign DISK_PROC TRUE 406 <2> %iassign $M_SERVICE TRUE 407 <2> %iassign $M_INCLUDE FALSE 408 <2> %iassign MSG_SERVICES_MATCHED 1 409 <2> %endif 410 <2> 411 <2> %IF $M_INCLUDE 412 <2> %define %%string %1 413 <2> %strlen %%length %%string 414 <2> %assign %%ii 1 415 <2> %define %%name "" 416 <2> %rep %%length 417 <2> %substr %%cc %%string %%ii 418 <2> %assign %%ii %%ii + 1 419 <2> %if %%cc >= 'A' && %%cc <= 'Z' 420 <2> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <2> %endif 422 <2> %strcat %%name %%name,%%cc 423 <2> %endrep 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 417 <3> %substr %%cc %%string %%ii 418 <3> %assign %%ii %%ii + 1 419 <3> %if %%cc >= 'A' && %%cc <= 'Z' 420 <3> %substr %%cc "abcdefghijklmnopqrstuvwxyz" (%%cc - 'A' + 1) 421 <3> %endif 422 <3> %strcat %%name %%name,%%cc 424 <2> %ifidni %%name, "format.ctl" 425 <2> 426 <2> %else 427 <2> %include %%name 428 <2> %endif 429 <2> %ENDIF 430 <2> 431 <2> %rotate 1 433 <1> 434 <1> %IF $M_SERVICE 435 <1> 436 <1> %include "msgserv.nas" 437 <1> 438 <1> %ENDIF 439 <1> 21 ; (no prior section) ; code ends