=== Trace listing source: display.lst 1 2 ;***************************************************************************** 3 ;***************************************************************************** 4 ;UTILITY NAME: FORMAT.COM 5 ; 6 ;MODULE NAME: DISPLAY.ASM 7 ; 8 ; 9 ; Change List: AN000 - New code DOS 3.3 spec additions 10 ; AC000 - Changed code DOS 3.3 spec additions 11 ;***************************************************************************** 12 ;***************************************************************************** 13 14 %include "lmacros1.mac" 1 <1> [list -] 1 ****************** <1> warning: redefining multi-line macro `struc' [-w+pp-macro-redef-multi] 15 16 ; 17 ;***************************************************************************** 18 ; Define Segment ordering 19 ;***************************************************************************** 20 ; 21 22 23 .SEQ ; 23 ****************** warning: label alone on a line without a colon might be in error [-w+label-orphan] 24 === Switch to base=000000h -> "PSP" 25 section PSP public align=16 class=DUMMY 26 ; (no prior section) ; PSP ends 27 === Switch to base=000080h -> "DATA" 28 section data public align=16 class=DATA ; 29 Public Test_Data_Start 30 Test_Data_Start label byte 31 ; (no prior section) ; data ends ; 32 === Switch to base=001710h -> "STACK" 33 section stack align=16 stack 0 00000000 2D537461636B212D2D db 62 dup ("-Stack!-") ; (362-80h) is the additionsal IBM ROM 0 00000009 537461636B212D2D53 0 00000012 7461636B212D2D5374 0 0000001B 61636B212D2D537461 0 00000024 636B212D2D53746163 0 0000002D 6B212D2D537461636B 0 00000036 212D2D537461636B21 0 0000003F 2D2D537461636B212D 0 00000048 2D537461636B212D2D 0 00000051 537461636B212D2D53 0 0000005A 7461636B212D2D5374 0 00000063 61636B212D2D537461 0 0000006C 636B212D2D53746163 0 00000075 6B212D2D537461636B 0 0000007E 212D2D537461636B21 0 00000087 2D2D537461636B212D 0 00000090 2D537461636B212D2D 0 00000099 537461636B212D2D53 0 000000A2 7461636B212D2D5374 0 000000AB 61636B212D2D537461 0 000000B4 636B212D2D53746163 0 000000BD 6B212D2D537461636B 0 000000C6 212D2D537461636B21 0 000000CF 2D2D537461636B212D 0 000000D8 2D537461636B212D2D 0 000000E1 537461636B212D2D53 0 000000EA 7461636B212D2D5374 0 000000F3 61636B212D2D537461 0 000000FC 636B212D2D53746163 0 00000105 6B212D2D537461636B 0 0000010E 212D2D537461636B21 0 00000117 2D2D537461636B212D 0 00000120 2D537461636B212D2D 0 00000129 537461636B212D2D53 0 00000132 7461636B212D2D5374 0 0000013B 61636B212D2D537461 0 00000144 636B212D2D53746163 0 0000014D 6B212D2D537461636B 0 00000156 212D2D537461636B21 0 0000015F 2D2D537461636B212D 0 00000168 2D537461636B212D2D 0 00000171 537461636B212D2D53 0 0000017A 7461636B212D2D5374 0 00000183 61636B212D2D537461 0 0000018C 636B212D2D53746163 0 00000195 6B212D2D537461636B 0 0000019E 212D2D537461636B21 0 000001A7 2D2D537461636B212D 0 000001B0 2D537461636B212D2D 0 000001B9 537461636B212D2D53 0 000001C2 7461636B212D2D5374 0 000001CB 61636B212D2D537461 0 000001D4 636B212D2D53746163 0 000001DD 6B212D2D537461636B 0 000001E6 212D2D537461636B21 0 000001EF 2D 35 assume ss:stack 36 ; (no prior section) ; stack ends 37 38 === Switch to base=001900h -> "CODE" 39 section code public align=16 class=CODE ; 40 assume cs:code,ds:data ; 41 ; (no prior section) ; code ends 42 === Switch to base=005740h -> "END_OF_MEMORY" 43 section End_Of_Memory public align=16 class=BUFFERS ; 44 Public Test_End 45 Test_End label byte 46 ; (no prior section) ; End_Of_Memory ends ; 47 48 49 ; 50 ;***************************************************************************** 51 ; INCLUDE FILES 52 ;***************************************************************************** 53 ; 54 55 [list -] 134 <1> 57 %include "forequ.mac" 1 <1> ; ; ; 2 <1> 3 <1> NO equ 0 4 <1> YES equ ~ NO 5 <1> FSExec equ NO ;an018; dms;conditional assembly 6 <1> ShipDisk equ NO ;an000; dms;ship disk flag 7 <1> 8 <1> Boot_ID equ 0AA55h 9 <1> DOS_Found equ 0 10 <1> 11 <1> Not_Include equ 0 12 <1> Do_Include equ 1 13 <1> 14 <1> INIT equ 0 15 <1> 16 <1> FAT12_File_System equ 01h 17 <1> FAT16_File_System equ 04h 18 <1> New_File_System equ 06h 19 <1> 20 <1> FS_String_Max_Length equ 5 21 <1> 22 <1> Paragraph_Size equ 16 ; ;AN005; 23 <1> Len_FS_String_Buffer equ 13 24 <1> 25 <1> Net_Check equ 1200h 26 <1> Assign_Check equ 8000h 27 <1> 28 <1> Found_Yes equ 1 29 <1> Found_No equ 0 30 <1> 31 <1> Asciiz_End equ 0 32 <1> DBCS equ 81h 33 <1> DBCS_Blank equ 40h 34 <1> DBCS_Vector_Size equ 2 35 <1> End_Of_Vector equ 0 36 <1> 37 <1> 38 <1> Blank equ " " 39 <1> 40 <1> Label_Length equ 11 41 <1> CR equ 13 42 <1> 43 <1> DBCS_VECTOR equ NO 44 <1> 45 <1> ;Limits 46 <1> BIG_FAT_THRESHOLD equ 4086 47 <1> 48 <1> ;------------------------------------------------------------------------------- 49 <1> 50 <1> 51 <1> 52 <1> 53 <1> 54 <1> DRNUM EQU 5CH 55 <1> 56 <1> 57 <1> 58 <1> ; Exit status defines 59 <1> ExitOK equ 0 60 <1> ExitCtrlC equ 3 61 <1> ExitFatal equ 4 62 <1> ExitNo equ 5 63 <1> 64 <1> 65 <1> ;------------------------------------------------------------------------------- 66 <1> ; These are the data structures which we will need 67 <1> 68 <1> 69 <1> Media_ID struc 0 00000000 ???? Media_ID_Info_Level dw ? 0 00000002 ???????? Media_ID_Serial_Number dd ? 72 00000006 <1> Media_ID_Volume_Label db 11 dup(?) 0 00000011 ???????????????? Media_ID_File_System db 8 dup(?) 74 <1> Media_ID ends 75 <1> 76 <1> 77 <1> Relative_Sector_Buffer struc ; ;AN000; 78 <1> 0 00000000 ???? Start_Sector_Low dw ? ;Low word of RBA sector ;AN000; 0 00000002 ???? Start_Sector_High dw ? ;High word of RBA sector ;AN000; 0 00000004 ???? Number_Sectors dw ? ;Number of sectors ;AN000; 0 00000006 ???? Buffer_Offset dw ? ;Address of data buffer ;AN000; 0 00000008 ???? Buffer_Segment dw ? ; ;AN000; 84 <1> 85 <1> Relative_Sector_Buffer ends ; ;AN000; 86 <1> 87 <1> 88 <1> ;Per system file data structure 89 <1> 90 <1> a_FileStructure struc 0 00000000 ???? fileHandle DW ? 0 00000002 ???? fileSizeInParagraphs DW ? 0 00000004 ???????? fileSizeInBytes DD ? 0 00000008 ???????? fileOffset DD ? 0 0000000C ???? fileStartSegment DW ? 0 0000000E ???? fileDate DW ? 0 00000010 ???? fileTime DW ? 98 <1> a_FileStructure ends 99 <1> 100 <1> ;------------------------------------------------------------------------------- 101 <1> 102 <1> LOGBOOTSECT equ 1 103 <1> Set_Drv_Owner equ 0Fh ; IOCTL subfunction 104 <1> Custom_Media equ 0F0H ; Media byte for custom format 105 <1> Dual_8_Media equ 0FFh ; Dual sided 8 sectored 106 <1> Single_8_Media equ 0FEh ; Single sided 8 sectored 107 <1> Dual_9_Media equ 0FDh ; Dual sided 9 sectored 108 <1> Single_9_Media equ 0FCh ; Single sided 9 sectored 109 <1> Dual_15_Media equ 0F9h ; Dual sided 15 sectored 110 <1> Fixed_Disk equ 0F8h ; Fixed Disk 111 <1> Invalid_Drive equ 000Fh ; Extended error 15 112 <1> Max_Format_Size equ 0FFFFh ; Max bytes to Format ;an015; dms; 113 <1> Multi_Track_Format equ 02h ; Multi-track format ;an015; dms; 114 <1> Single_Track_Format equ 00h ; Single track format ;an015; dms; 115 <1> Select_Disk_Message equ 0ADC1h ; an016; dms; 58 %include "formsg.mac" 1 <1> ; 2 <1> ;***************************************************************************** 3 <1> ; Macro's 4 <1> ;***************************************************************************** 5 <1> ; 6 <1> 7 <1> ; NASM original macros 8 <1> 9 <1> %imacro Define_Msg 1 10 <1> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input;AN000; 11 <1> %endmacro 12 <1> 13 <1> ;----------------------------------------------------------------------------- 14 <1> 15 <1> %imacro Create_Msg 8 16 <1> Public %1 17 <1> %1 label word ; ;AN000; 18 <1> dw %2 ; ;AN000; 19 <1> dw %3 ; ;AN000; 20 <1> dw %4 ; ;AN000; 21 <1> dw %5 ; ;AN000; 22 <1> db %6 ; ;AN000; 23 <1> db %7 ; ;AN000; 24 <1> dw %8 ; ;AN000; 25 <1> %endmacro 26 <1> 27 <1> ; end of NASM original macros 28 <1> 29 <1> ; 30 <1> ;***************************************************************************** 31 <1> ; External data declarations 32 <1> ;***************************************************************************** 33 <1> ; 34 <1> 35 <1> Extrn DriveLetter:Byte 36 <1> Extrn SystemDriveLetter:Byte 37 <1> Extrn CurrentHead:Byte 38 <1> Extrn CurrentCylinder:Word 39 <1> Extrn FdskSiz:Word 40 <1> Extrn SysSiz:Word 41 <1> Extrn BadSiz:Word 42 <1> Extrn DataSiz:Word 43 <1> Extrn Drive_Letter_Msg:Byte 44 <1> Extrn PercentComplete:Byte 45 <1> Extrn AllocSize:Dword 46 <1> Extrn AllocNum:Word 47 <1> Extrn Serial_Num_Low:Word 48 <1> Extrn Serial_Num_High:Word 49 <1> Extrn Command_Old_Ptr:Word 50 <1> Extrn Msg_Allocation_Unit_Val:Dword 51 <1> 52 <1> ; 53 <1> ;***************************************************************************** 54 <1> ; Publics 55 <1> ;***************************************************************************** 56 <1> ; 57 <1> 58 <1> 59 <1> 60 <1> ; 61 <1> ;***************************************************************************** 62 <1> ; Message Retriever equates 63 <1> ;***************************************************************************** 64 <1> ; 65 <1> 66 <1> Format_Msg equ 'C' 67 <1> 68 <1> N_A equ 0 69 <1> Sublist_Length equ 11 70 <1> None equ 0 71 <1> 72 <1> Blank equ " " 73 <1> No_Function equ 0 74 <1> No_Replace equ 0 75 <1> 76 <1> Msg_Ser_Class equ 0 77 <1> Ext_Err_Class equ 1 78 <1> Parse_Err_Class equ 2 79 <1> Utility_Msg_Class equ 0FFh 80 <1> 81 <1> Reserved equ 0 82 <1> 83 <1> 84 <1> 85 <1> === Switch to base=000080h -> "DATA" 86 <1> section data 87 <1> assume ds:data 88 <1> 89 <1> 90 <1> ; 91 <1> ;***************************************************************************** 92 <1> ; Message Sublist Tables 93 <1> ;***************************************************************************** 94 <1> ; 95 <1> ;The following control blocks are used for messages with 96 <1> ;replaceable paramaters. These control blocks are used by the 97 <1> ;SysDispMsg routine. 98 <1> ; 99 <1> 100 <1> ;--------------------------- ; 101 <1> Sublist_msgCurrentTrack label dword ; ;AN000; 102 <1> ; 0 00000000 0B db Sublist_Length ; ;AN000; 0 00000001 00 db Reserved ; ;AN000; 0 00000002 [0000] dw offset PercentComplete ; ;AN000; 0 00000004 [0000] dw data ; ;AN000; 0 00000006 01 db 1 ; ;AN000; 0 00000007 A1 db Right_Align+Unsgn_Bin_Word ; ;AN000; 0 00000008 03 db 3 ;Max % is 100 ;AN000; 0 00000009 03 db 3 ;Min % is 0 ;AN000; 0 0000000A 20 db Blank ; ;AN000; 112 <1> ;--------------------------- ; 113 <1> Sublist_msgInsertDisk label dword ; ;AN000; 114 <1> Sublist_msgReInsertDisk label dword ; ;AN000; 115 <1> Sublist_MsgHardDiskWarning label dword ; 116 <1> Sublist_msgFormatNotSupported label dword ; ;AN000; 117 <1> 0 0000000B 0B db Sublist_Length ; ;AN000; 0 0000000C 00 db Reserved ; ;AN000; 0 0000000D [0000] dw offset DriveLetter ; ;AN000; 0 0000000F [0000] dw data ; ;AN000; 0 00000011 01 db 1 ; ;AN000; 0 00000012 00 db Left_Align+Char_Field_Char ; ;AN000; 0 00000013 01 db 1 ; ;AN000; 0 00000014 01 db 1 ; ;AN000; 0 00000015 20 db Blank ; ;AN000; 127 <1> ;--------------------------- ; 128 <1> Sublist_msgInsertDOSDisk label dword ; ;AN000; 129 <1> ; 0 00000016 0B db Sublist_Length ; ;AN000; 0 00000017 00 db Reserved ; ;AN000; 0 00000018 [0000] dw offset SystemDriveLetter; ;AN000; 0 0000001A [0000] dw data ; ;AN000; 0 0000001C 01 db 1 ; ;AN000; 0 0000001D 00 db Left_Align+Char_Field_Char ; ;AN000; 0 0000001E 01 db 1 ; ;AN000; 0 0000001F 01 db 1 ; ;AN000; 0 00000020 20 db Blank ; ;AN000; 139 <1> ;--------------------------- ; 140 <1> Sublist_msgTotalDiskSpace label dword ; ;AN000; 141 <1> ; 0 00000021 0B db Sublist_Length ; ;AN000; 0 00000022 00 db Reserved ; ;AN000; 0 00000023 [0000] dw offset FdskSiz ; ;AN000; 0 00000025 [0000] dw data ; ;AN000; 0 00000027 01 db 1 ; ;AN000; 147 <1> Unsgn_Bin_Dword equ Unsgn_Bin_DWord ; NASM port equate 0 00000028 B1 db Right_Align+Unsgn_Bin_Dword ; ;AN000; 0 00000029 0A db 10 ; ;AN000; 0 0000002A 0A db 10 ;4,000,000,000 limit ;AN000; 0 0000002B 20 db Blank ; ;AN000; 152 <1> ;--------------------------- ; 153 <1> Sublist_msgSystemSpace label dword ; ;AN000; 154 <1> ; 0 0000002C 0B db Sublist_Length ; ;AN000; 0 0000002D 00 db Reserved ; ;AN000; 0 0000002E [0000] dw offset SysSiz ; ;AN000; 0 00000030 [0000] dw data ; ;AN000; 0 00000032 01 db 1 ; ;AN000; 0 00000033 B1 db Right_Align+Unsgn_Bin_DWord ; ;AN000; 0 00000034 0A db 10 ; ;AN000; 0 00000035 0A db 10 ;64k*3 max ;AN000; 0 00000036 20 db Blank ; ;AN000; 164 <1> ;--------------------------- ; 165 <1> Sublist_msgBadSpace label dword ; ;AN000; 166 <1> ; 0 00000037 0B db Sublist_Length ; ;AN000; 0 00000038 00 db Reserved ; ;AN000; 0 00000039 [0000] dw offset BadSiz ; ;AN000; 0 0000003B [0000] dw data ; ;AN000; 0 0000003D 01 db 1 ; ;AN000; 0 0000003E B1 db Right_Align+Unsgn_Bin_DWord ; ;AN000; 0 0000003F 0A db 10 ; ;AN000; 0 00000040 0A db 10 ;4,000,000,000 max ;AN000; 0 00000041 20 db Blank ; ;AN000; 176 <1> ;--------------------------- ; 177 <1> Sublist_msgDataSpace label dword ; ;AN000; 178 <1> ; 0 00000042 0B db Sublist_Length ; ;AN000; 0 00000043 00 db Reserved ; ;AN000; 0 00000044 [0000] dw Offset DataSiz ; ;AN000; 0 00000046 [0000] dw data ; ;AN000; 0 00000048 01 db 1 ; ;AN000; 0 00000049 B1 db Right_Align+Unsgn_Bin_DWord ; ;AN000; 0 0000004A 0A db 10 ; ;AN000; 0 0000004B 0A db 10 ;4,000,000,000 max ;AN000; 0 0000004C 20 db Blank ; ;AN000; 188 <1> ;--------------------------- ; 189 <1> Sublist_msgWhatIsVolumeId? label dword ; ;AN000; 190 <1> ; 0 0000004D 0B db Sublist_Length ; ;AN000; 0 0000004E 00 db Reserved ; ;AN000; 0 0000004F [0000] dw offset DriveLetter ; ;AN000; 0 00000051 [0000] dw data ; ;AN000; 0 00000053 01 db 1 ; ;AN000; 0 00000054 00 db Left_Align+Char_Field_Char ; ;AN000; 0 00000055 01 db 1 ; ;AN000; 0 00000056 01 db 1 ; ;AN000; 0 00000057 20 db Blank ; ;AN000; 200 <1> ;--------------------------- ; 201 <1> Sublist_msgEXECFailure label dword ; ;AN000; 202 <1> ; 0 00000058 0B db Sublist_Length ; ;AN000; 0 00000059 00 db Reserved ; ;AN000; 0 0000005A [0000] dw Drive_Letter_Msg ; ;AN000; 0 0000005C [0000] dw data ; ;AN000; 0 0000005E 01 db 1 ; ;AN000; 0 0000005F 10 db Left_Align+Char_Field_ASCIIZ ; ;AN000; 0 00000060 02 db 2 ; ;AN000; 0 00000061 02 db 2 ; ;AN000; 0 00000062 20 db Blank ; ;AN000; 212 <1> ;--------------------------- ; 213 <1> Sublist_msgAllocNum label dword ; ;AN000; 214 <1> ; 0 00000063 0B db Sublist_Length ; ;AN000; 0 00000064 00 db Reserved ; ;AN000; 0 00000065 [0000] dw offset AllocNum ; ;AN000; 0 00000067 [0000] dw data ; ;AN000; 0 00000069 01 db 1 ; ;AN000; 0 0000006A A1 db Right_Align+Unsgn_Bin_Word ; ;AN000; 0 0000006B 0A db 10 ; ;AN000; 0 0000006C 0A db 10 ; ;AN000; 0 0000006D 20 db Blank ; ;AN000; 224 <1> ;--------------------------- ; 225 <1> Sublist_msgAllocSize label dword ; ;AN000; 226 <1> ; 0 0000006E 0B db Sublist_Length ; ;AN000; 0 0000006F 00 db Reserved ; ;AN000; 0 00000070 [0000] dw offset AllocSize ; ;AN000; 0 00000072 [0000] dw data ; ;AN000; 0 00000074 01 db 1 ; ;AN000; 0 00000075 B1 db Right_Align+Unsgn_Bin_DWord ; ;AN000; 0 00000076 0A db 10 ; ;AN000; 0 00000077 0A db 10 ; ;AN000; 0 00000078 20 db Blank ; ;AN000; 236 <1> ;--------------------------- ; 237 <1> Sublist_msgSerialNumber label dword ; ;AN000; 238 <1> ; 0 00000079 0B db Sublist_Length ; ;AN000; 0 0000007A 00 db Reserved ; ;AN000; 0 0000007B [0000] dw offset Serial_Num_Low ; ;AN000; 0 0000007D [0000] dw data ; ;AN000; 0 0000007F 01 db 1 ; ;AN000; 0 00000080 A3 db Right_Align+Bin_Hex_Word ; ;AN000; 0 00000081 04 db 4 ; ;AN000; 0 00000082 04 db 4 ; ;AN000; 0 00000083 30 db '0' ;Display leading 0's ;AN000; 0 00000084 0B db Sublist_Length ; ;AN000; 0 00000085 00 db Reserved ; ;AN000; 0 00000086 [0000] dw offset Serial_Num_High ; ;AN000; 0 00000088 [0000] dw data ; ;AN000; 0 0000008A 02 db 2 ; ;AN000; 253 <1> Bin_hex_Word equ Bin_Hex_Word ; NASM port equate 0 0000008B A3 db Right_Align+Bin_hex_Word ; ;AN000; 0 0000008C 04 db 4 ; ;AN000; 0 0000008D 04 db 4 ; ;AN000; 0 0000008E 30 db '0' ; ;AN000; 258 <1> 259 <1> Sublist_MsgParse_Error equ Sublist_msgParse_Error ; NASM port label 260 <1> Public Sublist_MsgParse_Error 261 <1> Sublist_msgParse_Error label dword ; ;AN000; 262 <1> 0 0000008F 0B db Sublist_Length ; ;AN000; 0 00000090 00 db Reserved ; ;AN000; 0 00000091 0000 dw 0 ; ;AN000; 266 <1> Data equ data ; NASM port equate 0 00000093 [0000] dw Data ; ;AN000; 0 00000095 00 db 0 ; ;AN000; 0 00000096 10 db Left_Align+Char_Field_ASCIIZ ; ;AN000; 0 00000097 14 db 20 ; ;AN000; 0 00000098 01 db 01 ; ;AN000; 0 00000099 20 db Blank ; ;AN000; 273 <1> ;--------------------------- ; 274 <1> Sublist_MsgVerify label dword ; ;AN000; 275 <1> ; 0 0000009A 0B db Sublist_Length ; ;AN000; 0 0000009B 00 db Reserved ; ;AN000; 0 0000009C [0000] dw offset Msg_Allocation_Unit_Val; ;AN000; 0 0000009E [0000] dw data ; ;AN000; 0 000000A0 01 db 1 ; ;AN000; 0 000000A1 B1 db Right_Align+Unsgn_Bin_DWord; ;AN000; 0 000000A2 08 db 8 ; ;AN000; 0 000000A3 08 db 8 ; ;AN000; 0 000000A4 20 db Blank 285 <1> ; 286 <1> ;***************************************************************************** 287 <1> ; Message Description Tables 288 <1> ;***************************************************************************** 289 <1> ; 290 <1> 291 <1> ;---------------------- ; 292 <1> %define Message_Number 1 293 <1> No_Handle equ NO_HANDLE ; NASM port equate 294 <1> %define Handle No_Handle 295 <1> %define Sublist No_Replace 296 <1> %define Count N_A 297 <1> %define Class Utility_Msg_Class 298 <1> No_Input equ NO_INPUT ; NASM port equate 299 <1> %define Function No_Input 300 <1> %define Input N_A 301 <1> Define_Msg msgBadDOSVersion ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000A5 0100 dw %2 0 000000A7 FFFF dw %3 0 000000A9 0000 dw %4 0 000000AB 0000 dw %5 0 000000AD FF db %6 0 000000AE 00 db %7 0 000000AF 0000 dw %8 302 <1> ;---------------------- ; 303 <1> %define Message_Number 2 304 <1> %define Handle STDOUT 305 <1> %define Sublist Sublist_msgCurrentTrack 306 <1> %define Count 1 307 <1> %define Class Utility_Msg_Class 308 <1> %define Function No_Input 309 <1> %define Input N_A 310 <1> Define_Msg msgCurrentTrack ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000B1 0200 dw %2 0 000000B3 0100 dw %3 0 000000B5 [0000] dw %4 0 000000B7 0100 dw %5 0 000000B9 FF db %6 0 000000BA 00 db %7 0 000000BB 0000 dw %8 311 <1> ;---------------------- ; 312 <1> %define Message_Number 3 313 <1> %define Handle STDOUT 314 <1> %define Sublist Sublist_msgDataSpace 315 <1> %define Count 1 316 <1> %define Class Utility_Msg_Class 317 <1> %define Function No_Function 318 <1> %define Input N_A 319 <1> Define_Msg msgDataSpace ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000BD 0300 dw %2 0 000000BF 0100 dw %3 0 000000C1 [4200] dw %4 0 000000C3 0100 dw %5 0 000000C5 FF db %6 0 000000C6 00 db %7 0 000000C7 0000 dw %8 320 <1> ;---------------------- ; 321 <1> %define Message_Number 4 322 <1> %define Handle STDOUT 323 <1> %define Sublist No_Replace 324 <1> %define Count N_A 325 <1> %define Class Utility_Msg_Class 326 <1> %define Function No_Input 327 <1> %define Input N_A 328 <1> Define_Msg msgFormatComplete ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000C9 0400 dw %2 0 000000CB 0100 dw %3 0 000000CD 0000 dw %4 0 000000CF 0000 dw %5 0 000000D1 FF db %6 0 000000D2 00 db %7 0 000000D3 0000 dw %8 329 <1> ;---------------------- ; 330 <1> %define Message_Number 5 331 <1> %define Handle STDOUT 332 <1> %define Sublist Sublist_msgBadSpace 333 <1> %define Count 1 334 <1> %define Class Utility_Msg_Class 335 <1> %define Function No_Function 336 <1> %define Input N_A 337 <1> Define_Msg msgBadSpace ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000D5 0500 dw %2 0 000000D7 0100 dw %3 0 000000D9 [3700] dw %4 0 000000DB 0100 dw %5 0 000000DD FF db %6 0 000000DE 00 db %7 0 000000DF 0000 dw %8 338 <1> ;---------------------- ; 339 <1> %define Message_Number 6 340 <1> %define Handle STDOUT 341 <1> %define Sublist Sublist_msgTotalDiskSpace 342 <1> %define Count 1 343 <1> %define Class Utility_Msg_Class 344 <1> %define Function No_Function 345 <1> %define Input N_A 346 <1> Define_Msg msgTotalDiskSpace ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000E1 0600 dw %2 0 000000E3 0100 dw %3 0 000000E5 [2100] dw %4 0 000000E7 0100 dw %5 0 000000E9 FF db %6 0 000000EA 00 db %7 0 000000EB 0000 dw %8 347 <1> ;---------------------- ; 348 <1> %define Message_Number 7 349 <1> %define Handle STDOUT 350 <1> %define Sublist Sublist_msgInsertDisk 351 <1> %define Count 1 352 <1> %define Class Utility_Msg_Class 353 <1> %define Function No_Function 354 <1> %define Input N_A 355 <1> Define_Msg msgInsertDisk ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000ED 0700 dw %2 0 000000EF 0100 dw %3 0 000000F1 [0B00] dw %4 0 000000F3 0100 dw %5 0 000000F5 FF db %6 0 000000F6 00 db %7 0 000000F7 0000 dw %8 356 <1> ;---------------------- ; 357 <1> %define Message_Number 8 358 <1> %define Handle STDOUT 359 <1> %define Sublist Sublist_msgSystemSpace 360 <1> %define Count 1 361 <1> %define Class Utility_Msg_Class 362 <1> %define Function No_Function 363 <1> %define Input N_A 364 <1> Define_Msg msgSystemSpace ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000000F9 0800 dw %2 0 000000FB 0100 dw %3 0 000000FD [2C00] dw %4 0 000000FF 0100 dw %5 0 00000101 FF db %6 0 00000102 00 db %7 0 00000103 0000 dw %8 365 <1> ;---------------------- ; 366 <1> %define Message_Number 9 367 <1> %define Handle STDOUT 368 <1> %define Sublist Sublist_msgReInsertDisk 369 <1> %define Count 1 370 <1> %define Class Utility_Msg_Class 371 <1> %define Function No_Function 372 <1> %define Input N_A 373 <1> Define_Msg msgReInsertDisk ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000105 0900 dw %2 0 00000107 0100 dw %3 0 00000109 [0B00] dw %4 0 0000010B 0100 dw %5 0 0000010D FF db %6 0 0000010E 00 db %7 0 0000010F 0000 dw %8 374 <1> ;---------------------- ; 375 <1> %define Message_Number 10 376 <1> %define Handle STDOUT 377 <1> %define Sublist No_Replace 378 <1> %define Count N_A 379 <1> %define Class Utility_Msg_Class 380 <1> %define Function No_Function 381 <1> %define Input N_A 382 <1> Define_Msg msgLabelPrompt ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000111 0A00 dw %2 0 00000113 0100 dw %3 0 00000115 0000 dw %4 0 00000117 0000 dw %5 0 00000119 FF db %6 0 0000011A 00 db %7 0 0000011B 0000 dw %8 383 <1> ;---------------------- ; 384 <1> %define Message_Number 11 385 <1> %define Handle STDOUT 386 <1> %define Sublist Sublist_msgFormatNotSupported 387 <1> %define Count 1 388 <1> %define Class Utility_Msg_Class 389 <1> %define Function No_Function 390 <1> %define Input N_A 391 <1> Define_Msg msgFormatNotSupported ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000011D 0B00 dw %2 0 0000011F 0100 dw %3 0 00000121 [0B00] dw %4 0 00000123 0100 dw %5 0 00000125 FF db %6 0 00000126 00 db %7 0 00000127 0000 dw %8 392 <1> ;---------------------- ; 393 <1> %define Message_Number 12 394 <1> %define Handle STDOUT 395 <1> %define Sublist No_Replace 396 <1> %define Count N_A 397 <1> %define Class Utility_Msg_Class 398 <1> %define Function No_Function 399 <1> %define Input N_A 400 <1> Define_Msg msgInvalidDeviceParameters; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000129 0C00 dw %2 0 0000012B 0100 dw %3 0 0000012D 0000 dw %4 0 0000012F 0000 dw %5 0 00000131 FF db %6 0 00000132 00 db %7 0 00000133 0000 dw %8 401 <1> ;---------------------- ; 402 <1> %define Message_Number 13 403 <1> %define Handle STDOUT 404 <1> %define Sublist No_Replace 405 <1> %define Count N_A 406 <1> %define Class Utility_Msg_Class 407 <1> %define Function No_Function 408 <1> %define Input N_A 409 <1> Define_Msg msgErrorInIOCTL ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000135 0D00 dw %2 0 00000137 0100 dw %3 0 00000139 0000 dw %4 0 0000013B 0000 dw %5 0 0000013D FF db %6 0 0000013E 00 db %7 0 0000013F 0000 dw %8 410 <1> ;---------------------- ; 411 <1> %define Message_Number 14 412 <1> %define Handle STDOUT 413 <1> %define Sublist No_Replace 414 <1> %define Count N_A 415 <1> %define Class Utility_Msg_Class 416 <1> %define Function No_Function 417 <1> %define Input N_A 418 <1> Define_Msg msgNotBlockDevice ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000141 0E00 dw %2 0 00000143 0100 dw %3 0 00000145 0000 dw %4 0 00000147 0000 dw %5 0 00000149 FF db %6 0 0000014A 00 db %7 0 0000014B 0000 dw %8 419 <1> ;---------------------- ; 420 <1> %define Message_Number 15 421 <1> %define Handle STDOUT 422 <1> %define Sublist No_Replace 423 <1> %define Count N_A 424 <1> %define Class Utility_Msg_Class 425 <1> %define Function No_Function 426 <1> %define Input N_A 427 <1> Define_Msg msgFATwriteError ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000014D 0F00 dw %2 0 0000014F 0100 dw %3 0 00000151 0000 dw %4 0 00000153 0000 dw %5 0 00000155 FF db %6 0 00000156 00 db %7 0 00000157 0000 dw %8 428 <1> ;---------------------- ; 429 <1> %define Message_Number 16 430 <1> %define Handle STDOUT 431 <1> %define Sublist No_Replace 432 <1> %define Count N_A 433 <1> %define Class Utility_Msg_Class 434 <1> %define Function No_Function 435 <1> %define Input N_A 436 <1> Define_Msg msgDirectoryWriteError ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000159 1000 dw %2 0 0000015B 0100 dw %3 0 0000015D 0000 dw %4 0 0000015F 0000 dw %5 0 00000161 FF db %6 0 00000162 00 db %7 0 00000163 0000 dw %8 437 <1> ;---------------------- ; 438 <1> %define Message_Number 17 439 <1> %define Handle STDOUT 440 <1> %define Sublist No_Replace 441 <1> %define Count N_A 442 <1> %define Class Utility_Msg_Class 443 <1> %define Function No_Function 444 <1> %define Input N_A 445 <1> Define_Msg msgAssignedDrive ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000165 1100 dw %2 0 00000167 0100 dw %3 0 00000169 0000 dw %4 0 0000016B 0000 dw %5 0 0000016D FF db %6 0 0000016E 00 db %7 0 0000016F 0000 dw %8 446 <1> ;---------------------- ; 447 <1> %define Message_Number 18 448 <1> %define Handle STDOUT 449 <1> %define Sublist No_Replace 450 <1> %define Count N_A 451 <1> %define Class Utility_Msg_Class 452 <1> %define Function No_Function 453 <1> %define Input N_A 454 <1> Define_Msg msgNoSystemFiles ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000171 1200 dw %2 0 00000173 0100 dw %3 0 00000175 0000 dw %4 0 00000177 0000 dw %5 0 00000179 FF db %6 0 0000017A 00 db %7 0 0000017B 0000 dw %8 455 <1> ;---------------------- ; 456 <1> %define Message_Number 19 457 <1> %define Handle STDOUT 458 <1> %define Sublist No_Replace 459 <1> %define Count N_A 460 <1> %define Class Utility_Msg_Class 461 <1> %define Function No_Function 462 <1> %define Input N_A 463 <1> Define_Msg msgNetDrive ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000017D 1300 dw %2 0 0000017F 0100 dw %3 0 00000181 0000 dw %4 0 00000183 0000 dw %5 0 00000185 FF db %6 0 00000186 00 db %7 0 00000187 0000 dw %8 464 <1> ;---------------------- ; 465 <1> %define Message_Number 20 466 <1> %define Handle STDOUT 467 <1> %define Sublist No_Replace 468 <1> %define Count N_A 469 <1> %define Class Utility_Msg_Class 470 <1> %define Function No_Function 471 <1> %define Input N_A 472 <1> Define_Msg msgBadCharacters ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000189 1400 dw %2 0 0000018B 0100 dw %3 0 0000018D 0000 dw %4 0 0000018F 0000 dw %5 0 00000191 FF db %6 0 00000192 00 db %7 0 00000193 0000 dw %8 473 <1> ;---------------------- ; 474 <1> %define Message_Number 21 475 <1> %define Handle STDOUT 476 <1> %define Sublist No_Replace 477 <1> %define Count N_A 478 <1> %define Class Utility_Msg_Class 479 <1> %define Function No_Function 480 <1> %define Input N_A 481 <1> Define_Msg msgParametersNotSupported ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000195 1500 dw %2 0 00000197 0100 dw %3 0 00000199 0000 dw %4 0 0000019B 0000 dw %5 0 0000019D FF db %6 0 0000019E 00 db %7 0 0000019F 0000 dw %8 482 <1> ;---------------------- ; 483 <1> %define Message_Number 22 484 <1> %define Handle STDOUT 485 <1> %define Sublist No_Replace 486 <1> %define Count N_A 487 <1> %define Class Utility_Msg_Class 488 <1> %define Function No_Function 489 <1> %define Input N_A 490 <1> Define_Msg msgFormatFailure ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001A1 1600 dw %2 0 000001A3 0100 dw %3 0 000001A5 0000 dw %4 0 000001A7 0000 dw %5 0 000001A9 FF db %6 0 000001AA 00 db %7 0 000001AB 0000 dw %8 491 <1> ;---------------------- ; 492 <1> %define Message_Number 23 493 <1> %define Handle STDOUT 494 <1> %define Sublist No_Replace 495 <1> %define Count N_A 496 <1> %define Class Utility_Msg_Class 497 <1> %define Function No_Function 498 <1> %define Input N_A 499 <1> Define_Msg msgNotSystemDisk ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001AD 1700 dw %2 0 000001AF 0100 dw %3 0 000001B1 0000 dw %4 0 000001B3 0000 dw %5 0 000001B5 FF db %6 0 000001B6 00 db %7 0 000001B7 0000 dw %8 500 <1> ;---------------------- ; 501 <1> %define Message_Number 24 502 <1> %define Handle STDOUT 503 <1> %define Sublist No_Replace 504 <1> %define Count N_A 505 <1> %define Class Utility_Msg_Class 506 <1> %define Function No_Function 507 <1> %define Input N_A 508 <1> Define_Msg msgDiskUnusable ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001B9 1800 dw %2 0 000001BB 0100 dw %3 0 000001BD 0000 dw %4 0 000001BF 0000 dw %5 0 000001C1 FF db %6 0 000001C2 00 db %7 0 000001C3 0000 dw %8 509 <1> ;---------------------- ; 510 <1> %define Message_Number 25 511 <1> %define Handle STDOUT 512 <1> %define Sublist No_Replace 513 <1> %define Count N_A 514 <1> %define Class Utility_Msg_Class 515 <1> %define Function No_Function 516 <1> %define Input N_A 517 <1> Define_Msg msgBootWriteError ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001C5 1900 dw %2 0 000001C7 0100 dw %3 0 000001C9 0000 dw %4 0 000001CB 0000 dw %5 0 000001CD FF db %6 0 000001CE 00 db %7 0 000001CF 0000 dw %8 518 <1> ;---------------------- ; 519 <1> %define Message_Number 26 520 <1> %define Handle STDOUT 521 <1> %define Sublist No_Replace 522 <1> %define Count N_A 523 <1> %define Class Utility_Msg_Class 524 <1> %define Function No_Function 525 <1> %define Input N_A 526 <1> Define_Msg msgDirectoryReadError ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001D1 1A00 dw %2 0 000001D3 0100 dw %3 0 000001D5 0000 dw %4 0 000001D7 0000 dw %5 0 000001D9 FF db %6 0 000001DA 00 db %7 0 000001DB 0000 dw %8 527 <1> ;---------------------- ; 528 <1> %define Message_Number 27 529 <1> %define Handle STDOUT 530 <1> %define Sublist No_Replace 531 <1> %define Count N_A 532 <1> %define Class Utility_Msg_Class 533 <1> %define Function No_Function 534 <1> %define Input N_A 535 <1> Define_Msg msgNeedDrive ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001DD 1B00 dw %2 0 000001DF 0100 dw %3 0 000001E1 0000 dw %4 0 000001E3 0000 dw %5 0 000001E5 FF db %6 0 000001E6 00 db %7 0 000001E7 0000 dw %8 536 <1> ;---------------------- ; 537 <1> %define Message_Number 28 538 <1> %define Handle STDOUT 539 <1> %define Sublist No_Replace 540 <1> %define Count N_A 541 <1> %define Class Utility_Msg_Class 542 <1> %define Function No_Function 543 <1> %define Input N_A 544 <1> Define_Msg ContinueMsg ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001E9 1C00 dw %2 0 000001EB 0100 dw %3 0 000001ED 0000 dw %4 0 000001EF 0000 dw %5 0 000001F1 FF db %6 0 000001F2 00 db %7 0 000001F3 0000 dw %8 545 <1> ;---------------------- ; 546 <1> %define Message_Number 29 547 <1> %define Handle STDOUT 548 <1> %define Sublist No_Replace 549 <1> %define Count N_A 550 <1> %define Class Utility_Msg_Class 551 <1> %define Function No_Function 552 <1> %define Input N_A 553 <1> Define_Msg msgBadVolumeId ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000001F5 1D00 dw %2 0 000001F7 0100 dw %3 0 000001F9 0000 dw %4 0 000001FB 0000 dw %5 0 000001FD FF db %6 0 000001FE 00 db %7 0 000001FF 0000 dw %8 554 <1> ;---------------------- ; 555 <1> %define Message_Number 30 556 <1> %define Handle STDOUT 557 <1> %define Sublist No_Replace 558 <1> %define Count N_A 559 <1> %define Class Utility_Msg_Class 560 <1> %define Function No_Input 561 <1> %define Input N_A 562 <1> Define_Msg msgSystemTransfered ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000201 1E00 dw %2 0 00000203 0100 dw %3 0 00000205 0000 dw %4 0 00000207 0000 dw %5 0 00000209 FF db %6 0 0000020A 00 db %7 0 0000020B 0000 dw %8 563 <1> ;---------------------- ; 564 <1> %define Message_Number 31 565 <1> %define Handle STDOUT 566 <1> %define Sublist Sublist_msgWhatIsVolumeId? 567 <1> %define Count 1 568 <1> %define Class Utility_Msg_Class 569 <1> %define Function No_Function 570 <1> %define Input N_A 571 <1> Define_Msg msgWhatIsVolumeId? ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000020D 1F00 dw %2 0 0000020F 0100 dw %3 0 00000211 [4D00] dw %4 0 00000213 0100 dw %5 0 00000215 FF db %6 0 00000216 00 db %7 0 00000217 0000 dw %8 572 <1> ;---------------------- ; 573 <1> %define Message_Number 32 574 <1> %define Handle STDOUT 575 <1> %define Sublist No_Replace 576 <1> %define Count N_A 577 <1> %define Class Utility_Msg_Class 578 <1> %define Function No_Function 579 <1> %define Input N_A 580 <1> Define_Msg msgIncompatibleParametersForHardDisk ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000219 2000 dw %2 0 0000021B 0100 dw %3 0 0000021D 0000 dw %4 0 0000021F 0000 dw %5 0 00000221 FF db %6 0 00000222 00 db %7 0 00000223 0000 dw %8 581 <1> ; 1234567890123456789012345678901 582 <1> global MSGINCOMPATIBLEPARAMETERSFORHAR 583 <1> MSGINCOMPATIBLEPARAMETERSFORHAR equ msgIncompatibleParametersForHardDisk 584 <1> ;---------------------- ; 585 <1> 586 <1> %define Message_Number 33 587 <1> %define Handle STDOUT 588 <1> %define Sublist No_Replace 589 <1> %define Count N_A 590 <1> %define Class Utility_Msg_Class 591 <1> %define Function No_Function 592 <1> %define Input N_A 593 <1> Define_Msg msgWriteProtected ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000225 2100 dw %2 0 00000227 0100 dw %3 0 00000229 0000 dw %4 0 0000022B 0000 dw %5 0 0000022D FF db %6 0 0000022E 00 db %7 0 0000022F 0000 dw %8 594 <1> ;---------------------- ; 595 <1> %define Message_Number 34 596 <1> %define Handle STDOUT 597 <1> %define Sublist No_Replace 598 <1> %define Count N_A 599 <1> %define Class Utility_Msg_Class 600 <1> %define Function No_Function 601 <1> %define Input N_A 602 <1> Define_Msg msgNotReady ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000231 2200 dw %2 0 00000233 0100 dw %3 0 00000235 0000 dw %4 0 00000237 0000 dw %5 0 00000239 FF db %6 0 0000023A 00 db %7 0 0000023B 0000 dw %8 603 <1> ;---------------------- ; 604 <1> 605 <1> %define Message_Number 35 606 <1> %define Handle STDOUT 607 <1> %define Sublist No_Replace 608 <1> %define Count N_A 609 <1> %define Class Utility_Msg_Class 610 <1> %define Function No_Function 611 <1> %define Input N_A 612 <1> Define_Msg msgPartitionTableReadErr ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000023D 2300 dw %2 0 0000023F 0100 dw %3 0 00000241 0000 dw %4 0 00000243 0000 dw %5 0 00000245 FF db %6 0 00000246 00 db %7 0 00000247 0000 dw %8 613 <1> ;---------------------- ; 614 <1> %define Message_Number 36 615 <1> %define Handle STDOUT 616 <1> %define Sublist Sublist_msgSerialNumber 617 <1> %define Count 2 618 <1> %define Class Utility_Msg_Class 619 <1> %define Function No_Function 620 <1> %define Input N_A 621 <1> Define_Msg msgSerialNumber ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000249 2400 dw %2 0 0000024B 0100 dw %3 0 0000024D [7900] dw %4 0 0000024F 0200 dw %5 0 00000251 FF db %6 0 00000252 00 db %7 0 00000253 0000 dw %8 622 <1> ;---------------------- ; 623 <1> %define Message_Number 37 624 <1> %define Handle STDOUT 625 <1> %define Sublist No_Replace 626 <1> %define Count N_A 627 <1> %define Class Utility_Msg_Class 628 <1> %define Function No_Function 629 <1> %define Input N_A 630 <1> Define_Msg msgFormatBroken ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000255 2500 dw %2 0 00000257 0100 dw %3 0 00000259 0000 dw %4 0 0000025B 0000 dw %5 0 0000025D FF db %6 0 0000025E 00 db %7 0 0000025F 0000 dw %8 631 <1> ;---------------------- ; 632 <1> %define Message_Number 38 633 <1> %define Handle STDOUT 634 <1> %define Sublist Sublist_msgEXECFailure 635 <1> %define Count 1 636 <1> %define Class Utility_Msg_Class 637 <1> %define Function No_Function 638 <1> %define Input N_A 639 <1> Define_Msg msgEXECFailure ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000261 2600 dw %2 0 00000263 0100 dw %3 0 00000265 [5800] dw %4 0 00000267 0100 dw %5 0 00000269 FF db %6 0 0000026A 00 db %7 0 0000026B 0000 dw %8 640 <1> ;---------------------- ; 641 <1> %define Message_Number 39 642 <1> %define Handle STDOUT 643 <1> %define Sublist No_Replace 644 <1> %define Count N_A 645 <1> %define Class Utility_Msg_Class 646 <1> %define Function No_Function 647 <1> %define Input N_A 648 <1> Define_Msg NO_SYS_MESS ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000026D 2700 dw %2 0 0000026F 0100 dw %3 0 00000271 0000 dw %4 0 00000273 0000 dw %5 0 00000275 FF db %6 0 00000276 00 db %7 0 00000277 0000 dw %8 649 <1> ;---------------------- ; 650 <1> %define Message_Number 40 651 <1> %define Handle STDOUT 652 <1> %define Sublist No_Replace 653 <1> %define Count N_A 654 <1> %define Class Utility_Msg_Class 655 <1> %define Function No_Function 656 <1> %define Input N_A 657 <1> Define_Msg msgbadpartitiontable ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000279 2800 dw %2 0 0000027B 0100 dw %3 0 0000027D 0000 dw %4 0 0000027F 0000 dw %5 0 00000281 FF db %6 0 00000282 00 db %7 0 00000283 0000 dw %8 658 <1> ;---------------------- ; 659 <1> %define Message_Number 41 660 <1> %define Handle STDOUT 661 <1> %define Sublist No_Replace 662 <1> %define Count N_A 663 <1> %define Class Utility_Msg_Class 664 <1> %define Function No_Function 665 <1> %define Input N_A 666 <1> Define_Msg msgParametersNotSupportedByDrive ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000285 2900 dw %2 0 00000287 0100 dw %3 0 00000289 0000 dw %4 0 0000028B 0000 dw %5 0 0000028D FF db %6 0 0000028E 00 db %7 0 0000028F 0000 dw %8 667 <1> ; 1234567890123456789012345678901 668 <1> global MSGPARAMETERSNOTSUPPORTEDBYDRIV 669 <1> MSGPARAMETERSNOTSUPPORTEDBYDRIV equ msgParametersNotSupportedByDrive 670 <1> ;---------------------- ; 671 <1> %define Message_Number 42 672 <1> %define Handle STDOUT 673 <1> %define Sublist No_Replace 674 <1> %define Count N_A 675 <1> %define Class Utility_Msg_Class 676 <1> %define Function No_Function 677 <1> %define Input N_A 678 <1> Define_Msg msgCRLF ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000291 2A00 dw %2 0 00000293 0100 dw %3 0 00000295 0000 dw %4 0 00000297 0000 dw %5 0 00000299 FF db %6 0 0000029A 00 db %7 0 0000029B 0000 dw %8 679 <1> ;---------------------- ; 680 <1> %define Message_Number 43 681 <1> %define Handle STDOUT 682 <1> %define Sublist No_Replace 683 <1> %define Count N_A 684 <1> %define Class Utility_Msg_Class 685 <1> %define Function No_Function 686 <1> %define Input N_A 687 <1> Define_Msg msgInterrupt ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000029D 2B00 dw %2 0 0000029F 0100 dw %3 0 000002A1 0000 dw %4 0 000002A3 0000 dw %5 0 000002A5 FF db %6 0 000002A6 00 db %7 0 000002A7 0000 dw %8 688 <1> ;---------------------- ; 689 <1> %define Message_Number 44 690 <1> %define Handle STDOUT 691 <1> Sublist_MsgInsertDOSDisk equ Sublist_msgInsertDOSDisk ; NASM port label 692 <1> %define Sublist Sublist_MsgInsertDOSDisk 693 <1> %define Count 1 694 <1> %define Class Utility_Msg_Class 695 <1> %define Function No_Function 696 <1> %define Input N_A 697 <1> Define_Msg msgInsertDOSDisk ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002A9 2C00 dw %2 0 000002AB 0100 dw %3 0 000002AD [1600] dw %4 0 000002AF 0100 dw %5 0 000002B1 FF db %6 0 000002B2 00 db %7 0 000002B3 0000 dw %8 698 <1> ;---------------------- ; 699 <1> %define Message_Number 45 700 <1> %define Handle STDOUT 701 <1> %define Sublist Sublist_MsgHardDiskWarning 702 <1> %define Count 1 703 <1> %define Class Utility_Msg_Class 704 <1> %define Function No_Function 705 <1> %define Input N_A 706 <1> Define_Msg msgHardDiskWarning ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002B5 2D00 dw %2 0 000002B7 0100 dw %3 0 000002B9 [0B00] dw %4 0 000002BB 0100 dw %5 0 000002BD FF db %6 0 000002BE 00 db %7 0 000002BF 0000 dw %8 707 <1> ;---------------------- ; 708 <1> %define Message_Number 46 709 <1> %define Handle STDOUT 710 <1> %define Sublist No_Replace 711 <1> %define Count N_A 712 <1> %define Class Utility_Msg_Class 713 <1> %define Function No_Function 714 <1> %define Input N_A 715 <1> Define_Msg msgFormatAnother? ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002C1 2E00 dw %2 0 000002C3 0100 dw %3 0 000002C5 0000 dw %4 0 000002C7 0000 dw %5 0 000002C9 FF db %6 0 000002CA 00 db %7 0 000002CB 0000 dw %8 716 <1> ;---------------------- ; 717 <1> %define Message_Number 47 718 <1> %define Handle STDOUT 719 <1> %define Sublist No_Replace 720 <1> %define Count N_A 721 <1> %define Class Utility_Msg_Class 722 <1> %define Function No_Function 723 <1> %define Input N_A 724 <1> Define_Msg msgPartitionTableReadError ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002CD 2F00 dw %2 0 000002CF 0100 dw %3 0 000002D1 0000 dw %4 0 000002D3 0000 dw %5 0 000002D5 FF db %6 0 000002D6 00 db %7 0 000002D7 0000 dw %8 725 <1> ;---------------------- ; 726 <1> %define Message_Number 48 727 <1> %define Handle STDOUT 728 <1> %define Sublist No_Replace 729 <1> %define Count N_A 730 <1> %define Class Utility_Msg_Class 731 <1> %define Function No_Function 732 <1> %define Input N_A 733 <1> Define_Msg msgPartitionTableWriteError ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002D9 3000 dw %2 0 000002DB 0100 dw %3 0 000002DD 0000 dw %4 0 000002DF 0000 dw %5 0 000002E1 FF db %6 0 000002E2 00 db %7 0 000002E3 0000 dw %8 734 <1> ;---------------------- ; 735 <1> %define Message_Number 49 736 <1> %define Handle STDOUT 737 <1> %define Sublist No_Replace 738 <1> %define Count N_A 739 <1> %define Class Utility_Msg_Class 740 <1> %define Function No_Function 741 <1> %define Input N_A 742 <1> Define_Msg msgIncompatibleParameters ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002E5 3100 dw %2 0 000002E7 0100 dw %3 0 000002E9 0000 dw %4 0 000002EB 0000 dw %5 0 000002ED FF db %6 0 000002EE 00 db %7 0 000002EF 0000 dw %8 743 <1> ;---------------------- ; 744 <1> %define Message_Number 50 745 <1> %define Handle STDOUT 746 <1> Sublist_MsgAllocNum equ Sublist_msgAllocNum ; NASM port label 747 <1> %define Sublist Sublist_MsgAllocNum 748 <1> %define Count 1 749 <1> %define Class Utility_Msg_Class 750 <1> %define Function No_Function 751 <1> %define Input N_A 752 <1> Define_Msg msgAllocNum ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002F1 3200 dw %2 0 000002F3 0100 dw %3 0 000002F5 [6300] dw %4 0 000002F7 0100 dw %5 0 000002F9 FF db %6 0 000002FA 00 db %7 0 000002FB 0000 dw %8 753 <1> ;---------------------- ; 754 <1> %define Message_Number 51 755 <1> %define Handle STDOUT 756 <1> Sublist_MsgAllocSize equ Sublist_msgAllocSize ; NASM port label 757 <1> %define Sublist Sublist_MsgAllocSize 758 <1> %define Count 1 759 <1> %define Class Utility_Msg_Class 760 <1> %define Function No_Function 761 <1> %define Input N_A 762 <1> Define_Msg msgAllocSize ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 000002FD 3300 dw %2 0 000002FF 0100 dw %3 0 00000301 [6E00] dw %4 0 00000303 0100 dw %5 0 00000305 FF db %6 0 00000306 00 db %7 0 00000307 0000 dw %8 763 <1> ;---------------------- ; 764 <1> %define Message_Number 52 765 <1> %define Handle STDOUT 766 <1> %define Sublist No_Replace 767 <1> %define Count N_A 768 <1> %define Class Utility_Msg_Class 769 <1> %define Function No_Function 770 <1> %define Input N_A 771 <1> Define_Msg msgPartitionTableWriteErr ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000309 3400 dw %2 0 0000030B 0100 dw %3 0 0000030D 0000 dw %4 0 0000030F 0000 dw %5 0 00000311 FF db %6 0 00000312 00 db %7 0 00000313 0000 dw %8 772 <1> ;---------------------- ; 773 <1> %define Message_Number 53 ;AN002; 774 <1> %define Handle STDOUT ;AN002; 775 <1> %define Sublist No_Replace ;AN002; 776 <1> %define Count N_A ;AN002; 777 <1> %define Class Utility_Msg_Class ;AN002; 778 <1> %define Function No_Function ;AN002; 779 <1> %define Input N_A ;AN002; 780 <1> Define_Msg msgSameSwitch ; ;AN002; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000315 3500 dw %2 0 00000317 0100 dw %3 0 00000319 0000 dw %4 0 0000031B 0000 dw %5 0 0000031D FF db %6 0 0000031E 00 db %7 0 0000031F 0000 dw %8 781 <1> ;---------------------- ; 782 <1> %define Message_Number 54 ;AN009; 783 <1> %define Handle STDOUT ;AN009; 784 <1> %define Sublist No_Replace ;AN009; 785 <1> %define Count N_A ;AN009; 786 <1> %define Class Utility_Msg_Class ;AN009; 787 <1> %define Function No_Function ;AN009; 788 <1> %define Input N_A ;AN009; 789 <1> Define_Msg msgBad_T_N ; ;AN009; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000321 3600 dw %2 0 00000323 0100 dw %3 0 00000325 0000 dw %4 0 00000327 0000 dw %5 0 00000329 FF db %6 0 0000032A 00 db %7 0 0000032B 0000 dw %8 790 <1> ;---------------------- ; 791 <1> %define Message_Number 55 ;an019; dms; 792 <1> %define Handle STDOUT ;an019; dms; 793 <1> %define Sublist Sublist_MsgVerify ;an019; dms; 794 <1> %define Count 1 ;an019; dms; 795 <1> %define Class Utility_Msg_Class ;an019; dms; 796 <1> %define Function No_Function ;an019; dms; 797 <1> %define Input N_A ;an019; dms; 798 <1> Define_Msg MsgVerify ; ;an019; dms; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000032D 3700 dw %2 0 0000032F 0100 dw %3 0 00000331 [9A00] dw %4 0 00000333 0100 dw %5 0 00000335 FF db %6 0 00000336 00 db %7 0 00000337 0000 dw %8 799 <1> ;---------------------- ; 800 <1> %define Message_Number 0 801 <1> %define Handle STDERR 802 <1> %define Sublist No_Replace 803 <1> %define Count N_A 804 <1> %define Class Ext_Err_Class 805 <1> %define Function No_Function 806 <1> %define Input N_A 807 <1> Define_Msg Extended_Error_Msg ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000339 0000 dw %2 0 0000033B 0200 dw %3 0 0000033D 0000 dw %4 0 0000033F 0000 dw %5 0 00000341 01 db %6 0 00000342 00 db %7 0 00000343 0000 dw %8 808 <1> ;---------------------- 809 <1> %define Message_Number 0 810 <1> %define Handle STDERR 811 <1> %define Sublist Sublist_MsgParse_Error 812 <1> %define Count 1 813 <1> %define Class Parse_Err_Class 814 <1> %define Function No_Function 815 <1> %define Input N_A 816 <1> Define_Msg Parse_Error_Msg ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000345 0000 dw %2 0 00000347 0200 dw %3 0 00000349 [8F00] dw %4 0 0000034B 0100 dw %5 0 0000034D 02 db %6 0 0000034E 00 db %7 0 0000034F 0000 dw %8 817 <1> ;----------------------- 818 <1> 819 <1> 820 <1> ; 821 <1> ;These need to be coded as extended an parse errors, but left here to link. 822 <1> ; 823 <1> 824 <1> %define Message_Number 70 825 <1> %define Handle STDOUT 826 <1> %define Sublist No_Replace 827 <1> %define Count N_A 828 <1> %define Class Utility_Msg_Class 829 <1> %define Function No_Input 830 <1> %define Input N_A 831 <1> Define_Msg msgOutOfMemory ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000351 4600 dw %2 0 00000353 0100 dw %3 0 00000355 0000 dw %4 0 00000357 0000 dw %5 0 00000359 FF db %6 0 0000035A 00 db %7 0 0000035B 0000 dw %8 832 <1> ;---------------------- ; 833 <1> %define Message_Number 71 834 <1> %define Handle STDOUT 835 <1> %define Sublist No_Replace 836 <1> %define Count N_A 837 <1> %define Class Utility_Msg_Class 838 <1> %define Function No_Input 839 <1> %define Input N_A 840 <1> Define_Msg msgBadDrive ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 0000035D 4700 dw %2 0 0000035F 0100 dw %3 0 00000361 0000 dw %4 0 00000363 0000 dw %5 0 00000365 FF db %6 0 00000366 00 db %7 0 00000367 0000 dw %8 841 <1> ;---------------------- ; 842 <1> %define Message_Number 10 843 <1> StdErr equ STDERR ; NASM port equate 844 <1> %define Handle StdErr 845 <1> %define Sublist No_Replace 846 <1> %define Count N_A 847 <1> %define Class Parse_Err_Class 848 <1> %define Function No_Input 849 <1> %define Input N_A 850 <1> Define_Msg msgInvalidParameter ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000369 0A00 dw %2 0 0000036B 0200 dw %3 0 0000036D 0000 dw %4 0 0000036F 0000 dw %5 0 00000371 02 db %6 0 00000372 00 db %7 0 00000373 0000 dw %8 851 <1> ;---------------------- ; 852 <1> %define Message_Number 73 853 <1> %define Handle STDOUT 854 <1> %define Sublist No_Replace 855 <1> %define Count N_A 856 <1> %define Class Utility_Msg_Class 857 <1> %define Function No_Input 858 <1> %define Input N_A 859 <1> Define_Msg msgLoadFailure ; ;AN000; 10 <2> Create_Msg %1,Message_Number,Handle,Sublist,Count,Class,Function,Input 16 <3> Public %1 17 <3> %1 label word 0 00000375 4900 dw %2 0 00000377 0100 dw %3 0 00000379 0000 dw %4 0 0000037B 0000 dw %5 0 0000037D FF db %6 0 0000037E 00 db %7 0 0000037F 0000 dw %8 860 <1> 861 <1> 862 <1> ; (no prior section) ; data ends 59 %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> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 60 [list +] 61 62 ; 63 ;***************************************************************************** 64 ; Message Services 65 ;***************************************************************************** 66 ; 67 68 69 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> ;; 0 00000000 ?? $M_S_SIZE DB ? ;11 ;;AN000;; SUBLIST size (PTR to next SUBLIST) 0 00000001 ?? $M_S_RESV DB ? ;0 ;;AN000;; RESERVED 0 00000002 ???????? $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item 0 00000006 ?? $M_S_ID DB ? ;;AN000;; n of %n 0 00000007 ?? $M_S_FLAG DB ? ;;AN000;; Data-type flags 0 00000008 ?? $M_S_MAXW DB ? ;;AN000;; Maximum field width 0 00000009 ?? $M_S_MINW DB ? ;;AN000;; Minimum field width 0 0000000A ?? $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> ;; 0 00000000 ?? $M_CLS_ID DB ? ;-1 ;;AN000;; Class identifer 0 00000001 ???? $M_COMMAND_VER DW ? ;EXPECTED_VERSION ;;AN003;; COMMAND.COM version check 0 00000003 ?? $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> ;; 0 00000000 ???? $M_NUM DW ? ;-1 ;;AN000;; Message Number 0 00000002 ???? $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> ;; 0 00000000 ???????? $M_EXT_ERR_ADDRS DD ? ;0 ;;AN000;; Allow pointers to THREE Extended error locations 0 00000004 ???????? $M_EXT_FILE DD ? ;0 ;;AN001;; 0 00000008 ???????? $M_EXT_COMMAND DD ? ;0 ;;AN000;; 0 0000000C ???????? $M_EXT_TERM DD ? ;-1 ;;AN000;; 0 00000010 ???????? $M_PARSE_COMMAND DD ? ;0 ;;AN000;; 0 00000014 ???????? $M_PARSE_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Parse error locations 0 00000018 ???????? $M_PARSE_TERM DD ? ;-1 ;;AN000;; 0 0000001C ???????? $M_CRIT_ADDRS DD ? ;0 ;;AN000;; Allow pointers to TWO Critical error locations 0 00000020 ???????? $M_CRIT_COMMAND DD ? ;0 ;;AN000;; 0 00000024 ???????? $M_CRIT_TERM DD ? ;-1 ;;AN000;; 0 00000028 ???????? $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 0 00000038 ???????? $M_CLS_TERM DD ? ;-1 ;;AN000;; 0 0000003C ???????? $M_DBCS_VEC DD ? ;0 ;;AN000;; Save DBCS vector 0 00000040 ???? $M_HANDLE DW ? ;;AN000;; 0 00000042 ?? $M_SIZE DB ? ;0 ;;AN000;; 0 00000043 ???? $M_CRLF DB ?,? ;0DH,0AH ;;AN004;; CR LF message 0 00000045 ?? $M_CLASS DB ? ;;AN004;; Saved class 0 00000046 ???? $M_RETURN_ADDR DW ? ;;AN000;; 0 00000048 ???? $M_MSG_NUM DW ? ;$M_NULL ;;AN000;; 0 0000004A ???? $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 0 0000008C ?? $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 0 0000004C ???? $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format 0 0000004E ?????????? $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;; 0 00000053 ???? $M_THOU_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Thou Separator 0 00000055 ???? $M_DECI_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Decimal Separator 0 00000057 ???? $M_DATE_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Date Separator 0 00000059 ???? $M_TIME_SEPARA DB ?,? ;?,0 ;;AN000;; <------- Time Separator 0 0000005B ?? $M_CURR_FORMAT DB ? ;;AN000;; 0 0000005C ?? $M_SIG_DIGS_CU DB ? ;;AN000;; 0 0000005D ?? $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> 70 71 === Switch to base=000080h -> "DATA" 72 section data 73 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 0 00000381 00000000 dd 0 208 <2> at $M_EXT_FILE 0 00000385 00000000 dd 0 210 <2> at $M_EXT_COMMAND 0 00000389 00000000 dd 0 212 <2> at $M_EXT_TERM 0 0000038D FFFFFFFF dd -1 214 <2> at $M_PARSE_COMMAND 0 00000391 00000000 dd 0 216 <2> at $M_PARSE_ADDRS 0 00000395 00000000 dd 0 218 <2> at $M_PARSE_TERM 0 00000399 FFFFFFFF dd -1 220 <2> at $M_CRIT_ADDRS 0 0000039D 00000000 dd 0 222 <2> at $M_CRIT_COMMAND 0 000003A1 00000000 dd 0 224 <2> at $M_CRIT_TERM 0 000003A5 FFFFFFFF dd -1 226 <2> at $M_DISK_PROC_ADDR 0 000003A9 FFFFFFFF dd -1 228 <2> at $M_CLASS_ADDRS 0 000003AD 00000000 times $M_NUM_CLS dd 0 230 <2> at $M_CLS_TERM 0 000003B9 FFFFFFFF dd -1 232 <2> at $M_DBCS_VEC 0 000003BD 00000000 dd 0 234 <2> at $M_HANDLE 0 000003C1 0000 dw 0 236 <2> at $M_SIZE 0 000003C3 00 db 0 238 <2> at $M_CRLF 0 000003C4 0D0A db 0Dh, 0Ah 240 <2> at $M_CLASS 0 000003C6 00 db 0 242 <2> at $M_RETURN_ADDR 0 000003C7 0000 dw 0 244 <2> at $M_MSG_NUM 0 000003C9 0000 dw 0 246 <2> at $M_DIVISOR 0 000003CB 0A00 dw 10 248 <2> at $M_TEMP_BUF 0 000003CD 24 times $M_TEMP_BUF_SZ db "$" 250 <2> at $M_BUF_TERM 0 0000040D 24 db "$" 252 <2> iend 253 <2> ;; 254 <2> %include "copyrigh.mac" ;;AN001;; Include Copyright 1988 Microsoft 0 0000040E 4D5320444F53205665 DB "MS DOS Version 4.00 (C)Copyright 1988 Microsoft Corp" 0 00000417 7273696F6E20342E30 0 00000420 3020284329436F7079 0 00000429 726967687420313938 0 00000432 38204D6963726F736F 0 0000043B 667420436F7270 0 00000442 4C6963656E73656420 DB "Licensed Material - Property of Microsoft " 0 0000044B 4D6174657269616C20 0 00000454 2D2050726F70657274 0 0000045D 79206F66204D696372 0 00000466 6F736F66742020 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> 74 ; (no prior section) ; data ends 75 === Switch to base=001900h -> "CODE" 76 section code 77 78 global amis_sign 79 even 80 amis_sign: 0 00000000 65636D20 .ven: fill 8, 32, db "ecm" 0 00000008 6C444F5320 .prod: fill 8, 32, db "lDOS" 83 amis_id: ; must be directly after amis_sign 0 00000010 0000 dw 0 0 00000012 0000 .seq: dw 0 ; sequential number 0 00000014 06666F726D6174 .us: counted "format" ; our id name 87 88 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> 89 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;; 0 0000001B 50 PUSH AX ;;AN000; 0 0000001C 53 PUSH BX ;;AN000; 0 0000001D 52 PUSH DX ;;AN000; 0 0000001E 06 PUSH ES ;;AN000; 0 0000001F 57 PUSH DI ;;AN000; 0 00000020 31C9 XOR CX,CX ;;AN000; Reset to zero 0 00000022 8EC1 MOV ES,CX ;;AN000; 0 00000024 31FF XOR DI,DI ;;AN000; 0 00000026 B82E12 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 0 00000029 B200 MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM 0 0000002B CD2F INT 2FH ;;AN000;; Private interface 0 0000002D 8C06[8B03] MOV WORD PTR [$M_RT + $M_EXT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 0 00000031 893E[8903] MOV WORD PTR [$M_RT + $M_EXT_COMMAND],DI ;;AN000;; 572 <2> ;; 0 00000035 B82E12 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 0 00000038 B202 MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM 0 0000003A CD2F INT 2FH ;;AN000;; Private interface 0 0000003C 8C06[9303] MOV WORD PTR [$M_RT + $M_PARSE_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 0 00000040 893E[9103] MOV WORD PTR [$M_RT + $M_PARSE_COMMAND],DI ;;AN000;; 578 <2> ;; 0 00000044 B82E12 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface 0 00000047 B204 MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM 0 00000049 CD2F INT 2FH ;;AN000;; Private interface 0 0000004B 8C06[A303] MOV WORD PTR [$M_RT + $M_CRIT_COMMAND+2],ES ;;AN000;; Move into first avaliable table location 0 0000004F 893E[A103] MOV WORD PTR [$M_RT + $M_CRIT_COMMAND],DI ;;AN000;; 584 <2> 0 00000053 B82E12 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 0 00000056 B206 MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE 0 00000058 CD2F INT 2FH ;;AN001;; Private interface 0 0000005A 8C06[8703] MOV WORD PTR [$M_RT + $M_EXT_FILE+2],ES ;;AN001;; Move into first avaliable table location 0 0000005E 893E[8503] 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;; 0 00000062 E8C30F CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) 598 <2> %ENDIF ;;AN000;; 0 00000065 8C06[8303] MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 0 00000069 893E[8103] MOV WORD PTR [$M_RT + $M_EXT_ERR_ADDRS],DI ;;AN000;; 0 0000006D 8C06[9F03] MOV WORD PTR [$M_RT + $M_CRIT_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 0 00000071 893E[9D03] 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;; 0 00000075 E8D20F CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) 608 <2> %ENDIF ;;AN000;; 0 00000078 8C06[9703] MOV WORD PTR [$M_RT + $M_PARSE_ADDRS+2],ES ;;AN000;; Move into first avaliable table location 0 0000007C 893E[9503] MOV WORD PTR [$M_RT + $M_PARSE_ADDRS],DI ;;AN000;; 611 <2> %ENDIF ;; 612 <2> ;; 0 00000080 B82E12 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface 0 00000083 B208 MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM 0 00000085 CD2F INT 2FH ;;AN001;; Private interface 0 00000087 8C06[AB03] MOV WORD PTR [$M_RT + $M_DISK_PROC_ADDR+2],ES ;;AN001;; Move into first avaliable table location 0 0000008B 893E[A903] 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 0 0000008F E89709 CALL $M_CLS_%1 0 00000092 893E[AD03] 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 0 00000096 E8780C CALL $M_CLS_%1 0 00000099 893E[B103] 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 0 0000009D E8D60E CALL $M_CLS_%1 0 000000A0 893E[B503] 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;; 0 000000A4 E81900 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 0 000000A7 E82E00 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 0 000000AA E83E00 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 0 000000AD 51 PUSH CX ;;AN000;; 0 000000AE E89400 CALL $M_VERSION_CHECK ;;AN000;; Check Version 636 <2> %ENDIF ;;AN000;; 637 <2> ;; Error ? 638 <2> ; $IF NC ;;AN000;; No. 0 000000B1 7208 JC $MIF20 640 <2> %IFN NOVERCHECKmsg ;;AN000;; IF version check was not supressed 0 000000B3 59 POP CX ;;AN000;; Reset stack 642 <2> %ENDIF ;;AN000;; 0 000000B4 5F POP DI ;;AN000;; Restore REGS 0 000000B5 07 POP ES ;;AN000;; 0 000000B6 5A POP DX ;;AN000;; 0 000000B7 5B POP BX ;;AN000;; 0 000000B8 58 POP AX ;;AN000;; 648 <2> ; $ELSE ;;AN000;; Yes, 0 000000B9 EB04 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 0 000000BB 83C40C ADD SP,12 ;;AN000;; 0 000000BE F9 STC ;;AN000;; Reset carry flag 657 <2> %ENDIF ;;AN000;; IF version check is to be supressed 658 <2> ; $ENDIF ;;AN000;; 659 <2> $MEN20: 0 000000BF C3 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> ;; 0 000000C0 50 PUSH AX ;;AN000;; Save character to check 0 000000C1 56 PUSH SI ;;AN000;; 0 000000C2 1E PUSH DS ;;AN000;; 0 000000C3 B80063 MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment 0 000000C6 CD21 INT 21H ;;AN000;; Get environment pointer 0 000000C8 1E PUSH DS ;;AN000;; Get environment pointer 0 000000C9 07 POP ES ;;AN000;; Get environment pointer 0 000000CA 1F POP DS ;;AN000;; Get environment pointer 690 <2> ; $IF NC ;;AN000;; 0 000000CB 7208 JC $MIF23 0 000000CD 8936[BD03] MOV WORD PTR [$M_RT + $M_DBCS_VEC],SI ;;AN000;; Save DBCS Vector 0 000000D1 8C06[BF03] MOV WORD PTR [$M_RT + $M_DBCS_VEC+2],ES ;;AN000;; 694 <2> ; $ENDIF ;;AN000;; 695 <2> $MIF23: 0 000000D5 5E POP SI ;;AN000;; 0 000000D6 58 POP AX ;;AN000;; Retrieve character to check 0 000000D7 C3 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> 0 000000D8 B80044 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 0 000000DB BB0000 MOV BX,STDIN ;AN001; 0 000000DE 31D2 XOR DX,DX ;AN001; 0 000000E0 CD21 INT 21H ;AN001; 727 <2> 0 000000E2 80CE01 OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 0 000000E5 B80144 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 0 000000E8 CD21 INT 21H ;AN001; 731 <2> 0 000000EA C3 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> 0 000000EB B80044 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL 0 000000EE BB0100 MOV BX,STDOUT ;AN001; 0 000000F1 31D2 XOR DX,DX ;AN001; 0 000000F3 CD21 INT 21H ;AN001; 762 <2> 0 000000F5 80CE01 OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit 0 000000F8 B80144 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL 0 000000FB CD21 INT 21H ;AN001; 766 <2> 0 000000FD C3 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: 0 000000FE 50 push ax 0 000000FF 1E push ds 0 00000100 56 push si 0 00000101 06 push es 0 00000102 57 push di 0 00000103 52 push dx 0 00000104 50 push ax ; version number, last on stack 801 <2> 0 00000105 B400 mov ah, 0 ; multiplex number = 0 803 <2> .loop: 0 00000107 B000 mov al, 0 0 00000109 CD2D int 2Dh ; installation check 0 0000010B 3CFF cmp al, -1 ; multiplexer installed ? 0 0000010D 7520 jne .next ; no --> 0 0000010F 0E push cs 0 00000110 1F pop ds 0 00000111 BE[0000] mov si, offset amis_sign ; ds:si -> amis_sign (for lDOS) 0 00000114 8EC2 mov es, dx ; es:di -> multiplexer's sign 0 00000116 B90800 mov cx, 8 ; 16 bytes 0 00000119 F3A7 repe cmpsw ; compare 0 0000011B 7512 jne .next ; not us --> 0 0000011D 8CCA mov dx, cs ; dx:si -> amis_id 0 0000011F B011 mov al, 11h 0 00000121 CD2D int 2Dh ; CHG: al, bx, cx, dx, si, di 0 00000123 3C00 cmp al, 0 ; id call supported ? 0 00000125 740C je .unsup ; no, allow if alt version --> 0 00000127 5A pop dx 0 00000128 31D2 xor dx, dx ; 2D.MM11 supported, mark that we need it 0 0000012A 52 push dx 0 0000012B 3CF0 cmp al, 0F0h ; CY if below 0F0h 0 0000012D EB05 jmp .done 825 <2> 826 <2> .next: 0 0000012F FEC4 inc ah ; next multiplex number 0 00000131 75D4 jnz .loop ; ZR if done, NZ if more to check --> 829 <2> .unsup: 0 00000133 F9 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 0 00000134 5B pop bx 0 00000135 5A pop dx 0 00000136 5F pop di 0 00000137 07 pop es 0 00000138 5E pop si 0 00000139 1F pop ds 0 0000013A 58 pop ax 0 0000013B 731B jnc alt_good_DOS ; id is supported --> 0 0000013D 81FB051A cmp bx, alt_expected_version ; is it fine ? 0 00000141 7415 je alt_good_DOS ; yes --> (NC) 0 00000143 EB16 jmp $MIF25 ; no, cancel program --> 852 <2> 853 <2> $M_VERSION_CHECK PROC NEAR ;;AN000;; 854 <2> ;; 0 00000145 B430 MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC 0 00000147 CD21 INT 21H ;;AN000;; 857 <2> ;; 0 00000149 3D0526 cmp ax,new_expected_version ; compare with DOS version 0 0000014C 74B0 je check_amis 0 0000014E 3D051A cmp ax,alt_expected_version ; compare with DOS version 0 00000151 74AB je check_amis 0 00000153 83F804 CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct 863 <2> ; $IF E ;;AN000;; 0 00000156 7503 JNE $MIF25 865 <2> alt_good_DOS: 0 00000158 F8 CLC ;;AN000;; Clear the carry flag 867 <2> ; $ELSE ;;AN000;; ELSE 0 00000159 EB18 JMP SHORT $MEN25 869 <2> $MIF25: 870 <2> %IFN COMR ;; ** Special case for RESIDENT COMMAND.COM 0 0000015B 83F802 CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH 872 <2> ; $IF B ;;AN000;; No, 0 0000015E 7305 JNB $MIF27 0 00000160 BBFFFF MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support) 875 <2> ; $ELSE ;;AN000;; Yes, 0 00000163 EB03 JMP SHORT $MEN27 877 <2> $MIF27: 0 00000165 BB0200 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 0 00000168 B80100 MOV AX,1 ;;AN000;; Set message # 1 0 0000016B B90000 MOV CX,NO_REPLACE ;;AN000;; No replacable parms 0 0000016E B200 MOV DL,NO_INPUT ;;AN000;; No input 0 00000170 B6FF MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message 0 00000172 F9 STC ;;AN000;; Set Carry Flag 889 <2> ; $ENDIF ;;AN000;; 890 <2> $MEN25: 891 <2> ;; 0 00000173 C3 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> 90 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> 0 00000174 50 PUSH AX ;;AN000;; Save changed REGs 0 00000175 53 PUSH BX ;;AN000;; 0 00000176 51 PUSH CX ;;AN000;; 0 00000177 55 PUSH BP ;;AN000;; 0 00000178 57 PUSH DI ;;AN000;; Save pointer to input buffer (offset) 0 00000179 06 PUSH ES ;;AN000;; Save pointer to input buffer (segment) 0 0000017A 52 PUSH DX ;;AN000;; Save Input/Class request 1352 <2> 0 0000017B 89CD MOV BP,CX ;;AN000;; Use BP to hold replace count 0 0000017D 891E[C103] MOV WORD PTR [$M_RT + $M_HANDLE],BX ;;AN000;; Save handle 0 00000181 8836[C603] 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;; 0 00000185 E89D02 CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message 1363 <2> %ENDIF ;;AN000;; 0 00000188 09C9 OR CX,CX ;;AN000;; Was message found? 1365 <2> ; $IF NZ ;;AN000;; YES, Message address in ES:DI 0 0000018A 741C JZ $MIF93 1367 <2> 1368 <2> ;; Test if replacable parameters were specified 1369 <2> 0 0000018C 09ED OR BP,BP ;;AN000;; Were replacable parameters requested 1371 <2> ; $IF Z ;;AN000;; 0 0000018E 7505 JNZ $MIF94 1373 <2> 1374 <2> ;; Display string without replacable parms 1375 <2> 0 00000190 E82600 CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message 1377 <2> ; $ELSE ;;AN000;; 0 00000193 EB03 JMP SHORT $MEN94 1379 <2> $MIF94: 1380 <2> %IF $M_REPLACE ;;AN000;; 1381 <2> 1382 <2> ;; Display message with replacable parms 1383 <2> 0 00000195 E86D01 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 0 00000198 7208 JC $MIF97 1390 <2> 0 0000019A 5A POP DX ;;AN000;; Get Input/Class request 1392 <2> 0 0000019B E8C200 CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. 1394 <2> 0 0000019E 07 POP ES ;;AN000;; Get location of input buffer (if specified) 0 0000019F 5F 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;; 0 000001A0 EB04 JMP SHORT $MEN97 1410 <2> $MIF97: 0 000001A2 83C406 ADD SP,6 ;;AN000;; 0 000001A5 F9 STC ;;AN000;; Reset carry flag 1413 <2> ; $ENDIF ;;AN000;; 1414 <2> $MEN97: 1415 <2> ; $ELSE ;;AN000;; No, 0 000001A6 EB04 JMP SHORT $MEN93 1417 <2> $MIF93: 0 000001A8 07 POP ES ;;AN000;; Get pointer to input buffer (segment) 0 000001A9 5F POP DI ;;AN000;; Get base pointer to first sublist (offset) 0 000001AA 5A POP DX ;;AN000;; Get base pointer to first sublist (segment) 0 000001AB F9 STC ;;AN000;; Set carry flag 1422 <2> ; $ENDIF ;;AN000;; 1423 <2> $MEN93: 1424 <2> ;; 1425 <2> ; $IF NC ;;AN000;; Was there an error? 0 000001AC 7206 JC $MIF104 0 000001AE 5D POP BP ;;AN000;; No, 0 000001AF 59 POP CX ;;AN000;; 0 000001B0 5B POP BX ;;AN000;; 1430 <2> %IF INPUTmsg ;;AN000;; 1431 <2> ADD SP,2 ;;AN000;; 1432 <2> %ELSE ;AN000; 0 000001B1 58 POP AX ;;AN000;; 1434 <2> %ENDIF ;;AN000;; 1435 <2> ; $ELSE ;;AN000;; Yes, 0 000001B2 EB04 JMP SHORT $MEN104 1437 <2> $MIF104: 0 000001B4 83C408 ADD SP,8 ;;AN000;; Eliminate from stack 0 000001B7 F9 STC ;;AN000;; 1440 <2> ; $ENDIF ;;AN000;; 1441 <2> $MEN104: 1442 <2> ;; 0 000001B8 C3 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> ;; 0 000001B9 50 PUSH AX ;;AN000;; 0 000001BA 53 PUSH BX ;;AN000;; 0 000001BB 52 PUSH DX ;;AN000;; 1465 <2> ;; 0 000001BC 8B1E[C103] 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 0 000001C0 83FBFF CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1472 <2> ; $IF E ;;AN000;; 0 000001C3 7505 JNE $MIF107 0 000001C5 E82C00 CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string 1475 <2> ; $ELSE ;;AN000;; 0 000001C8 EB03 JMP SHORT $MEN107 1477 <2> $MIF107: 0 000001CA E85C00 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? 0 000001CD 730F JNC $MIF110 0 000001CF B459 MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes, 0 000001D1 BB0000 MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error 0 000001D4 CD21 INT 21H ;;AN000;; 0 000001D6 30E4 XOR AH,AH ;;AN000;; Clear AH 0 000001D8 83C406 ADD SP,6 ;;AN000;; Clean up stack 0 000001DB F9 STC ;;AN000;; Flag that there was an error 1490 <2> ; $ELSE ;;AN000;; No, 0 000001DC EB10 JMP SHORT $MEN110 1492 <2> $MIF110: 0 000001DE 83FBFF CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? 1494 <2> ; $IF NE ;;AN000;; 0 000001E1 740B JE $MIF112 0 000001E3 39C8 CMP AX,CX ;AN001; Was it ALL written? 1497 <2> ; $IF NE ;AN001; No, 0 000001E5 7407 JE $MIF113 0 000001E7 E86D00 CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error 0 000001EA 83C406 ADD SP,6 ;AN001; Clean up stack 0 000001ED F9 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? 0 000001EE 7203 JC $MIF117 0 000001F0 5A POP DX ;;AN000;; Restore regs 0 000001F1 5B POP BX ;;AN000;; 0 000001F2 58 POP AX ;;AN000;; 1514 <2> ; $ENDIF ;;AN000;; 1515 <2> $MIF117: 0 000001F3 C3 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> ;; 0 000001F4 1E PUSH DS ;;AN000;; 0 000001F5 06 PUSH ES ;;AN000;; 0 000001F6 1F POP DS ;;AN000;; Set DS to segment of message text 1536 <2> %IFN COMR 0 000001F7 83F901 CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1538 <2> ; $IF E ;;AN000;; Yes, 0 000001FA 751B JNE $MIF119 0 000001FC B402 MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 0 000001FE 268A15 MOV DL,BYTE PTR [ES:DI] ;;AN000;; Get the character 0 00000201 CD21 INT 21H ;;AN000;; Write character 0 00000203 1F POP DS ;;AN000;; Set DS to segment of message text 0 00000204 88D0 MOV AL,DL ;;AN000;; Get the character in AL 0 00000206 E86E00 CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 0 00000209 1E PUSH DS ;;AN000;; 0 0000020A 06 PUSH ES ;;AN000;; 0 0000020B 1F POP DS ;;AN000;; Set DS to segment of message text 1549 <2> ; $IF C ;;AN000;; Yes, 0 0000020C 7307 JNC $MIF120 0 0000020E 268A5501 MOV DL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 0 00000212 CD21 INT 21H ;;AN000;; Write character 0 00000214 F8 CLC ;;AN000;; Clear the DBCS indicator 1554 <2> ; $ENDIF ;;AN000;; 1555 <2> $MIF120: 1556 <2> ; $ELSE ;;AN000;; No, 0 00000215 EB0F JMP SHORT $MEN119 1558 <2> $MIF119: 1559 <2> %ENDIF 0 00000217 B402 MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER 1561 <2> ; $DO ;;AN002;; No, 1562 <2> $MDO123: 0 00000219 09C9 OR CX,CX ;;AN002;; Are there any left to display? 1564 <2> ; $LEAVE Z ;;AN002;; Yes, 0 0000021B 7409 JZ $MEN123 0 0000021D 268A15 MOV DL,BYTE PTR [ES:DI] ;;AN002;; Get the character 0 00000220 CD21 INT 21H ;;AN002;; Display the character 0 00000222 47 INC DI ;;AN002;; Set pointer to next character 0 00000223 49 DEC CX ;;AN002;; Count this character 1570 <2> ; $ENDDO Z ;;AN002;; No, 0 00000224 75F3 JNZ $MDO123 1572 <2> $MEN123: 1573 <2> %IFN COMR 1574 <2> ; $ENDIF ;;AN000;; 1575 <2> $MEN119: 1576 <2> %ENDIF 0 00000226 F8 CLC ;;AN000;; Char functions used don't return carry as error 0 00000227 1F POP DS ;;AN000;; 0 00000228 C3 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> ;; 0 00000229 31C0 XOR AX,AX ;;AN002;; Set number of bytes written to 0 0 0000022B 09C9 OR CX,CX ;;AN002;; For performance, don't write if not necessary 1601 <2> ; $IF NZ ;;AN002;; Any chars to write? 0 0000022D 7427 JZ $MIF127 0 0000022F 1E PUSH DS ;;AN000;; Yes, 0 00000230 06 PUSH ES ;;AN000;; 0 00000231 1F POP DS ;;AN000;; Set DS to segment of message text 0 00000232 B440 MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 0 00000234 89FA MOV DX,DI ;;AN000;; Pointer to data to write 0 00000236 83F901 CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? 1609 <2> ; $IF E ;;AN000;; Yes, 0 00000239 7518 JNE $MIF128 0 0000023B CD21 INT 21H ;;AN000;; Write character 0 0000023D 1F POP DS ;;AN000;; Set DS to segment of message text 0 0000023E 50 PUSH AX ;;AN000;; 0 0000023F 268A05 MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 0 00000242 E83200 CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 0 00000245 58 POP AX ;;AN000;; Set DS to segment of message text 0 00000246 1E PUSH DS ;;AN000;; 0 00000247 06 PUSH ES ;;AN000;; 0 00000248 1F POP DS ;;AN000;; Set DS to segment of message text 1620 <2> ; $IF C ;;AN000;; Yes, 0 00000249 7306 JNC $MIF129 0 0000024B F8 CLC ;;AN000;; Clear the DBCS indicator 0 0000024C B440 MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle 0 0000024E 42 INC DX ;;AN000;; Point to next character 0 0000024F CD21 INT 21H ;;AN000;; Write character 1626 <2> ; $ENDIF ;;AN000;; 1627 <2> $MIF129: 1628 <2> ; $ELSE ;;AN000;; No, 0 00000251 EB02 JMP SHORT $MEN128 1630 <2> $MIF128: 0 00000253 CD21 INT 21H ;;AN000;; Write String at DS:SI to handle 1632 <2> ; $ENDIF ;;AN000;; 1633 <2> $MEN128: 0 00000255 1F POP DS ;;AN000;; 1635 <2> ; $ENDIF ;;AN002;; 1636 <2> $MIF127: 1637 <2> ;; 0 00000256 C3 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> ;; 0 00000257 B82700 MOV AX,EXT_ERR_39 ;AN001; Set AX=39 0 0000025A BB0400 MOV BX,(ERROR_CLASS_39 >> 8) + ACTION_39 ;AN001; Set BH=1 BL=4 0 0000025D B501 MOV CH,LOCUS_39 ;AN001; Set CH=1 1658 <2> ;AN001; 0 0000025F C3 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> ;; 0 00000260 80FEFF CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1678 <2> ; $IF NE ;;AN004;; No, 0 00000263 7411 JE $MIF134 0 00000265 F6C680 TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? 1681 <2> ; $IF Z ;;AN004;; No, 0 00000268 750C JNZ $MIF135 0 0000026A 1E PUSH DS ;;AN004;; 0 0000026B 07 POP ES ;;AN004;; Set ES to data segment 0 0000026C 8D3E[C403] LEA DI,[$M_RT + $M_CRLF] ;;AN004;; Point at CRLF message 0 00000270 B90200 MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size 0 00000273 E843FF CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF 1688 <2> ; $ENDIF ;;AN004;; 1689 <2> $MIF135: 1690 <2> ; $ENDIF ;;AN004;; 1691 <2> $MIF134: 0 00000276 C3 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> ;; 0 00000277 06 PUSH ES ;;AN000;; Save Extra segment register 0 00000278 57 PUSH DI ;;AN000;; Save SI register 1712 <2> ;; 0 00000279 C43E[BD03] LES DI,[$M_RT + $M_DBCS_VEC] ;;AN000;; 0 0000027D 09FF OR DI,DI ;;AN000;; Was the DBCS vector set? 1715 <2> ; $IF NZ ;;AN000;; 0 0000027F 7417 JZ $MIF138 1717 <2> ; $DO ;;AN000;; 1718 <2> $MDO139: 0 00000281 26833D00 CMP WORD PTR [ES:DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag? 0 00000285 F8 CLC ;;AN000;; 1721 <2> ; $LEAVE E ;;AN000;; 0 00000286 7410 JE $MEN139 1723 <2> ;; No, 0 00000288 263A05 CMP AL,BYTE PTR [ES:DI] ;;AN000;; Does the character fall in the DBCS range? 1725 <2> ; $IF AE,AND ;;AN000;; 0 0000028B 7207 JNAE $MIF141 0 0000028D 263A4501 CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Does the character fall in the DBCS range? 1728 <2> ; $IF BE ;;AN000;; 0 00000291 7701 JNBE $MIF141 0 00000293 F9 STC ;;AN000;; Yes, 1731 <2> ; $ENDIF ;;AN000;; Set carry flag 1732 <2> $MIF141: 0 00000294 47 INC DI ;;AN000;; No, 0 00000295 47 INC DI ;;AN000;; Go to next vector 1735 <2> ; $ENDDO ;;AN000;; 0 00000296 EBE9 JMP SHORT $MDO139 1737 <2> $MEN139: 1738 <2> ; $ENDIF ;;AN000;; 1739 <2> $MIF138: 1740 <2> 0 00000298 5F POP DI ;;AN000;; 0 00000299 07 POP ES ;;AN000;; Restore SI register 0 0000029A C3 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> ;; 0 0000029B 8F06[C703] POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Save Return Address 0 0000029F 31DB XOR BX,BX ;;AN000;; Use BP as a swapping register 1766 <2> ;; 0 000002A1 93 XCHG BX,AX ;;AN000;; Initialize - Low Word in BP 0 000002A2 92 XCHG AX,DX ;;AN000;; - High Word in AX 1769 <2> ; $DO ;;AN000;; DO UNTIL Low Word becomes zero 1770 <2> $MDO145: 0 000002A3 F736[CB03] DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide High Word by divisor 0 000002A7 93 XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder 1773 <2> ;; and save reduced High Word in BP 0 000002A8 F736[CB03] DIV word [$M_RT + $M_DIVISOR] ;;AN000;; Divide Low Word by divisor 0 000002AC 83FA09 CMP DX,9 ;;AN000;; Make a digit of the remainder 1776 <2> ; $IF A ;;AN000;; IF 10 to 15, 0 000002AF 7605 JNA $MIF146 0 000002B1 80C237 ADD DL,55 ;;AN000;; Make A to F ASCII 1779 <2> ; $ELSE ;;AN000;; IF 0 to 9, 0 000002B4 EB03 JMP SHORT $MEN146 1781 <2> $MIF146: 0 000002B6 80C230 ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII 1783 <2> ; $ENDIF ;;AN000;; 1784 <2> $MEN146: 0 000002B9 52 PUSH DX ;;AN000;; Save the digit on the stack 0 000002BA 41 INC CX ;;AN000;; Count that digit 0 000002BB 09C0 OR AX,AX ;;AN000;; Are we done? 1788 <2> ; $LEAVE Z,AND ;;AN000;; 0 000002BD 7504 JNZ $MLL149 0 000002BF 09DB OR BX,BX ;;AN000;; AX and BX must be ZERO!! 1791 <2> ; $LEAVE Z ;;AN000;; No, 0 000002C1 7439 JZ $MEN145 1793 <2> $MLL149: 1794 <2> %IFN COMR 0 000002C3 83F903 CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark 1796 <2> ; $IF E ;;AN000;; Yes, 0 000002C6 750D JNE $MIF150 0 000002C8 807C0A2C CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1799 <2> ; $IF E ;;AN000;; Yes, 0 000002CC 7505 JNE $MIF151 0 000002CE FF36[D403] PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 0 000002D2 41 INC CX ;;AN000;; 1803 <2> ; $ENDIF ;;AN000;; 1804 <2> $MIF151: 1805 <2> ; $ELSE ;;AN000;; No, 0 000002D3 EB22 JMP SHORT $MEN150 1807 <2> $MIF150: 0 000002D5 83F906 CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark 1809 <2> ; $IF E ;;AN000;; Yes, 0 000002D8 750D JNE $MIF154 0 000002DA 807C0A2C CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1812 <2> ; $IF E ;;AN000;; Yes, 0 000002DE 7505 JNE $MIF155 0 000002E0 FF36[D403] PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 0 000002E4 41 INC CX ;;AN000;; 1816 <2> ; $ENDIF ;;AN000;; 1817 <2> $MIF155: 1818 <2> ; $ELSE ;;AN000;; No, 0 000002E5 EB10 JMP SHORT $MEN154 1820 <2> $MIF154: 0 000002E7 83F909 CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark 1822 <2> ; $IF E ;;AN000;; Yes, 0 000002EA 750B JNE $MIF158 0 000002EC 807C0A2C CMP byte [$M_SL + $M_S_PAD],$M_COMMA ;;AN000;; Is the pad character a comma? 1825 <2> ; $IF E ;;AN000;; Yes, 0 000002F0 7505 JNE $MIF159 0 000002F2 FF36[D403] PUSH WORD [$M_RT + $M_THOU_SEPARA] ;;AN000;; Insert a thousand separator 0 000002F6 41 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 0 000002F7 93 XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word 1839 <2> ;;AN000;; and Revised Low Word 0 000002F8 31D2 XOR DX,DX ;;AN000;; Reset remainder 1841 <2> ; $ENDDO ;;AN000;; NEXT 0 000002FA EBA7 JMP SHORT $MDO145 1843 <2> $MEN145: 1844 <2> ;;AN000;; Yes, 0 000002FC 31D2 XOR DX,DX ;;AN000;; Reset remainder 0 000002FE 31C0 XOR AX,AX ;;AN000;; Reset remainder 0 00000300 FF36[C703] PUSH word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Restore Return Address 0 00000304 C3 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: 0 00000305 31D2 XOR DX,DX ;;AN000;; Set size = 0 0 00000307 09C9 OR CX,CX ;;AN000;; Are we finished the message yet? 1874 <2> ; $IF NZ ;;AN000;; No, 0 00000309 7421 JZ $MIF166 0 0000030B B425 MOV AH,"%" ;;AN000;; Prepare to scan for % 0 0000030D B000 MOV AL,0 ;;AN004;; 1878 <2> ;; 1879 <2> ; $DO ;;AN000;; Scan through string until % 1880 <2> $MDO167: 0 0000030F 263825 CMP BYTE PTR [ES:DI],AH ;;AN000;; Is this character NOT a % 1882 <2> ; $LEAVE E,AND ;;AN000;; No, 0 00000312 750A JNE $MLL168 0 00000314 26386501 CMP BYTE PTR [ES:DI+1],AH ;;AN000;; Is the next character also a % 1885 <2> ; $LEAVE NE,AND ;;AN000;; No, 0 00000318 7404 JE $MLL168 0 0000031A 38E0 CMP AL,AH ;;AN000;; Was the character before a % 1888 <2> ; $LEAVE NE ;;AN000;; No, GREAT found it 0 0000031C 750E JNE $MEN167 1890 <2> $MLL168: 0 0000031E 268A05 MOV AL,BYTE PTR [ES:DI] ;;AN004;; Yes, (to any of the above) 0 00000321 E853FF CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? 1893 <2> ; $IF C ;;AN004;; Yes, 0 00000324 7301 JNC $MIF169 0 00000326 47 INC DI ;;AN004;; Increment past second part 1896 <2> ; $ENDIF ;;AN004;; 1897 <2> $MIF169: 0 00000327 47 INC DI ;;AN000;; Next character in string 0 00000328 42 INC DX ;;AN000;; Size = Size + 1 0 00000329 49 DEC CX ;;AN000;; Decrement total size 1901 <2> ; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line 0 0000032A 75E3 JNZ $MDO167 1903 <2> $MEN167: 1904 <2> ; $ENDIF ;;AN000;; 1905 <2> $MIF166: 1906 <2> ;; 0 0000032C 56 PUSH SI ;;AN000;; Save beginning of sublists 0 0000032D 87D1 XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX) 0 0000032F 09ED OR BP,BP ;;AN000;; Do we have any replacables to do? 1910 <2> ; $IF NZ ;;AN000;; Yes, 0 00000331 7433 JZ $MIF173 0 00000333 4D DEC BP ;;AN000;; Decrement number of replacables 1913 <2> 1914 <2> ;; Search through sublists to find applicable one 1915 <2> 0 00000334 833E[C903]00 CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 1917 <2> ; $IF E ;;AN000;; No, 0 00000339 752B JNE $MIF174 1919 <2> ; $SEARCH ;;AN000;; 1920 <2> $MDO175: 0 0000033B 8A4406 MOV AL,[$M_SL + $M_S_ID] ;;AN000;; Get ID byte 0 0000033E 0430 ADD AL,30H ;;AN000;; Convert to ASCII 0 00000340 263A4501 CMP AL,BYTE PTR [ES:DI + 1] ;;AN000;; Is this the right sublist? 1924 <2> ; $EXITIF E ;;AN000;; 0 00000344 7502 JNE $MIF175 1926 <2> ; $ORELSE ;;AN000;; No, 0 00000346 EB1E JMP SHORT $MSR175 1928 <2> $MIF175: 0 00000348 3C30 CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 1930 <2> ; $LEAVE E,AND ;;AN000;; Yes, 0 0000034A 7504 JNE $MLL178 0 0000034C 09D2 OR DX,DX ;;AN000;; Are we at the end of the message? 1933 <2> ; $LEAVE Z ;;AN000;; No, 0 0000034E 7404 JZ $MEN175 1935 <2> $MLL178: 0 00000350 0334 ADD SI,WORD PTR [$M_SL + $M_S_SIZE] ;;AN000;; Next SUBLIST 1937 <2> ; $ENDLOOP ;;AN000;; Yes, 0 00000352 EBE7 JMP SHORT $MDO175 1939 <2> $MEN175: 0 00000354 803E[C603]FF CMP byte [$M_RT + $M_CLASS],UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? 1941 <2> ; $IF E ;;AN004;; Yes, 0 00000359 7508 JNE $MIF180 0 0000035B 42 INC DX ;;AN000;; Remember to display CR,LF 0 0000035C 42 INC DX ;;AN000;; at the end of the message 0 0000035D 49 DEC CX ;;AN000;; Adjust message length 0 0000035E 49 DEC CX ;;AN000;; 0 0000035F 4F DEC DI ;;AN000;; Adjust ending address of message 0 00000360 4F DEC DI ;;AN000;; 1949 <2> ; $ELSE ;;AN004;; No, 0 00000361 EB03 JMP SHORT $MEN180 1951 <2> $MIF180: 0 00000363 BAFFFF 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> 0 00000366 57 PUSH DI ;;AN000;; Save pointer to replace number 0 00000367 29CF SUB DI,CX ;;AN000;; Determine beginning of string 0 00000369 E84DFE CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) 0 0000036C 5F POP DI ;;AN000;; Get back pointer to replace number 0 0000036D 59 POP CX ;;AN000;; Clean up stack in case error 1969 <2> ; $LEAVE C,LONG ;;AN000;; Fail if carry was set 0 0000036E 7303 JNC $MXL3 0 00000370 EB7F JMP $MEN165 0 00000372 90 nop ; identicalise 1973 <2> $MXL3: 0 00000373 51 PUSH CX ;;AN000;; 1975 <2> 1976 <2> ;; Save and reset pointer registers 1977 <2> 0 00000374 89D1 MOV CX,DX ;;AN000;; Get the size of the rest of the message 0 00000376 807C0600 CMP byte [$M_SL + $M_S_ID],$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case? 1980 <2> ; $IF NE ;;AN000;; No, 0 0000037A 740D JE $MIF187 0 0000037C 09C9 OR CX,CX ;;AN000;; Are we finished the whole message? 1983 <2> ; $IF NZ ;;AN000;; No, 0 0000037E 7406 JZ $MIF188 0 00000380 49 DEC CX ;;AN000;; Decrement total size (%) 0 00000381 49 DEC CX ;;AN000;; Decrement total size (#) 0 00000382 47 INC DI ;;AN000;; Go past % 0 00000383 47 INC DI ;;AN000;; Go past replace number 1989 <2> ; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) 0 00000384 EB01 JMP SHORT $MEN188 1991 <2> $MIF188: 0 00000386 5E 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;; 0 00000387 EB10 JMP SHORT $MEN187 1997 <2> $MIF187: 0 00000389 09C9 OR CX,CX ;;AN000;; Are we finished the whole message? 1999 <2> ; $IF Z ;;AN004;; No, 0 0000038B 7503 JNZ $MIF192 0 0000038D 5E POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs 2002 <2> ; $ELSE ;;AN000;; No, 0 0000038E EB09 JMP SHORT $MEN192 2004 <2> $MIF192: 0 00000390 83F9FF CMP CX,-1 ;;AN004;; Are we at the end of the message? 2006 <2> ; $IF Z ;;AN004;; No, 0 00000393 7502 JNZ $MIF194 0 00000395 31C9 XOR CX,CX ;;AN004;; 2009 <2> ; $ENDIF ;;AN000;; 2010 <2> $MIF194: 0 00000397 09FF 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;; 0 00000399 7456 JZ $MEN165 0 0000039B 55 PUSH BP ;;AN000;; Save the replace count 0 0000039C 57 PUSH DI ;;AN000;; Save location to complete message 0 0000039D 06 PUSH ES ;;AN000;; 0 0000039E 51 PUSH CX ;;AN000;; Save size of the rest of the message 0 0000039F 31C9 XOR CX,CX ;;AN000;; Reset CX used for character count 2023 <2> 2024 <2> ;; Determine what action is required on parameter 2025 <2> 0 000003A1 833E[C903]00 CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2027 <2> ; $IF E ;;AN000;; 0 000003A6 752D JNE $MIF199 2029 <2> 2030 <2> %IF CHARmsg ;;AN000;; Was Char specified? 2031 <2> Char_Type equ Char_type ; NASM port equate 0 000003A8 F644070F TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2033 <2> ; $IF Z ;;AN000;; 0 000003AC 7508 JNZ $MIF200 2035 <2> 2036 <2> ;; Character type requested 2037 <2> ;;AN000;; 0 000003AE C47C02 LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 0 000003B1 E87402 CALL $M_CHAR_REPLACE ;;AN000;; 2040 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 0 000003B4 EB1A JMP SHORT $MEN200 2042 <2> $MIF200: 2043 <2> %ENDIF ;;AN000;; 2044 <2> %IF NUMmsg ;;AN000;; Was Nnmeric type specified? 0 000003B6 F644070D TEST BYTE [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2046 <2> ; $IF Z,OR ;;AN000;; 0 000003BA 740C JZ $MLL202 0 000003BC F644070E TEST BYTE [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; 2049 <2> ; $IF Z,OR ;;AN000;; 0 000003C0 7406 JZ $MLL202 0 000003C2 F644070C TEST BYTE [$M_SL + $M_S_FLAG],~ Bin_Hex_Type & $M_TYPE_MASK ;;AN000;; 2052 <2> ; $IF Z ;;AN000;; 0 000003C6 7508 JNZ $MIF202 2054 <2> $MLL202: 2055 <2> 2056 <2> ;; Numeric type requested 2057 <2> 0 000003C8 C47C02 LES DI,[$M_SL + $M_S_VALUE] ;;AN000;; Load pointer to replacing parameter 0 000003CB E88202 CALL $M_BIN2ASC_REPLACE ;;AN000;; 2060 <2> ; $ELSE ;;AN000;; Get the rest of the message to display 0 000003CE EB00 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> 0 000003D0 E87A01 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;; 0 000003D3 EB03 JMP SHORT $MEN199 2104 <2> $MIF199: 2105 <2> %IFN COMR 0 000003D5 E82000 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 0 000003D8 7207 JC $MIF211 0 000003DA 59 POP CX ;;AN000;; Get size of the rest of the message 0 000003DB 07 POP ES ;;AN000;; Get address of the rest of the message 0 000003DC 5F POP DI ;;AN000;; 0 000003DD 5D POP BP ;;AN000;; Get replacment count 0 000003DE 5E POP SI ;;AN000;; ELSE get address of first sublist structure 2120 <2> ; $ELSE ;;AN000;; 0 000003DF EB04 JMP SHORT $MEN211 2122 <2> $MIF211: 0 000003E1 83C40A ADD SP,10 ;;AN000;; Clean up stack if error 0 000003E4 F9 STC ;;AN000;; 2125 <2> ; $ENDIF ;;AN000;; 2126 <2> $MEN211: 0 000003E5 833E[C903]00 CMP word [$M_RT + $M_MSG_NUM],$M_NULL ;;AN000;; Is this an Extended/Parse case 2128 <2> ; $ENDDO NE,OR ;;AN000;; 0 000003EA 7505 JNE $MLL214 2130 <2> ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message 0 000003EC 7203 JC $MXL4 0 000003EE E914FF JMP $MDO165 2133 <2> $MXL4: 2134 <2> $MLL214: 2135 <2> $MEN165: 2136 <2> ;; IF there was an error displaying then EXIT 0 000003F1 C706[C903]0000 MOV word [$M_RT + $M_MSG_NUM],0 ;;AN000;; Reset message number to null 0 000003F7 C3 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> ;; 0 000003F8 31D2 XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 0 000003FA A1[C903] MOV AX,[$M_RT + $M_MSG_NUM] ;;AN000;; Prepare for get binary value (LOW) 0 000003FD C706[CB03]0A00 MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; Set default divisor 2159 <2> ;; 0 00000403 E895FE CALL $M_CONVERT2ASC ;;AN000;; 2161 <2> ;; 2162 <2> ; $DO ;;AN000;; 2163 <2> $MDO215: 0 00000406 58 POP AX ;;AN000;; Get character in register 0 00000407 8887[CD03] MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 0 0000040B 43 INC BX ;;AN000;; Increase buffer count 0 0000040C 83FB40 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2168 <2> ; $IF E ;;AN000;; Yes, 0 0000040F 7503 JNE $MIF216 0 00000411 E8F801 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2171 <2> ; $ENDIF ;;AN000;; 2172 <2> $MIF216: 0 00000414 FEC9 DEC CL ;;AN000;; Have we completed replace? 2174 <2> ; $ENDDO Z ;;AN000;; 0 00000416 75EE JNZ $MDO215 2176 <2> ;; 0 00000418 B80D0A MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer 0 0000041B 8987[CD03] MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],AX ;;AN000;; Move char into the buffer 0 0000041F 43 INC BX ;;AN000;; Increase buffer count 0 00000420 43 INC BX ;;AN000;; Increase buffer count 0 00000421 E8E801 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 0 00000424 C3 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> ;; 0 00000425 56 PUSH SI ;;AN000;; 0 00000426 53 PUSH BX ;;AN000;; 0 00000427 31F6 XOR SI,SI ;;AN000;; Use SI as an index 0 00000429 31C9 XOR CX,CX ;;AN000;; Use CX as an size 2212 <2> ; $DO ;;AN000;; 2213 <2> $MDO219: 0 0000042B 80FEFF CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? 2215 <2> ; $IF E ;;AN000;; Yes, 0 0000042E 7508 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;; 0 00000430 8BBC[AD03] MOV DI,WORD PTR [$M_RT + $M_CLASS_ADDRS + SI] ;;AN000;; Get address of class 0 00000434 89FB MOV BX,DI ;;AN000; 2223 <2> %ENDIF ;;AN000;; 2224 <2> ; $ELSE ;;AN000;; No, 0 00000436 EB25 JMP SHORT $MEN220 2226 <2> $MIF220: 0 00000438 F6C602 TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? 2228 <2> ; $IF NE ;;AN000;; Yes, 0 0000043B 7408 JE $MIF222 0 0000043D C4BC[9103] LES DI,[$M_RT + $M_PARSE_COMMAND + SI] ;;AN000;; Get address of class 0 00000441 8CC3 MOV BX,ES ;;AN000; 2232 <2> ; $ELSE ;;AN000;; No, extended errors were specified 0 00000443 EB18 JMP SHORT $MEN222 2234 <2> $MIF222: 0 00000445 83F813 CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? 2236 <2> ; $IF AE,AND ;;AN000;; 0 00000448 720D JNAE $MIF224 0 0000044A 83F827 CMP AX,$M_CRIT_HI ;;AN000;; 2239 <2> ; $IF BE ;;AN000;; Yes, 0 0000044D 7708 JNBE $MIF224 0 0000044F C4BC[9D03] LES DI,[$M_RT + $M_CRIT_ADDRS + SI] ;;AN000;; Get address of class 0 00000453 8CC3 MOV BX,ES ;;AN000; 2243 <2> ; $ELSE ;;AN000;; 0 00000455 EB06 JMP SHORT $MEN224 2245 <2> $MIF224: 0 00000457 C4BC[8103] LES DI,[$M_RT + $M_EXT_ERR_ADDRS + SI] ;;AN000;; Get address of class 0 0000045B 8CC3 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> ;; 0 0000045D 83FBFF CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? 2256 <2> ; $IF E ;;AN000;; Yes, 0 00000460 7516 JNE $MIF229 0 00000462 80FEFF CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? 2259 <2> ; $IF E ;;AN000;; Yes, 0 00000465 7503 JNE $MIF230 0 00000467 F9 STC ;;AN000;; Set the carry flag 2262 <2> ; $ELSE ;;AN000;; No, 0 00000468 EB0C JMP SHORT $MEN230 2264 <2> $MIF230: 0 0000046A A3[C903] MOV [$M_RT + $M_MSG_NUM],AX ;;AN000;; Save message number 0 0000046D B8FFFF MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number 0 00000470 BD0100 MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message 0 00000473 31F6 XOR SI,SI ;;AN000;; Reset the SI index to start again 0 00000475 F8 CLC ;;AN000;; 2270 <2> ; $ENDIF ;;AN000;; No, 2271 <2> $MEN230: 2272 <2> ; $ELSE ;;AN000;; 0 00000476 EB0C JMP SHORT $MEN229 2274 <2> $MIF229: 0 00000478 83FB00 CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? 2276 <2> ; $IF NE ;;AN001;; Yes, 0 0000047B 7403 JE $MIF234 0 0000047D E85400 CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message 2279 <2> ; $ENDIF ;;AN000;; 2280 <2> $MIF234: 0 00000480 83C604 ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class 0 00000483 F8 CLC ;;AN000;; 2283 <2> ; $ENDIF ;;AN000;; 2284 <2> $MEN229: 2285 <2> ; $LEAVE C ;;AN000;; 0 00000484 7206 JC $MEN219 0 00000486 09C9 OR CX,CX ;;AN000;; Was the message found? 2288 <2> ; $ENDDO NZ,LONG ;;AN000;; 0 00000488 7502 JNZ $MXL5 0 0000048A EB9F JMP $MDO219 2291 <2> $MXL5: 2292 <2> $MEN219: 2293 <2> 0 0000048C 9C PUSHF ;;AN006;; Save the flag state 0 0000048D 80FE01 CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? 2296 <2> ; $IF E ;;AN006;; Yes, 0 00000490 7529 JNE $MIF239 0 00000492 52 PUSH DX ;;AN006;; Save all needed registers 0 00000493 55 PUSH BP ;;AN006;; 0 00000494 51 PUSH CX ;;AN006;; 0 00000495 06 PUSH ES ;;AN006;; 0 00000496 57 PUSH DI ;;AN006;; 0 00000497 50 PUSH AX ;;AN006;; 2304 <2> 0 00000498 B80005 MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed 0 0000049B CD2F INT 2FH ;;AN006;; 0 0000049D 3CFF CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? 0 0000049F 58 POP AX ;;AN006;; Restore msg number 2309 <2> ; $IF E ;;AN006;; Yes, 0 000004A0 7509 JNE $MIF240 0 000004A2 89C3 MOV BX,AX ;;AN006;; BX is the extended error number 0 000004A4 B80205 MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number 0 000004A7 CD2F INT 2FH ;;AN006;; Call IFSFUNC 2314 <2> ; $ELSE ;;AN006;; No, 0 000004A9 EB01 JMP SHORT $MEN240 2316 <2> $MIF240: 0 000004AB F9 STC ;;AN006;; Carry conditon 2318 <2> ; $ENDIF ;;AN006;; 2319 <2> $MEN240: 2320 <2> 2321 <2> ; $IF C ;;AN006;; Was there an update? 0 000004AC 7305 JNC $MIF243 0 000004AE 5F POP DI ;;AN006;; No, 0 000004AF 07 POP ES ;;AN006;; Restore old pointer 0 000004B0 59 POP CX ;;AN006;; 2326 <2> ; $ELSE ;;AN006;; Yes 0 000004B1 EB06 JMP SHORT $MEN243 2328 <2> $MIF243: 0 000004B3 83C406 ADD SP,6 ;;AN006;; Throw away old pointer 0 000004B6 E80C00 CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string 2331 <2> ; $ENDIF ;;AN006;; 2332 <2> $MEN243: 0 000004B9 5D POP BP ;;AN006;; Restore other Regs 0 000004BA 5A POP DX ;;AN006;; 2335 <2> ; $ENDIF ;;AN006;; 2336 <2> $MIF239: 0 000004BB EB01CF0EE8FBFF $M_POPF ;;AN006;; Restore the flag state 2338 <2> 0 000004C2 5B POP BX ;;AN000;; 0 000004C3 5E POP SI ;;AN000;; 0 000004C4 C3 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> ;; 0 000004C5 57 PUSH DI ;;AN006;; Save position 0 000004C6 50 PUSH AX ;;AN006;; 0 000004C7 B9FFFF MOV CX,-1 ;;AN006;; Set CX for decrements 0 000004CA 30C0 XOR AL,AL ;;AN006;; Prepare compare register 0 000004CC F2AE REPNE SCASB ;;AN006;; Scan for zero 0 000004CE F7D1 NOT CX ;;AN006;; Change decrement into number 0 000004D0 49 DEC CX ;;AN006;; Don't include the zero 0 000004D1 58 POP AX ;;AN006;; 0 000004D2 5F POP DI ;;AN006;; Restore position 0 000004D3 C3 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> ;; 0 000004D4 83FB01 CMP BX,1 ;;AN004;; Do we have an address to CALL? 2376 <2> ; $IF E,AND ;;AN004;; Yes, 0 000004D7 751D JNE $MIF247 0 000004D9 833E[A903]FF CMP WORD [$M_RT + $M_DISK_PROC_ADDR],-1 ;;AN004;; Do we have an address to CALL? 2379 <2> ; $IF NE ;;AN004;; Yes, 0 000004DE 7416 JE $MIF247 0 000004E0 83F8FF CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? 2382 <2> ; $IF E ;;AN004;; . . . and . . . 0 000004E3 750B JNE $MIF248 0 000004E5 50 PUSH AX ;;AN004;; Reset the special message number 0 000004E6 A1[C903] MOV AX,[$M_RT + $M_MSG_NUM] ;;AN004;; Get the old message number 0 000004E9 FF1E[A903] CALL far [$M_RT + $M_DISK_PROC_ADDR] ;;AN004;; Call the READ_DISK_PROC to get error text 0 000004ED 58 POP AX ;;AN004;; Reset the special message number 2388 <2> ; $ELSE ;;AN004;; Get the old message number 0 000004EE EB04 JMP SHORT $MEN248 2390 <2> $MIF248: 0 000004F0 FF1E[A903] 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;; 0 000004F4 EB1A JMP SHORT $MEN247 2396 <2> $MIF247: 0 000004F6 31C9 XOR CX,CX ;;AN002;; CX = 0 will allow us to 0 000004F8 80FEFF CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2399 <2> ; $IF NE ;;AN001;; 0 000004FB 7406 JE $MIF252 0 000004FD 268A4D03 MOV CL,BYTE PTR [ES:DI + $M_NUM_CLS_MSG] ;;AN001;; Get number of messages in class 2402 <2> ; $ELSE ;;AN001;; 0 00000501 EB09 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 0 00000503 2E3835 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) 0 00000506 7504 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 0 00000508 2E8A4D03 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: 0 0000050C 83C704 ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header 0 0000050F F9 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? 0 00000510 732D JNC $MIF258 0 00000512 F8 CLC ;;AN004;; No, reset carry 2429 <2> ; $SEARCH ;;AN000;; 2430 <2> $MDO259: 0 00000513 09C9 OR CX,CX ;;AN000;; Do we have any to check? 2432 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 0 00000515 7419 JZ $MEN259 0 00000517 80FEFF CMP DH,UTILITY_MSG_CLASS ;;AN001;; 2435 <2> ; $IF NE ;;AN001;; 0 0000051A 7405 JE $MIF261 0 0000051C 263B05 CMP AX,WORD PTR [ES:DI + $M_NUM] ;;AN001;; Is this the message requested? 2438 <2> ; $ELSE ;;AN001;; 0 0000051F EB03 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 0 00000521 2E3B05 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;; 0 00000524 7502 JNE $MIF259 2450 <2> ; $ORELSE ;;AN000; 0 00000526 EB09 JMP SHORT $MSR259 2452 <2> $MIF259: 0 00000528 49 DEC CX ;;AN000;; No, well do we have more to check? 2454 <2> ; $LEAVE Z ;;AN000;; No, return with CX = 0 0 00000529 7405 JZ $MEN259 0 0000052B 83C704 ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header 2457 <2> ; $ENDLOOP ;;AN000;; 0 0000052E EBE3 JMP SHORT $MDO259 2459 <2> $MEN259: 0 00000530 F9 STC ;;AN000;; 2461 <2> ; $ENDSRCH ;;AN000;; Check next message 2462 <2> $MSR259: 2463 <2> ; $IF NC ;;AN000;; Did we find the message? 0 00000531 720C JC $MIF269 0 00000533 80FEFF CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? 0 00000536 F8 CLC ;;AN001;; 2467 <2> ; $IF E ;;AN001;; 0 00000537 7502 JNE $MIF270 2469 <2> %IF FARmsg ;;AN001;; 2470 <2> %ELSE ;;AN000;; 0 00000539 0E PUSH CS ;;AN000;; 0 0000053A 07 POP ES ;;AN000;; Return ES:DI pointing to the message 2473 <2> %ENDIF 2474 <2> ; $ENDIF ;;AN001;; 2475 <2> $MIF270: 0 0000053B 26037D02 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? 0 0000053F 7206 JC $MIF274 0 00000541 30ED XOR CH,CH ;;AN000;; 0 00000543 268A0D MOV CL,BYTE PTR [ES:DI] ;;AN000;; Move size into CX 0 00000546 47 INC DI ;;AN000;; Increment past length 2488 <2> ; $ENDIF ;;AN004;; 2489 <2> $MIF274: 2490 <2> 0 00000547 C606[C303]00 MOV byte [$M_RT + $M_SIZE],$M_NULL ;;AN004;; Reset variable 0 0000054C C3 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> ;; 0 0000054D 31DB XOR BX,BX ;;AN000;; Use BX for buffer count 2506 <2> %IFN COMR 0 0000054F 807C0600 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, 0 00000553 7511 JNE $MIF276 0 00000555 C787[CD03]202D MOV WORD PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE_HYP ;;AN000;; Move in a " -" 0 0000055B 43 INC BX ;;AN000;; Increment count 0 0000055C 43 INC BX ;;AN000;; Increment count 0 0000055D C687[CD03]20 MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],$M_SPACE ;;AN000;; Move in a " " 0 00000562 43 INC BX ;;AN000;; Increment count 0 00000563 E8A600 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> 0 00000566 5D POP BP ;;AN000;; Remember the return address 0 00000567 31DB XOR BX,BX ;;AN000;; Use BX for buffer count 0 00000569 31D2 XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack 2523 <2> 0 0000056B 880E[C303] MOV [$M_RT + $M_SIZE],CL ;;AN000;; Save size to later clear stack 0 0000056F 8A4409 MOV AL,BYTE PTR [$M_SL + $M_S_MINW] ;;AN000;; Get the minimum width 2526 <2> ;; 0 00000572 38C8 CMP AL,CL ;;AN000;; Do we need pad chars added? 2528 <2> ; $IF A ;;AN000;; Yes, 0 00000574 761E JNA $MIF278 0 00000576 28C8 SUB AL,CL ;;AN000;; Calculate how many pad chars are needed. 0 00000578 88C6 MOV DH,AL ;;AN000;; Save the number of pad characters 0 0000057A F6440780 TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be right aligned? 2533 <2> ; $IF NZ ;;AN000;; Yes, 0 0000057E 7414 JZ $MIF279 2535 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2536 <2> $MDO280: 0 00000580 8A440A MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 0 00000583 8887[CD03] MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 0 00000587 43 INC BX ;;AN000;; 0 00000588 83FB40 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2541 <2> ; $IF E ;;AN000;; Yes, 0 0000058B 7503 JNE $MIF281 0 0000058D E87C00 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2544 <2> ; $ENDIF ;;AN000;; 2545 <2> $MIF281: 0 00000590 FECE DEC DH ;;AN000;; Have we filled with enough pad chars? 2547 <2> ; $ENDDO Z ;;AN000;; No, next pad character 0 00000592 75EC JNZ $MDO280 2549 <2> ; $ENDIF ;;AN000;; 2550 <2> $MIF279: 2551 <2> ; $ENDIF ;;AN000;; Yes, 2552 <2> $MIF278: 2553 <2> ;; 0 00000594 807C0800 CMP BYTE [$M_SL + $M_S_MAXW],$M_UNLIM_W ;;AN000;; Is maximum width unlimited? 2555 <2> ; $IF NE ;;AN000;; 0 00000598 740D JE $MIF286 0 0000059A 384C08 CMP BYTE PTR [$M_SL + $M_S_MAXW],CL ;;AN000;; Will we exceed maximum width? 2558 <2> ; $IF B ;;AN000;; Yes, 0 0000059D 7308 JNB $MIF287 0 0000059F 2A4C08 SUB CL,BYTE PTR [$M_SL + $M_S_MAXW] ;;AN000;; Calculate how many extra chars 0 000005A2 88CA MOV DL,CL ;;AN000;; Remember how many chars to pop off 0 000005A4 8A4C08 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: 0 000005A7 09C9 OR CX,CX ;;AN000;; 2568 <2> ; $IF NZ ;;AN000;; 0 000005A9 7424 JZ $MIF290 2570 <2> ; $DO ;;AN000;; Begin filling buffer with string 2571 <2> $MDO291: 0 000005AB F644070F TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2573 <2> ; $IF Z,AND ;;AN000;; 0 000005AF 750C JNZ $MIF292 2575 <2> Char_field_ASCIIZ equ Char_Field_ASCIIZ ; NASM port equate 0 000005B1 F6440710 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, 0 000005B5 7406 JZ $MIF292 0 000005B7 268A05 MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get first character from string 0 000005BA 47 INC DI ;;AN000;; Next character in string 2581 <2> ; $ELSE ;;AN000;; No, 0 000005BB EB01 JMP SHORT $MEN292 2583 <2> $MIF292: 0 000005BD 58 POP AX ;;AN000;; Get character in register 2585 <2> ; $ENDIF ;;AN000;; 2586 <2> $MEN292: 0 000005BE 8887[CD03] MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move char into the buffer 0 000005C2 43 INC BX ;;AN000;; Increase buffer count 0 000005C3 83FB40 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2590 <2> ; $IF E ;;AN000;; Yes, 0 000005C6 7503 JNE $MIF295 0 000005C8 E84100 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2593 <2> ; $ENDIF ;;AN000;; 2594 <2> $MIF295: 0 000005CB FEC9 DEC CL ;;AN000;; Have we completed replace? 2596 <2> ; $ENDDO Z ;;AN000;; Test again 0 000005CD 75DC JNZ $MDO291 2598 <2> ; $ENDIF ;;AN000;; 2599 <2> $MIF290: 2600 <2> ;; 0 000005CF F6440780 TEST BYTE [$M_SL + $M_S_FLAG],Right_Align ;;AN000;; Was replaceable parm to be left aligned? 2602 <2> ; $IF Z ;;AN000;; Yes, 0 000005D3 7518 JNZ $MIF299 0 000005D5 08F6 OR DH,DH ;;AN000;; Do we need pad chars added? 2605 <2> ; $IF NZ ;;AN000;; Yes, 0 000005D7 7414 JZ $MIF300 2607 <2> ; $DO ;;AN000;; Begin filling buffer with pad chars 2608 <2> $MDO301: 0 000005D9 8A440A MOV AL,BYTE PTR [$M_SL + $M_S_PAD] ;;AN000;; 0 000005DC 8887[CD03] MOV BYTE PTR [$M_RT + $M_TEMP_BUF + BX],AL ;;AN000;; Move in a pad char 0 000005E0 43 INC BX ;;AN000;; 0 000005E1 83FB40 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? 2613 <2> ; $IF E ;;AN000;; Yes, 0 000005E4 7503 JNE $MIF302 0 000005E6 E82300 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer 2616 <2> ; $ENDIF ;;AN000;; 2617 <2> $MIF302: 0 000005E9 FECE DEC DH ;;AN000;; Have we filled with enough pad chars? 2619 <2> ; $ENDDO Z ;;AN000;; Test again 0 000005EB 75EC JNZ $MDO301 2621 <2> ; $ENDIF ;;AN000;; 2622 <2> $MIF300: 2623 <2> ; $ENDIF ;;AN000;; 2624 <2> $MIF299: 2625 <2> ;; 0 000005ED F644070F TEST BYTE [$M_SL + $M_S_FLAG],~ Char_Type & $M_TYPE_MASK ;;AN000;; 2627 <2> ; $IF Z,AND ;;AN000;; 0 000005F1 7508 JNZ $MIF307 0 000005F3 F6440710 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, 0 000005F7 7402 JZ $MIF307 2632 <2> ; $ELSE ;;AN000;; 0 000005F9 EB0C JMP SHORT $MEN307 2634 <2> $MIF307: 0 000005FB 08D2 OR DL,DL ;;AN000;; 2636 <2> ; $IF NE ;;AN000;; 0 000005FD 7408 JE $MIF309 2638 <2> ; $DO ;;AN000;; 2639 <2> $MDO310: 0 000005FF 8F06[C703] POP word [$M_RT + $M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable 0 00000603 FECA DEC DL ;;AN000;; Are we done? 2642 <2> ; $ENDDO Z ;;AN000;; 0 00000605 75F8 JNZ $MDO310 2644 <2> ; $ENDIF ;;AN000;; 2645 <2> $MIF309: 2646 <2> ; $ENDIF ;;AN000;; 2647 <2> $MEN307: 0 00000607 E80200 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time 0 0000060A 55 PUSH BP ;;AN000;; Restore the return address 2650 <2> ;; 0 0000060B C3 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> ;; 0 0000060C 51 PUSH CX ;;AN000;; Save changed regs 0 0000060D 06 PUSH ES ;;AN000;; 0 0000060E 57 PUSH DI ;;AN000;; 0 0000060F 1E PUSH DS ;;AN000;; Set ES pointing to buffer 0 00000610 07 POP ES ;;AN000;; 2674 <2> ;; 0 00000611 89D9 MOV CX,BX ;;AN000;; Set number of bytes to display 0 00000613 31DB XOR BX,BX ;;AN000;; Reset buffer counter 0 00000615 8D3E[CD03] LEA DI,[$M_RT + $M_TEMP_BUF] ;;AN000;; Reset buffer location pointer 0 00000619 E89DFB CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer 2679 <2> ;; 2680 <2> ; $IF NC ;;AN000;; Error? 0 0000061C 7205 JC $MIF314 0 0000061E 5F POP DI ;;AN000;; No, Restore changed regs 0 0000061F 07 POP ES ;;AN000;; 0 00000620 59 POP CX ;;AN000;; 2685 <2> ; $ELSE ;;AN000;; Yes, 0 00000621 EB04 JMP SHORT $MEN314 2687 <2> $MIF314: 0 00000623 83C406 ADD SP,6 ;;AN000;; Fix stack 0 00000626 F9 STC ;;AN000;; 2690 <2> ; $ENDIF ;;AN000;; Error? 2691 <2> $MEN314: 2692 <2> ;; 0 00000627 C3 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> ;; 0 00000628 5D POP BP ;;AN000;; Save return address 0 00000629 F6440730 TEST byte [$M_SL + $M_S_FLAG],~ Char_Field_Char & $M_SIZE_MASK ;;AN000;; Was Character specified? 2721 <2> ; $IF Z ;;AN000;; Yes, 0 0000062D 7512 JNZ $MIF317 0 0000062F 268A05 MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 0 00000632 50 PUSH AX ;;AN000;; Put it on the stack 0 00000633 41 INC CX ;;AN000;; Increase the count 0 00000634 E840FC CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character 2727 <2> ; $IF C ;;AN000;; Yes, 0 00000637 7306 JNC $MIF318 0 00000639 268A4501 MOV AL,BYTE PTR [ES:DI + 1] ;;AN000;; Get the next character 0 0000063D 50 PUSH AX ;;AN000;; Put it on the stack 0 0000063E F8 CLC ;;AN000;; Clear the carry 2732 <2> ; $ENDIF ;;AN000;; 2733 <2> $MIF318: 2734 <2> ; $ELSE ;;AN000;; No, it was an ASCIIZ string 0 0000063F EB0D JMP SHORT $MEN317 2736 <2> $MIF317: 2737 <2> ; $DO ;;AN000;; 2738 <2> $MDO321: 0 00000641 268A05 MOV AL,BYTE PTR [ES:DI] ;;AN000;; Get the character 0 00000644 08C0 OR AL,AL ;;AN000;; Is it the NULL? 2741 <2> ; $LEAVE Z ;;AN000;; No, 0 00000646 7404 JZ $MEN321 0 00000648 47 INC DI ;;AN000;; Next character 0 00000649 41 INC CX ;;AN000;; Increment the count 2745 <2> ; $ENDDO ;;AN000;; Yes, 0 0000064A EBF5 JMP SHORT $MDO321 2747 <2> $MEN321: 0 0000064C 29CF SUB DI,CX ;;AN000;; Set SI at the beginning of the string 2749 <2> ; $ENDIF ;;AN000;; 2750 <2> $MEN317: 2751 <2> ;;AN000;; 0 0000064E 55 PUSH BP ;;AN000;; Restore return address 0 0000064F C3 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> ;; 0 00000650 5D POP BP ;;AN000;; Save return address 2782 <2> ;; 0 00000651 31D2 XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) 0 00000653 31C0 XOR AX,AX ;;AN000;; Prepare for get binary value (LOW) 0 00000655 C706[CB03]1000 MOV word [$M_RT + $M_DIVISOR],$M_BASE16 ;;AN000;; Set default divisor 0 0000065B 31DB XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable) 2787 <2> %IFN COMR 0 0000065D F6440720 TEST byte [$M_SL + $M_S_FLAG],~ $M_BYTE & $M_SIZE_MASK ;;AN000;; Was BYTE specified? 2789 <2> ; $IF Z ;;AN000;; 0 00000661 7524 JNZ $MIF325 0 00000663 268A05 MOV AL, BYTE PTR [ES:DI] ;;AN000;; Setup byte in AL 0 00000666 F644070D TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2793 <2> ; $IF Z ;;AN000;; 0 0000066A 750D JNZ $MIF326 0 0000066C A880 TEST AL,10000000b ;;AN000;; Is this number negative? 2796 <2> ; $IF NZ ;;AN000;; Yes, 0 0000066E 7403 JZ $MIF327 0 00000670 43 INC BX ;;AN000;; Remember that it was negative 0 00000671 247F AND AL,01111111b ;;AN000;; Make it positive 2800 <2> ; $ENDIF ;;AN000;; 2801 <2> $MIF327: 0 00000673 C706[CB03]0A00 MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2803 <2> ; $ENDIF ;;AN000;; 2804 <2> $MIF326: 0 00000679 F644070E TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2806 <2> ; $IF Z ;;AN000;; 0 0000067D 7506 JNZ $MIF330 0 0000067F C706[CB03]0A00 MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2809 <2> ; $ENDIF ;;AN000;; 2810 <2> $MIF330: 2811 <2> ; $ELSE ;;AN000;; 0 00000685 EB54 JMP SHORT $MEN325 2813 <2> $MIF325: 2814 <2> %ENDIF 0 00000687 F6440710 TEST byte [$M_SL + $M_S_FLAG],~ $M_WORD & $M_SIZE_MASK ;;AN000;; Was WORD specified? 2816 <2> ; $IF Z ;;AN000;; 0 0000068B 7526 JNZ $MIF333 0 0000068D 268B05 MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup byte in AL 0 00000690 F644070D TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;; AN000;; Was Signed binary specified? 2820 <2> ; $IF Z ;;AN000;; 0 00000694 750F JNZ $MIF334 0 00000696 F6C480 TEST AH,10000000b ;;AN000;; Is this number negative? 2823 <2> ; $IF NZ ;;AN000;; Yes, 0 00000699 7404 JZ $MIF335 0 0000069B 43 INC BX ;;AN000;; Remember that it was negative 0 0000069C 80E47F AND AH,01111111b ;;AN000;; Make it positive 2827 <2> ; $ENDIF ;;AN000;; 2828 <2> $MIF335: 0 0000069F C706[CB03]0A00 MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2830 <2> ; $ENDIF ;;AN000;; 2831 <2> $MIF334: 0 000006A5 F644070E TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2833 <2> ; $IF Z ;;AN000;; 0 000006A9 7506 JNZ $MIF338 0 000006AB C706[CB03]0A00 MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2836 <2> ; $ENDIF ;;AN000;; 2837 <2> $MIF338: 2838 <2> ; $ELSE ;;AN000;; 0 000006B1 EB28 JMP SHORT $MEN333 2840 <2> $MIF333: 2841 <2> %IFN COMR 0 000006B3 268B05 MOV AX, WORD PTR [ES:DI] ;;AN000;; Setup Double word in DX:AX 0 000006B6 268B5502 MOV DX, WORD PTR [ES:DI + 2] ;;AN000;; 0 000006BA F644070D TEST byte [$M_SL + $M_S_FLAG],~ Sgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2845 <2> ; $IF Z ;;AN000;; 0 000006BE 750F JNZ $MIF341 0 000006C0 F6C680 TEST DH,10000000b ;;AN000;; Is this number negative? 2848 <2> ; $IF NZ ;;AN000;; Yes, 0 000006C3 7404 JZ $MIF342 0 000006C5 43 INC BX ;;AN000;; Remember that it was negative 0 000006C6 80E67F AND DH,01111111b ;;AN000;; Make it positive 2852 <2> ; $ENDIF ;;AN000;; 2853 <2> $MIF342: 0 000006C9 C706[CB03]0A00 MOV word [$M_RT + $M_DIVISOR],$M_BASE10 ;;AN000;; 2855 <2> ; $ENDIF ;;AN000;; 2856 <2> $MIF341: 0 000006CF F644070E TEST byte [$M_SL + $M_S_FLAG],~ Unsgn_Bin_Type & $M_TYPE_MASK ;;AN000;; Was Signed binary specified? 2858 <2> ; $IF Z ;;AN000;; 0 000006D3 7506 JNZ $MIF345 0 000006D5 C706[CB03]0A00 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> ;; 0 000006DB E8BDFB CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string 2870 <2> %IFN COMR 0 000006DE 09DB OR BX,BX ;;AN000;; 2872 <2> ; $IF NZ ;;AN000;; Was number negative? 0 000006E0 7405 JZ $MIF349 0 000006E2 31D2 XOR DX,DX ;;AN000;; Yes, 0 000006E4 B22D MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number 0 000006E6 52 PUSH DX ;;AN000;; 2877 <2> ; $ENDIF ;;AN000;; No, 2878 <2> $MIF349: 2879 <2> %ENDIF 2880 <2> ;; 0 000006E7 55 PUSH BP ;;AN000;; Restore return address 0 000006E8 C3 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> 91 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 Utility_Msg_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 0 000006E9 FF db 0FFH 16 <3> at $M_COMMAND_VER 0 000006EA 0400 dw EXPECTED_VERSION 18 <3> at $M_NUM_CLS_MSG 0 000006EC 14 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 0 000006ED 0100 dw 00001H 30 <3> at $M_TXT_PTR 0 000006EF 5000 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 0 000006F1 0200 dw 00002H 38 <3> at $M_TXT_PTR 0 000006F3 6400 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 0 000006F5 0300 dw 00003H 46 <3> at $M_TXT_PTR 0 000006F7 A700 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 0 000006F9 0400 dw 00004H 54 <3> at $M_TXT_PTR 0 000006FB C000 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 0 000006FD 0500 dw 00005H 62 <3> at $M_TXT_PTR 0 000006FF 0401 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 0 00000701 0600 dw 00006H 70 <3> at $M_TXT_PTR 0 00000703 1A01 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 0 00000705 0700 dw 00007H 78 <3> at $M_TXT_PTR 0 00000707 3201 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 0 00000709 0800 dw 00008H 86 <3> at $M_TXT_PTR 0 0000070B 5201 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 0 0000070D 0900 dw 00009H 94 <3> at $M_TXT_PTR 0 0000070F 6801 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 0 00000711 0A00 dw 0000AH 102 <3> at $M_TXT_PTR 0 00000713 8701 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 0 00000715 0B00 dw 0000BH 110 <3> at $M_TXT_PTR 0 00000717 B201 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 0 00000719 0C00 dw 0000CH 118 <3> at $M_TXT_PTR 0 0000071B D301 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 0 0000071D 0D00 dw 0000DH 126 <3> at $M_TXT_PTR 0 0000071F FF01 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 0 00000721 0E00 dw 0000EH 134 <3> at $M_TXT_PTR 0 00000723 1B02 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 0 00000725 0F00 dw 0000FH 142 <3> at $M_TXT_PTR 0 00000727 3702 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 0 00000729 1000 dw 00010H 150 <3> at $M_TXT_PTR 0 0000072B 5302 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 0 0000072D 1100 dw 00011H 158 <3> at $M_TXT_PTR 0 0000072F 6A02 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 0 00000731 1200 dw 00012H 166 <3> at $M_TXT_PTR 0 00000733 9602 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 0 00000735 1300 dw 00013H 174 <3> at $M_TXT_PTR 0 00000737 AE02 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 0 00000739 1400 dw 00014H 182 <3> at $M_TXT_PTR 0 0000073B CB02 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 0 0000073D 17 DB $M_A_00001H_END-$M_A_00001H_MSG-1 0 0000073E 496E636F7272656374 DB "Incorrect DOS version",CR,LF 0 00000747 20444F532076657273 0 00000750 696F6E0D0A 192 <3> $M_A_00001H_END LABEL BYTE 193 <3> 194 <3> $M_A_00002H_MSG LABEL BYTE 0 00000755 46 DB $M_A_00002H_END-$M_A_00002H_MSG-1 0 00000756 0D2531207065726365 DB CR,"%1 percent of disk formatted ",CR 0 0000075F 6E74206F6620646973 0 00000768 6B20666F726D617474 0 00000771 656420202020202020 0 0000077A 202020202020202020 0 00000783 202020202020202020 0 0000078C 202020202020202020 0 00000795 2020202020200D 197 <3> $M_A_00002H_END LABEL BYTE 198 <3> 199 <3> $M_A_00003H_MSG LABEL BYTE 0 0000079C 1C DB $M_A_00003H_END-$M_A_00003H_MSG-1 0 0000079D 253120627974657320 DB "%1 bytes available on disk",CR,LF 0 000007A6 617661696C61626C65 0 000007AF 206F6E206469736B0D 0 000007B8 0A 202 <3> $M_A_00003H_END LABEL BYTE 203 <3> 204 <3> $M_A_00004H_MSG LABEL BYTE 0 000007B9 47 DB $M_A_00004H_END-$M_A_00004H_MSG-1 0 000007BA 0D466F726D61742063 DB CR,"Format complete ",CR,LF 0 000007C3 6F6D706C6574652020 0 000007CC 202020202020202020 0 000007D5 202020202020202020 0 000007DE 202020202020202020 0 000007E7 202020202020202020 0 000007F0 202020202020202020 0 000007F9 2020202020200D0A 207 <3> $M_A_00004H_END LABEL BYTE 208 <3> 209 <3> $M_A_00005H_MSG LABEL BYTE 0 00000801 19 DB $M_A_00005H_END-$M_A_00005H_MSG-1 0 00000802 253120627974657320 DB "%1 bytes in bad sectors",CR,LF 0 0000080B 696E20626164207365 0 00000814 63746F72730D0A 212 <3> $M_A_00005H_END LABEL BYTE 213 <3> 214 <3> $M_A_00006H_MSG LABEL BYTE 0 0000081B 1B DB $M_A_00006H_END-$M_A_00006H_MSG-1 0 0000081C 253120627974657320 DB "%1 bytes total disk space",CR,LF 0 00000825 746F74616C20646973 0 0000082E 6B2073706163650D0A 217 <3> $M_A_00006H_END LABEL BYTE 218 <3> 219 <3> $M_A_00007H_MSG LABEL BYTE 0 00000837 23 DB $M_A_00007H_END-$M_A_00007H_MSG-1 0 00000838 496E73657274206E65 DB "Insert new diskette for drive %1:",CR,LF 0 00000841 77206469736B657474 0 0000084A 6520666F7220647269 0 00000853 76652025313A0D0A 222 <3> $M_A_00007H_END LABEL BYTE 223 <3> 224 <3> $M_A_00008H_MSG LABEL BYTE 0 0000085B 19 DB $M_A_00008H_END-$M_A_00008H_MSG-1 0 0000085C 253120627974657320 DB "%1 bytes used by system",CR,LF 0 00000865 757365642062792073 0 0000086E 797374656D0D0A 227 <3> $M_A_00008H_END LABEL BYTE 228 <3> 229 <3> $M_A_00009H_MSG LABEL BYTE 0 00000875 22 DB $M_A_00009H_END-$M_A_00009H_MSG-1 0 00000876 52652D696E73657274 DB "Re-insert diskette for drive %1:",CR,LF 0 0000087F 206469736B65747465 0 00000888 20666F722064726976 0 00000891 652025313A0D0A 232 <3> $M_A_00009H_END LABEL BYTE 233 <3> 234 <3> $M_A_0000AH_MSG LABEL BYTE 0 00000898 2E DB $M_A_0000AH_END-$M_A_0000AH_MSG-1 0 00000899 566F6C756D65206C61 DB "Volume label (11 characters, ENTER for none)? " 0 000008A2 62656C202831312063 0 000008AB 686172616374657273 0 000008B4 2C20454E5445522066 0 000008BD 6F72206E6F6E65293F 0 000008C6 20 237 <3> $M_A_0000AH_END LABEL BYTE 238 <3> 239 <3> $M_A_0000BH_MSG LABEL BYTE 0 000008C7 24 DB $M_A_0000BH_END-$M_A_0000BH_MSG-1 0 000008C8 0D466F726D6174206E DB CR,"Format not supported on drive %1:", CR,LF 0 000008D1 6F7420737570706F72 0 000008DA 746564206F6E206472 0 000008E3 6976652025313A0D0A 242 <3> $M_A_0000BH_END LABEL BYTE 243 <3> 244 <3> $M_A_0000CH_MSG LABEL BYTE 0 000008EC 2F DB $M_A_0000CH_END-$M_A_0000CH_MSG-1 0 000008ED 0D496E76616C696420 DB CR,"Invalid device parameters from device driver",CR,LF 0 000008F6 646576696365207061 0 000008FF 72616D657465727320 0 00000908 66726F6D2064657669 0 00000911 636520647269766572 0 0000091A 0D0A 247 <3> $M_A_0000CH_END LABEL BYTE 248 <3> 249 <3> $M_A_0000DH_MSG LABEL BYTE 0 0000091C 1F DB $M_A_0000DH_END-$M_A_0000DH_MSG-1 0 0000091D 0D4572726F7220696E DB CR,"Error in IOCTL call ",CR,LF 0 00000926 20494F43544C206361 0 0000092F 6C6C20202020202020 0 00000938 20200D0A 252 <3> $M_A_0000DH_END LABEL BYTE 253 <3> 254 <3> $M_A_0000EH_MSG LABEL BYTE 0 0000093C 1F DB $M_A_0000EH_END-$M_A_0000EH_MSG-1 0 0000093D 0D4E6F74206120626C DB CR,"Not a block device ",CR,LF 0 00000946 6F636B206465766963 0 0000094F 652020202020202020 0 00000958 20200D0A 257 <3> $M_A_0000EH_END LABEL BYTE 258 <3> 259 <3> $M_A_0000FH_MSG LABEL BYTE 0 0000095C 1F DB $M_A_0000FH_END-$M_A_0000FH_MSG-1 0 0000095D 0D4572726F72207772 DB CR,"Error writing FAT ",CR,LF 0 00000966 6974696E6720464154 0 0000096F 202020202020202020 0 00000978 20200D0A 262 <3> $M_A_0000FH_END LABEL BYTE 263 <3> 264 <3> $M_A_00010H_MSG LABEL BYTE 0 0000097C 1A DB $M_A_00010H_END-$M_A_00010H_MSG-1 0 0000097D 0D4572726F72207772 DB CR,"Error writing directory",CR,LF 0 00000986 6974696E6720646972 0 0000098F 6563746F72790D0A 267 <3> $M_A_00010H_END LABEL BYTE 268 <3> 269 <3> $M_A_00011H_MSG LABEL BYTE 0 00000997 2F DB $M_A_00011H_END-$M_A_00011H_MSG-1 0 00000998 0D43616E6E6F742066 DB CR,"Cannot format an ASSIGNed or SUBSTed drive. ",CR,LF 0 000009A1 6F726D617420616E20 0 000009AA 41535349474E656420 0 000009B3 6F7220535542535465 0 000009BC 642064726976652E20 0 000009C5 0D0A 272 <3> $M_A_00011H_END LABEL BYTE 273 <3> 274 <3> $M_A_00012H_MSG LABEL BYTE 0 000009C7 1B DB $M_A_00012H_END-$M_A_00012H_MSG-1 0 000009C8 0D43616E6E6F742066 DB CR,"Cannot find System Files",CR,LF 0 000009D1 696E64205379737465 0 000009DA 6D2046696C65730D0A 277 <3> $M_A_00012H_END LABEL BYTE 278 <3> 279 <3> $M_A_00013H_MSG LABEL BYTE 0 000009E3 20 DB $M_A_00013H_END-$M_A_00013H_MSG-1 0 000009E4 0D43616E6E6F742046 DB CR,"Cannot FORMAT a network drive",CR,LF 0 000009ED 4F524D41542061206E 0 000009F6 6574776F726B206472 0 000009FF 6976650D0A 282 <3> $M_A_00013H_END LABEL BYTE 283 <3> 284 <3> $M_A_00014H_MSG LABEL BYTE 0 00000A04 24 DB $M_A_00014H_END-$M_A_00014H_MSG-1 0 00000A05 496E76616C69642063 DB "Invalid characters in volume label",CR,LF 0 00000A0E 686172616374657273 0 00000A17 20696E20766F6C756D 0 00000A20 65206C6162656C0D0A 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> 0 00000A29 0E PUSH CS 0 00000A2A 07 POP ES 0 00000A2B 8D3E[E906] LEA DI,[$M_CLASS_A_STRUC] 0 00000A2F 81C14603 ADD CX,$-$M_CLASS_A_STRUC 0 00000A33 C3 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 Utility_Msg_Class byte [-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 0 00000A34 FF db 0FFH 15 <3> at $M_COMMAND_VER 0 00000A35 0400 dw EXPECTED_VERSION 17 <3> at $M_NUM_CLS_MSG 0 00000A37 12 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 0 00000A38 1500 dw 00015H 28 <3> at $M_TXT_PTR 0 00000A3A 4800 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 0 00000A3C 1600 dw 00016H 36 <3> at $M_TXT_PTR 0 00000A3E 6000 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 0 00000A40 1700 dw 00017H 44 <3> at $M_TXT_PTR 0 00000A42 A400 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 0 00000A44 1800 dw 00018H 52 <3> at $M_TXT_PTR 0 00000A46 C300 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 0 00000A48 1900 dw 00019H 60 <3> at $M_TXT_PTR 0 00000A4A EF00 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 0 00000A4C 1A00 dw 0001AH 68 <3> at $M_TXT_PTR 0 00000A4E 1B01 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 0 00000A50 1B00 dw 0001BH 76 <3> at $M_TXT_PTR 0 00000A52 3201 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 0 00000A54 1C00 dw 0001CH 84 <3> at $M_TXT_PTR 0 00000A56 4A01 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 0 00000A58 1D00 dw 0001DH 92 <3> at $M_TXT_PTR 0 00000A5A 6501 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 0 00000A5C 1E00 dw 0001EH 100 <3> at $M_TXT_PTR 0 00000A5E 9101 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 0 00000A60 1F00 dw 0001FH 108 <3> at $M_TXT_PTR 0 00000A62 A201 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 0 00000A64 2000 dw 00020H 116 <3> at $M_TXT_PTR 0 00000A66 C901 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 0 00000A68 2300 dw 00023H 124 <3> at $M_TXT_PTR 0 00000A6A F301 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 0 00000A6C 2400 dw 00024H 132 <3> at $M_TXT_PTR 0 00000A6E 1002 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 0 00000A70 2500 dw 00025H 140 <3> at $M_TXT_PTR 0 00000A72 2C02 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 0 00000A74 2600 dw 00026H 148 <3> at $M_TXT_PTR 0 00000A76 3902 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 0 00000A78 2700 dw 00027H 156 <3> at $M_TXT_PTR 0 00000A7A 5902 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 0 00000A7C 2800 dw 00028H 164 <3> at $M_TXT_PTR 0 00000A7E 7602 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 0 00000A80 1B DB $M_B_00015H_END-$M_B_00015H_MSG-1 0 00000A81 0D506172616D657465 DB CR,"Parameters not supported",CR,LF 0 00000A8A 7273206E6F74207375 0 00000A93 70706F727465640D0A 174 <3> $M_B_00015H_END LABEL BYTE 175 <3> 176 <3> $M_B_00016H_MSG LABEL BYTE 0 00000A9C 47 DB $M_B_00016H_END-$M_B_00016H_MSG-1 0 00000A9D 0D466F726D61742074 DB CR,"Format terminated ",CR,LF 0 00000AA6 65726D696E61746564 0 00000AAF 202020202020202020 0 00000AB8 202020202020202020 0 00000AC1 202020202020202020 0 00000ACA 202020202020202020 0 00000AD3 202020202020202020 0 00000ADC 2020202020200D0A 179 <3> $M_B_00016H_END LABEL BYTE 180 <3> 181 <3> $M_B_00017H_MSG LABEL BYTE 0 00000AE4 22 DB $M_B_00017H_END-$M_B_00017H_MSG-1 0 00000AE5 0D4469736B20756E73 DB CR,"Disk unsuitable for system disk",CR,LF 0 00000AEE 75697461626C652066 0 00000AF7 6F722073797374656D 0 00000B00 206469736B0D0A 184 <3> $M_B_00017H_END LABEL BYTE 185 <3> 186 <3> $M_B_00018H_MSG LABEL BYTE 0 00000B07 2F DB $M_B_00018H_END-$M_B_00018H_MSG-1 0 00000B08 0D496E76616C696420 DB CR,"Invalid media or Track 0 bad - disk unusable",CR,LF 0 00000B11 6D65646961206F7220 0 00000B1A 547261636B20302062 0 00000B23 6164202D206469736B 0 00000B2C 20756E757361626C65 0 00000B35 0D0A 189 <3> $M_B_00018H_END LABEL BYTE 190 <3> 191 <3> $M_B_00019H_MSG LABEL BYTE 0 00000B37 2F DB $M_B_00019H_END-$M_B_00019H_MSG-1 0 00000B38 0D556E61626C652074 DB CR,"Unable to write BOOT ",CR,LF 0 00000B41 6F2077726974652042 0 00000B4A 4F4F54202020202020 0 00000B53 202020202020202020 0 00000B5C 202020202020202020 0 00000B65 0D0A 194 <3> $M_B_00019H_END LABEL BYTE 195 <3> 196 <3> $M_B_0001AH_MSG LABEL BYTE 0 00000B67 1A DB $M_B_0001AH_END-$M_B_0001AH_MSG-1 0 00000B68 0D4572726F72207265 DB CR,"Error reading directory",CR,LF 0 00000B71 6164696E6720646972 0 00000B7A 6563746F72790D0A 199 <3> $M_B_0001AH_END LABEL BYTE 200 <3> 201 <3> $M_B_0001BH_MSG LABEL BYTE 0 00000B82 1B DB $M_B_0001BH_END-$M_B_0001BH_MSG-1 0 00000B83 4E6F20746172676574 DB "No target drive specified",CR,LF 0 00000B8C 206472697665207370 0 00000B95 656369666965640D0A 204 <3> $M_B_0001BH_END LABEL BYTE 205 <3> 206 <3> $M_B_0001CH_MSG LABEL BYTE 0 00000B9E 1E DB $M_B_0001CH_END-$M_B_0001CH_MSG-1 0 00000B9F 0D616E642070726573 DB CR,"and press ENTER when ready..." 0 00000BA8 7320454E5445522077 0 00000BB1 68656E207265616479 0 00000BBA 2E2E2E 209 <3> $M_B_0001CH_END LABEL BYTE 210 <3> 211 <3> $M_B_0001DH_MSG LABEL BYTE 0 00000BBD 2F DB $M_B_0001DH_END-$M_B_0001DH_MSG-1 0 00000BBE 0D496E76616C696420 DB CR,"Invalid Volume ID ",CR,LF 0 00000BC7 566F6C756D65204944 0 00000BD0 202020202020202020 0 00000BD9 202020202020202020 0 00000BE2 202020202020202020 0 00000BEB 0D0A 214 <3> $M_B_0001DH_END LABEL BYTE 215 <3> 216 <3> $M_B_0001EH_MSG LABEL BYTE 0 00000BED 14 DB $M_B_0001EH_END-$M_B_0001EH_MSG-1 0 00000BEE 53797374656D207472 DB "System transferred",CR,LF 0 00000BF7 616E73666572726564 0 00000C00 0D0A 219 <3> $M_B_0001EH_END LABEL BYTE 220 <3> 221 <3> $M_B_0001FH_MSG LABEL BYTE 0 00000C02 2A DB $M_B_0001FH_END-$M_B_0001FH_MSG-1 0 00000C03 0D456E746572206375 DB CR,"Enter current volume label for drive %1: " 0 00000C0C 7272656E7420766F6C 0 00000C15 756D65206C6162656C 0 00000C1E 20666F722064726976 0 00000C27 652025313A20 224 <3> $M_B_0001FH_END LABEL BYTE 225 <3> 226 <3> $M_B_00020H_MSG LABEL BYTE 0 00000C2D 2D DB $M_B_00020H_END-$M_B_00020H_MSG-1 0 00000C2E 0D506172616D657465 DB CR,"Parameters not compatible",CR,LF,"with fixed disk",CR,LF 0 00000C37 7273206E6F7420636F 0 00000C40 6D70617469626C650D 0 00000C49 0A7769746820666978 0 00000C52 6564206469736B0D0A 229 <3> $M_B_00020H_END LABEL BYTE 230 <3> 231 <3> $M_B_00023H_MSG LABEL BYTE 0 00000C5B 20 DB $M_B_00023H_END-$M_B_00023H_MSG-1 0 00000C5C 0D4572726F72207265 DB CR,"Error reading partition table",CR,LF 0 00000C65 6164696E6720706172 0 00000C6E 746974696F6E207461 0 00000C77 626C650D0A 234 <3> $M_B_00023H_END LABEL BYTE 235 <3> 236 <3> $M_B_00024H_MSG LABEL BYTE 0 00000C7C 1F DB $M_B_00024H_END-$M_B_00024H_MSG-1 0 00000C7D 566F6C756D65205365 DB "Volume Serial Number is %1-%2",CR,LF 0 00000C86 7269616C204E756D62 0 00000C8F 65722069732025312D 0 00000C98 25320D0A 239 <3> $M_B_00024H_END LABEL BYTE 240 <3> 241 <3> $M_B_00025H_MSG LABEL BYTE 0 00000C9C 10 DB $M_B_00025H_END-$M_B_00025H_MSG-1 0 00000C9D 0D466F726D61742062 DB CR,"Format broken",CR,LF 0 00000CA6 726F6B656E0D0A 244 <3> $M_B_00025H_END LABEL BYTE 245 <3> 246 <3> $M_B_00026H_MSG LABEL BYTE 0 00000CAD 23 DB $M_B_00026H_END-$M_B_00026H_MSG-1 0 00000CAE 0D466F726D6174206E DB CR,"Format not available on drive %1",CR,LF 0 00000CB7 6F7420617661696C61 0 00000CC0 626C65206F6E206472 0 00000CC9 6976652025310D0A 249 <3> $M_B_00026H_END LABEL BYTE 250 <3> 251 <3> $M_B_00027H_MSG LABEL BYTE 0 00000CD1 20 DB $M_B_00027H_END-$M_B_00027H_MSG-1 0 00000CD2 0D4E6F6E2D53797374 DB CR,"Non-System disk or disk error",CR,LF 0 00000CDB 656D206469736B206F 0 00000CE4 72206469736B206572 0 00000CED 726F720D0A 254 <3> $M_B_00027H_END LABEL BYTE 255 <3> 256 <3> $M_B_00028H_MSG LABEL BYTE 0 00000CF2 1E DB $M_B_00028H_END-$M_B_00028H_MSG-1 0 00000CF3 0D4261642050617274 DB CR,"Bad Partition Table ",CR,LF 0 00000CFC 6974696F6E20546162 0 00000D05 6C6520202020202020 0 00000D0E 200D0A 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> 0 00000D11 0E PUSH CS 0 00000D12 07 POP ES 0 00000D13 8D3E[340A] LEA DI,[$M_CLASS_B_STRUC] 0 00000D17 81C1E302 ADD CX,$-$M_CLASS_B_STRUC 0 00000D1B C3 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 Utility_Msg_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 0 00000D1C FF db 0FFH 15 <3> at $M_COMMAND_VER 0 00000D1D 0400 dw EXPECTED_VERSION 17 <3> at $M_NUM_CLS_MSG 0 00000D1F 0F 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 0 00000D20 2900 dw 00029H 28 <3> at $M_TXT_PTR 0 00000D22 3C00 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 0 00000D24 2A00 dw 0002AH 36 <3> at $M_TXT_PTR 0 00000D26 5D00 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 0 00000D28 2B00 dw 0002BH 44 <3> at $M_TXT_PTR 0 00000D2A 5C00 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 0 00000D2C 2C00 dw 0002CH 52 <3> at $M_TXT_PTR 0 00000D2E 5C00 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 0 00000D30 2D00 dw 0002DH 60 <3> at $M_TXT_PTR 0 00000D32 7800 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 0 00000D34 2E00 dw 0002EH 68 <3> at $M_TXT_PTR 0 00000D36 D300 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 0 00000D38 2F00 dw 0002FH 76 <3> at $M_TXT_PTR 0 00000D3A E600 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 0 00000D3C 3000 dw 00030H 84 <3> at $M_TXT_PTR 0 00000D3E 0301 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 0 00000D40 3100 dw 00031H 92 <3> at $M_TXT_PTR 0 00000D42 2001 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 0 00000D44 3200 dw 00032H 100 <3> at $M_TXT_PTR 0 00000D46 3901 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 0 00000D48 3300 dw 00033H 108 <3> at $M_TXT_PTR 0 00000D4A 5D01 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 0 00000D4C 3400 dw 00034H 116 <3> at $M_TXT_PTR 0 00000D4E 7C01 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 0 00000D50 3500 dw 00035H 124 <3> at $M_TXT_PTR 0 00000D52 9901 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 0 00000D54 3600 dw 00036H 132 <3> at $M_TXT_PTR 0 00000D56 B501 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 0 00000D58 3700 dw 00037H 140 <3> at $M_TXT_PTR 0 00000D5A D901 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 0 00000D5C 24 DB $M_C_00029H_END-$M_C_00029H_MSG-1 0 00000D5D 0D506172616D657465 DB CR,"Parameters not supported by drive",CR,LF 0 00000D66 7273206E6F74207375 0 00000D6F 70706F727465642062 0 00000D78 792064726976650D0A 150 <3> $M_C_00029H_END LABEL BYTE 151 <3> 152 <3> $M_C_0002AH_MSG LABEL BYTE 0 00000D81 02 DB $M_C_0002AH_END-$M_C_0002AH_MSG-1 0 00000D82 0D0A DB CR,LF 155 <3> $M_C_0002AH_END LABEL BYTE 156 <3> 157 <3> $M_C_0002BH_MSG LABEL BYTE 0 00000D84 03 DB $M_C_0002BH_END-$M_C_0002BH_MSG-1 0 00000D85 0D0A0A DB CR,LF,LF 160 <3> $M_C_0002BH_END LABEL BYTE 161 <3> 162 <3> $M_C_0002CH_MSG LABEL BYTE 0 00000D88 1F DB $M_C_0002CH_END-$M_C_0002CH_MSG-1 0 00000D89 0D496E736572742044 DB CR,"Insert DOS disk in drive %1:",CR,LF 0 00000D92 4F53206469736B2069 0 00000D9B 6E2064726976652025 0 00000DA4 313A0D0A 165 <3> $M_C_0002CH_END LABEL BYTE 166 <3> 167 <3> $M_C_0002DH_MSG LABEL BYTE 0 00000DA8 5E DB $M_C_0002DH_END-$M_C_0002DH_MSG-1 0 00000DA9 0D0A5741524E494E47 DB CR,LF,"WARNING, ALL DATA ON NON-REMOVABLE DISK",CR,LF 0 00000DB2 2C20414C4C20444154 0 00000DBB 41204F4E204E4F4E2D 0 00000DC4 52454D4F5641424C45 0 00000DCD 204449534B0D0A 0 00000DD4 44524956452025313A DB "DRIVE %1: WILL BE LOST!",CR,LF 0 00000DDD 2057494C4C20424520 0 00000DE6 4C4F5354210D0A 0 00000DED 50726F636565642077 DB "Proceed with Format (Y/N)?" 0 00000DF6 69746820466F726D61 0 00000DFF 742028592F4E293F 172 <3> $M_C_0002DH_END LABEL BYTE 173 <3> 174 <3> $M_C_0002EH_MSG LABEL BYTE 0 00000E07 16 DB $M_C_0002EH_END-$M_C_0002EH_MSG-1 0 00000E08 0D466F726D61742061 DB CR,"Format another (Y/N)?" 0 00000E11 6E6F74686572202859 0 00000E1A 2F4E293F 177 <3> $M_C_0002EH_END LABEL BYTE 178 <3> 179 <3> $M_C_0002FH_MSG LABEL BYTE 0 00000E1E 20 DB $M_C_0002FH_END-$M_C_0002FH_MSG-1 0 00000E1F 0D4572726F72207265 DB CR,"Error reading partition table",CR,LF 0 00000E28 6164696E6720706172 0 00000E31 746974696F6E207461 0 00000E3A 626C650D0A 182 <3> $M_C_0002FH_END LABEL BYTE 183 <3> 184 <3> $M_C_00030H_MSG LABEL BYTE 0 00000E3F 20 DB $M_C_00030H_END-$M_C_00030H_MSG-1 0 00000E40 0D4572726F72207772 DB CR,"Error writing partition table",CR,LF 0 00000E49 6974696E6720706172 0 00000E52 746974696F6E207461 0 00000E5B 626C650D0A 187 <3> $M_C_00030H_END LABEL BYTE 188 <3> 189 <3> $M_C_00031H_MSG LABEL BYTE 0 00000E60 1C DB $M_C_00031H_END-$M_C_00031H_MSG-1 0 00000E61 0D506172616D657465 DB CR,"Parameters not compatible", CR,LF 0 00000E6A 7273206E6F7420636F 0 00000E73 6D70617469626C650D 0 00000E7C 0A 192 <3> $M_C_00031H_END LABEL BYTE 193 <3> 194 <3> $M_C_00032H_MSG LABEL BYTE 0 00000E7D 27 DB $M_C_00032H_END-$M_C_00032H_MSG-1 0 00000E7E 253120616C6C6F6361 DB "%1 allocation units available on disk",CR,LF 0 00000E87 74696F6E20756E6974 0 00000E90 7320617661696C6162 0 00000E99 6C65206F6E20646973 0 00000EA2 6B0D0A 197 <3> $M_C_00032H_END LABEL BYTE 198 <3> 199 <3> $M_C_00033H_MSG LABEL BYTE 0 00000EA5 22 DB $M_C_00033H_END-$M_C_00033H_MSG-1 0 00000EA6 253120627974657320 DB "%1 bytes in each allocation unit",CR,LF 0 00000EAF 696E20656163682061 0 00000EB8 6C6C6F636174696F6E 0 00000EC1 20756E69740D0A 202 <3> $M_C_00033H_END LABEL BYTE 203 <3> 204 <3> $M_C_00034H_MSG LABEL BYTE 0 00000EC8 20 DB $M_C_00034H_END-$M_C_00034H_MSG-1 0 00000EC9 0D4572726F72207772 DB CR, "Error writing partition table",CR,LF 0 00000ED2 6974696E6720706172 0 00000EDB 746974696F6E207461 0 00000EE4 626C650D0A 207 <3> $M_C_00034H_END LABEL BYTE 208 <3> 209 <3> $M_C_00035H_MSG LABEL BYTE 0 00000EE9 1F DB $M_C_00035H_END-$M_C_00035H_MSG-1 0 00000EEA 0D53616D6520706172 DB CR,"Same parameter entered twice",CR,LF 0 00000EF3 616D6574657220656E 0 00000EFC 746572656420747769 0 00000F05 63650D0A 212 <3> $M_C_00035H_END LABEL BYTE 213 <3> 214 <3> $M_C_00036H_MSG LABEL BYTE 0 00000F09 27 DB $M_C_00036H_END-$M_C_00036H_MSG-1 0 00000F0A 0D4D75737420656E74 DB CR,"Must enter both /T and /N parameters",CR,LF 0 00000F13 657220626F7468202F 0 00000F1C 5420616E64202F4E20 0 00000F25 706172616D65746572 0 00000F2E 730D0A 217 <3> $M_C_00036H_END LABEL BYTE 218 <3> 219 <3> $M_C_00037H_MSG LABEL BYTE 0 00000F31 44 DB $M_C_00037H_END-$M_C_00037H_MSG-1 0 00000F32 0D417474656D707469 DB CR,"Attempting to recover allocation unit %1 ",CR 0 00000F3B 6E6720746F20726563 0 00000F44 6F76657220616C6C6F 0 00000F4D 636174696F6E20756E 0 00000F56 697420253120202020 0 00000F5F 202020202020202020 0 00000F68 202020202020202020 0 00000F71 202020200D 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> 0 00000F76 0E PUSH CS 0 00000F77 07 POP ES 0 00000F78 8D3E[1C0D] LEA DI,[$M_CLASS_C_STRUC] 0 00000F7C 81C16002 ADD CX,$-$M_CLASS_C_STRUC 0 00000F80 C3 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 Utility_Msg_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 0 00000F81 01 db 001H 16 <3> at $M_COMMAND_VER 0 00000F82 0400 dw EXPECTED_VERSION 18 <3> at $M_NUM_CLS_MSG 0 00000F84 07 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 0 00000F85 0200 dw 00002H 30 <3> at $M_TXT_PTR 0 00000F87 1C00 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 0 00000F89 0400 dw 00004H 38 <3> at $M_TXT_PTR 0 00000F8B 2700 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 0 00000F8D 0500 dw 00005H 46 <3> at $M_TXT_PTR 0 00000F8F 3700 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 0 00000F91 0800 dw 00008H 54 <3> at $M_TXT_PTR 0 00000F93 4200 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 0 00000F95 0F00 dw 0000FH 62 <3> at $M_TXT_PTR 0 00000F97 5200 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 0 00000F99 1A00 dw 0001AH 70 <3> at $M_TXT_PTR 0 00000F9B 6A00 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 0 00000F9D FFFF dw 0FFFFH 80 <3> at $M_TXT_PTR 0 00000F9F 7900 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 0 00000FA1 0E DB $M_1_00002H_END-$M_1_00002H_MSG-1 0 00000FA2 46696C65206E6F7420 DB "File not found" 0 00000FAB 666F756E64 90 <3> $M_1_00002H_END LABEL BYTE 91 <3> 92 <3> $M_1_00004H_MSG LABEL BYTE 0 00000FB0 13 DB $M_1_00004H_END-$M_1_00004H_MSG-1 0 00000FB1 546F6F206D616E7920 DB "Too many open files" 0 00000FBA 6F70656E2066696C65 0 00000FC3 73 95 <3> $M_1_00004H_END LABEL BYTE 96 <3> 97 <3> $M_1_00005H_MSG LABEL BYTE 0 00000FC4 0E DB $M_1_00005H_END-$M_1_00005H_MSG-1 0 00000FC5 416363657373206465 DB "Access denied " 0 00000FCE 6E69656420 100 <3> $M_1_00005H_END LABEL BYTE 101 <3> 102 <3> $M_1_00008H_MSG LABEL BYTE 0 00000FD3 13 DB $M_1_00008H_END-$M_1_00008H_MSG-1 0 00000FD4 496E73756666696369 DB "Insufficient memory" 0 00000FDD 656E74206D656D6F72 0 00000FE6 79 105 <3> $M_1_00008H_END LABEL BYTE 106 <3> 107 <3> $M_1_0000FH_MSG LABEL BYTE 0 00000FE7 1B DB $M_1_0000FH_END-$M_1_0000FH_MSG-1 0 00000FE8 496E76616C69642064 DB "Invalid drive specification" 0 00000FF1 726976652073706563 0 00000FFA 696669636174696F6E 110 <3> $M_1_0000FH_END LABEL BYTE 111 <3> 112 <3> $M_1_0001AH_MSG LABEL BYTE 0 00001003 12 DB $M_1_0001AH_END-$M_1_0001AH_MSG-1 0 00001004 496E76616C6964206D DB "Invalid media type" 0 0000100D 656469612074797065 115 <3> $M_1_0001AH_END LABEL BYTE 116 <3> 117 <3> ; ---------------------------------------------------------- 118 <3> 119 <3> $M_1_FF_MSG LABEL BYTE 0 00001016 11 DB $M_1_FF_END-$M_1_FF_MSG-1 0 00001017 457874656E64656420 DB "Extended Error %1" 0 00001020 4572726F72202531 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> 0 00001028 0E PUSH CS 0 00001029 07 POP ES 0 0000102A 8D3E[810F] LEA DI,[$M_CLASS_1_STRUC] 0 0000102E 81C1AD00 ADD CX,$-$M_CLASS_1_STRUC 0 00001032 C3 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 Utility_Msg_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 0 00001033 02 db 002H 15 <3> at $M_COMMAND_VER 0 00001034 0400 dw EXPECTED_VERSION 17 <3> at $M_NUM_CLS_MSG 0 00001036 01 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 0 00001037 FFFF dw 0FFFFH 30 <3> at $M_TXT_PTR 0 00001039 0400 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 0 0000103B 0E DB $M_2_FF_END-$M_2_FF_MSG-1 0 0000103C 506172736520457272 DB "Parse Error %1" 0 00001045 6F72202531 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> 0 0000104A 0E PUSH CS 0 0000104B 07 POP ES 0 0000104C 8D3E[3310] LEA DI,[$M_CLASS_2_STRUC] 0 00001050 83C11D ADD CX,$-$M_CLASS_2_STRUC 0 00001053 C3 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> 92 ; (no prior section) ; code ends 93 94 ; 95 ;***************************************************************************** 96 ; Public Declarations 97 ;***************************************************************************** 98 ; 99 100 SysDispMsg equ SYSDISPMSG ; NASM port label 101 Public SysDispMsg 102 SysLoadMsg equ SYSLOADMSG ; NASM port label 103 Public SysLoadMsg 104 105 106 ; 107 ;*************************************************************************** 108 ; Message Structures 109 ;*************************************************************************** 110 ; 111 112 113 Message_Table struc ; ;AN000; 114 ; 0 00000000 ???? Entry1 dw ? ; ;AN000; 0 00000002 ???? Entry2 dw ? ; ;AN000; 0 00000004 ???? Entry3 dw ? ; ;AN000; 0 00000006 ???? Entry4 dw ? ; ;AN000; 0 00000008 ?? Entry5 db ? ; ;AN000; 0 00000009 ?? Entry6 db ? ; ;AN000; 0 0000000A ???? Entry7 dw ? ; ;AN000; 122 ; 123 Message_Table ends ; ;AN000; 124 125 126 === Switch to base=001900h -> "CODE" 127 section code 128 ;***************************************************************************** 129 ;Routine name&gml Display_Interface 130 ;***************************************************************************** 131 ; 132 ;DescriptioN&gml Save all registers, set up registers required for SysDispMsg 133 ; routine. This information is contained in a message description 134 ; table pointed to by the DX register. Call SysDispMsg, then 135 ; restore registers. This routine assumes that the only time an 136 ; error will be returned is if an extended error message was 137 ; requested, so it will ignore error returns 138 ; 139 ;Called Procedures: Message (macro) 140 ; 141 ;Change History&gml Created 4/22/87 MT 142 ; 143 ;Input&gml ES&gmlDX = pointer to message description 144 ; 145 ;Output&gml None 146 ; 147 ;Psuedocode 148 ;---------- 149 ; 150 ; Save all registers 151 ; Setup registers for SysDispMsg from Message Description Tables 152 ; CALL SysDispMsg 153 ; Restore registers 154 ; ret 155 ;***************************************************************************** 156 157 Public Display_Interface 158 Display_Interface proc ; ;AN000; 159 0 00001054 1E push ds ; ;AN000; 0 00001055 50 push ax ;Save registers ;AN000; 0 00001056 53 push bx ; " " " " ;AN000; 0 00001057 51 push cx ; " " " " ;AN000; 0 00001058 52 push dx ; " " " " ;AN000; 0 00001059 56 push si ; " " " " ;AN000; 0 0000105A 57 push di ; " " " " ;AN000; 0 0000105B 89D7 mov di,dx ;Change pointer to table ;AN000; 0 0000105D BA[0000] mov dx,data ;Point to data segment 0 00001060 8EDA mov ds,dx ; 0 00001062 8B05 mov ax,[di + Entry1] ;Message number ;AN000; 0 00001064 8B5D02 mov bx,[di + Entry2] ;Handle ;AN000; 0 00001067 8B7504 mov si,[di + Entry3] ;Sublist ;AN000; 0 0000106A 8B4D06 mov cx,[di + Entry4] ;Count ;AN000; 0 0000106D 8A7508 mov dh,[di + Entry5] ;Class ;AN000; 0 00001070 8A5509 mov dl,[di + Entry6] ;Function ;AN000; 0 00001073 8B7D0A mov di,[di + Entry7] ;Input ;AN000; 0 00001076 E8FBF0 call SysDispMsg ;Display the message ;AN000; 0 00001079 5F pop di ;Restore registers ;AN000; 0 0000107A 5E pop si ; " " " " ;AN000; 0 0000107B 5A pop dx ; " " " " ;AN000; 0 0000107C 59 pop cx ; " " " " ;AN000; 0 0000107D 5B pop bx ; " " " " ;AN000; 0 0000107E 58 pop ax ; " " " " ;AN000; 0 0000107F 1F pop ds ; ;AN000; 0 00001080 C3 ret ;All done ;AN000; 186 187 Display_Interface endp ; ;AN000; 188 ; (no prior section) ; code ends 189 end 190 === Trace listing source: forinit.lst 1 ;***************************************************************************** 2 ;***************************************************************************** 3 ;UTILITY NAME: FORMAT.COM 4 ; 5 ;MODULE NAME: FORINIT.SAL 6 ; 7 ; 8 ; 9 ; ============= 10 ; = Main_Init = 11 ; ============= 12 ; = 13 ; ==================== ================== 14 ; ==Init_Input_Output=======Preload_Messages= 15 ; ==================== =================== 16 ; = ====================== ===================== 17 ; = ==Check_For_FS_Switch=====Parse_For_FS_Switch= 18 ; = ====================== ====================== 19 ; = = ================= 20 ; = = ==EXEC_FS_Format= 21 ; = = ================ 22 ; = ====================== ================= 23 ; = ==Parse_Command_Line =====Interpret_Parse= 24 ; = ===================== ================= 25 ; ======================== ==================== 26 ; ==Validate_Target_Drive===Check_Target_Drive= 27 ; ============================================= 28 ; = ==================== 29 ; = ==Check_For_Network= 30 ; = ==================== 31 ; = ======================== 32 ; = ==Check_Translate_Drive= 33 ; = ======================= 34 ; =============== 35 ; ==Hook_CNTRL_C= 36 ; ============== 37 ; 38 ; 39 ; Change List: AN000 - New code DOS 3.3 spec additions 40 ; AC000 - Changed code DOS 3.3 spec additions 41 ;***************************************************************************** 42 ;***************************************************************************** 43 === Switch to base=000080h -> "DATA" 44 section data public align=16 class=DATA 45 46 0 00000470 00 Command_Line db NO 0 00000471 0000 PSP_Segment dw 0 49 50 ;These should stay togather 51 ; --------------------------------------- ; ;AN000; 0 00000473 202020202020202020 FS_String_Buffer db 13 dup(" ") ; ;AN000; 0 0000047C 20202020 0 00000480 464D542E45584500 FS_String_End db "FMT.EXE",0 ; ;AN000; 54 Len_FS_String_End equ $ - FS_String_End ; ;AN000; 55 ; ;AN000; 56 ;---------------------------------------- 57 0 00000488 80 Vol_Label_Count db 80h ;an000; dms;max. string length 0 00000489 00 Vol_Label_Len db 00h ;an000; dms;len. entered 0 0000048A 000000000000000000 Vol_Label_Buffer db 80h dup(0) ; ;AN000; 0 00000493 000000000000000000 0 0000049C 000000000000000000 0 000004A5 000000000000000000 0 000004AE 000000000000000000 0 000004B7 000000000000000000 0 000004C0 000000000000000000 0 000004C9 000000000000000000 0 000004D2 000000000000000000 0 000004DB 000000000000000000 0 000004E4 000000000000000000 0 000004ED 000000000000000000 0 000004F6 000000000000000000 0 000004FF 000000000000000000 0 00000508 0000 61 Vol_Label_Buffer_Length equ $ - Vol_Label_Buffer ; ;AN000; 62 0 0000050A 000000000000000000 Command_Line_Buffer db 80h dup(0) ; ;AN000; 0 00000513 000000000000000000 0 0000051C 000000000000000000 0 00000525 000000000000000000 0 0000052E 000000000000000000 0 00000537 000000000000000000 0 00000540 000000000000000000 0 00000549 000000000000000000 0 00000552 000000000000000000 0 0000055B 000000000000000000 0 00000564 000000000000000000 0 0000056D 000000000000000000 0 00000576 000000000000000000 0 0000057F 000000000000000000 0 00000588 0000 64 Command_Line_Length equ $ - Command_Line_Buffer ; ;AN000; 0 0000058A 00 Fatal_Error db 0 ; ;AN000; 66 0 0000058B ???? Command_Old_Ptr dw ? 68 69 ; (no prior section) ; data ends 70 === Switch to base=001900h -> "CODE" 71 section code public align=16 class=CODE 72 assume cs:code,ds:data,es:data 73 ; (no prior section) ; code ends 74 75 ; 76 ;***************************************************************************** 77 ; Include files 78 ;***************************************************************************** 79 ; 80 81 [list -] 134 <1> 83 %include "formacro.mac" 1 <1> ; 2 <1> ;****************************************************************************** 3 <1> ; Message Macro Definitions 4 <1> ;****************************************************************************** 5 <1> ; 6 <1> 7 <1> EXTRN Display_Interface:near 8 <1> 9 <1> 10 <1> ; NASM original macros 11 <1> 12 <1> ;----------------------------------------------------------------------------- 13 <1> 14 <1> %imacro Message 1.nolist 15 <1> mov dx,offset %1 wrt data 16 <1> call Display_Interface 17 <1> %endmacro 18 <1> 19 <1> ;----------------------------------------------------------------------------- 20 <1> 21 <1> %imacro Parse_Message 0.nolist 22 <1> push ds 23 <1> mov dx,data 24 <1> mov ds,dx 25 <1> mov word ptr [Parse_Error_Msg],ax 26 <1> mov dx,offset Parse_Error_Msg ; ;AN000; 27 <1> call Display_Interface ; ;AN000; 28 <1> pop ds ; 29 <1> %endmacro 30 <1> 31 <1> ;----------------------------------------------------------------------------- 32 <1> 33 <1> %imacro Extended_Message 0.nolist 34 <1> push ds 35 <1> mov dx,data 36 <1> mov ds,dx 37 <1> mov word ptr [Extended_Error_Msg],ax 38 <1> mov dx,offset Extended_Error_Msg wrt data 39 <1> call Display_Interface ; ;AN000; 40 <1> pop ds 41 <1> %endmacro 42 <1> 43 <1> ; 44 <1> ;***************************************************************************** 45 <1> ; General Macro's 46 <1> ;***************************************************************************** 47 <1> ; 48 <1> 49 <1> %imacro Procedure 1.nolist 50 <1> %1 proc 51 <1> Public %1 52 <1> %endmacro 53 <1> 54 <1> ;----------------------------------------------------------------------------- 55 <1> 56 <1> %imacro DOS_Call 1.nolist 57 <1> mov ah, %1 58 <1> int 21h 59 <1> %endmacro 60 <1> ;----------------------------------------------------------------------------- 61 <1> 62 <1> %imacro Popff 0.nolist 63 <1> jmp strict short $+3 64 <1> iret 65 <1> push cs 66 <1> call near $-2 67 <1> %endmacro 68 <1> 69 <1> ;----------------------------------------------------------------------------- 70 <1> 71 <1> %imacro Set_Data_Segment 0.nolist 72 <1> push ax 73 <1> mov ax,data ;Point to data segment 74 <1> mov ds,ax ; 75 <1> push ds 76 <1> pop es 77 <1> pop ax 78 <1> assume ds:data,es:data 79 <1> %endmacro 80 <1> 81 <1> ; end of NASM original macros 84 %include "syscall.mac" 1 <1> ; SCCSID = @(#)syscall.asm 1.1 85/04/10 2 <1> ;BREAK 3 <1> ;SUBTTL system call definitions 4 <1> ;PAGE 5 <1> 6 <1> Abort EQU 0 ; 0 0 7 <1> Std_Con_Input EQU 1 ; 1 1 8 <1> Std_Con_Output EQU 2 ; 2 2 9 <1> Std_Aux_Input EQU 3 ; 3 3 10 <1> Std_Aux_Output EQU 4 ; 4 4 11 <1> Std_Printer_Output EQU 5 ; 5 5 12 <1> Raw_Con_IO EQU 6 ; 6 6 13 <1> Raw_Con_Input EQU 7 ; 7 7 14 <1> Std_Con_Input_No_Echo EQU 8 ; 8 8 15 <1> Std_Con_String_Output EQU 9 ; 9 9 16 <1> Std_Con_String_Input EQU 10 ; 10 A 17 <1> Std_Con_Input_Status EQU 11 ; 11 B 18 <1> Std_Con_Input_Flush EQU 12 ; 12 C 19 <1> Disk_Reset EQU 13 ; 13 D 20 <1> Set_Default_Drive EQU 14 ; 14 E 21 <1> FCB_Open EQU 15 ; 15 F 22 <1> FCB_Close EQU 16 ; 16 10 23 <1> Dir_Search_First EQU 17 ; 17 11 24 <1> Dir_Search_Next EQU 18 ; 18 12 25 <1> FCB_Delete EQU 19 ; 19 13 26 <1> FCB_Seq_Read EQU 20 ; 20 14 27 <1> FCB_Seq_Write EQU 21 ; 21 15 28 <1> FCB_Create EQU 22 ; 22 16 29 <1> FCB_Rename EQU 23 ; 23 17 30 <1> Get_Default_Drive EQU 25 ; 25 19 31 <1> Set_DMA EQU 26 ; 26 1A 32 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 33 <1> ; C A V E A T P R O G R A M M E R ; 34 <1> ; ; 35 <1> Get_Default_DPB EQU 31 ; 31 1F 36 <1> ; ; 37 <1> ; C A V E A T P R O G R A M M E R ; 38 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 39 <1> FCB_Random_Read EQU 33 ; 33 21 40 <1> FCB_Random_Write EQU 34 ; 34 22 41 <1> Get_FCB_File_Length EQU 35 ; 35 23 42 <1> Get_FCB_Position EQU 36 ; 36 24 43 <1> Set_Interrupt_Vector EQU 37 ; 37 25 44 <1> Create_Process_Data_Block EQU 38 ; 38 26 45 <1> FCB_Random_Read_Block EQU 39 ; 39 27 46 <1> FCB_Random_Write_Block EQU 40 ; 40 28 47 <1> Parse_File_Descriptor EQU 41 ; 41 29 48 <1> Get_Date EQU 42 ; 42 2A 49 <1> Set_Date EQU 43 ; 43 2B 50 <1> Get_Time EQU 44 ; 44 2C 51 <1> Set_Time EQU 45 ; 45 2D 52 <1> Set_Verify_On_Write EQU 46 ; 46 2E 53 <1> ; Extended functionality group 54 <1> Get_DMA EQU 47 ; 47 2F 55 <1> Get_Version EQU 48 ; 48 30 56 <1> Keep_Process EQU 49 ; 49 31 57 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 58 <1> ; C A V E A T P R O G R A M M E R ; 59 <1> ; ; 60 <1> Get_DPB EQU 50 ; 50 32 61 <1> ; ; 62 <1> ; C A V E A T P R O G R A M M E R ; 63 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 64 <1> Set_CTRL_C_Trapping EQU 51 ; 51 33 65 <1> Get_InDOS_Flag EQU 52 ; 52 34 66 <1> Get_Interrupt_Vector EQU 53 ; 53 35 67 <1> Get_Drive_Freespace EQU 54 ; 54 36 68 <1> Char_Oper EQU 55 ; 55 37 69 <1> International EQU 56 ; 56 38 70 <1> ; Directory Group 71 <1> MKDir EQU 57 ; 57 39 72 <1> RMDir EQU 58 ; 58 3A 73 <1> CHDir EQU 59 ; 59 3B 74 <1> ; File Group 75 <1> Creat EQU 60 ; 60 3C 76 <1> Open EQU 61 ; 61 3D 77 <1> Close EQU 62 ; 62 3E 78 <1> Read EQU 63 ; 63 3F 79 <1> Write EQU 64 ; 64 40 80 <1> Unlink EQU 65 ; 65 41 81 <1> LSeek EQU 66 ; 66 42 82 <1> CHMod EQU 67 ; 67 43 83 <1> IOCtl EQU 68 ; 68 44 84 <1> XDup EQU 69 ; 69 45 85 <1> XDup2 EQU 70 ; 70 46 86 <1> Current_Dir EQU 71 ; 71 47 87 <1> ; Memory Group 88 <1> Alloc EQU 72 ; 72 48 89 <1> Dealloc EQU 73 ; 73 49 90 <1> Setblock EQU 74 ; 74 4A 91 <1> ; Process Group 92 <1> Exec EQU 75 ; 75 4B 93 <1> Exit EQU 76 ; 76 4C 94 <1> WaitProcess EQU 77 ; 77 4D 95 <1> Find_First EQU 78 ; 78 4E 96 <1> ; Special Group 97 <1> Find_Next EQU 79 ; 79 4F 98 <1> ; SPECIAL SYSTEM GROUP 99 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 100 <1> ; C A V E A T P R O G R A M M E R ; 101 <1> ; ; 102 <1> Set_Current_PDB EQU 80 ; 80 50 103 <1> Get_Current_PDB EQU 81 ; 81 51 104 <1> Get_In_Vars EQU 82 ; 82 52 105 <1> SetDPB EQU 83 ; 83 53 106 <1> ; ; 107 <1> ; C A V E A T P R O G R A M M E R ; 108 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 109 <1> Get_Verify_On_Write EQU 84 ; 84 54 110 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 111 <1> ; C A V E A T P R O G R A M M E R ; 112 <1> ; ; 113 <1> Dup_PDB EQU 85 ; 85 55 114 <1> ; ; 115 <1> ; C A V E A T P R O G R A M M E R ; 116 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 117 <1> Rename EQU 86 ; 86 56 118 <1> File_Times EQU 87 ; 87 57 119 <1> AllocOper EQU 88 ; 88 58 120 <1> ; Network extention system calls 121 <1> GetExtendedError EQU 89 ; 89 59 122 <1> CreateTempFile EQU 90 ; 90 5A 123 <1> CreateNewFile EQU 91 ; 91 5B 124 <1> LockOper EQU 92 ; 92 5C Lock and Unlock 125 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 126 <1> ; C A V E A T P R O G R A M M E R ; 127 <1> ; ; 128 <1> ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall, 129 <1> ; CloseByName, CloseUser, 130 <1> ; CloseUserProcess, 131 <1> ; GetOpenFileList 132 <1> ; ; 133 <1> ; C A V E A T P R O G R A M M E R ; 134 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 135 <1> UserOper EQU 94 ; 94 5E Get and Set 136 <1> AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel 137 <1> xNameTrans EQU 96 ; 96 60 138 <1> PathParse EQU 97 ; 97 61 139 <1> GetCurrentPSP EQU 98 ; 98 62 140 <1> Hongeul EQU 99 ; 99 63 141 <1> ECS_CALL EQU 99 ; 99 63 ;; DBCS support 142 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 143 <1> ; C A V E A T P R O G R A M M E R ; 144 <1> ; ; 145 <1> Set_Printer_Flag EQU 100 ; 100 64 146 <1> ; ; 147 <1> ; C A V E A T P R O G R A M M E R ; 148 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 149 <1> GetExtCntry EQU 101 ; 101 65 150 <1> GetSetCdPg EQU 102 ; 102 66 151 <1> ExtHandle EQU 103 ; 103 67 152 <1> Commit EQU 104 ; 104 68 153 <1> GetSetMediaID EQU 105 ; 105 69 154 <1> IFS_IOCTL EQU 107 ; 107 6B 155 <1> ExtOpen EQU 108 ; 108 6C 156 <1> ; 157 <1> ; 158 <1> Set_Oem_Handler EQU 248 ; 248 F8 159 <1> OEM_C1 EQU 249 ; 249 F9 160 <1> OEM_C2 EQU 250 ; 250 FA 161 <1> OEM_C3 EQU 251 ; 251 FB 162 <1> OEM_C4 EQU 252 ; 252 FC 163 <1> OEM_C5 EQU 253 ; 253 FD 164 <1> OEM_C6 EQU 254 ; 254 FE 165 <1> OEM_C7 EQU 255 ; 255 FF 85 %include "ioctl.mac" 1 <1> 2 <1> %warning out: IOCTL.INC... 2 ****************** <1> warning: out: IOCTL.INC... [-w+user] 3 <1> ; THESE ARE ALL THE IMPORTANT STRUCTURES AND EQUATES FOR IOCTL 4 <1> ;============================================================================== 5 <1> ;REVISION HISTORY: 6 <1> ;AN000 - New for DOS Version 4.00 - J.K. 7 <1> ;AC000 - Changed for DOS Version 4.00 - J.K. 8 <1> ;AN00x - PTM number for DOS Version 4.00 - J.K. 9 <1> ;============================================================================== 10 <1> ;AN001; D241 Provide support of Multi-track Format/Verify 9/23/87 J.K. 11 <1> ;AN002; P1535 Unformatted hard file problem 10/15/87 J.K. 12 <1> ;AN003; D490 IOCTL subfunction 63h,43h,64h,44h conflicts with OS2 2/26/88 J.K. 13 <1> ;============================================================================== 14 <1> 15 <1> ;*** J.K. 16 <1> ;General Guide - 17 <1> ;Category Code: 18 <1> ; 0... .... DOS Defined 19 <1> ; 1... .... User defined 20 <1> ; .xxx xxxx Code 21 <1> 22 <1> ;Function Code: 23 <1> ; 0... .... Return error if unsupported 24 <1> ; 1... .... Ignore if unsupported 25 <1> ; .0.. .... Intercepted by DOS 26 <1> ; .1.. .... Passed to driver 27 <1> ; ..0. .... Sends data/commands to device 28 <1> ; ..1. .... Quries data/info from device 29 <1> ; ...x .... Subfunction 30 <1> ; 31 <1> ; Note that "Sends/queries" data bit is intended only to regularize the 32 <1> ; function set. It plays no critical role; some functions may contain both 33 <1> ; command and query elements. The convention is that such commands are 34 <1> ; defined as "sends data". 35 <1> 36 <1> ;*****************************;* 37 <1> ; BLOCK DRIVERS ;* 38 <1> ;*****************************;* 39 <1> 40 <1> ; IOCTL SUB-FUNCTIONS 41 <1> IOCTL_GET_DEVICE_INFO EQU 0 42 <1> IOCTL_SET_DEVICE_INFO EQU 1 43 <1> IOCTL_READ_HANDLE EQU 2 44 <1> IOCTL_WRITE_HANDLE EQU 3 45 <1> IOCTL_READ_DRIVE EQU 4 46 <1> IOCTL_WRITE_DRIVE EQU 5 47 <1> IOCTL_GET_INPUT_STATUS EQU 6 48 <1> IOCTL_GET_OUTPUT_STATUS EQU 7 49 <1> IOCTL_CHANGEABLE? EQU 8 50 <1> IOCTL_DeviceLocOrRem? EQU 9 51 <1> IOCTL_HandleLocOrRem? EQU 0Ah ;10 52 <1> IOCTL_SHARING_RETRY EQU 0Bh ;11 53 <1> GENERIC_IOCTL_HANDLE EQU 0Ch ;12 54 <1> GENERIC_IOCTL EQU 0Dh ;13 55 <1> 56 <1> ; GENERIC IOCTL CATEGORY CODES 57 <1> IOC_OTHER EQU 0 ; Other device control J.K. 4/29/86 58 <1> IOC_SE EQU 1 ; SERIAL DEVICE CONTROL 59 <1> IOC_TC EQU 2 ; TERMINAL CONTROL 60 <1> IOC_SC EQU 3 ; SCREEN CONTROL 61 <1> IOC_KC EQU 4 ; KEYBOARD CONTROL 62 <1> IOC_PC EQU 5 ; PRINTER CONTROL 63 <1> IOC_DC EQU 8 ; DISK CONTROL (SAME AS RAWIO) 64 <1> 65 <1> ; GENERIC IOCTL SUB-FUNCTIONS 66 <1> RAWIO EQU 8 67 <1> 68 <1> ; RAWIO SUB-FUNCTIONS 69 <1> GET_DEVICE_PARAMETERS EQU 60H 70 <1> SET_DEVICE_PARAMETERS EQU 40H 71 <1> READ_TRACK EQU 61H 72 <1> WRITE_TRACK EQU 41H 73 <1> VERIFY_TRACK EQU 62H 74 <1> FORMAT_TRACK EQU 42H 75 <1> GET_MEDIA_ID EQU 66h ;AN000;AN003;changed from 63h 76 <1> SET_MEDIA_ID EQU 46h ;AN000;AN003;changed from 43h 77 <1> GET_ACCESS_FLAG EQU 67h ;AN002;AN003;Unpublished function.Changed from 64h 78 <1> SET_ACCESS_FLAG EQU 47h ;AN002;AN003;Unpublished function.Changed from 44h 79 <1> 80 <1> ; SPECIAL FUNCTION FOR GET DEVICE PARAMETERS 81 <1> BUILD_DEVICE_BPB EQU 000000001B 82 <1> 83 <1> ; SPECIAL FUNCTIONS FOR SET DEVICE PARAMETERS 84 <1> INSTALL_FAKE_BPB EQU 000000001B 85 <1> ONLY_SET_TRACKLAYOUT EQU 000000010B 86 <1> TRACKLAYOUT_IS_GOOD EQU 000000100B 87 <1> 88 <1> ; SPECIAL FUNCTION FOR FORMAT TRACK 89 <1> STATUS_FOR_FORMAT EQU 000000001B 90 <1> DO_FAST_FORMAT equ 000000010B ;AN001; 91 <1> ; CODES RETURNED FROM FORMAT STATUS CALL 92 <1> FORMAT_NO_ROM_SUPPORT EQU 000000001B 93 <1> FORMAT_COMB_NOT_SUPPORTED EQU 000000010B 94 <1> 95 <1> ; DEVICETYPE VALUES 96 <1> MAX_SECTORS_IN_TRACK EQU 63 ; MAXIMUM SECTORS ON A DISK.(Was 40 in DOS 3.2) 97 <1> DEV_5INCH EQU 0 98 <1> DEV_5INCH96TPI EQU 1 99 <1> DEV_3INCH720KB EQU 2 100 <1> DEV_8INCHSS EQU 3 101 <1> DEV_8INCHDS EQU 4 102 <1> DEV_HARDDISK EQU 5 103 <1> DEV_OTHER EQU 7 104 <1> 105 <1> MAX_DEV_TYPE EQU 7 ; MAXIMUM DEVICE TYPE THAT WE 106 <1> ; CURRENTLY SUPPORT. 107 <1> 108 <1> %include "bpb.mac" 1 <2> %warning out: BPB.INC... 1 ****************** <2> warning: out: BPB.INC... [-w+user] 2 <2> ; SCCSID = @(#)BPB.ASM 1.1 85/04/29 3 <2> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 4 <2> ; C A V E A T P R O G R A M M E R ; 5 <2> ; ; 6 <2> 7 <2> ; BIOS PARAMETER BLOCK DEFINITION 8 <2> ; THIS STRUCTURE IS USED TO BUILD A FULL DPB 9 <2> 10 <2> BPBLOCK STRUC 0 00001090 ???? BPSECSZ DW ? ; SIZE IN BYTES OF PHYSICAL SECTOR 0 00001092 ?? BPCLUS DB ? ; SECTORS/ALLOC UNIT 0 00001093 ???? BPRES DW ? ; NUMBER OF RESERVED SECTORS 0 00001095 ?? BPFTCNT DB ? ; NUMBER OF FATS 0 00001096 ???? BPDRCNT DW ? ; NUMBER OF DIRECTORY ENTRIES 0 00001098 ???? BPSCCNT DW ? ; TOTAL NUMBER OF SECTORS 0 0000109A ?? BPMEDIA DB ? ; MEDIA DESCRIPTOR BYTE 0 0000109B ???? BPFTSEC DW ? ; NUMBER OF SECTORS TAKEN UP BY ONE FAT 19 <2> BPBLOCK ENDS 20 <2> 21 <2> A_BPB STRUC 0 00001090 ???? BPB_BYTESPERSECTOR DW ? 0 00001092 ?? BPB_SECTORSPERCLUSTER DB ? 0 00001093 ???? BPB_RESERVEDSECTORS DW ? 0 00001095 ?? BPB_NUMBEROFFATS DB ? 0 00001096 ???? BPB_ROOTENTRIES DW ? 0 00001098 ???? BPB_TOTALSECTORS DW ? 0 0000109A ?? BPB_MEDIADESCRIPTOR DB ? 0 0000109B ???? BPB_SECTORSPERFAT DW ? 0 0000109D ???? BPB_SECTORSPERTRACK DW ? 0 0000109F ???? BPB_HEADS DW ? 0 000010A1 ???? BPB_HIDDENSECTORS DW ? 0 000010A3 ???? DW ? 0 000010A5 ???? BPB_BIGTOTALSECTORS DW ? 0 000010A7 ???? DW ? 0 000010A9 ???????????? DB 6 DUP(?) 37 <2> A_BPB ENDS 38 <2> ; ; 39 <2> ; C A V E A T P R O G R A M M E R ; 40 <2> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 109 <1> 110 <1> A_SECTORTABLE STRUC 0 00001090 ???? ST_SECTORNUMBER DW ? 0 00001092 ???? ST_SECTORSIZE DW ? 113 <1> A_SECTORTABLE ENDS 114 <1> 115 <1> A_DEVICEPARAMETERS STRUC 0 00001090 ?? DP_SPECIALFUNCTIONS DB ? 0 00001091 ?? DP_DEVICETYPE DB ? 0 00001092 ???? DP_DEVICEATTRIBUTES DW ? 0 00001094 ???? DP_CYLINDERS DW ? 0 00001096 ?? DP_MEDIATYPE DB ? 121 00000007 <1> DP_BPB DB A_BPB_struc_size DUP (?) 0 000010B6 ???? DP_TRACKTABLEENTRIES DW ? 123 00000028 <1> DP_SECTORTABLE DB MAX_SECTORS_IN_TRACK * A_SECTORTABLE_struc_size DUP (?) 124 <1> A_DEVICEPARAMETERS ENDS 125 <1> 126 <1> A_TRACKREADWRITEPACKET STRUC 0 00001090 ?? TRWP_SPECIALFUNCTIONS DB ? 0 00001091 ???? TRWP_HEAD DW ? 0 00001093 ???? TRWP_CYLINDER DW ? 0 00001095 ???? TRWP_FIRSTSECTOR DW ? 0 00001097 ???? TRWP_SECTORSTOREADWRITE DW ? 0 00001099 ???????? TRWP_TRANSFERADDRESS DD ? 133 <1> A_TRACKREADWRITEPACKET ENDS 134 <1> 135 <1> ;AN001; - FP_TRACKCOUNT is only meaningful when FP_SPECIALFUNCTIONS bit 1 = 1. 136 <1> A_FORMATPACKET STRUC 0 00001090 ?? FP_SPECIALFUNCTIONS DB ? 0 00001091 ???? FP_HEAD DW ? 0 00001093 ???? FP_CYLINDER DW ? 0 00001095 ???? FP_TRACKCOUNT DW ? ;1 141 <1> A_FORMATPACKET ENDS 142 <1> 143 <1> A_VERIFYPACKET STRUC 0 00001090 ?? VP_SPECIALFUNCTIONS DB ? 0 00001091 ???? VP_HEAD DW ? 0 00001093 ???? VP_CYLINDER DW ? 147 <1> A_VERIFYPACKET ENDS 148 <1> 149 <1> A_MEDIA_ID_INFO STRUC 0 00001090 ???? MI_LEVEL DW ? ;0 ;J.K. 87 Info. level 0 00001092 ???????? MI_SERIAL DD ? ;J.K. 87 Serial # 152 00000006 <1> MI_LABEL DB 11 DUP (?) ;(' ') ;J.K. 87 volume label 0 000010A1 ???????????????? MI_SYSTEM DB 8 DUP (?) ;(' ') ;J.K. 87 File system type 154 <1> A_MEDIA_ID_INFO ENDS 155 <1> 156 <1> A_DISKACCESS_CONTROL STRUC ;AN002; Unpublished function. Only for Hard file. 0 00001090 ?? DAC_SPECIALFUNCTIONS DB ? ;0 ;AN002; Always 0 0 00001091 ?? DAC_ACCESS_FLAG DB ? ;0 ;AN002; Non Zero - allow disk I/O to unformatted hard file 159 <1> A_DISKACCESS_CONTROL ENDS ;AN002; 0 - Disallow disk I/O to unformatted hard file 160 <1> 161 <1> ;********************************;* 162 <1> ; CHARACTER DEVICES (PRINTERS) ;* 163 <1> ;********************************;* 164 <1> 165 <1> ;RAWIO SUB-FUNCTIONS 166 <1> GET_RETRY_COUNT EQU 65H 167 <1> SET_RETRY_COUNT EQU 45H 168 <1> 169 <1> A_RETRYCOUNT STRUC 0 00001090 ???? RC_COUNT DW ? 171 <1> A_RETRYCOUNT ENDS 172 <1> 173 <1> ;********************************;* ;J.K. 4/29/86 174 <1> ; CHARACTER DEVICES (SCREEN) ;* 175 <1> ;********************************;* ;J.K. 4/29/86 176 <1> ; 177 <1> ;SC_MODE_INFO struc 178 <1> ;SC_INFO_LENGTH DW 9 179 <1> ;SC_MODE DB 0 180 <1> ;SC_COLORS DW 0 181 <1> ;SC_WIDTH DW 0 182 <1> ;SC_LENGTH DW 0 183 <1> ;SC_MODE_INFO ends 184 <1> ; 185 <1> ;SC_INFO_PACKET_LENGTH EQU 9 ;LENGTH OF THE INFO PACKET. 186 <1> 187 <1> ;SUBFUNCTIONS FOR CON$GENIOCTL 188 <1> ;GET_SC_MODE EQU 60h 189 <1> ;SET_SC_MODE EQU 40h 190 <1> ;The following subfunctions are reserved for installable CODE PAGE switch 191 <1> ;console devices. - J.K. 4/29/86 192 <1> ;Get_active_codepage equ 6Ah 193 <1> ;Invoke_active_codepage equ 4Ah 194 <1> ;Start_designate_codepage equ 4Ch 195 <1> ;End_designate_codepage equ 4Dh 196 <1> ;Get_list_of_designated_codepage equ 6Bh 197 <1> ;J.K. 4/29/86 *** End of Con$genioctl equates & structures 86 %include "forequ.mac" 1 <1> ; ; ; 2 <1> 3 <1> NO equ 0 4 <1> YES equ ~ NO 5 <1> FSExec equ NO ;an018; dms;conditional assembly 6 <1> ShipDisk equ NO ;an000; dms;ship disk flag 7 <1> 8 <1> Boot_ID equ 0AA55h 9 <1> DOS_Found equ 0 10 <1> 11 <1> Not_Include equ 0 12 <1> Do_Include equ 1 13 <1> 14 <1> INIT equ 0 15 <1> 16 <1> FAT12_File_System equ 01h 17 <1> FAT16_File_System equ 04h 18 <1> New_File_System equ 06h 19 <1> 20 <1> FS_String_Max_Length equ 5 21 <1> 22 <1> Paragraph_Size equ 16 ; ;AN005; 23 <1> Len_FS_String_Buffer equ 13 24 <1> 25 <1> Net_Check equ 1200h 26 <1> Assign_Check equ 8000h 27 <1> 28 <1> Found_Yes equ 1 29 <1> Found_No equ 0 30 <1> 31 <1> Asciiz_End equ 0 32 <1> DBCS equ 81h 33 <1> DBCS_Blank equ 40h 34 <1> DBCS_Vector_Size equ 2 35 <1> End_Of_Vector equ 0 36 <1> 37 <1> 38 <1> Blank equ " " 39 <1> 40 <1> Label_Length equ 11 41 <1> CR equ 13 42 <1> 43 <1> DBCS_VECTOR equ NO 44 <1> 45 <1> ;Limits 46 <1> BIG_FAT_THRESHOLD equ 4086 47 <1> 48 <1> ;------------------------------------------------------------------------------- 49 <1> 50 <1> 51 <1> 52 <1> 53 <1> 54 <1> DRNUM EQU 5CH 55 <1> 56 <1> 57 <1> 58 <1> ; Exit status defines 59 <1> ExitOK equ 0 60 <1> ExitCtrlC equ 3 61 <1> ExitFatal equ 4 62 <1> ExitNo equ 5 63 <1> 64 <1> 65 <1> ;------------------------------------------------------------------------------- 66 <1> ; These are the data structures which we will need 67 <1> 68 <1> 69 <1> Media_ID struc 0 00001090 ???? Media_ID_Info_Level dw ? 0 00001092 ???????? Media_ID_Serial_Number dd ? 72 00000006 <1> Media_ID_Volume_Label db 11 dup(?) 0 000010A1 ???????????????? Media_ID_File_System db 8 dup(?) 74 <1> Media_ID ends 75 <1> 76 <1> 77 <1> Relative_Sector_Buffer struc ; ;AN000; 78 <1> 0 00001090 ???? Start_Sector_Low dw ? ;Low word of RBA sector ;AN000; 0 00001092 ???? Start_Sector_High dw ? ;High word of RBA sector ;AN000; 0 00001094 ???? Number_Sectors dw ? ;Number of sectors ;AN000; 0 00001096 ???? Buffer_Offset dw ? ;Address of data buffer ;AN000; 0 00001098 ???? Buffer_Segment dw ? ; ;AN000; 84 <1> 85 <1> Relative_Sector_Buffer ends ; ;AN000; 86 <1> 87 <1> 88 <1> ;Per system file data structure 89 <1> 90 <1> a_FileStructure struc 0 00001090 ???? fileHandle DW ? 0 00001092 ???? fileSizeInParagraphs DW ? 0 00001094 ???????? fileSizeInBytes DD ? 0 00001098 ???????? fileOffset DD ? 0 0000109C ???? fileStartSegment DW ? 0 0000109E ???? fileDate DW ? 0 000010A0 ???? fileTime DW ? 98 <1> a_FileStructure ends 99 <1> 100 <1> ;------------------------------------------------------------------------------- 101 <1> 102 <1> LOGBOOTSECT equ 1 103 <1> Set_Drv_Owner equ 0Fh ; IOCTL subfunction 104 <1> Custom_Media equ 0F0H ; Media byte for custom format 105 <1> Dual_8_Media equ 0FFh ; Dual sided 8 sectored 106 <1> Single_8_Media equ 0FEh ; Single sided 8 sectored 107 <1> Dual_9_Media equ 0FDh ; Dual sided 9 sectored 108 <1> Single_9_Media equ 0FCh ; Single sided 9 sectored 109 <1> Dual_15_Media equ 0F9h ; Dual sided 15 sectored 110 <1> Fixed_Disk equ 0F8h ; Fixed Disk 111 <1> Invalid_Drive equ 000Fh ; Extended error 15 112 <1> Max_Format_Size equ 0FFFFh ; Max bytes to Format ;an015; dms; 113 <1> Multi_Track_Format equ 02h ; Multi-track format ;an015; dms; 114 <1> Single_Track_Format equ 00h ; Single track format ;an015; dms; 115 <1> Select_Disk_Message equ 0ADC1h ; an016; dms; 87 %include "forparse.mac" 1 <1> 2 <1> 3 <1> === Switch to base=000080h -> "DATA" 4 <1> section data 5 <1> 6 <1> ; 7 <1> ;***************************************************************************** 8 <1> ; Publics 9 <1> ;***************************************************************************** 10 <1> ; 11 <1> 12 <1> Public Drive_Letter_Buffer 13 <1> Public Switch_Buffer 14 <1> Public Switch_Num_Buffer 15 <1> Public Switch_String_Buffer 16 <1> 17 <1> 18 <1> ; 19 <1> ;*************************************************************************** 20 <1> ; Equates 21 <1> ;*************************************************************************** 22 <1> ; 23 <1> 24 <1> ;Match Flags 25 <1> 26 <1> Numeric_Value equ 8000h ; ;AN000; 27 <1> Signed_Numeric_Value equ 4000h ; ;AN000; 28 <1> Simple_String equ 2000h ; ;AN000; 29 <1> Date_String equ 1000h ; ;AN000; 30 <1> Time_String equ 0800h ; ;AN000; 31 <1> Complex_List equ 0400h ; ;AN000; 32 <1> Filespec equ 0200h ; ;AN000; 33 <1> Drive_Only equ 0100h ; ;AN000; 34 <1> Quoted_String equ 0080h ; ;AN000; 35 <1> Ignore_Colon equ 0010h ; ;AN000; 36 <1> Repeats_Allowed equ 0002h ; ;AN000; 37 <1> Optional equ 0001h ; ;AN000; 38 <1> 39 <1> ;Function_Flags 40 <1> 41 <1> File_Table_Capitalize equ 1 ; ;AN000; 42 <1> Char_Table_Capitalize equ 2 ; ;AN000; 43 <1> Remove_Colon equ 10h ; ;AN000; 44 <1> 45 <1> ;Extra delimeters and EOL 46 <1> 47 <1> Delimiters_Only equ 1 ; ;AN000; 48 <1> EOL_Or_Delimiters equ 2 ; ;AN000; 49 <1> 50 <1> Semi_Colon equ ";" ; ;AN000; 51 <1> Tab equ 09h ; ;AN000; 52 <1> Colon equ ":" ; ;AN000; 53 <1> 54 <1> 55 <1> ;Parse Errors 56 <1> 57 <1> No_Error equ 0 ; ;AN000; 58 <1> Too_Many_Operands equ 1 ; ;AN000; 59 <1> Operand_Missing equ 2 ; ;AN000; 60 <1> Not_In_Switch_List equ 3 ; ;AN000; 61 <1> Not_In_Keyword_List equ 4 ; ;AN000; 62 <1> Out_Of_Range equ 6 ; ;AN000; 63 <1> Not_In_Value_List equ 7 ; ;AN000; 64 <1> Not_In_String_List equ 8 ; ;AN000; 65 <1> Syntax_Error equ 9 ; ;AN000; 66 <1> End_Of_Parse equ -1 ; ;AN000; 67 <1> 68 <1> ;Return types 69 <1> 70 <1> Type_Reserved equ 0 ; ;AN000; 71 <1> Type_Number equ 1 ; ;AN000; 72 <1> Type_List_Index equ 2 ; ;AN000; 73 <1> Type_String equ 3 ; ;AN000; 74 <1> Type_Complex equ 4 ; ;AN000; 75 <1> Type_Filespec equ 5 ; ;AN000; 76 <1> Type_Drive equ 6 ; ;AN000; 77 <1> Type_Date equ 7 ; ;AN000; 78 <1> Type_Time equ 8 ; ;AN000; 79 <1> Type_Quoted_String equ 9 ; ;AN000; 80 <1> 81 <1> ;Other 82 <1> 83 <1> None equ 0 ; ;AN000; 84 <1> No_Error equ 0 ; ;AN000; 85 <1> Switch_Found equ 0FFFFh ; ;AN000; 86 <1> Range_Ok equ 1 ; ;AN000; 87 <1> Command_Line_Parms equ 81h ; ;AN000; 88 <1> 89 <1> ; 90 <1> ;***************************************************************************** 91 <1> ; Parse Structures 92 <1> ;***************************************************************************** 93 <1> ; 94 <1> 95 <1> Control struc 96 <1> 0 00000470 ???? Match_Flags dw ? 0 00000472 ???? Function_Flags dw ? 0 00000474 ???? Result dw ? 0 00000476 ???? Values dw ? 0 00000478 ?? Num_Keywords db ? 0 00000479 ?? Keyword db ? 103 <1> 104 <1> Control ends 105 <1> 106 <1> Drive_Letter_Return struc ; ;AN000; 107 <1> 0 00000470 ?? Drive_Type db ? ; ;AN000; 0 00000471 ?? Drive_Item_Tag db ? ; ;AN000; 0 00000472 ???? Drive_Pointer dw ? ; ;AN000; 0 00000474 ?? Drive_Number db ? ;A=1, B=2, C=3 ;AN000; 0 00000475 ???????????????? Drive_debug db 8 dup(?) 113 <1> 114 <1> Drive_Letter_Return ends ; ;AN000; 115 <1> 116 <1> Switch_Return struc ; ;AN000; 117 <1> 0 00000470 ?? Switch_Type db ? ; ;AN000; 0 00000471 ?? Switch_Item_Tag db ? ; ;AN000; 0 00000472 ???? Switch_Pointer dw ? ; ;AN000; 0 00000474 ???????? Switch_Debug db 4 dup(?) 122 <1> 123 <1> Switch_Return ends ; ;AN000; 124 <1> 125 <1> Switch_Num_Return struc ; ;AN000; 126 <1> 0 00000470 ?? Switch_Num_Type db ? ; ;AN000; 0 00000471 ?? Switch_Num_Item_Tag db ? ; ;AN000; 0 00000472 ???? Switch_Num_Pointer dw ? ; ;AN000; 0 00000474 ???? Switch_Number_Low dw ? ; ;AN000; 0 00000476 ???? Switch_Number_High dw ? ; ;AN000; 132 <1> 133 <1> Switch_Num_Return ends ; ;AN000; 134 <1> 135 <1> Switch_String_Return struc ; ;AN000; 136 <1> 0 00000470 ?? Switch_String_Type db ? ; ;AN000; 0 00000471 ?? Switch_String_Item_Tag db ? ; ;AN000; 0 00000472 ???? Switch_String_Pointer dw ? ; ;AN000; 0 00000474 ???? Switch_String_Off dw ? ; ;AN000; 0 00000476 ???? Switch_String_Seg dw ? ; ;AN000; 142 <1> 143 <1> Switch_String_Return ends ; ;AN000; 144 <1> 145 <1> 146 <1> ; 147 <1> ;************************************************************************** 148 <1> ; Parse tables 149 <1> ;************************************************************************** 150 <1> ; 151 <1> 152 <1> %IF FSExec ;conditionally assemble /FS: ;an018; dms; 153 <1> 154 <1> Switch_FS_Table label byte ; ;AN000; 155 <1> 156 <1> dw Drive_Control_Definition ;Point to next level ;AN000; 157 <1> db 0 ; ;AN000; 158 <1> 159 <1> %ENDIF ;end conditional assembly /FS: ;an018; dms; 160 <1> 161 <1> Command_Line_Table label byte ; ;AN000; 162 <1> 0 0000058D [2001] dw Command_Control ;Point to next level ;AN000; 0 0000058F 00 db 0 ; ;AN000; 165 <1> 166 <1> ; 167 <1> ;************************************************************************** 168 <1> ;Define Positionals, Switches and Keywords 169 <1> ;************************************************************************** 170 <1> ; 171 <1> 172 <1> 173 <1> %IF FSExec ;conditionally assemble /FS: ;an018; dms; 174 <1> 175 <1> Drive_Control_Definition label byte ; ;AN000; 176 <1> 177 <1> db 1,1 ;Only drive letter posistional ;AN000; 178 <1> dw Positional_Control ;Pointer to control table ;AN000; 179 <1> db 1 ;1 switch ;AN000; 180 <1> dw Switch_FS_Control ; ;AN000; 181 <1> db None ;No Keywords (maxk) ;AN000; 182 <1> 183 <1> %ENDIF ;end conditional assembly /FS: ;an018; dms; 184 <1> 185 <1> Command_Control label byte ; ;AN000; 186 <1> 0 00000590 0101 db 1,1 ;Only drive letter posistional ;AN000; 0 00000592 [3E01] dw Positional_Control ;Pointer to control table ;AN000; 189 <1> %IF ShipDisk 190 <1> db 13 ;if /Z switch needed ;an000; dms; 191 <1> %ELSE 0 00000594 0C db 12 ; ;AC001; 193 <1> %ENDIF 0 00000595 [4701] dw Switch_V_Control ;Without quotes AN000; 0 00000597 [5301] dw Switch_S_Control ; ;AN000; 0 00000599 [5F01] dw Switch_4_Control ; ;AN000; 0 0000059B [6B01] dw Switch_1_Control ; ;AN000; 0 0000059D [7701] dw Switch_8_Control ; ;AN000; 0 0000059F [8301] dw Switch_B_Control ; ;AN000; 0 000005A1 [8F01] dw Switch_T_Control ; ;AN000; 0 000005A3 [9B01] dw Switch_N_Control ; ;AN000; 0 000005A5 [A701] dw Switch_Select_Control ; ;AN000; 0 000005A7 [B801] dw Switch_Backup_Control ; ;AN000; 0 000005A9 [C901] dw Switch_Autotest_Control ; ;AN000; 0 000005AB [DC01] dw Switch_F_Control ; ;AC001; 206 <1> %IF ShipDisk 207 <1> dw Switch_Z_Control ;1 sector/cluster switch ;an000; dms; 208 <1> %ENDIF 0 000005AD 00 db None ;No Keywords (maxk) ;AN000; 210 <1> 211 <1> ; 212 <1> ;************************************************************************** 213 <1> ;Control Tables 214 <1> ;************************************************************************** 215 <1> ; 216 <1> 217 <1> Positional_Control label byte ; ;AN000; 218 <1> 0 000005AE 0001 dw Drive_Only ;Match_Flag ;AN000; 0 000005B0 0000 dw None ;No function flags ;AN000; 0 000005B2 [E402] dw Drive_Letter_Buffer ;Where it will be returned ;AN000; 0 000005B4 [5302] dw No_Value ;No value ranges defined ;AN000; 0 000005B6 00 db None ;No defined switches/keywords ;AN000; 224 <1> 225 <1> %IF FSExec ;conditionally assemble /FS: ;an018; dms; 226 <1> 227 <1> Switch_FS_Control label byte 228 <1> dw Simple_String ;/FS:xxxxx ;AN000; 229 <1> dw File_Table_Capitalize ;Make it uppercase ;AN000; 230 <1> dw Switch_String_Buffer ; ;AN000; 231 <1> dw No_Value ; ;AN000; 232 <1> db 1 ; ;AN000; 233 <1> db "/FS",0 ; ;AN000; 234 <1> 235 <1> %ENDIF ;end conditional assembly /FS: ;an018; dms; 236 <1> 237 <1> Switch_V_Control label byte ; ;AN000; 238 <1> 0 000005B7 8120 dw Simple_String+Quoted_String+Optional ;/v:xxxxxxxx ;AN000; 0 000005B9 0100 dw File_Table_Capitalize ; ;AN000; 0 000005BB [0103] dw Switch_String_Buffer ; ;AN000; 0 000005BD [5302] dw No_Value ; ;AN000; 0 000005BF 01 db 1 ; ;AN000; 0 000005C0 2F5600 db "/V",0 ; ;AN000; 245 <1> 246 <1> Switch_S_Control label byte ; ;AN000; 247 <1> 0 000005C3 0000 dw None ; ;AN000; 0 000005C5 0000 dw None ; ;AN000; 0 000005C7 [F102] dw Switch_Buffer ; ;AN000; 0 000005C9 [5302] dw No_Value ; ;AN000; 0 000005CB 01 db 1 ; ;AN000; 0 000005CC 2F5300 db "/S",0 ; ;AN000; 254 <1> 255 <1> Switch_4_Control label byte ; ;AN000; 256 <1> 0 000005CF 0000 dw None ; ;AN000; 0 000005D1 0000 dw None ; ;AN000; 0 000005D3 [F102] dw Switch_Buffer ; ;AN000; 0 000005D5 [5302] dw No_Value ; ;AN000; 0 000005D7 01 db 1 ; ;AN000; 0 000005D8 2F3400 db "/4",0 ; ;AN000; 263 <1> 264 <1> Switch_1_Control label byte ; ;AN000; 265 <1> 0 000005DB 0000 dw None ; ;AN000; 0 000005DD 0000 dw None ; ;AN000; 0 000005DF [F102] dw Switch_Buffer ; ;AN000; 0 000005E1 [5302] dw No_Value ; ;AN000; 0 000005E3 01 db 1 ; ;AN000; 0 000005E4 2F3100 db "/1",0 ; ;AN000; 272 <1> 273 <1> Switch_8_Control label byte ; ;AN000; 274 <1> 0 000005E7 0000 dw None ; ;AN000; 0 000005E9 0000 dw None ; ;AN000; 0 000005EB [F102] dw Switch_Buffer ; ;AN000; 0 000005ED [5302] dw No_Value ; ;AN000; 0 000005EF 01 db 1 ; ;AN000; 0 000005F0 2F3800 db "/8",0 ; ;AN000; 281 <1> 282 <1> Switch_B_Control label byte ; ;AN000; 283 <1> 0 000005F3 0000 dw None ; ;AN000; 0 000005F5 0000 dw None ; ;AN000; 0 000005F7 [F102] dw Switch_Buffer ; ;AN000; 0 000005F9 [5302] dw No_Value ; ;AN000; 0 000005FB 01 db 1 ; ;AN000; 0 000005FC 2F4200 db "/B",0 ; ;AN000; 290 <1> 291 <1> Switch_T_Control label byte ; ;AN000; 292 <1> 0 000005FF 0080 dw Numeric_Value ; ;AN000; 0 00000601 0000 dw None ; ;AN000; 0 00000603 [F902] dw Switch_Num_Buffer ; ;AN000; 0 00000605 [E801] dw Switch_T_Value ; ;AN000; 0 00000607 01 db 1 ; ;AN000; 0 00000608 2F5400 db "/T",0 ; ;AN000; 299 <1> 300 <1> Switch_N_Control label byte ; ;AN000; 301 <1> 0 0000060B 0080 dw Numeric_Value ; ;AN000; 0 0000060D 0000 dw None ; ;AN000; 0 0000060F [F902] dw Switch_Num_Buffer ; ;AN000; 0 00000611 [F301] dw Switch_N_Value ; ;AN000; 0 00000613 01 db 1 ; ;AN000; 0 00000614 2F4E00 db "/N",0 ; ;AN000; 308 <1> 309 <1> Switch_Select_Control label byte ; ;AN000; 310 <1> 0 00000617 0000 dw None ; ;AN000; 0 00000619 0000 dw None ; ;AN000; 0 0000061B [F102] dw Switch_Buffer ; ;AN000; 0 0000061D [5302] dw No_Value ; ;AN000; 0 0000061F 01 db 1 ; ;AN000; 0 00000620 2F53454C45435400 db "/SELECT",0 ; ;AN000; 317 <1> 318 <1> Switch_Backup_Control label byte ; ;AN000; 319 <1> 0 00000628 0000 dw None ; ;AN000; 0 0000062A 0000 dw None ; ;AN000; 0 0000062C [F102] dw Switch_Buffer ; ;AN000; 0 0000062E [5302] dw No_Value ; ;AN000; 0 00000630 01 db 1 ; ;AN000; 0 00000631 2F4241434B555000 db "/BACKUP",0 ; ;AN000; 326 <1> 327 <1> Switch_Autotest_Control label byte ; ;AN000; 328 <1> 0 00000639 0000 dw None ; ;AN000; 0 0000063B 0000 dw None ; ;AN000; 0 0000063D [F102] dw Switch_Buffer ; ;AN000; 0 0000063F [5302] dw No_Value ; ;AN000; 0 00000641 01 db 1 ; ;AN000; 0 00000642 2F4155544F54455354 db "/AUTOTEST",0 ; ;AN000; 0 0000064B 00 335 <1> 336 <1> Switch_F_Control label byte ; ;AN001; 0 0000064C 0020 dw Simple_String ;/F:xxxxx ;AN001; 0 0000064E 0100 dw File_Table_Capitalize ;Make it uppercase ;AN001; 0 00000650 [0103] dw Switch_String_Buffer ; ;AN001; 0 00000652 [FE01] dw Switch_Size_Value ; ;AN001; 0 00000654 01 db 1 ; ;AN001; 0 00000655 2F4600 db "/F",0 ; ;AN001; 343 <1> 344 <1> %IF ShipDisk 345 <1> 346 <1> Switch_Z_Control label byte ;control structure for /Z ;an000; dms; 347 <1> dw None ; ;an000; dms; 348 <1> dw None ; ;an000; dms; 349 <1> dw Switch_Buffer ; ;an000; dms; 350 <1> dw No_Value ; ;an000; dms; 351 <1> db 1 ; ;an000; dms; 352 <1> db "/Z",0 ; ;an000; dms; 353 <1> 354 <1> %ENDIF 355 <1> 356 <1> ; 357 <1> ;************************************************************************ 358 <1> ; PARSE Value Lists 359 <1> ;************************************************************************ 360 <1> ; 361 <1> 362 <1> Switch_T_Value label byte ; ;AN000; 363 <1> 0 00000658 01 db 1 ;Range only ;ANOOO; 0 00000659 01 db 1 ;1 range ;ANOOO; 366 <1> Range_OK equ Range_Ok ; NASM port equate 0 0000065A 01 db Range_OK ;Item_Tag ;ANOOO; 0 0000065B 01000000 dd 1 ;1 is low bound ;ANOOO; 0 0000065F 00040000 dd 1024 ;2**10 is max ;AN000; 370 <1> 371 <1> Switch_N_Value label byte ; ;AN000; 372 <1> 0 00000663 01 db 1 ;Range only ;ANOOO; 0 00000664 01 db 1 ;1 range ;ANOOO; 0 00000665 01 db Range_OK ;Item_Tag ;ANOOO; 0 00000666 01000000 dd 1 ;1 is low bound ;ANOOO; 0 0000066A 40000000 dd 64 ;2**6 is max ;AN000; 378 <1> 379 <1> Switch_Size_Value label byte ; ;AN001; 380 <1> 0 0000066E 03 db 3 ;Look for strings ;AN001; 0 0000066F 00 db 0 ;No ranges ;AN001; 0 00000670 00 db 0 ;No numerics ;AN001; 0 00000671 1B db 27 ;16 possible strings ;AN001; 0 00000672 01 db Size_160 ; ;AN001; 0 00000673 [5402] dw String_160k_1 ;/F:160 ;AN001; 0 00000675 01 db Size_160 ; ;AN001; 0 00000676 [5802] dw String_160k_2 ;/F:160K ;AN001; 0 00000678 01 db Size_160 ; ;AN001; 0 00000679 [5D02] dw String_160k_3 ;/F:160KB ;AN001; 0 0000067B 02 db Size_180 ; ;AN001; 0 0000067C [6302] dw String_180k_1 ;/F:180 ;AN001; 0 0000067E 02 db Size_180 ; ;AN001; 0 0000067F [6702] dw String_180k_2 ;/F:180K ;AN001; 0 00000681 02 db Size_180 ; ;AN001; 0 00000682 [6C02] dw String_180k_3 ;/F:180KB ;AN001; 0 00000684 04 db Size_320 ; ;AN001; 0 00000685 [7202] dw String_320k_1 ;/F:320 ;AN001; 0 00000687 04 db Size_320 ; ;AN001; 0 00000688 [7602] dw String_320k_2 ;/F:320K ;AN001; 0 0000068A 04 db Size_320 ; ;AN001; 0 0000068B [7B02] dw String_320k_3 ;/F:320KB ;AN001; 0 0000068D 08 db Size_360 ; ;AN001; 0 0000068E [8102] dw String_360k_1 ;/F:360 ;AN001; 0 00000690 08 db Size_360 ; ;AN001; 0 00000691 [8502] dw String_360k_2 ;/F:360K ;AN001; 0 00000693 08 db Size_360 ; ;AN001; 0 00000694 [8A02] dw String_360k_3 ;/F:360KB ;AN001; 0 00000696 10 db Size_720 ; ;AN001; 0 00000697 [9002] dw String_720k_1 ;/F:720 ;AN001; 0 00000699 10 db Size_720 ; ;AN001; 0 0000069A [9402] dw String_720k_2 ;/F:720K ;AN001; 0 0000069C 10 db Size_720 ; ;AN001; 0 0000069D [9902] dw String_720k_3 ;/F:720KB ;AN001; 0 0000069F 20 db Size_1200 ; ;AN001; 0 000006A0 [9F02] dw String_1200k_1 ;/F:1200 ;AN001; 0 000006A2 20 db Size_1200 ; ;AN001; 0 000006A3 [A402] dw String_1200k_2 ;/F:1200K ;AN001; 0 000006A5 20 db Size_1200 ; ;AN001; 0 000006A6 [AA02] dw String_1200k_3 ;/F:1200KB ;AN001; 0 000006A8 20 db Size_1200 ; ;AN001; 0 000006A9 [B102] dw String_1200k_4 ;/F:1.2 ;AN001; 0 000006AB 20 db Size_1200 ; ;AN001; 0 000006AC [B502] dw String_1200k_5 ;/F:1.2M ;AN001; 0 000006AE 20 db Size_1200 ; ;AN001; 0 000006AF [BA02] dw String_1200k_6 ;/F:1.2MB ;AN001; 0 000006B1 40 db Size_1440 ; ;AN001; 0 000006B2 [C002] dw String_1440k_1 ;/F:1440 ;AN001; 0 000006B4 40 db Size_1440 ; ;AN001; 0 000006B5 [C502] dw String_1440k_2 ;/F:1440K ;AN001; 0 000006B7 40 db Size_1440 ; ;AN001; 0 000006B8 [CB02] dw String_1440k_3 ;/F:1440KB ;AN001; 0 000006BA 40 db Size_1440 ; ;AN001; 0 000006BB [D202] dw String_1440k_4 ;/F:1.44 ;AN001; 0 000006BD 40 db Size_1440 ; ;AN001; 0 000006BE [D702] dw String_1440k_5 ;/F:1.44M ;AN001; 0 000006C0 40 db Size_1440 ; ;AN001; 0 000006C1 [DD02] dw String_1440k_6 ;/F:1.44MB ;AN001; 439 <1> 440 <1> 441 <1> No_Value label byte ; ;AN000; 0 000006C3 00 db 0 ; ;AN000; 443 <1> 444 <1> ; 445 <1> ;***************************************************************************** 446 <1> ; Data Area for value lists 447 <1> ;***************************************************************************** 448 <1> ; 449 <1> 450 <1> ; 451 <1> ;The following are a list of the allowed strings for the /F:xxxxx switch. 452 <1> ; 453 <1> 0 000006C4 31363000 String_160k_1 db "160" ,Asciiz_End ; ;AN001; 0 000006C8 3136304B00 String_160k_2 db "160K" ,Asciiz_End ; ;AN001; 0 000006CD 3136304B4200 String_160k_3 db "160KB" ,Asciiz_End ; ;AN001; 0 000006D3 31383000 String_180k_1 db "180" ,Asciiz_End ; ;AN001; 0 000006D7 3138304B00 String_180k_2 db "180K" ,Asciiz_End ; ;AN001; 0 000006DC 3138304B4200 String_180k_3 db "180KB" ,Asciiz_End ; ;AN001; 0 000006E2 33323000 String_320k_1 db "320" ,Asciiz_End ; ;AN001; 0 000006E6 3332304B00 String_320k_2 db "320K" ,Asciiz_End ; ;AN001; 0 000006EB 3332304B4200 String_320k_3 db "320KB" ,Asciiz_End ; ;AN001; 0 000006F1 33363000 String_360k_1 db "360" ,Asciiz_End ; ;AN001; 0 000006F5 3336304B00 String_360k_2 db "360K" ,Asciiz_End ; ;AN001; 0 000006FA 3336304B4200 String_360k_3 db "360KB" ,Asciiz_End ; ;AN001; 0 00000700 37323000 String_720k_1 db "720" ,Asciiz_End ; ;AN001; 0 00000704 3732304B00 String_720k_2 db "720K" ,Asciiz_End ; ;AN001; 0 00000709 3732304B4200 String_720k_3 db "720KB" ,Asciiz_End ; ;AN001; 0 0000070F 3132303000 String_1200k_1 db "1200" ,Asciiz_End ; ;AN001; 0 00000714 313230304B00 String_1200k_2 db "1200K",Asciiz_End ; ;AN001; 0 0000071A 313230304B4200 String_1200k_3 db "1200KB",Asciiz_End ; ;AN001; 0 00000721 312E3200 String_1200k_4 db "1.2" ,Asciiz_End ; ;AN001; 0 00000725 312E324D00 String_1200k_5 db "1.2M" ,Asciiz_End ; ;AN001; 0 0000072A 312E324D4200 String_1200k_6 db "1.2MB" ,Asciiz_End ; ;AN001; 0 00000730 3134343000 String_1440k_1 db "1440" ,Asciiz_End ; ;AN001; 0 00000735 313434304B00 String_1440k_2 db "1440K",Asciiz_End ; ;AN001; 0 0000073B 313434304B4200 String_1440k_3 db "1440KB",Asciiz_End ; ;AN001; 0 00000742 312E343400 String_1440k_4 db "1.44",Asciiz_End ; ;AN001; 0 00000747 312E34344D00 String_1440k_5 db "1.44M",Asciiz_End ; ;AN001; 0 0000074D 312E34344D4200 String_1440k_6 db "1.44MB",Asciiz_End ; ;AN001; 481 <1> 482 <1> ; 483 <1> ;************************************************************************ 484 <1> ; PARSE Return Buffers 485 <1> ;************************************************************************ 486 <1> ; 487 <1> 488 <1> Drive_Letter_Buffer: ; NASM structure instance 489 <1> Drive_Letter_Return_size equ Drive_Letter_Return_struc_size ; NASM port equate 490 <1> istruc Drive_Letter_Return 0 00000754 ?? iend 492 <1> Switch_Buffer: ; NASM structure instance 493 <1> Switch_Return_size equ Switch_Return_struc_size ; NASM port equate 494 <1> istruc Switch_Return 0 00000761 ?? iend 496 <1> Switch_Num_Buffer: ; NASM structure instance 497 <1> Switch_Num_Return_size equ Switch_Num_Return_struc_size ; NASM port equate 498 <1> istruc Switch_Num_Return 0 00000769 ?? iend 500 <1> Switch_String_Buffer: ; NASM structure instance 501 <1> Switch_String_Return_size equ Switch_String_Return_struc_size ; NASM port equate 502 <1> istruc Switch_String_Return 0 00000771 ?? iend 504 <1> 505 <1> ; (no prior section) ; data ends 506 <1> 507 <1> ; 508 <1> ;***************************************************************************** 509 <1> ; SysParse Routines 510 <1> ;***************************************************************************** 511 <1> ; 512 <1> 513 <1> === Switch to base=001900h -> "CODE" 514 <1> section code 515 <1> assume cs:code,ds:Data 516 <1> 517 <1> %ixdefine FarSW Not_Include ;AN000; 518 <1> %ixdefine DateSW Not_Include ; ;AN000; 519 <1> %ixdefine TimeSW Not_Include ; ;AN000; 520 <1> %ixdefine FileSW Do_Include ; ;AN000; 521 <1> %ixdefine CAPSW Do_Include ; ;AN000; 522 <1> %ixdefine CmpxSW Not_Include ; ;AN000; 523 <1> %ixdefine NumSW Do_Include ; ;AN000; 524 <1> %ixdefine KeySW Not_Include ; ;AN000; 525 <1> %ixdefine SwSW Do_Include ; ;AN000; 526 <1> DO_Include equ Do_Include ; NASM port equate 527 <1> %ixdefine Val1SW DO_Include ; ;AN000; 528 <1> %ixdefine Val2SW Not_Include ; ;AN000; 529 <1> %ixdefine Val3SW Do_Include ; ;AN001; 530 <1> %ixdefine DrvSW Do_Include ; ;AN000; 531 <1> %ixdefine QusSW Do_Include ; ;AN000; 532 <1> 533 <1> ;=== Push trace listing source: parse.nas 534 <1> %include "parse.nas" ; ;AN000; ; NASM included file 1 <2> ; PAGE ;AN000; 2 <2> ; $SALUT (4,4,8,41) 3 <2> ;(deleted).XLIST 4 <2> ;(deleted)INCLUDE STRUC.INC ;AN020;structured macro definitions for .IF,.ELSE etc. 5 <2> ;(deleted).LIST 6 <2> ; 7 <2> ; NOTE: basesw must be set properly to allow the PARSER to access psdata. 8 <2> ; - basesw undefined means CS seg. override for psdata access. 9 <2> ; - basesw = 1 means DS seg. override for psdata access & 10 <2> ; DS must point to psdata. 11 <2> ; - basesw = 0 means ES seg. override for psdata access & 12 <2> ; ES must point to psdata. 13 <2> ; 14 <2> ; 15 <2> %IFNDEF basesw ;AN022; 16 <2> %idefine psdata_seg CS ;AN022; 17 <2> %ELSE ;AN022; 18 <2> %IF basesw ;AN022;IF "basesw EQU 1" specified by caller THEN 19 <2> %idefine psdata_seg DS ;AN022; 20 <2> %ELSE ;AN022; 21 <2> %idefine psdata_seg ES ;AN022;ELSE only other choice is ES (basesw EQU 0) 22 <2> %ENDIF ;AN022; 23 <2> %ENDIF ;AN022; 24 <2> 25 <2> %ifndef incsw ;AN000; (tm03) Someone doesn't want to include psdata 26 <2> %iassign incsw 1 ;AN000; include psdata.inc (tm03) 27 <2> %endif ;AN000; (tm03) 28 <2> %if incsw ;AN000; If incsw = 1 then (tm03) 29 <2> %include "psdata.mac" ;AN000; include psdata.inc (tm03) 1 <3> ;******************************************************************* 2 <3> ; Parser include file 3 <3> ;******************************************************************* 4 <3> %warning out: INCLUDING COMP=COMMON DSN=PSDATA.INC...;AN000; 4 ****************** <3> warning: out: INCLUDING COMP=COMMON DSN=PSDATA.INC... [-w+user] 5 <3> ; 6 <3> ;**** Default assemble switches definition ************************* 7 <3> 8 <3> %ifndef FarSW ;AN000; 9 <3> %iassign FarSW 0 ;AN000; Near call expected 10 <3> %endif ;AN000; 11 <3> 12 <3> %ifndef DateSW ;AN000; 13 <3> %iassign DateSW 1 ;AN000; Check date format 14 <3> %endif ;AN000; 15 <3> 16 <3> %ifndef TimeSW ;AN000; 17 <3> %iassign TimeSW 1 ;AN000; Check time format 18 <3> %endif ;AN000; 19 <3> 20 <3> %ifndef FileSW ;AN000; 21 <3> %iassign FileSW 1 ;AN000; Check file specification 22 <3> %endif ;AN000; 23 <3> 24 <3> %ifndef CAPSW ;AN000; 25 <3> %iassign CAPSW 1 ;AN000; Perform CAPS if specified 26 <3> %endif ;AN000; 27 <3> 28 <3> %ifndef CmpxSW ;AN000; 29 <3> %iassign CmpxSW 1 ;AN000; Check complex list 30 <3> %endif ;AN000; 31 <3> 32 <3> %ifndef NumSW ;AN000; 33 <3> %iassign NumSW 1 ;AN000; Check numeric value 34 <3> %endif ;AN000; 35 <3> 36 <3> %ifndef KeySW ;AN000; 37 <3> %iassign KeySW 1 ;AN000; Support keywords 38 <3> %endif ;AN000; 39 <3> 40 <3> %ifndef SwSW ;AN000; 41 <3> %iassign SwSW 1 ;AN000; Support switches 42 <3> %endif ;AN000; 43 <3> 44 <3> %ifndef Val1SW ;AN000; 45 <3> %iassign Val1SW 1 ;AN000; Support value definition 1 46 <3> %endif ;AN000; 47 <3> 48 <3> %ifndef Val2SW ;AN000; 49 <3> %iassign Val2SW 1 ;AN000; Support value definition 2 50 <3> %endif ;AN000; 51 <3> 52 <3> %ifndef Val3SW ;AN000; 53 <3> %iassign Val3SW 1 ;AN000; Support value definition 3 54 <3> %endif ;AN000; 55 <3> 56 <3> %ifndef DrvSW ;AN000; 57 <3> %iassign DrvSW 1 ;AN000; Support drive only format 58 <3> %endif ;AN000; 59 <3> 60 <3> %ifndef QusSW ;AN000; 61 <3> %iassign QusSW 1 ;AN000; Support quoted string format 62 <3> %endif ;AN000; 63 <3> 64 <3> %ifndef LFEOLSW ;AN028; 65 <3> %iassign LFEOLSW 1 ;AN028; Accept Line feed (0AH) as end of line 66 <3> %endif ;AN028; 67 <3> 68 <3> ;**** Equation field 69 <3> ;-------- Character code definition 70 <3> 71 <3> D_P_DBSP1 equ 81h ;AN000; 1st byte of DBCS blank 72 <3> D_P_DBSP2 equ 40h ;AN000; 2nd byte of DBCS blank 73 <3> D_P_Period equ "." ;AN020; 74 <3> D_P_Slash equ "/" ;AN020; 75 <3> D_P_Space equ " " ;AN000; SBCS blank 76 <3> D_P_Comma equ "," ;AN000; 77 <3> D_P_Switch equ "/" ;AN000; 78 <3> D_P_Keyword equ "=" ;AN000; 79 <3> D_P_Colon equ ":" ;AN000; 80 <3> D_P_Plus equ "+" ;AN000; 81 <3> D_P_Minus equ "-" ;AN000; 82 <3> D_P_Rparen equ ")" ;AN000; 83 <3> D_P_Lparen equ "(" ;AN000; 84 <3> ;(deleted ;AN025;) D_P_SQuote equ "'" 85 <3> D_P_DQuote equ '"' ;AN000; 86 <3> D_P_NULL equ 0 ;AN000; 87 <3> D_P_TAB equ 9 ;AN000; 88 <3> D_P_CR equ 0Dh ;AN000; 89 <3> D_P_LF equ 0Ah ;AN000; 90 <3> D_P_ASCII80 equ 80h ;AN000; ASCII 80h character code 91 <3> 92 <3> ;-------- Masks 93 <3> D_P_Make_Lower equ 20h ;AN000; make lower case character 94 <3> D_P_Make_Upper equ 0ffh-D_P_Make_Lower ;AN000; make upper case character 95 <3> 96 <3> ; PAGE ;AN000; 97 <3> ;-------- DOS function call related equs 98 <3> 99 <3> D_P_DOS_Get_CDI equ 3800h ;AN000; get country dependent information 100 <3> ; by this call, following information 101 <3> D_P_CDI struc ;AN000; is returned. 0 00001090 ???? D_P_CDI_DateF dw ? ;0 ;AN000; 0 00001092 ?????????? D_P_CDI_Money db ?,?,?,?,? ;0,0,0,0,0 ;AN000; 0 00001097 ???? D_P_CDI_1000 db ?,? ;0,0 ;AN000; 0 00001099 ???? D_P_CDI_Dec db ?,? ;0,0 ;AN000; 0 0000109B ???? D_P_CDI_DateS db ?,? ;0,0 ;AN000; 0 0000109D ???? D_P_CDI_TimeS db ?,? ;0,0 ;AN000; 0 0000109F ?? db ? ;0 ;AN000; 0 000010A0 ?? db ? ;0 ;AN000; 0 000010A1 ?? D_P_CDI_TimeF db ? ;0 ;AN000; 0 000010A2 ???????? dw ?,? ;0,0 ;AN000; 0 000010A6 ???? db ?,? ;0,0 ;AN000; 113 00000018 <3> dw 5 dup (?) ;(0) ;AN000; 114 <3> D_P_CDI ends ;AN000; 115 <3> 116 <3> D_P_Date_MDY equ 0 ;AN000; 117 <3> D_P_Date_DMY equ 1 ;AN000; 118 <3> D_P_Date_YMD equ 2 ;AN000; 119 <3> ;------------- 120 <3> D_P_DOS_GetEV equ 6300h ;AN000; get DBCS EV call 121 <3> ;AN000; DS:SI will points to DBCS EV 122 <3> ;------------- 123 <3> D_P_DOS_Get_TBL equ 65h ;AN000; get uppercase table call 124 <3> ;AN000; following parameters are set 125 <3> ;AN000; to get casemap table. 126 <3> D_P_DOSTBL_Def equ -1 ;AN000; get default 127 <3> D_P_DOSTBL_BL equ 5 ;AN000; buffer length for Tbl pointer 128 <3> D_P_DOSTBL_File equ 4 ;AN000; get file uppercase table 129 <3> D_P_DOSTBL_Char equ 2 ;AN000; get character uppercase table 130 <3> ; By this call following information 131 <3> ; is returned. 132 <3> D_P_DOS_TBL struc ;AN000; 0 00001090 ?? D_P_DOS_InfoID db ? ;0 ;AN000; information id for the table 0 00001091 ???? D_P_DOS_TBL_Off dw ? ;0 ;AN000; offset address of the table 0 00001093 ???? D_P_DOS_TBL_Seg dw ? ;0 ;AN000; segment address of the table 136 <3> D_P_DOS_TBL ends ;AN000; 137 <3> ; PAGE ;AN000; 138 <3> ;--------------------------------------------------------------------------------------------------------- 139 <3> ; PARMS LABEL BYTE 140 <3> ; DW PARMSX 141 <3> ; DB 2 ; NUMBER OF STRINGS (0, 1, 2) 142 <3> ; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE 143 <3> ; DB " .. " ; EXTRA DELIMITER LIST, 144 <3> ; ; TYPICAL ARE ";", "=" 145 <3> ; ; "," & WHITESPACE ALWAYS 146 <3> ; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE 147 <3> ; DB " .. " ; EXTRA END OF LINE LIST, CR, LF OR 0 ALWAYS 148 <3> ;--------------------------------------------------------------------------------------------------------- 149 <3> 150 <3> ;-------------------------------- PARMS block structure 151 <3> D_P_PARMS_Blk struc ;AN000; 0 00001090 ???? D_P_PARMSX_Address dw ? ;0 ;AN000; Address of PARMSX 0 00001092 ?? D_P_Num_Extra db ? ;0 ;AN000; Number of extra stuff 0 00001093 ?? D_P_Len_Extra_Delim db ? ;0 ;AN000; Length of extra delimiter 155 <3> D_P_PARMS_Blk ends ;AN000; 156 <3> 157 <3> D_P_Len_PARMS equ 4 ;AN000; 158 <3> D_P_I_Use_Default equ 0 ;AN000; no extra stuff specified 159 <3> D_P_I_Have_Delim equ 1 ;AN000; extra delimiter specified 160 <3> D_P_I_Have_EOL equ 2 ;AN000; extra EOL specified 161 <3> 162 <3> ;--------------------------------------------------------------------------------------------------------- 163 <3> ; PARMSX LABEL BYTE 164 <3> ; DB minp,maxp ; MIN, MAX POSITIONAL OPERANDS ALLOWED 165 <3> ; DW CONTROL ; DESCRIPTION OF POSITIONAL 1 166 <3> ; : ; REPEATS maxp-1 TIMES 167 <3> ; DB maxs ; # OF SWITCHES 168 <3> ; DW CONTROL ; DESCRIPTION OF SWITCH 1 169 <3> ; : ; REPEATS maxs-1 TIMES 170 <3> ; DB maxk ; # OF KEYWORD 171 <3> ; DW CONTROL ; DESCRIPTION OF KEYWORD 1 172 <3> ; : ; REPEATS maxk-1 TIMES 173 <3> ;--------------------------------------------------------------------------------------------------------- 174 <3> 175 <3> ;-------------------------------- PARMSX block structure 176 <3> D_P_PARMSX_Blk struc ;AN000; 0 00001090 ?? D_P_MinP db ? ;0 ;AN000; Minimum positional number 0 00001091 ?? D_P_Maxp db ? ;0 ;AN000; Maximum positional number 0 00001092 ???? D_P_1st_Control dw ? ;0 ;AN000; Address of the 1st CONTROL block 180 <3> D_P_PARMSX_Blk ends ;AN000; 181 <3> ; PAGE ;AN000; 182 <3> ;--------------------------------------------------------------------------------------------------------- 183 <3> ; << Control field definition >> 184 <3> ; 185 <3> ; 186 <3> ;CONTROL LABEL BYTE 187 <3> ; DW MATCH_FLAGS ; CONTROLS TYPE MATCHED 188 <3> ; ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED) 189 <3> ; ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE CHECKED) 190 <3> ; ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED) 191 <3> ; ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED) 192 <3> ; ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED) 193 <3> ; ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED) 194 <3> ; ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED) 195 <3> ; ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED) 196 <3> ; ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED) 197 <3> ; ; 0010H=IGNORE ":" AT END IN MATCH 198 <3> ; ; 0002H=REPEATS ALLOWED 199 <3> ; ; 0001H=OPTIONAL 200 <3> ; DW FUNCTION_FLAGS 201 <3> ; ; 0001H=CAP RESULT BY FILE TABLE 202 <3> ; ; 0002H=CAP RESULT BY CHAR TABLE 203 <3> ; ; 0010H=REMOVE ":" AT END 204 <3> ; (tm10) ; 0020H=colon is not necessary for switch 205 <3> ; DW RESULT ; RESULT BUFFER 206 <3> ; DW VALUES ; VALUE LISTS 207 <3> ; DB nid ; NUMBER OF KEYWORD/SWITCH SYNONYMS IN FOLLOWING LIST 208 <3> ; DB "...",0 ; IF n >0, KEYWORD 1 209 <3> ; : 210 <3> ; 211 <3> ;Note: 212 <3> ; - The MATCH_FLAG is bit significant. You can set, for example, TIME bit and 213 <3> ; DATE bit simalteniously. 214 <3> ; 215 <3> ; The parser examins each bit along with the following priority. 216 <3> ; 217 <3> ; COMPLEX -> DATE -> TIME -> NUMERIC VAL -> SIGNED NUMERIC VAL -> DRIVE -> 218 <3> ; FILE SPEC -> SIMPLE STRING. 219 <3> ; 220 <3> ; 221 <3> ; - When the FUNCTION_FLAG is 0001 or 0002, the STRING pointed to by a pointer 222 <3> ; in the result buffer is capitalized. 223 <3> ; 224 <3> ; - Match_Flags 0001H and 0002H have meaning only for the positional. 225 <3> ; 226 <3> ; 227 <3> ; - The "...",0 (bottom most line) does require '=' or '/'. When you need a 228 <3> ; switch, for example, '/A', then STRING points to; 229 <3> ; 230 <3> ; DB 1 ; number of following synonyms 231 <3> ; DB '/A',0 232 <3> ; 233 <3> ; When you need a keyword, for example, 'CODEPAGE=', then "...",0 will be; 234 <3> ; 235 <3> ; DB 1 ; number of following synonyms 236 <3> ; DB 'CODEPAGE=',0 237 <3> ; 238 <3> ; 239 <3> ; - "..." must consist of upper case characters only because the parser 240 <3> ; performs pattern matching after converting input to upper case (by 241 <3> ; using the current country upper case table) 242 <3> ; 243 <3> ; 244 <3> ; - One "..." can contain only one switch or keyword. If you need, for 245 <3> ; example /A and /B, the format will be; 246 <3> ; 247 <3> ; DB 2 ; number of following synonyms 248 <3> ; DB '/A',0 249 <3> ; DB '/B',0 250 <3> ;--------------------------------------------------------------------------------------------------------- 251 <3> 252 <3> ;**** Match_Flags 253 <3> 254 <3> D_P_Num_Val equ 8000h ;AN000; Numeric Value 255 <3> D_P_SNum_Val equ 4000h ;AN000; Signed numeric value 256 <3> D_P_Simple_S equ 2000h ;AN000; Simple string 257 <3> D_P_Date_S equ 1000h ;AN000; Date string 258 <3> D_P_Time_S equ 0800h ;AN000; Time string 259 <3> D_P_Cmpx_S equ 0400h ;AN000; Complex string 260 <3> D_P_File_Spc equ 0200h ;AN000; File Spec 261 <3> D_P_Drv_Only equ 0100h ;AN000; Drive Only 262 <3> D_P_Qu_String equ 0080h ;AN000; Quoted string 263 <3> D_P_Ig_Colon equ 0010h ;AN000; Ignore colon at end in match 264 <3> D_P_Repeat equ 0002h ;AN000; Repeat allowed 265 <3> D_P_Optional equ 0001h ;AN000; Optional 266 <3> 267 <3> ;**** Function flags 268 <3> 269 <3> D_P_CAP_File equ 0001h ;AN000; CAP result by file table 270 <3> D_P_CAP_Char equ 0002h ;AN000; CAP result by character table 271 <3> D_P_Rm_Colon equ 0010h ;AN000; Remove ":" at the end 272 <3> D_P_colon_is_not_necessary equ 0020h ;AN000;(tm10) /+10 and /+:10 273 <3> 274 <3> ;-------------------------------- Control block structure 275 <3> D_P_Control_Blk struc ;AN000; 0 00001090 ???? D_P_Match_Flag dw ? ;0 ;AN000; Controls type matched 0 00001092 ???? D_P_Function_Flag dw ? ;0 ;AN000; Function should be taken 0 00001094 ???? D_P_Result_Buf dw ? ;0 ;AN000; Result buffer address 0 00001096 ???? D_P_Value_List dw ? ;0 ;AN000; Value list address 0 00001098 ?? D_P_nid db ? ;0 ;AN000; # of keyword/SW synonyms 0 00001099 ?? D_P_KeyorSW db ? ;0 ;AN000; keyword or sw 282 <3> D_P_Control_Blk ends ;AN000; 283 <3> ; PAGE ;AN000; 284 <3> ;--------------------------------------------------------------------------------------------------------- 285 <3> ; << Value List Definition >> 286 <3> ; 287 <3> ;VALUES LABEL BYTE 288 <3> ; DB nval ; NUMBER OF VALUE DEFINITIONS (0 - 3) 289 <3> ; = 290 <3> ; = DB nrng ; NUMBER OF RANGES 291 <3> ; = =DB ITEM_TAG ; RETURN VALUE IF RANGE MATCHED 292 <3> ; = =DD X,Y ; RANGE OF VALUES 293 <3> ; = : 294 <3> ; = DB nnval ; NUMBER OF CHOICES 295 <3> ; = =DB ITEM_TAG ; RETURN VALUE IF NUMBER CHOICE MATCHED 296 <3> ; = =DD VALUE ; SPECIFIC CHOICE IF NUMBER 297 <3> ; = : 298 <3> ; = DB nstrval ; NUMBER OF CHOICES 299 <3> ; = =DB ITEM_TAG ; RETURN VALUE IF STRING CHOICE MATCHED 300 <3> ; = =DW STRING ; SPECIFIC CHOICE IF STING 301 <3> ; = : 302 <3> ; 303 <3> ;STRING DB "...",0 ; ASCIIZ STRING IMAGE 304 <3> ; 305 <3> ;Note: 306 <3> ; - ITEM_TAG must not be 0FFH, which will be used in the result buffer 307 <3> ; when no choice lists are provided. 308 <3> ; 309 <3> ; - STRING must consist of upper case characters only because the parser 310 <3> ; performs pattern matching after converting input to upper case (by 311 <3> ; using the current country upper case table) 312 <3> ;--------------------------------------------------------------------------------------------------------- 313 <3> 314 <3> D_P_nval_None equ 0 ;AN000; no value list ID 315 <3> D_P_nval_Range equ 1 ;AN000; range list ID 316 <3> D_P_nval_Value equ 2 ;AN000; value list ID 317 <3> D_P_nval_String equ 3 ;AN000; string list ID 318 <3> D_P_Len_Range equ 9 ;AN000; Length of a range choice(two DD plus one DB) 319 <3> D_P_Len_Value equ 5 ;AN000; Length of a value choice(one DD plus one DB) 320 <3> D_P_Len_String equ 3 ;AN000; Length of a string choice(one DW plus one DB) 321 <3> D_P_No_nrng equ 0 ;AN000; (tm07) no nrng. nnval must not be 0. 322 <3> 323 <3> D_P_Val_List struc ;AN000; 0 00001090 ?? D_P_NumofList db ? ;0 ;AN000; number of following choice 0 00001091 ???? D_P_Val_XL dw ? ;0 ;AN000; lower word of value 0 00001093 ???? D_P_Val_XH dw ? ;0 ;AN000; higher word of value 0 00001095 ???? D_P_Val_YL dw ? ;0 ;AN000; lower word of another value 0 00001097 ???? D_P_Val_YH dw ? ;0 ;AN000; higher word of another value 329 <3> D_P_Val_List ends ;AN000; 330 <3> ; PAGE ;AN000; 331 <3> ;--------------------------------------------------------------------------------------------------------- 332 <3> ; << Result Buffer Definition >> 333 <3> ; 334 <3> ;RESULT LABEL BYTE ; BELOW FILLED IN FOR DEFAULTS 335 <3> ; DB type ; TYPE RETURNED: 0=RESERVED, 336 <3> ; ; 1=NUMBER, 2=LIST INDEX, 337 <3> ; ; 3=STRING, 4=COMPLEX, 338 <3> ; ; 5=FILESPEC, 6=DRIVE 339 <3> ; ; 7=DATE, 8=TIME 340 <3> ; ; 9=QUOTED STRING 341 <3> ; DB ITEM_TAG ; MATCHED ITEM TAG 342 <3> ; 343 <3> ; dw synonym@ ; es:@ points to found SYNONYM if provided. 344 <3> ; 345 <3> ; 346 <3> ; = DD n ; VALUE IF NUMBER 347 <3> ; = or 348 <3> ; = DW i ; INDEX (OFFSET) INTO VALUE LIST 349 <3> ; = ; (ES presents Segment address) 350 <3> ; = or 351 <3> ; = DD STRING ; OFFSET OF STRING VALUE 352 <3> ; = or 353 <3> ; = DB drv ; DRIVE NUMBER (1-A, 2-B,..., 26-Z) 354 <3> ; = or 355 <3> ; = DW YEAR ;(1980-2099) IN CASE OF DATE 356 <3> ; = DB MONTH ;(1-12) Note: Range check is not performed. 357 <3> ; = DB DATE ;(1-31) 0 is filled when the corresponding field was not specified. 358 <3> ; = or 359 <3> ; = DB HOUR ;(0-23) IN CASE OF TIME 360 <3> ; = DB MINUTES ;(0-59) Note: Range check is not performed . 361 <3> ; = DB SECONDS ;(0-59) 0 is filled when the corresponding field was not specified . 362 <3> ; = DB HUNDREDTHS ;(0-99) 363 <3> ; = 364 <3> ; 365 <3> ; 366 <3> ;Note: ITEM_TAG is 0FFH when the caller does not specify the choice 367 <3> ; list. 368 <3> ; 369 <3> ; YEAR: If the input value for the year is less than 100, parser 370 <3> ; adds 1900 to it. For example, when 87 is input to parser for 371 <3> ; the year value, he returns 1987. 372 <3> ;--------------------------------------------------------------------------------------------------------- 373 <3> 374 <3> ;-------------------------------- Result block structure 375 <3> D_P_Result_Blk struc ;AN000; 0 00001090 ?? D_P_Type db ? ;0 ;AN000; Type returned 0 00001091 ?? D_P_Item_Tag db ? ;0 ;AN000; Matched item tag 0 00001092 ???? D_P_SYNONYM_Ptr dw ? ;0 ;AN000; pointer to Synonym list returned 0 00001094 ???????? D_P_Picked_Val db ?,?,?,? ;0,0,0,0 ;AN000; value 380 <3> D_P_Result_Blk ends ;AN000; 381 <3> ;-------------------------------- 382 <3> ;**** values for the type field in the result block 383 <3> 384 <3> D_P_EOL equ 0 ;AN000; End of line 385 <3> D_P_Number equ 1 ;AN000; Number 386 <3> D_P_List_Idx equ 2 ;AN000; List Index 387 <3> D_P_String equ 3 ;AN000; String 388 <3> D_P_Complex equ 4 ;AN000; Complex 389 <3> D_P_File_Spec equ 5 ;AN000; File Spec 390 <3> D_P_Drive equ 6 ;AN000; Drive 391 <3> D_P_Date_F equ 7 ;AN000; Date 392 <3> D_P_Time_F equ 8 ;AN000; Time 393 <3> D_P_Quoted_String equ 9 ;AN000; Quoted String 394 <3> 395 <3> D_P_No_Tag equ 0FFH ;AN000; No ITEM_TAG found 396 <3> ;**** Return code 397 <3> ; 398 <3> ; following return code will be returned in the AX register. 399 <3> 400 <3> D_P_No_Error equ 0 ;AN000; No error 401 <3> D_P_Too_Many equ 1 ;AN000; Too many operands 402 <3> D_P_Op_Missing equ 2 ;AN000; Required operand missing 403 <3> D_P_Not_In_SW equ 3 ;AN000; Not in switch list provided 404 <3> D_P_Not_In_Key equ 4 ;AN000; Not in keyword list provided 405 <3> D_P_Out_Of_Range equ 6 ;AN000; Out of range specified 406 <3> D_P_Not_In_Val equ 7 ;AN000; Not in value list provided 407 <3> D_P_Not_In_Str equ 8 ;AN000; Not in string list provided 408 <3> D_P_Syntax equ 9 ;AN000; Syntax error 409 <3> D_P_RC_EOL equ -1 ;AN000; End of command line 410 <3> 411 <3> ; PAGE ;AN000; 412 <3> ;********************** Local Data ************************************* 0 00001090 0000 D_P_ORDINAL dw 0 ;AN000; Operand ordinal save area 0 00001092 0000 D_P_RC dw 0 ;AN000; Return code from parser 0 00001094 0000 D_P_SI_Save dw 0 ;AN000; Pointer of command buffer 0 00001096 0000 D_P_DX dw 0 ;AN000; Return result buffer address 0 00001098 00 D_P_Terminator db 0 ;AN000; Terminator code (ASCII) 0 00001099 0000 D_P_DBCSEV_OFF dw 0 ;AN000; Offset of DBCS EV 0 0000109B 0000 D_P_DBCSEV_SEG dw 0 ;AN000; Segment of DBCS EV 0 0000109D 0000 D_P_Flags dw 0 ;AN000; Parser internal flags 421 <3> labelsize D_P_Flags1, byte, D_P_Flags ;AN038; to reference first byte flags 422 <3> labelsize D_P_Flags2, byte, D_P_Flags+1 ;AN038; to reference second byte flags only 423 <3> 424 <3> ;in second byte of D_P_Flags, referenced as D_P_Flags2: 425 <3> D_P_equ equ 01h ;AN000; "=" packed in string buffet 426 <3> D_P_Neg equ 02h ;AN000; Negative value 427 <3> D_P_Time12 equ 04h ;AN000; set when PM is specified 428 <3> D_P_Key_Cmp equ 08h ;AN000; set when keyword compare 429 <3> D_P_SW_Cmp equ 10h ;AN000; set when switch compare 430 <3> D_P_Extra equ 20h ;AN000; set when extra delimiter found 431 <3> D_P_SW equ 40h ;AN000; set when switch found (tm08) 432 <3> D_P_Signed equ 80h ;AN000; signed numeric specified 433 <3> 434 <3> ;in first byte of D_P_Flags, referenced as D_P_Flags1: 435 <3> D_P_time12am equ 01h ;AN038; set when AM is specified on time 436 <3> D_P_TIME_AGAIN EQU 02H ;AN039; SET WHEN READY TO RE-PARSE TIME 437 <3> 0 0000109F 0000 D_P_SaveSI_Cmpx dw 0 ;AN000; save si for later use by complex 0 000010A1 0000 D_P_KEYorSW_Ptr dw 0 ;AN000; points next to "=" or ":" code 0 000010A3 0000 D_P_Save_EOB dw 0 ;AN000; save pointer to EOB 0 000010A5 0000 D_P_Found_SYNONYM dw 0 ;AN000; es:@ points to found synonym 442 <3> 0 000010A7 000000000000000000 D_P_STRING_BUF db 128 dup(0) ;AN000; Pick a operand from command line 0 000010B0 000000000000000000 0 000010B9 000000000000000000 0 000010C2 000000000000000000 0 000010CB 000000000000000000 0 000010D4 000000000000000000 0 000010DD 000000000000000000 0 000010E6 000000000000000000 0 000010EF 000000000000000000 0 000010F8 000000000000000000 0 00001101 000000000000000000 0 0000110A 000000000000000000 0 00001113 000000000000000000 0 0000111C 000000000000000000 0 00001125 0000 444 <3> D_P_STRING_BUF_END equ $ ;AN000; 445 <3> %IF TimeSw ;AN039; For TIME only 446 <3> D_P_ORIG_ORD DW 0 ;AN039; ORIGINAL ORDINAL FROM CX 447 <3> D_P_ORIG_STACK DW 0 ;AN039; ORIGINAL VALUE OF STACK FROM SP 448 <3> D_P_ORIG_SI DW 0 ;AN039; ORIGINAL START PARSE POINTER FROM SI 449 <3> %endif ;AN039; 450 <3> %IF DateSw+TimeSw ;AN000;(Check if date or time format is supported) 451 <3> ;------------------------------ 452 <3> ; 453 <3> D_P_Got_Time db 0 ;AN023; if 1, use Time delimiters 454 <3> D_P_NeedToBeRead equ 0ffffh ;AN000; 455 <3> 456 <3> D_P_COUNTRY_INFO: ; NASM structure instance 457 <3> D_P_CDI_size equ D_P_CDI_struc_size ; NASM port equate 458 <3> istruc D_P_CDI 459 <3> at D_P_CDI_DateF 460 <3> dw D_P_NeedToBeRead 461 <3> iend 462 <3> ; 463 <3> D_P_1st_Val dw 0 ;AN000; used when process date or time 464 <3> D_P_2nd_Val dw 0 ;AN000; used when process date or time 465 <3> D_P_3rd_Val dw 0 ;AN000; used when process date or time 466 <3> D_P_4th_Val dw 0 ;AN000; used when process date or time 467 <3> ;------------------------------ 468 <3> %endif ;AN000;(of DateSW+TimeSW) 0 00001127 FF D_P_Char_CAP_Ptr db 0ffh ;AN000; info id 0 00001128 0000 dw 0 ;AN000; offset of char case map table 0 0000112A 0000 dw 0 ;AN000; segment of char case map table 472 <3> %IF CAPSW ;AN000;(Check if uppercase conversion is supported) 0 0000112C FF D_P_File_CAP_Ptr db 0ffh ;AN000; info id 0 0000112D 0000 dw 0 ;AN000; offset of file case map table 0 0000112F 0000 dw 0 ;AN000; segment of file case map table 476 <3> %endif ;AN000;(of CAPSW) 477 <3> ; (tm06) IF FileSW ;AN000;(Check if file spec is supported) 478 <3> %IF FileSW+DrvSW ;AN000;(Check if file spec is supported) 0 00001131 5B5D7C3C3E2B3D3B22 D_P_FileSp_Char db '[]|<>+=;"' ;AN000; delimitter of file spec 480 <3> D_P_FileSp_Len equ $-D_P_FileSp_Char ;AN000; 481 <3> %endif ;AN000;(of FileSW) 482 <3> ; (tm05) IF QusSW ;AN000;(Check if quoted string is supported) 483 <3> ;(deleted ;AN025;) IF QusSW+CmpxSW ; (tm05) ;AN000;(Check if quoted string is supported) 484 <3> ;(deleted ;AN025;) D_P_SorD_Quote db 0 ;AN000; keep double or single quote 485 <3> ;(deleted ;AN025;) %endif ;AN000;(of QueSW) 486 <3> %IF KeySW ;AN029; if keywords supported 487 <3> D_P_count_to_eol dw 0 ;AN029; count of chars not including EOL 488 <3> ; REGISTER EQUATES - SPECIAL USAGE FOR REGISTERS 489 <3> %idefine D_P_REG_BH_CG_SW BH ;AN029;0="NO CHANGES MADE", FF=CHANGES MADE 490 <3> %idefine D_P_REG_BL_DQ_SW BL ;AN029;0=NOT IN QUOTES,FF=IN QUOTES 491 <3> 492 <3> D_P_DOUBLE_QUOTE EQU '"' ;AN029; 493 <3> D_P_BL_EQ EQU "= " ;AN029; 494 <3> D_P_EQ_BL EQU " =" ;AN029; 495 <3> D_P_TB_EQ EQU 093DH ;AN029; ;"=" 496 <3> D_P_EQ_TB EQU 3D09H ;AN029; ;"=" 497 <3> %endif ;AN029; IF KeySW Supported 498 <3> 499 <3> ; delimiter parsing 500 <3> D_P_colon_period equ 01 ;AN032; check for colon & period 501 <3> D_P_period_only equ 02 ;AN032; check only for period 502 <3> 503 <3> ;filespec error flag 0 0000113A 00 D_P_err_flag db 00 ;AN033; flag set if filespec parsing error 505 <3> ;AN033; was detected. 506 <3> D_P_error_filespec equ 01 ;AN033; mask to set flag 507 <3> ;*********************************************************************** 30 <2> %endif ;AN000; endif (tm03) 31 <2> ; PAGE ;AN000; 32 <2> %warning out: INCLUDING COMP=COMMON DSN=PARSE.ASM...;AN000; 32 ****************** <2> warning: out: INCLUDING COMP=COMMON DSN=PARSE.ASM... [-w+user] 33 <2> ;*********************************************************************** 34 <2> ; SysParse; 35 <2> ; 36 <2> ; Function : Parser Entry 37 <2> ; 38 <2> ; Input: DS:SI -> command line 39 <2> ; ES:DI -> parameter block 40 <2> ; psdata_seg -> psdata.inc 41 <2> ; CX = operand ordinal 42 <2> ; 43 <2> ; Note: ES is the segment containing all the control blocks defined 44 <2> ; by the caller, except for the DOS COMMAND line parms, which 45 <2> ; is in DS. 46 <2> ; 47 <2> ; Output: CY = 1 error of caller, means invalid parameter block or 48 <2> ; invalid value list. But this parser does NOT implement 49 <2> ; this feature. Therefore CY always zero. 50 <2> ; 51 <2> ; CY = 0 AX = return code 52 <2> ; BL = terminated delimiter code 53 <2> ; CX = new operand ordinal 54 <2> ; SI = set past scaned operand 55 <2> ; DX = selected result buffer 56 <2> ; 57 <2> ; Use: D_P_Skip_Delim, D_P_Chk_EOL, D_P_Chk_Delim, D_P_Chk_DBCS 58 <2> ; D_P_Chk_Swtch, D_P_Chk_Pos_Control, D_P_Chk_Key_Control 59 <2> ; D_P_Chk_Sw_Control, D_P_Fill_Result 60 <2> ; 61 <2> ; Vars: D_P_Ordinal(RW), D_P_RC(RW), D_P_SI_Save(RW), D_P_DX(R), D_P_Terminator(R) 62 <2> ; D_P_SaveSI_Cmpx(W), D_P_Flags(RW), D_P_Found_SYNONYM(R), D_P_Save_EOB(W) 63 <2> ; 64 <2> ;-------- Modification History ----------------------------------------- 65 <2> ; 66 <2> ; 4/04/87 : Created by K. K, 67 <2> ; 4/28/87 : D_P_Val_YH assemble error (tm01) 68 <2> ; : JMP SHORT assemble error (tm02) 69 <2> ; 5/14/87 : Someone doesn't want to include psdata (tm03) 70 <2> ; 6/12/87 : D_P_Bridge is missing when TimeSw equ 0 and (CmpxSw equ 1 or 71 <2> ; DateSW equ 1) (tm04) 72 <2> ; 6/12/87 : D_P_SorD_Quote is missing when QusSw equ 0 and CmpxSW equ 1 73 <2> ; (tm05) in PSDATA.INC 74 <2> ; 6/12/87 : D_P_FileSp_Char and D_P_FileSP_Len are missing 75 <2> ; when FileSW equ 0 and DrvSW equ 1 (tm06) in PSDATA.INC 76 <2> ; 6/18/87 : $VAL1 and $VAL3, $VAL2 and $VAL3 can be used in the same 77 <2> ; value-list block (tm07) 78 <2> ; 6/20/87 : Add D_P_SW to check if there's an omiting parameter after 79 <2> ; switch (keyword) or not. If there is, backup si for next call 80 <2> ; (tm08) 81 <2> ; 6/24/87 : Complex Item checking does not work correctly when CmpSW equ 1 82 <2> ; and DateSW equ 0 and TimeSW equ 0 (tm09) 83 <2> ; 6/24/87 : New function flag D_P_colon_is_not_necessary for switch 84 <2> ; /+15 and /+:15 are allowed for user (tm10) 85 <2> ; 6/29/87 : ECS call changes DS register but it causes the address problem 86 <2> ; in user's routines. D_P_Chk_DBCS (tm11) 87 <2> ; 7/10/87 : Switch with no_match flag (0x0000H) does not work correctly 88 <2> ; (tm12) 89 <2> ; 7/10/87 : Invalid switch/keyword does not work correctly 90 <2> ; (tm13) 91 <2> ; 7/10/87 : Drive_only breaks 3 bytes after the result buffer 92 <2> ; (tm14) 93 <2> ; 7/12/87 : Too_Many_Operands sets DX=0 as the PARSE result 94 <2> ; (tm15) 95 <2> ; 7/24/87 : Negative lower bound on numeric ranges cause trouble 96 <2> 97 <2> ; 7/24/87 : Quoted strings being returned with quotes. 98 <2> 99 <2> ; 7/28/87 : Kerry S (;AN018;) 100 <2> ; Non optional value on switch (match flags<>0 and <>1) not flagged 101 <2> ; as an error when missing. Solution: return error 2. Modules 102 <2> ; affected: D_P_Chk_SW_Control. 103 <2> 104 <2> ; 7/29/87 : Kerry S (;AN019;) 105 <2> ; Now allow the optional bit in match flags for switches. This 106 <2> ; allows the switch to be encountered with a value or without a 107 <2> ; value and no error is returned. 108 <2> ; 109 <2> 110 <2> ; 8/28/87 : Ed K, Kerry S (;AN020;) 111 <2> ; 9/14/87 In PROC D_P_Get_DecNum, when checking for field separators 112 <2> ; within a date response, instead of checking just for the one 113 <2> ; character defined by the COUNTRY DEPENDENT INFO, check for 114 <2> ; all three chars, "-", "/", and ".". Change D_P_Chk_Switch to allow 115 <2> ; slashes in date strings when DateSw (assembler switch) is set. 116 <2> 117 <2> ; 9/1/87 : Kerry S (;AN021) 118 <2> ; In PROC D_P_String_Comp, when comparing the switch or keyword on 119 <2> ; the command line with the string in the control block the 120 <2> ; comparing was stopping at a colon (switch) or equal (keyword) 121 <2> ; on the command line and assuming a match. This allowed a shorter 122 <2> ; string on the command line than in the synonym list in the control 123 <2> ; block. I put in a test for a null in the control block so the 124 <2> ; string in the control block must be the same length as the string 125 <2> ; preceeding the colon or equal on the command line. 126 <2> 127 <2> ; 8/28/87 : Kerry S (;AN022;) 128 <2> ; All references to data in PSDATA.INC had CS overrides. This caused 129 <2> ; problems for people who included it themselves in a segment other 130 <2> ; than CS. Added switch to allow including PSDATA.INC in any 131 <2> ; segment. 132 <2> 133 <2> ; 9/16/87 : Ed K (;AN023;) PTM1040 134 <2> ; in D_P_set_cdi PROC, it assumes CS points to psdata. Change Push CS 135 <2> ; into PUSH PSDATA_SEG. In D_P_Get_DecNum PROC, fix AN020 136 <2> ; forced both TIME and DATE to use the delims, "-","/",".". 137 <2> ; Created FLag, in D_P_time_Format PROC, to request the delim in 138 <2> ; BL be used if TIME is being parsed. 139 <2> 140 <2> ; 9/24/87 : Ed K 141 <2> ; Removed the include to STRUC.INC. Replaced the STRUC macro 142 <2> ; invocations with their normally expanded code; made comments 143 <2> ; out of the STRUC macro invocation statements to maintain readability. 144 <2> 145 <2> ; 9/24/87 : Ed K (;AN024;) PTM1222 146 <2> ; When no CONTROL for a keyword found, tried to fill in RESULT 147 <2> ; pointed to by non-existant CONTROL. 148 <2> 149 <2> ; 10/15/87 : Ed K (;AN025;) PTM1672 150 <2> ; A quoted text string can be framed only by double quote. Remove 151 <2> ; support to frame quoted text string with single quote. 152 <2> ; (apostrophe) D_P_SorD_Quote is removed from PSDATA.INC. 153 <2> ; D_P_SQuote EQU also removed from PSDATA.INC. Any references to 154 <2> ; single quote in PROC prologues are left as is for history reasons. 155 <2> 156 <2> ; This fixes another bug, not mentioned in p1672, in that two 157 <2> ; quote chars within a quoted string is supposed to be reported as 158 <2> ; one quote character, but is reported as two quotes. This changed 159 <2> ; two instructions in PROC D_P_Quoted_Str. 160 <2> 161 <2> ; Also fixed are several JMP that caused a NOP, these changed to 162 <2> ; have the SHORT operator to avoid the unneeded NOP. 163 <2> 164 <2> ; The code and PSDATA.INC have been aligned for ease of reading. 165 <2> 166 <2> ; 10/26/87 : Ed K (;AN026;) PTM2041, DATE within SWITCH, BX reference to 167 <2> ; psdata buffer should have psdata_seg. 168 <2> 169 <2> ; 10/27/87 : Ed K (;AN027;) PTM2042 comma between keywords implies 170 <2> ; positional missing. 171 <2> 172 <2> ; 11/06/87 : Ed K (;AN028;) PTM 2315 Parser should not use line feed 173 <2> ; as a line delimiter, should use carriage return. 174 <2> ; Define switch: LFEOLSW, if on, accept LF as end of line char. 175 <2> 176 <2> ; 11/11/87 : Ed K (;AN029;) PTM 1651 GET RID OF WHITESPACE AROUND "=". 177 <2> 178 <2> ; 11/18/87 : Ed K (;AN030;) PTM 2551 If filename is just "", then 179 <2> ; endless loop since SI is returned still pointing to start 180 <2> ; of that parm. 181 <2> 182 <2> ; 11/19/87 : Ed K (;AN031;) PTM 2585 date & time getting bad values. 183 <2> ; Vector to returned string has CS instead of Psdata_Seg, but 184 <2> ; when tried to fix it on previous version, changed similar 185 <2> ; but wrong place. 186 <2> 187 <2> ; 12/09/87 : Bill L (;AN032;) PTM 2772 colon and period are now valid 188 <2> ; delimiters between hours, minutes, seconds for time. And period 189 <2> ; and comma are valid delimiters between seconds and 100th second. 190 <2> 191 <2> ; 12/14/87 : Bill L (;AN033;) PTM 2722 if illegal delimiter characters 192 <2> ; in a filespec, then flag an error. 193 <2> 194 <2> ; 12/22/87 : Bill L (;AN034;) All local data to parser is now 195 <2> ; indexed off of the psdata_seg equate instead of the DS register. 196 <2> ; Using this method, DS can point to the segment of PSP or to psdata 197 <2> ; --> local parser data. Why were some references to local data changed 198 <2> ; to do this before, but not all ????? 199 <2> 200 <2> ; 02/02/88 : Ed K (;AC035;) INSPECT utility, suggests optimizations. 201 <2> 202 <2> ; 02/05/88 : Ed K (;AN036;) P3372-UPPERCASE TRANSLATION, PSDATA_SEG HOSED. 203 <2> ; 204 <2> ; 02/08/88 : Ed K (;AN037;) P3410-AVOID POP OF CS, CHECK BASESW FIRST. 205 <2> 206 <2> ; 02/19/88 : Ed K (;AN038;) p3524 above noon and "am" should be error 207 <2> 208 <2> ; 02/23/88 : Ed K (;AN039;) p3518 accept "comma" and "period" as decimal 209 <2> ; separator in TIME before hundredths field. 210 <2> ; 211 <2> ;*********************************************************************** 212 <2> %IF FarSW ;AN000;(Check if need far return) 213 <2> SysParse proc far ;AN000; 214 <2> %ELSE ;AN000; 215 <2> SysParse proc near ;AN000; 216 <2> %ENDIF ;AN000;(of FarSW) 217 <2> ; $SALUT (4,9,17,41) 0 0000113B 2EC706[0D00]0000 mov word [psdata_seg:D_P_Flags],0 ;AC034; Clear all internal flags 219 <2> %IF TimeSw ;AN039; FOR TIME ONLY 220 <2> MOV [PSDATA_SEG:D_P_ORIG_ORD],CX ;AN039; ORIGINAL ORDINAL FROM CX 221 <2> MOV [PSDATA_SEG:D_P_ORIG_STACK],SP ;AN039; ORIGINAL VALUE OF STACK FROM SP 222 <2> MOV [PSDATA_SEG:D_P_ORIG_SI],SI ;AN039; ORIGINAL START PARSE POINTER FROM SI 223 <2> D_P_REDO_TIME: ;AN039; try to parse time again 224 <2> %ENDIF ;AN039; FOR TIME ONLY 0 00001142 FC cld ;AN000; confirm forward direction 226 <2> D_P_ordinal equ D_P_ORDINAL ; NASM port label 0 00001143 2E890E[0000] mov [psdata_seg:D_P_ordinal],cx ;AC034; save operand ordinal 0 00001148 2EC706[0200]0000 mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; Assume no error 0 0000114F 2EC706[1500]0000 mov word [psdata_seg:D_P_Found_SYNONYM],0 ;AC034; initalize synonym pointer 230 <2> 0 00001156 2EC706[0600]0000 mov word [psdata_seg:D_P_DX],0 ;AC034; (tm15) 232 <2> %IF KeySW ;AN029; 233 <2> ;IN CASE THE USER PUT OPTIONAL WHITESPACE CHARS AROUND THE "=" USED IN 234 <2> ;KEYWORD DEFINITIONS, SCAN THE COMMAND LINE AND COMPRESS OUT ANY WHITESPACES 235 <2> ;NEXT TO "=" BEFORE STARTING THE USUAL PARSING. 236 <2> push cx ;AN029; 237 <2> push dx ;AN029; 238 <2> push di ;AN029; 239 <2> 240 <2> push si ;AN029; remember where command line starts 241 <2> mov cx,-1 ;AN029; init counter 242 <2> ; $do 243 <2> D_P_loc_eol: ;AN029; 244 <2> inc cx ;AN029; bump counter of chars up to EOL 245 <2> lodsb ;AN029; get a char from command line 246 <2> CALL D_P_Chk_EOL ;AN029; see if AL is EOL char 247 <2> 248 <2> ; enddo z 249 <2> D_P_loc_EOL equ D_P_loc_eol ; NASM port label 250 <2> jnz D_P_loc_EOL ;AN029; not found that EOL char 251 <2> 252 <2> D_P_count_to_EOL equ D_P_count_to_eol ; NASM port label 253 <2> mov [psdata_seg:D_P_count_to_EOL],cx ;AN029;AC034;; save count of chars up to EOL 254 <2> pop si ;AN029; restore start of command line 255 <2> 256 <2> ;scan command string for combinations including "=", 257 <2> ; and replace each with just the simple "=" 258 <2> 259 <2> ;REPEAT UNTIL ONE PASS IS MADE WHEREIN NO CHANGES WERE MADE 260 <2> ; $do 261 <2> D_P_DO1: ;AN029; 262 <2> push si ;AN029; remember where string started 263 <2> D_P_COUNT_TO_EOL equ D_P_count_to_eol ; NASM port label 264 <2> MOV CX,[psdata_seg:D_P_COUNT_TO_EOL] ;AN029;AC034;; set count to no. chars in string, 265 <2> ;AN029; not counting the EOL char 266 <2> XOR BX,BX ;AN029;SET D_P_REG_BL_DQ_SW TO "NOT IN QUOTES", AND... 267 <2> ;AN029;SET D_P_REG_BH_CG_SW TO "NO CHANGES MADE" 268 <2> ;MAKE ONE PASS THRU THE STRING, LOOKING AT EACH CHARACTER 269 <2> ; $do ;AN029; 270 <2> D_P_DO2: ;AN029; 271 <2> D_P_double_quote equ D_P_DOUBLE_QUOTE ; NASM port equate 272 <2> cmp BYTE PTR [SI],D_P_double_quote ;AN029; 273 <2> ; $if e ;AN029;if a double quote was found 274 <2> JNE D_P_IF3 ;AN029; 275 <2> NOT D_P_REG_BL_DQ_SW ;AN029;TOGGLE THE DOUBLE QUOTE STATE SWITCH 276 <2> ; $endif ;AN029; 277 <2> D_P_IF3: ;AN029; 278 <2> OR D_P_REG_BL_DQ_SW,D_P_REG_BL_DQ_SW ;AN029;IS THE DOUBLE QUOTE SWITCH SET? 279 <2> ; $if Z ;AN029;IF NOT IN DOUBLE QUOTES 280 <2> JNZ D_P_IF5 ;AN029; 281 <2> mov ax,word ptr [si] ;AN029; get pair to be checked out 282 <2> cmp ax,D_P_BL_EQ ;AN029;" =" 283 <2> ; $if e,or ;AN029; 284 <2> JE D_P_LL6 ;AN029; 285 <2> cmp ax,D_P_EQ_BL ;AN029;"= " 286 <2> ; $if e,or ;AN029; 287 <2> JE D_P_LL6 ;AN029; 288 <2> cmp ax,D_P_EQ_TB ;AN029; "=" 289 <2> ; $if e,or ;AN029; 290 <2> JE D_P_LL6 ;AN029; 291 <2> cmp ax,D_P_TB_EQ ;AN029;"=" 292 <2> ; $if e ;AN029;if this pair to be replaced with a single "=" 293 <2> JNE D_P_IF6 ;AN029; 294 <2> D_P_LL6: ;AN029; 295 <2> mov BYTE PTR [SI],D_P_Keyword ;AN029; "=" 296 <2> inc si ;AN029;point to next char after the new "=" 297 <2> mov di,si ;AN029;move target right after new "=" 298 <2> 299 <2> push si ;AN029;remember where i am, right after new "=" 300 <2> PUSH CX ;AN029;SAVE CURRENT COUNT 301 <2> inc si ;AN029;source is one beyond that 302 <2> push es ;AN029;remember the extra segment 303 <2> push ds ;AN029;temporarily, set source seg and 304 <2> pop es ;AN029; target seg to the command line seg 305 <2> rep movsb ;AN029;move chars left one position 306 <2> pop es ;AN029;restore the extra segment 307 <2> POP CX ;AN029;RESTORE CURRENT COUNT 308 <2> pop si ;AN029;back to where I was 309 <2> 310 <2> DEC SI ;AN029;LOOK AT FIRST CHAR JUST MOVED 311 <2> MOV D_P_REG_BH_CG_SW,-1 ;AN029;set switch to say "a change was made" 312 <2> DEC word [psdata_seg:D_P_COUNT_TO_EOL] ;AN029;AC034;;because just threw away a char 313 <2> dec CX ;AN029;DITTO 314 <2> ; $endif ;AN029;comparand pair found? 315 <2> D_P_IF6: ;AN029; 316 <2> ; $endif ;AN029;double quote switch? 317 <2> D_P_IF5: ;AN029; 318 <2> inc si ;AN029;bump index to look at next char in command string 319 <2> dec CX ;AN029;one less char to look at 320 <2> ;(deleted ;AC035;) CMP CX,0 ;AN029;is char count all gone yet? 321 <2> ; $enddo LE ;AN029;quit if no more chars 322 <2> JNLE D_P_DO2 ;AN029; 323 <2> pop si ;AN029;remember where string started 324 <2> OR D_P_REG_BH_CG_SW,D_P_REG_BH_CG_SW ;AN029;WAS "A CHANGE MADE"? 325 <2> ; $enddo Z ;AN029;QUIT when no changes were made 326 <2> JNZ D_P_DO1 ;AN029; 327 <2> pop di ;AN029; 328 <2> pop dx ;AN029; 329 <2> pop cx ;AN029; 330 <2> 331 <2> ;NOW THAT ALL WHITESPACE SURROUNDING "=" HAVE BEEN COMPRESSED OUT, 332 <2> ;RESUME NORMAL PARSING... 333 <2> %ENDIF ;AN029; KEYWORDS SUPPORTED? 0 0000115D E86007 call D_P_Skip_Delim ;AN000; Move si to 1st non white space 0 00001160 7313 jnc D_P_Start ;AN000; If EOL is not encountered, do parse 336 <2> 337 <2> ;--------------------------- End of Line 0 00001162 B8FFFF mov ax,D_P_RC_EOL ;AN000; set exit code to -1 0 00001165 53 push bx ;AN000; 0 00001166 268B1D mov bx,[es:di + D_P_PARMSX_Address] ;AN000; Get the PARMSX address to 0 00001169 263A0F cmp cl,[es:bx + D_P_MinP] ;AN000; check ORDINAL to see if the minimum 0 0000116C 7303 jae D_P_Fin ;AN000; positional found. 343 <2> 0 0000116E B80200 mov ax,D_P_Op_Missing ;AN000; If no, set exit code to missing operand 345 <2> D_P_Fin: ;AN000; 0 00001171 5B pop bx ;AN000; 0 00001172 E91D01 jmp D_P_Single_Exit ;AN000; return to the caller 348 <2> 349 <2> ;--------------------------- 350 <2> D_P_Start: ;AN000; 0 00001175 2E8936[0F00] mov [psdata_seg:D_P_SaveSI_Cmpx],si ;AN000;AC034; save ptr to command line for later use by complex, 0 0000117A 53 push bx ;AN000; quoted string or file spec. 0 0000117B 57 push di ;AN000; 0 0000117C 55 push bp ;AN000; 0 0000117D 8D1E[1700] lea bx,[D_P_STRING_BUF] ;AC034; set buffer to copy from command string 0 00001181 2EF606[0E00]20 test byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; 3/9 extra delimiter encountered ? 0 00001187 7543 jne D_P_Pack_End ;AN000; 3/9 if yes, no need to copy 358 <2> 359 <2> D_P_Pack_Loop: ;AN000; 0 00001189 AC lodsb ;AN000; Pick a operand from buffer 0 0000118A E8F007 call D_P_Chk_Switch ;AN000; Check switch character 0 0000118D 723C jc D_P_Pack_End_BY_EOL ;AN020; if carry set found delimiter type slash, need backup si, else continue 363 <2> 0 0000118F E85407 call D_P_Chk_EOL ;AN000; Check EOL character 0 00001192 7437 je D_P_Pack_End_BY_EOL ;AN000; need backup si 366 <2> 0 00001194 E88507 call D_P_Chk_Delim ;AN000; Check delimiter 0 00001197 7518 jne D_P_PL01 ;AN000; If no, process next byte 369 <2> 0 00001199 2EF606[0E00]20 test byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; 3/9 If yes and white spec, 371 <2> ; (tm08)jne D_P_Pack_End ;AN000; 3/9 then 372 <2> D_P_Pack_End_backup_si equ D_P_PAck_End_backup_si ; NASM port label 0 0000119F 7505 jne D_P_Pack_End_backup_si ;AN000; (tm08) 374 <2> 0 000011A1 E81C07 call D_P_Skip_Delim ;AN000; skip subsequent white space,too 0 000011A4 EB26 jmp short D_P_Pack_End ;AN000; finish copy by placing NUL at end 377 <2> 378 <2> D_P_PAck_End_backup_si: ;AN000; (tm08) 0 000011A6 2EF606[0E00]41 test byte [psdata_seg:D_P_Flags2],D_P_SW+D_P_equ ;AN000;AC034; (tm08) 0 000011AC 741E je D_P_Pack_End ;AN000; (tm08) 381 <2> 0 000011AE 4E dec si ;AN000; (tm08) 0 000011AF EB1B jmp short D_P_Pack_End ;AN025; (tm08) 384 <2> 385 <2> D_P_PL01: ;AN000; 0 000011B1 2E8807 mov [psdata_seg:bx],al ;AN000; move byte to STRING_BUF 0 000011B4 3C3D cmp al,D_P_Keyword ;AN000; if it is equal character, 0 000011B6 7506 jne D_P_PL00 ;AN000; then 389 <2> 0 000011B8 2E800E[0E00]01 or byte [psdata_seg:D_P_Flags2],D_P_equ ;AC034; remember it in flag 391 <2> D_P_PL00: ;AN000; 0 000011BE 43 inc bx ;AN000; ready to see next byte 0 000011BF E8D907 call D_P_Chk_DBCS ;AN000; was it 1st byte of DBCS ? 0 000011C2 73C5 jnc D_P_Pack_Loop ;AN000; if no, process to next byte 395 <2> 0 000011C4 AC lodsb ;AN000; if yes, store 0 000011C5 2E8807 mov [psdata_seg:bx],al ;AN000; 2nd byte of DBCS 0 000011C8 43 inc bx ;AN000; update pointer 0 000011C9 EBBE jmp short D_P_Pack_Loop ;AN000; process to next byte 400 <2> 401 <2> D_P_Pack_End_BY_EOL: ;AN000; 0 000011CB 4E dec si ;AN000; backup si pointer 403 <2> D_P_Pack_End: ;AN000; 0 000011CC 2E8936[0400] mov [psdata_seg:D_P_SI_Save],si ;AC034; save next pointer, SI 0 000011D1 2EC60700 mov byte ptr [psdata_seg:bx],D_P_NULL ;AN000; put NULL at the end 0 000011D5 2E891E[1300] mov [psdata_seg:D_P_Save_EOB],bx ;AC034; 3/17/87 keep the address for later use of complex 0 000011DA 268B1D mov bx,[es:di + D_P_PARMSX_Address] ;AN000; get PARMSX address 0 000011DD 8D36[1700] lea si,[D_P_STRING_BUF] ;AC034; 0 000011E1 2E803C2F cmp byte ptr [psdata_seg:si],D_P_Switch ;AN000; the operand begins w/ switch char ? 0 000011E5 7430 je D_P_SW_Manager ;AN000; if yes, process as switch 411 <2> 0 000011E7 2EF606[0E00]01 test byte [psdata_seg:D_P_Flags2],D_P_equ ;AC034; the operand includes equal char ? 413 <2> D_P_Key_manager equ D_P_Key_Manager ; NASM port label 0 000011ED 7554 jne D_P_Key_manager ;AN000; if yes, process as keyword 415 <2> 416 <2> D_P_Positional_Manager: ;AN000; else process as positional 417 <2> D_P_MaxP equ D_P_Maxp ; NASM port equate 0 000011EF 268A4701 mov al,[es:bx + D_P_MaxP] ;AN000; get maxp 0 000011F3 30E4 xor ah,ah ;AN000; ax = maxp 0 000011F5 2E3906[0000] cmp [psdata_seg:D_P_ORDINAL],ax ;AC034; too many positional ? 0 000011FA 7312 jae D_P_Too_Many_Error ;AN000; if yes, set exit code to too many 422 <2> 0 000011FC 2EA1[0000] mov ax,[psdata_seg:D_P_ORDINAL] ;AC034; see what the current ordinal 0 00001200 D1E0 shl ax,1 ;AN000; ax = ax*2 0 00001202 43 inc bx ;AC035; add '2' to 0 00001203 43 inc bx ;AC035; BX reg 427 <2> ;AN000; now bx points to 1st CONTROL 428 <2> ;(changed ;AC035;) add bx,2 ;AN000; now bx points to 1st CONTROL 0 00001204 01C3 add bx,ax ;AN000; now bx points to specified CONTROL address 0 00001206 268B1F mov bx,[es:bx] ;AN000; now bx points to specified CONTROL itself 0 00001209 E88800 call D_P_Chk_Pos_Control ;AN000; Do process for positional 0 0000120C EB69 jmp short D_P_Return_to_Caller ;AN000; and return to the caller 433 <2> 434 <2> D_P_Too_Many_Error: ;AN000; 0 0000120E 2EC706[0200]0100 mov word [psdata_seg:D_P_RC],D_P_Too_Many ;AC034; set exit code 0 00001215 EB60 jmp short D_P_Return_to_Caller ;AN000; and return to the caller 437 <2> ; 438 <2> D_P_SW_Manager: ;AN000; 0 00001217 268A4701 mov al,[es:bx + D_P_MaxP] ;AN000; get maxp 0 0000121B 30E4 xor ah,ah ;AN000; ax = maxp 0 0000121D 40 inc ax ;AN000; 0 0000121E D1E0 shl ax,1 ;AN000; ax = (ax+1)*2 0 00001220 01C3 add bx,ax ;AN000; now bx points to maxs 0 00001222 268A0F mov cl,[es:bx] ;AN000; 0 00001225 30ED xor ch,ch ;AN000; cx = maxs 0 00001227 09C9 or cx,cx ;AN000; at least one switch ? 0 00001229 740F je D_P_SW_Not_Found ;AN000; 448 <2> 0 0000122B 43 inc bx ;AN000; now bx points to 1st CONTROL address 450 <2> 451 <2> D_P_SW_Mgr_Loop: ;AN000; 0 0000122C 53 push bx ;AN000; 0 0000122D 268B1F mov bx,[es:bx] ;AN000; bx points to Switch CONTROL itself 0 00001230 E8C600 call D_P_Chk_SW_Control ;AN000; do process for switch 0 00001233 5B pop bx ;AN000; 0 00001234 7341 jnc D_P_Return_to_Caller ;AN000; if the CONTROL is for the switch, exit 457 <2> 0 00001236 43 inc bx ;AC035; add '2' to 0 00001237 43 inc bx ;AC035; BX reg 460 <2> ;AN000; else bx points to the next CONTROL 461 <2> ;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL 0 00001238 E2F2 loop D_P_SW_Mgr_Loop ;AN000; and loop 463 <2> 464 <2> D_P_SW_Not_Found: ;AN000; 0 0000123A 2EC706[0200]0300 mov word [psdata_seg:D_P_RC],D_P_Not_In_SW ;AC034; here no CONTROL for the switch has 0 00001241 EB34 jmp short D_P_Return_to_Caller0 ;AN000; not been found, means error. 467 <2> ; 468 <2> D_P_Key_Manager: ;AN000; 0 00001243 268A4701 mov al,[es:bx + D_P_MaxP] ;AN000; get maxp 0 00001247 30E4 xor ah,ah ;AN000; ax = maxp 0 00001249 40 inc ax ;AN000; 0 0000124A D1E0 shl ax,1 ;AN000; ax = (ax+1)*2 0 0000124C 01C3 add bx,ax ;AN000; now bx points to maxs 0 0000124E 268A07 mov al,[es:bx] ;AN000; 0 00001251 30E4 xor ah,ah ;AN000; ax = maxs 0 00001253 D1E0 shl ax,1 ;AN000; 0 00001255 40 inc ax ;AN000; ax = ax*2+1 0 00001256 01C3 add bx,ax ;AN000; now bx points to maxk 0 00001258 268A0F mov cl,[es:bx] ;AN000; 0 0000125B 30ED xor ch,ch ;AN000; cx = maxk 0 0000125D 09C9 or cx,cx ;AN000; at least one keyword ? 0 0000125F 740F je D_P_Key_Not_Found ;AN000; 483 <2> 0 00001261 43 inc bx ;AN000; now bx points to 1st CONTROL 485 <2> 486 <2> D_P_Key_Mgr_Loop: ;AN000; 0 00001262 53 push bx ;AN000; 0 00001263 268B1F mov bx,[es:bx] ;AN000; bx points to keyword CONTROL itself 0 00001266 E85D00 call D_P_Chk_Key_Control ;AN000; do process for keyword 0 00001269 5B pop bx ;AN000; 0 0000126A 730B jnc D_P_Return_to_Caller ;AN000; if the CONTROL is for the keyword, exit 492 <2> 0 0000126C 43 inc bx ;AC035; add '2' to 0 0000126D 43 inc bx ;AC035; BX reg 495 <2> ;AN000; else bx points to the next CONTROL 496 <2> ;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL 0 0000126E E2F2 loop D_P_Key_Mgr_Loop ;AN000; and loop 498 <2> 499 <2> D_P_Key_Not_Found: ;AN000; 0 00001270 2EC706[0200]0400 mov word [psdata_seg:D_P_RC],D_P_Not_In_Key ;AC034; here no CONTROL for the keyword has 501 <2> D_P_Return_to_Caller0: ;AN000; not been found, means error. 502 <2> 503 <2> ;(deleted ;AN024;) mov bx,[es:bx-2] ;AN000; (tm13) backup bx 504 <2> 505 <2> ;(deleted ;AN024;) mov al,D_P_String ;AN000; Set 506 <2> ;(deleted ;AN024;) mov ah,D_P_No_Tag ;AN000; result 507 <2> ;(deleted ;AN024;) call D_P_Fill_Result ;AN000; buffer 508 <2> 509 <2> D_P_Return_to_Caller: ;AN000; 0 00001277 5D pop bp ;AN000; 0 00001278 5F pop di ;AN000; 0 00001279 5B pop bx ;AN000; 513 <2> D_P_Ordinal equ D_P_ORDINAL ; NASM port label 0 0000127A 2E8B0E[0000] mov cx,[psdata_seg:D_P_Ordinal] ;AC034; return next ordinal 0 0000127F 2EA1[0200] mov ax,[psdata_seg:D_P_RC] ;AC034; return exit code 0 00001283 2E8B36[0400] mov si,[psdata_seg:D_P_SI_Save] ;AC034; return next operand pointer 0 00001288 2E8B16[0600] mov dx,[psdata_seg:D_P_DX] ;AC034; return result buffer address 0 0000128D 2E8A1E[0800] mov bl,[psdata_seg:D_P_Terminator] ;AC034; return delimiter code found 519 <2> D_P_Single_Exit: ;AN000; 0 00001292 F8 clc ;AN000; 0 00001293 C3 ret ;AN000; 522 <2> SysParse endp ;AN000; 523 <2> ;PAGE ;AN000; 524 <2> ;*********************************************************************** 525 <2> ; D_P_Chk_Pos_Control 526 <2> ; 527 <2> ; Function: Parse CONTROL block for a positional 528 <2> ; 529 <2> ; Input: ES:BX -> CONTROL block 530 <2> ; psdata_seg:SI -> D_P_STRING_BUF 531 <2> ; 532 <2> ; Output: None 533 <2> ; 534 <2> ; Use: D_P_Fill_Result, D_P_Check_Match_Flags 535 <2> ; 536 <2> ; Vars: D_P_Ordinal(W), D_P_RC(W) 537 <2> ;*********************************************************************** 538 <2> D_P_Chk_Pos_Control proc ;AN000; 0 00001294 50 push ax ;AN000; 0 00001295 268B07 mov ax,[es:bx + D_P_Match_Flag] ;AN000; 0 00001298 A90200 test ax,D_P_Repeat ;AN000; repeat allowed ? 0 0000129B 7505 jne D_P_CPC00 ;AN000; then do not increment ORDINAL 543 <2> 0 0000129D 2EFF06[0000] inc word [psdata_seg:D_P_ORDINAL] ;AC034; update the ordinal 545 <2> D_P_CPC00: ;AN000; 0 000012A2 2E803C00 cmp byte ptr [psdata_seg:si],D_P_NULL ;AN000; no data ? 0 000012A6 7519 jne D_P_CPC01 ;AN000; 548 <2> 0 000012A8 A90100 test ax,D_P_Optional ;AN000; yes, then is it optional ? 0 000012AB 7509 jne D_P_CPC02 ;AN000; 551 <2> 0 000012AD 2EC706[0200]0200 mov word [psdata_seg:D_P_RC],D_P_Op_Missing ;AC034; no, then error 3/17/87 0 000012B4 EB0E jmp short D_P_CPC_Exit ;AN000; 554 <2> 555 <2> D_P_CPC02: ;AN000; 0 000012B6 50 push ax ;AN000; 0 000012B7 B003 mov al,D_P_String ;AN000; if it is optional return NULL 0 000012B9 B4FF mov ah,D_P_No_Tag ;AN000; no item tag indication 0 000012BB E89E00 call D_P_Fill_Result ;AN000; 0 000012BE 58 pop ax ;AN000; 0 000012BF EB03 jmp short D_P_CPC_Exit ;AN000; 562 <2> 563 <2> D_P_CPC01: ;AN000; 0 000012C1 E81D01 call D_P_Check_Match_Flags ;AN000; 565 <2> D_P_CPC_Exit: ;AN000; 0 000012C4 58 pop ax ;AN000; 0 000012C5 C3 ret ;AN000; 568 <2> D_P_Chk_Pos_Control endp ;AN000; 569 <2> ;PAGE ;AN000; 570 <2> ;*********************************************************************** 571 <2> ; D_P_Chk_Key_Control 572 <2> ; 573 <2> ; Function: Parse CONTROL block for a keyword 574 <2> ; 575 <2> ; Input: ES:BX -> CONTROL block 576 <2> ; psdata_seg:SI -> D_P_STRING_BUF 577 <2> ; 578 <2> ; Output: CY = 1 : not match 579 <2> ; 580 <2> ; Use: D_P_Fill_Result, D_P_Search_KEYorSW, D_P_Check_Match_Flags 581 <2> ; 582 <2> ; Vars: D_P_RC(W), D_P_SaveSI_Cmpx(W), D_P_KEYorSW_Ptr(R), D_P_Flags(W) 583 <2> ;*********************************************************************** 584 <2> D_P_Chk_Key_Control proc ;AN000; 585 <2> %IF KeySW ;AN000;(Check if keyword is supported) 586 <2> or byte [psdata_seg:D_P_Flags2],D_P_Key_Cmp ;AC034; Indicate keyword for later string comparison 587 <2> call D_P_Search_KEYorSW ;AN000; Search the keyword in the CONTROL block 588 <2> jc D_P_Chk_Key_Err0 ;AN000; not found, then try next CONTROL 589 <2> 590 <2> and byte [psdata_seg:D_P_Flags2],0ffh-D_P_Key_Cmp ;AC034; reset the indicator previously set 591 <2> ; 592 <2> push ax ;AN000; keyword= 593 <2> mov ax,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034; ^ ^ 594 <2> sub ax,si ;AN000; SI KEYorSW 595 <2> add [psdata_seg:D_P_SaveSI_Cmpx],ax ;AC034; update for complex, quoted or file spec. 596 <2> pop ax ;AN000; 597 <2> ; 598 <2> mov si,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034; set si just after equal char 599 <2> cmp byte ptr [psdata_seg:si],D_P_NULL ;AN000; any data after equal ? 600 <2> je D_P_Chk_Key_Err1 ;AN000; if no, syntax error 601 <2> 602 <2> call D_P_Check_Match_Flags ;AN000; else, process match flags 603 <2> clc ;AN000; 604 <2> jmp short D_P_Chk_Key_Exit ;AN000; 605 <2> 606 <2> D_P_Chk_Key_Err0: ;AN000; 607 <2> stc ;AN000; not found in keyword synonym list 608 <2> jmp short D_P_Chk_Key_Exit ;AN000; 609 <2> 610 <2> D_P_Chk_Key_Err1: ;AN000; 611 <2> mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; no parameter is not specified after "=" 612 <2> D_P_Chk_Key_ErrExit: ;AN000; 613 <2> push ax ;AN000; 614 <2> mov al,D_P_String ;AN000; set 615 <2> mov ah,D_P_No_Tag ;AN000; result 616 <2> call D_P_Fill_Result ;AN000; buffer 617 <2> pop ax ;AN000; 618 <2> clc ;AN000; 619 <2> D_P_Chk_Key_Exit: ;AN000; 620 <2> ret ;AN000; 621 <2> %ELSE ;AN000;(of IF KeySW) 0 000012C6 F9 stc ;AN000;this logic works when the KeySW 0 000012C7 C3 ret ;AN000;is reset. 624 <2> %ENDIF ;AN000;(of KeySW) 625 <2> D_P_Chk_Key_Control endp ;AN000; 626 <2> ;PAGE ;AN000; 627 <2> ;*********************************************************************** 628 <2> %IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported) 629 <2> ; D_P_Search_KEYorSW: 630 <2> ; 631 <2> ; Function: Seach specified keyword or switch from CONTROL 632 <2> ; 633 <2> ; Input: ES:BX -> CONTROL block 634 <2> ; psdata_seg:SI -> D_P_STRING_BUF 635 <2> ; 636 <2> ; Output: CY = 1 : not match 637 <2> ; 638 <2> ; Use: D_P_String_Comp, D_P_MoveBP_NUL, D_P_Found_SYNONYM 639 <2> ;*********************************************************************** 640 <2> D_P_Search_KEYorSW proc ;AN000; 0 000012C8 55 push bp ;AN000; 0 000012C9 51 push cx ;AN000; 0 000012CA 268A4F08 mov cl,[es:bx + D_P_nid] ;AN000; Get synonym count 0 000012CE 30ED xor ch,ch ;AN000; and set it to cx 0 000012D0 09C9 or cx,cx ;AN000; No synonyms specified ? 0 000012D2 740D je D_P_KEYorSW_Not_Found ;AN000; then indicate not found by CY 647 <2> 648 <2> D_P_KEYorSW equ D_P_KeyorSW ; NASM port equate 0 000012D4 8D6F09 lea bp,[bx + D_P_KEYorSW] ;AN000; BP points to the 1st synonym 650 <2> D_P_KEYorSW_Loop: ;AN000; 0 000012D7 E80204 call D_P_String_Comp ;AN000; compare string in buffer w/ the synonym 0 000012DA 7308 jnc D_P_KEYorSW_Found ;AN000; If match, set it to synonym pointer 653 <2> 0 000012DC E80E00 call D_P_MoveBP_NUL ;AN000; else, bp points to the next string 0 000012DF E2F6 loop D_P_KEYorSW_Loop ;AN000; loop nid times 656 <2> D_P_KEYorSW_Not_Found: ;AN000; 0 000012E1 F9 stc ;AN000; indicate not found in synonym list 0 000012E2 EB06 jmp short D_P_KEYorSW_Exit ;AN000; and exit 659 <2> 660 <2> D_P_KEYorSW_Found: ;AN000; 0 000012E4 2E892E[1500] mov [psdata_seg:D_P_Found_SYNONYM],bp ;AC034; set synonym pointer 0 000012E9 F8 clc ;AN000; indicate found 663 <2> D_P_KEYorSW_Exit: ;AN000; 0 000012EA 59 pop cx ;AN000; 0 000012EB 5D pop bp ;AN000; 0 000012EC C3 ret ;AN000; 667 <2> D_P_Search_KEYorSW endp ;AN000; 668 <2> ;*********************************************************************** 669 <2> ; D_P_MoveBP_NUL 670 <2> ;*********************************************************************** 671 <2> D_P_MoveBP_NUL proc ;AN000; 672 <2> D_P_MBP_Loop: ;AN000; 0 000012ED 26807E0000 cmp byte ptr [es:bp],D_P_NULL ;AN000; Increment BP that points 0 000012F2 7403 je D_P_MBP_Exit ;AN000; to the synomym list 675 <2> 0 000012F4 45 inc bp ;AN000; until 0 000012F5 EBF6 jmp short D_P_MBP_Loop ;AN000; NULL encountered. 678 <2> 679 <2> D_P_MBP_Exit: ;AN000; 0 000012F7 45 inc bp ;AN000; bp points to next to NULL 0 000012F8 C3 ret ;AN000; 682 <2> D_P_MoveBP_NUL endp ;AN000; 683 <2> %ENDIF ;AN000;(of KeySW+SwSW) 684 <2> ;PAGE ;AN000; 685 <2> ;*********************************************************************** 686 <2> ; D_P_Chk_SW_Control 687 <2> ; 688 <2> ; Function: Parse CONTROL block for a switch 689 <2> ; 690 <2> ; Input: ES:BX -> CONTROL block 691 <2> ; psdata_seg:SI -> D_P_STRING_BUF 692 <2> ; 693 <2> ; Output: CY = 1 : not match 694 <2> ; 695 <2> ; Use: D_P_Fill_Result, D_P_Search_KEYorSW, D_P_Check_Match_Flags 696 <2> ; 697 <2> ; Vars: D_P_SaveSI_Cmpx(W), D_P_KEYorSW_Ptr(R), D_P_Flags(W) 698 <2> ;*********************************************************************** 699 <2> D_P_Chk_SW_Control proc ;AN000; 700 <2> 701 <2> 702 <2> %IF SwSW ;AN000;(Check if switch is supported) 703 <2> D_P_Sw_Cmp equ D_P_SW_Cmp ; NASM port equate 0 000012F9 2E800E[0E00]10 or byte [psdata_seg:D_P_Flags2],D_P_Sw_Cmp ;AC034; Indicate switch for later string comparison 0 000012FF E8C6FF call D_P_Search_KEYorSW ;AN000; Search the switch in the CONTROL block 0 00001302 724A jc D_P_Chk_SW_Err0 ;AN000; not found, then try next CONTROL 707 <2> 0 00001304 2E8026[0E00]EF and byte [psdata_seg:D_P_Flags2],0ffh-D_P_Sw_Cmp ;AC034; reset the indicator previously set 709 <2> ; 0 0000130A 50 push ax ;AN000; /switch: 0 0000130B 2EA1[1100] mov ax,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034; ^ ^ 0 0000130F 29F0 sub ax,si ;AN000; SI KEYorSW 0 00001311 2E0106[0F00] add [psdata_seg:D_P_SaveSI_Cmpx],ax ;AC034; update for complex list 0 00001316 58 pop ax ;AN000; 715 <2> ; 0 00001317 2E8B36[1100] mov si,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034; set si at the end or colon 0 0000131C 2E803C00 cmp byte ptr [psdata_seg:si],D_P_NULL ;AN000; any data after colon 0 00001320 7526 jne D_P_CSW00 ;AN000; if yes, process match flags 719 <2> 0 00001322 2E807CFF3A cmp byte ptr [psdata_seg:si-1],D_P_Colon ;AN000; if no, the switch terminated by colon ? 0 00001327 7509 jne D_P_Chk_if_data_required ;AN000; if yes, 722 <2> 0 00001329 2EC706[0200]0900 mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; return syntax error 0 00001330 EB1F jmp short D_P_Chk_SW_Exit ;AN000; 725 <2> 726 <2> D_P_Chk_if_data_required: ;AN018; no data, no colon 0 00001332 26833F00 cmp word [es:bx + D_P_Match_Flag],0 ;AN018; should have data? zero match flag means switch followed by nothing is OK 0 00001336 7419 je D_P_Chk_SW_Exit ;AN018; match flags not zero so should have something if optional bit is not on 729 <2> 0 00001338 26F7070100 test word [es:bx + D_P_Match_Flag],D_P_Optional ;AN019; see if no value is valid 0 0000133D 7512 jnz D_P_Chk_SW_Exit ;AN019; if so, then leave, else yell 732 <2> 0 0000133F 2EC706[0200]0200 mov word [psdata_seg:D_P_RC],D_P_Op_Missing ;AC034; return required operand missing 0 00001346 EB09 jmp short D_P_Chk_SW_Exit ;AN018; 735 <2> 736 <2> D_P_CSW00: ;AN000; 0 00001348 E89600 call D_P_Check_Match_Flags ;AN000; process match flag 0 0000134B F8 clc ;AN000; indicate match 0 0000134C EB0D jmp short D_P_Chk_SW_Single_Exit ;AN000; 740 <2> 741 <2> D_P_Chk_SW_Err0: ;AN000; 0 0000134E F9 stc ;AN000; not found in switch synonym list 0 0000134F EB0A jmp short D_P_Chk_SW_Single_Exit ;AN000; 744 <2> 745 <2> D_P_Chk_SW_Exit: ;AN000; 0 00001351 50 push ax ;AN000; 0 00001352 B003 mov al,D_P_String ;AN000; set 0 00001354 B4FF mov ah,D_P_No_Tag ;AN000; result 0 00001356 E80300 call D_P_Fill_Result ;AN000; buffer 0 00001359 58 pop ax ;AN000; 0 0000135A F8 clc ;AN000; 752 <2> D_P_Chk_SW_Single_Exit: ;AN000; 0 0000135B C3 ret ;AN000; 754 <2> %ELSE ;AN000;(of IF SwSW) 755 <2> stc ;AN000; this logic works when the SwSW 756 <2> ret ;AN000; is reset. 757 <2> %ENDIF ;AN000;(of SwSW) 758 <2> D_P_Chk_SW_Control endp ;AN000; 759 <2> ;PAGE ;AN000; 760 <2> ;*********************************************************************** 761 <2> ; D_P_Fill_Result 762 <2> ; 763 <2> ; Function: Fill the result buffer 764 <2> ; 765 <2> ; Input: AH = Item tag 766 <2> ; AL = type 767 <2> ; AL = 1: CX,DX has 32bit number (CX = high) 768 <2> ; AL = 2: DX has index(offset) into value list 769 <2> ; AL = 6: DL has driver # (1-A, 2-B, ... , 26 - Z) 770 <2> ; AL = 7: DX has year, CL has month and CH has date 771 <2> ; AL = 8: DL has hours, DH has minutes, CL has secondsn, 772 <2> ; amd CH has hundredths 773 <2> ; AL = else: psdata_seg:SI points to returned string buffer 774 <2> ; ES:BX -> CONTROL block 775 <2> ; 776 <2> ; Output: None 777 <2> ; 778 <2> ; Use: D_P_Do_CAPS_String, D_P_Remove_Colon, D_P_Found_SYNONYM 779 <2> ; 780 <2> ; Vars: D_P_DX(W) 781 <2> ;*********************************************************************** 782 <2> D_P_Fill_Result proc ;AN000; 0 0000135C 57 push di ;AN000; 0 0000135D 268B7F04 mov di,[es:bx + D_P_Result_Buf] ;AN000; di points to result buffer 0 00001361 2E893E[0600] mov [psdata_seg:D_P_DX],di ;AC034; set returned result address 0 00001366 268805 mov [es:di + D_P_Type],al ;AN000; store type 0 00001369 26886501 mov [es:di + D_P_Item_Tag],ah ;AN000; store item tag 0 0000136D 50 push ax ;AN000; 0 0000136E 2EA1[1500] mov ax,[psdata_seg:D_P_Found_SYNONYM] ;AC034; if yes, 0 00001372 26894502 mov [es:di + D_P_SYNONYM_Ptr],ax ;AN000; then set it to the result 0 00001376 58 pop ax ;AN000; 792 <2> D_P_RLT04: ;AN000; 0 00001377 3C01 cmp al,D_P_Number ;AN000; if number 0 00001379 750A jne D_P_RLT00 ;AN000; 795 <2> 796 <2> D_P_RLT02: ;AN000; 0 0000137B 26895504 mov word ptr [es:di + D_P_Picked_Val],dx ;AN000; then store 32bit 0 0000137F 26894D06 mov word ptr [es:di+2 + D_P_Picked_Val],cx ;AN000; number 0 00001383 EB5A jmp short D_P_RLT_Exit ;AN000; 800 <2> 801 <2> D_P_RLT00: ;AN000; 0 00001385 3C02 cmp al,D_P_List_Idx ;AN000; if list index 0 00001387 7506 jne D_P_RLT01 ;AN000; 804 <2> 0 00001389 26895504 mov word ptr [es:di + D_P_Picked_Val],dx ;AN000; then store list index 0 0000138D EB50 jmp short D_P_RLT_Exit ;AN000; 807 <2> 808 <2> D_P_RLT01: ;AN000; 0 0000138F 3C07 cmp al,D_P_Date_F ;AN000; Date format ? 0 00001391 74E8 je D_P_RLT02 ;AN000; 811 <2> 0 00001393 3C08 cmp al,D_P_Time_F ;AN000; Time format ? 0 00001395 74E4 je D_P_RLT02 ;AN000; 814 <2> ; 0 00001397 3C06 cmp al,D_P_Drive ;AN000; drive format ? 0 00001399 7506 jne D_P_RLT03 ;AN000; 817 <2> 0 0000139B 26885504 mov byte ptr [es:di + D_P_Picked_Val],dl ;AN000; store drive number 0 0000139F EB3E jmp short D_P_RLT_Exit ;AN000; 820 <2> 821 <2> D_P_RLT03: ;AN000; 0 000013A1 3C04 cmp al,D_P_Complex ;AN000; complex format ? 0 000013A3 750F jne D_P_RLT05 ;AN000; 824 <2> 0 000013A5 2EA1[0F00] mov ax,[psdata_seg:D_P_SaveSI_Cmpx] ;AC034; then get pointer in command buffer 0 000013A9 40 inc ax ;AN000; skip left Parentheses 0 000013AA 26894504 mov word ptr [es:di + D_P_Picked_Val],ax ;AN000; store offset 0 000013AE 268C5D06 mov word ptr [es:di+2 + D_P_Picked_Val],ds ;AN000; store segment 0 000013B2 EB2B jmp short D_P_RLT_Exit ;AN000; 830 <2> 831 <2> D_P_RLT05: ;AN000; 832 <2> ;------------------------ AL = 3, 5, or 9 0 000013B4 26897504 mov word ptr [es:di + D_P_Picked_Val],si ;AN000; store offset of STRING_BUF 834 <2> ;(replaced ;AN031;) mov word ptr [es:di+word].D_P_Picked_Val,cs ;AN000; store segment of STRING_BUF 0 000013B8 268C4D06 mov word ptr [es:di+2 + D_P_Picked_Val],Psdata_Seg ;AN031; store segment of STRING_BUF 836 <2> ; 0 000013BC 50 push ax ;AN000; 0 000013BD 26F6470201 test byte ptr [es:bx + D_P_Function_Flag],D_P_CAP_File ;AN000; need CAPS by file table? 0 000013C2 7404 je D_P_RLT_CAP00 ;AN000; 840 <2> 0 000013C4 B004 mov al,D_P_DOSTBL_File ;AN000; use file upper case table 0 000013C6 EB09 jmp short D_P_RLT_CAP02 ;AN000; 843 <2> 844 <2> D_P_RLT_CAP00: ;AN000; 0 000013C8 26F6470202 test byte ptr [es:bx + D_P_Function_Flag],D_P_CAP_Char ;AN000; need CAPS by char table ? 0 000013CD 7405 je D_P_RLT_CAP01 ;AN000; 847 <2> 0 000013CF B002 mov al,D_P_DOSTBL_Char ;AN000; use character upper case table 849 <2> D_P_RLT_CAP02: ;AN000; 0 000013D1 E8FC00 call D_P_Do_CAPS_String ;AN000; process CAPS along the table 851 <2> D_P_RLT_CAP01: ;AN000; 0 000013D4 58 pop ax ;AN000; 0 000013D5 26F6470210 test byte ptr [es:bx + D_P_Function_Flag],D_P_Rm_Colon ;AN000; removing colon at end ? 0 000013DA 7403 je D_P_RLT_Exit ;AN000; 855 <2> 0 000013DC E8CB00 call D_P_Remove_Colon ;AN000; then process it. 857 <2> D_P_RLT_Exit: ;AN000; 0 000013DF 5F pop di ;AN000; 0 000013E0 C3 ret ;AN000; 860 <2> D_P_Fill_Result endp ;AN000; 861 <2> ;PAGE ;AN000; 862 <2> ;*********************************************************************** 863 <2> ; D_P_Check_Match_Flags 864 <2> ; 865 <2> ; Function: Check the mutch_flags and make the exit code and set the 866 <2> ; result buffer 867 <2> ; 868 <2> ; Check for types in this order: 869 <2> ; Complex 870 <2> ; Date 871 <2> ; Time 872 <2> ; Drive 873 <2> ; Filespec 874 <2> ; Quoted String 875 <2> ; Simple String 876 <2> ; 877 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 878 <2> ; ES:BX -> CONTROL block 879 <2> ; 880 <2> ; Output: None 881 <2> ; 882 <2> ; Use: D_P_Value, P$_SValue, D_P_Simple_String, D_P_Date_Format 883 <2> ; D_P_Time_Format, D_P_Complex_Format, D_P_File_Foemat 884 <2> ; D_P_Drive_Format 885 <2> ;*********************************************************************** 886 <2> D_P_Check_Match_Flags proc ;AN000; 0 000013E1 2EC606[AA00]00 mov byte [psdata_seg:D_P_err_flag],D_P_NULL ;AN033;AC034;; clear filespec error flag. 0 000013E7 50 push ax ;AN000; 0 000013E8 268B07 mov ax,[es:bx + D_P_Match_Flag] ;AN000; load match flag(16bit) to ax 890 <2> 0 000013EB 09C0 or ax,ax ;AC035; test ax for zero 892 <2> ;(changed ;AC035;) cmp ax,0 ;AN000; (tm12) 0 000013ED 7518 jne D_P_Mat ;AN000; (tm12) 894 <2> 0 000013EF 50 push ax ;AN000; (tm12) 0 000013F0 53 push bx ;AN000; (tm12) 0 000013F1 52 push dx ;AN000; (tm12) 0 000013F2 57 push di ;AN000; (tm12) 0 000013F3 2EC706[0200]0900 mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; (tm12) 0 000013FA B4FF mov ah,D_P_No_Tag ;AN000; (tm12) 0 000013FC B003 mov al,D_P_String ;AN000; (tm12) 0 000013FE E85BFF call D_P_Fill_Result ;AN000; (tm12) 0 00001401 5F pop di ;AN000; (tm12) 0 00001402 5A pop dx ;AN000; (tm12) 0 00001403 5B pop bx ;AN000; (tm12) 0 00001404 58 pop ax ;AN000; (tm12) 0 00001405 EB02 jmp short D_P_Bridge ;AC035; (tm12) 908 <2> 909 <2> D_P_Mat: ;AN000; (tm12) 910 <2> 911 <2> %IF CmpxSW ;AN000;(Check if complex item is supported) 912 <2> test ax,D_P_Cmpx_S ;AN000; Complex string 913 <2> je D_P_Match01 ;AN000; 914 <2> 915 <2> mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 916 <2> call D_P_Complex_Format ;AN000; do process 917 <2> cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type 918 <2> jne D_P_Bridge ;AN000; 919 <2> 920 <2> D_P_Match01: ;AN000; 921 <2> %ENDIF ;AN000;(of CmpxSW) 922 <2> %IF DateSW ;AN000;(Check if date format is supported) 923 <2> test ax,D_P_Date_S ;AN000; Date string 924 <2> je D_P_Match02 ;AN000; 925 <2> 926 <2> mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 927 <2> call D_P_Date_Format ;AN000; do process 928 <2> cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type 929 <2> jne D_P_Bridge ;AN000; 930 <2> 931 <2> D_P_Match02: ;AN000; 932 <2> %ENDIF ;AN000;(of DateSW) 933 <2> %IF TimeSW ;AN000;(Check if time format is supported) 934 <2> test ax,D_P_Time_S ;AN000; Time string 935 <2> je D_P_Match03 ;AN000; 936 <2> 937 <2> mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 938 <2> call D_P_Time_Format ;AN000; do process 939 <2> cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type 940 <2> ; je D_P_Match03 ;AN000: 941 <2> 942 <2> jne D_P_Bridge ;AN000; (tm09) 943 <2> 944 <2> %ENDIF ;AN000;(of TimeSW) (tm04) 0 00001407 EB03 jmp short D_P_Match03 ;AN025; (tm09) 946 <2> 947 <2> D_P_Bridge: ;AN000; 948 <2> ; jmp short D_P_Match_Exit (tm02) 949 <2> 0 00001409 E98500 jmp D_P_Match_Exit ;AN000; (tm02) 951 <2> 952 <2> D_P_Match03: ;AN000; 953 <2> ; ENDIF ;AN000;(of TimeSW) (tm04) 954 <2> %IF NumSW ;AN000;(Check if numeric value is supported) 0 0000140C A90080 test ax,D_P_Num_Val ;AN000; Numeric value 0 0000140F 7412 je D_P_Match04 ;AN000; 957 <2> 0 00001411 2EC706[0200]0000 mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 0 00001418 E84601 call D_P_Value ;AN000; do process 0 0000141B 2E833E[0200]09 cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type 0 00001421 756E jne D_P_Match_Exit ;AN000; 962 <2> 963 <2> D_P_Match04: ;AN000; 964 <2> D_P_SNUM_Val equ D_P_SNum_Val ; NASM port equate 0 00001423 A90040 test ax,D_P_SNUM_Val ;AN000; Signed numeric value 0 00001426 7412 je D_P_Match05 ;AN000; 967 <2> 0 00001428 2EC706[0200]0000 mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 0 0000142F E80B01 call D_P_SValue ;AN000; do process 0 00001432 2E833E[0200]09 cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type 0 00001438 7557 jne D_P_Match_Exit ;AN000; 972 <2> 973 <2> D_P_Match05: ;AN000; 974 <2> %ENDIF ;AN000;(of NumSW) 975 <2> %IF DrvSW ;AN000;(Check if drive only is supported) 0 0000143A A90001 test ax,D_P_Drv_Only ;AN000; Drive only 0 0000143D 7415 je D_P_Match06 ;AN000; 978 <2> 0 0000143F 2EC706[0200]0000 mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 0 00001446 E8AD03 call D_P_File_Format ;AN000; 1st, call file format 0 00001449 E83004 call D_P_Drive_Format ;AN000; check drive format, next 0 0000144C 2E833E[0200]09 cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examinee the next type 0 00001452 753D jne D_P_Match_Exit ;AN000; 984 <2> 985 <2> D_P_Match06: ;AN000; 986 <2> %ENDIF ;AN000;(of DrvSW) 987 <2> %IF FileSW ;AN000;(Check if file spec is supported) 0 00001454 A90002 test ax,D_P_File_Spc ;AN000; File spec 0 00001457 7412 je D_P_Match07 ;AN000; 990 <2> 0 00001459 2EC706[0200]0000 mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 0 00001460 E89303 call D_P_File_Format ;AN000; do process 0 00001463 2E833E[0200]09 cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type 0 00001469 7526 jne D_P_Match_Exit ;AN000; 995 <2> 996 <2> D_P_Match07: ;AN000; 997 <2> %ENDIF ;AN000;(of FileSW) 998 <2> %IF QusSW ;AN000;(Check if quoted string is supported) 0 0000146B A98000 test ax,D_P_Qu_String ;AN000; Quoted string 0 0000146E 7412 je D_P_Match08 ;AN000; 1001 <2> 0 00001470 2EC706[0200]0000 mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 0 00001477 E80503 call D_P_Quoted_Format ;AN000; do process 0 0000147A 2E833E[0200]09 cmp word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type 0 00001480 750F jne D_P_Match_Exit ;AN000; 1006 <2> 1007 <2> D_P_Match08: ;AN000; 1008 <2> %ENDIF ;AN000;(of QusSW) 0 00001482 A90020 test ax,D_P_Simple_S ;AN000; Simple string 0 00001485 740A je D_P_Match09 ;AN000; 1011 <2> 0 00001487 2EC706[0200]0000 mov word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error 0 0000148E E8E201 call D_P_Simple_String ;AN000; do process 1014 <2> ;;;; cmp psdata_seg:D_P_RC,D_P_Syntax ;AC034; These two lines will be alive 1015 <2> ;;;; jne D_P_Match_Exit ;when extending the match_flags. 1016 <2> D_P_Match09: ;AN000; 1017 <2> D_P_Match_Exit: ;AN000; 0 00001491 2E803E[AA00]01 cmp byte [psdata_seg:D_P_err_flag],D_P_error_filespec ;AC034; bad filespec ? 0 00001497 750F jne D_P_Match2_Exit ;AN033; no, continue 0 00001499 2E833E[0200]00 cmp word [psdata_seg:D_P_RC],D_P_No_Error ;AN033;AC034;; check for other errors ? 0 0000149F 7507 jne D_P_Match2_Exit ;AN033; no, continue 0 000014A1 2EC706[0200]0900 mov word [psdata_seg:D_P_RC],D_P_Syntax ;AN033;AC034;; set error flag 1023 <2> D_P_Match2_Exit: ;AN033; 0 000014A8 58 pop ax ;AN000; 0 000014A9 C3 ret ;AN000; 1026 <2> D_P_Check_Match_Flags endp ;AN000; 1027 <2> ;PAGE ;AN000; 1028 <2> ;*********************************************************************** 1029 <2> ; D_P_Remove_Colon; 1030 <2> ; 1031 <2> ; Function: Remove colon at end 1032 <2> ; 1033 <2> ; Input: psdata_seg:SI points to string buffer to be examineed 1034 <2> ; 1035 <2> ; Output: None 1036 <2> ; 1037 <2> ; Use: D_P_Chk_DBCS 1038 <2> ;*********************************************************************** 1039 <2> D_P_Remove_Colon proc ;AN000; 0 000014AA 50 push ax ;AN000; 0 000014AB 56 push si ;AN000; 1042 <2> D_P_RCOL_Loop: ;AN000; 0 000014AC 2E8A04 mov al,[psdata_seg:si] ;AN000; get character 0 000014AF 08C0 or al,al ;AN000; end of string ? 0 000014B1 741A je D_P_RCOL_Exit ;AN000; if yes, just exit 1046 <2> 0 000014B3 3C3A cmp al,D_P_Colon ;AN000; is it colon ? 0 000014B5 750D jne D_P_RCOL00 ;AN000; 1049 <2> 0 000014B7 2E807C0100 cmp byte ptr [psdata_seg:si+1],D_P_NULL ;AN000; if so, next is NULL ? 0 000014BC 7506 jne D_P_RCOL00 ;AN000; no, then next char 1052 <2> 0 000014BE 2EC60400 mov byte ptr [psdata_seg:si],D_P_NULL ;AN000; yes, remove colon 0 000014C2 EB09 jmp short D_P_RCOL_Exit ;AN000; and exit. 1055 <2> 1056 <2> D_P_RCOL00: ;AN000; 0 000014C4 E8D404 call D_P_Chk_DBCS ;AN000; if not colon, then check if 0 000014C7 7301 jnc D_P_RCOL01 ;AN000; DBCS leading byte. 1059 <2> 0 000014C9 46 inc si ;AN000; if yes, skip trailing byte 1061 <2> D_P_RCOL01: ;AN000; 0 000014CA 46 inc si ;AN000; si points to next byte 0 000014CB EBDF jmp short D_P_RCOL_Loop ;AN000; loop until NULL encountered 1064 <2> 1065 <2> D_P_RCOL_Exit: ;AN000; 0 000014CD 5E pop si ;AN000; 0 000014CE 58 pop ax ;AN000; 0 000014CF C3 ret ;AN000; 1069 <2> D_P_Remove_Colon endp ;AN000; 1070 <2> ;PAGE ;AN000; 1071 <2> ;*********************************************************************** 1072 <2> ; D_P_Do_CAPS_String; 1073 <2> ; 1074 <2> ; Function: Perform capitalization along with the file case map table 1075 <2> ; or character case map table. 1076 <2> ; 1077 <2> ; Input: AL = 2 : Use character table 1078 <2> ; AL = 4 : Use file table 1079 <2> ; psdata_seg:SI points to string buffer to be capitalized 1080 <2> ; 1081 <2> ; Output: None 1082 <2> ; 1083 <2> ; Use: D_P_Do_CAPS_Char, D_P_Chk_DBCS 1084 <2> ;*********************************************************************** 1085 <2> D_P_Do_CAPS_String proc ;AN000; 0 000014D0 56 push si ;AN000; 0 000014D1 52 push dx ;AN000; 0 000014D2 88C2 mov dl,al ;AN000; save info id 1089 <2> 1090 <2> D_P_DCS_Loop: ;AN000; 0 000014D4 2E8A04 mov al,[psdata_seg:si] ;AN000; load charater and 0 000014D7 E8C104 call D_P_Chk_DBCS ;AN000; check if DBCS leading byte 0 000014DA 720C jc D_P_DCS00 ;AN000; if yes, do not need CAPS 1094 <2> 0 000014DC 08C0 or al,al ;AN000; end of string ? 0 000014DE 740C je D_P_DCS_Exit ;AN000; then exit. 1097 <2> 0 000014E0 E80C00 call D_P_Do_CAPS_Char ;AN000; Here a SBCS char need to be CAPS 0 000014E3 2E8804 mov [psdata_seg:si],al ;AN000; stored upper case char to buffer 0 000014E6 EB01 jmp short D_P_DCS01 ;AN000; process nexit 1101 <2> D_P_DCS00: ;AN000; 0 000014E8 46 inc si ;AN000; skip DBCS leading and trailing byte 1103 <2> D_P_DCS01: ;AN000; 0 000014E9 46 inc si ;AN000; si point to next byte 0 000014EA EBE8 jmp short D_P_DCS_Loop ;AN000; loop until NULL encountered 1106 <2> D_P_DCS_Exit: ;AN000; 0 000014EC 5A pop dx ;AN000; 0 000014ED 5E pop si ;AN000; 0 000014EE C3 ret ;AN000; 1110 <2> D_P_Do_CAPS_String endp ;AN000; 1111 <2> ;PAGE ;AN000; 1112 <2> ;*********************************************************************** 1113 <2> ; D_P_Do_CAPS_Char; 1114 <2> ; 1115 <2> ; Function: Perform capitalization along with the file case map table 1116 <2> ; or character case map table. 1117 <2> ; 1118 <2> ; Input: DL = 2 : Use character table 1119 <2> ; DL = 4 : Use file table 1120 <2> ; AL = character to be capitalized 1121 <2> ; 1122 <2> ; Output: None 1123 <2> ; 1124 <2> ; Use: INT 21h /w AH=65h 1125 <2> ;*********************************************************************** 1126 <2> D_P_Do_CAPS_Char proc ;AN000; 0 000014EF 3C80 cmp al,D_P_ASCII80 ;AN000; need upper case table ? 0 000014F1 730C jae D_P_DCC_Go ;AN000; 1129 <2> 0 000014F3 3C61 cmp al,"a" ;AN000; if no, 0 000014F5 7245 jb D_P_CAPS_Ret ;AN000; check if "a" <= AL <= "z" 1132 <2> 0 000014F7 3C7A cmp al,"z" ;AN000; 0 000014F9 7741 ja D_P_CAPS_Ret ;AN000; if yes, make CAPS 1135 <2> 0 000014FB 24DF and al,D_P_Make_Upper ;AN000; else do nothing. 0 000014FD EB3D jmp short D_P_CAPS_Ret ;AN000; 1138 <2> 1139 <2> D_P_DCC_Go: ;AN000; 0 000014FF 53 push bx ;AN000; 0 00001500 06 push es ;AN000; 0 00001501 57 push di ;AN000; 1143 <2> %IF CAPSW ;AN000;(Check if uppercase conversion is supported) 0 00001502 8D3E[9C00] lea di,[D_P_File_CAP_Ptr] ;AC034; 0 00001506 80FA04 cmp dl,D_P_DOSTBL_File ;AN000; Use file CAPS table ? 0 00001509 7404 je D_P_DCC00 ;AN000; 1147 <2> 1148 <2> %ENDIF ;AN000;(of CAPSW) 0 0000150B 8D3E[9700] lea di,[D_P_Char_CAP_Ptr] ;AC034; or use char CAPS table ? 1150 <2> D_P_DCC00: ;AN000; 0 0000150F 2E3815 cmp [psdata_seg:di],dl ;AN000; already got table address ? 0 00001512 7417 je D_P_DCC01 ;AN000; if no, 1153 <2> 1154 <2> ;In this next section, ES will be used to pass a 5 byte workarea to INT 21h, 1155 <2> ; the GET COUNTYRY INFO call. This usage of ES is required by the function 1156 <2> ; call, regardless of what base register is currently be defined as PSDATA_SEG. 1157 <2> ;BASESW EQU 0 means that ES is the psdata_seg reg. 1158 <2> 1159 <2> %IFDEF BASESW ;AN037; If BASESW has been defined, and 1160 <2> %IFN BASESW ;AN037; If ES is psdata base 1161 <2> push PSDATA_SEG ;AN037; save current base reg 1162 <2> %ENDIF ;AN037; 1163 <2> %ENDIF ;AN037; 1164 <2> 0 00001514 50 push ax ;AN000; get CAPS table thru DOS call 0 00001515 51 push cx ;AN000; 0 00001516 52 push dx ;AN000; 1168 <2> 1169 <2> 0 00001517 0E push PSDATA_SEG ;AC036; pass current base seg into 1171 <2> ;(Note: this used to push CS. BUG... 0 00001518 07 pop es ;AN000; ES reg, required for 1173 <2> ;get extended country information 0 00001519 B465 mov ah,D_P_DOS_Get_TBL ;AN000; get extended CDI 0 0000151B 88D0 mov al,dl ;AN000; upper case table 0 0000151D BBFFFF mov bx,D_P_DOSTBL_Def ;AN000; get active CON 0 00001520 B90500 mov cx,D_P_DOSTBL_BL ;AN000; buffer length 0 00001523 BAFFFF mov dx,D_P_DOSTBL_Def ;AN000; get for default code page 1179 <2> ;DI already set to point to buffer 0 00001526 CD21 int 21h ;AN000; es:di point to buffer that 1181 <2> ;now has been filled in with info 0 00001528 5A pop dx ;AN000; 0 00001529 59 pop cx ;AN000; 0 0000152A 58 pop ax ;AN000; 1185 <2> %IFDEF BASESW ;AN037; If BASESW has been defined, and 1186 <2> %IFN BASESW ;AN037; If ES is psdata base 1187 <2> pop PSDATA_SEG ;AN037; restore current base reg 1188 <2> %ENDIF ;AN037; 1189 <2> %ENDIF ;AN037; 1190 <2> D_P_DCC01: ;AN000; 1191 <2> 1192 <2> ;In this next section, ES will be used as the base of the XLAT table, provided 1193 <2> ; by the previous GET COUNTRY INFO DOS call. This usage of ES is made 1194 <2> ; regardless of which base reg is currently the PSDATA_SEG reg. 1195 <2> 1196 <2> %IFDEF BASESW ;AN037; If BASESW has been defined, and 1197 <2> %IFN BASESW ;AN037; If ES is psdata base 1198 <2> push PSDATA_SEG ;AN037; save current base reg 1199 <2> %ENDIF ;AN037; 1200 <2> %ENDIF ;AN037; 0 0000152B 2E8B5D01 mov bx,[psdata_seg:di+D_P_DOS_TBL_Off] ;AN000; get offset of table 0 0000152F 2E8E4503 mov es,[psdata_seg:di+D_P_DOS_TBL_Seg] ;AN000; get segment of table 0 00001533 43 inc bx ;AC035; add '2' to 0 00001534 43 inc bx ;AC035; BX reg 1205 <2> ;AN000; skip length field 1206 <2> ;(changed ;AN035;) add bx,word ;AN000; skip length field 0 00001535 2C80 sub al,D_P_ASCII80 ;AN000; make char to index 0 00001537 26D7 es xlatb ;AN000; perform case map 1209 <2> 1210 <2> %IFDEF BASESW ;AN037; If BASESW has been defined, and 1211 <2> %IFN BASESW ;AN037; If ES is psdata base 1212 <2> pop PSDATA_SEG ;AN037; restore current base reg 1213 <2> %ENDIF ;AN037; 1214 <2> %ENDIF ;AN037; 0 00001539 5F pop di ;AN000; 0 0000153A 07 pop es ;AN000; 0 0000153B 5B pop bx ;AN000; 1218 <2> D_P_CAPS_Ret: ;AN000; 0 0000153C C3 ret ;AN000; 1220 <2> D_P_Do_CAPS_Char endp ;AN000; 1221 <2> ;PAGE ;AN000; 1222 <2> ;*********************************************************************** 1223 <2> %IF NumSW ;AN000;(Check if numeric value is supported) 1224 <2> ; D_P_Value / D_P_SValue 1225 <2> ; 1226 <2> ; Function: Make 32bit value from psdata_seg:SI and see value list 1227 <2> ; and make result buffer. 1228 <2> ; D_P_SValue is an entry point for the signed value 1229 <2> ; and this will simply call D_P_Value after the handling 1230 <2> ; of the sign character, "+" or "-" 1231 <2> ; 1232 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 1233 <2> ; ES:BX -> CONTROL block 1234 <2> ; 1235 <2> ; Output: None 1236 <2> ; 1237 <2> ; Use: D_P_Fill_Result, D_P_Check_OVF 1238 <2> ; 1239 <2> ; Vars: D_P_RC(W), D_P_Flags(RW) 1240 <2> ;*********************************************************************** 1241 <2> D_P_SValue proc ;AN000; when signed value here 0 0000153D 50 push ax ;AN000; 0 0000153E 2E800E[0E00]80 or byte [psdata_seg:D_P_Flags2],D_P_Signed ;AC034; indicate a signed numeric 0 00001544 2E8026[0E00]FD and byte [psdata_seg:D_P_Flags2],0ffh-D_P_Neg ;AC034; assume positive value 0 0000154A 2E8A04 mov al,[psdata_seg:si] ;AN000; get sign 0 0000154D 3C2B cmp al,D_P_Plus ;AN000; "+" ? 0 0000154F 740A je D_P_SVal00 ;AN000; 1248 <2> 0 00001551 3C2D cmp al,D_P_Minus ;AN000; "-" ? 0 00001553 7507 jne D_P_Sval01 ;AN000; else 1251 <2> 0 00001555 2E800E[0E00]02 or byte [psdata_seg:D_P_Flags2],D_P_Neg ;AC034; set this is negative value 1253 <2> D_P_SVal00: ;AN000; 0 0000155B 46 inc si ;AN000; skip sign char 1255 <2> D_P_Sval01: ;AN000; 0 0000155C E80200 call D_P_Value ;AN000; and process value 0 0000155F 58 pop ax ;AN000; 0 00001560 C3 ret ;AN000; 1259 <2> D_P_SValue endp ;AN000; 1260 <2> ;*********************************************************************** 1261 <2> D_P_Value proc ;AN000; 0 00001561 50 push ax ;AN000; 0 00001562 51 push cx ;AN000; 0 00001563 52 push dx ;AN000; 0 00001564 56 push si ;AN000; 0 00001565 31C9 xor cx,cx ;AN000; cx = higher 16 bits 0 00001567 31D2 xor dx,dx ;AN000; dx = lower 16 bits 0 00001569 53 push bx ;AN000; save control pointer 1269 <2> D_P_Value_Loop: ;AN000; 0 0000156A 2E8A04 mov al,[psdata_seg:si] ;AN000; get character 0 0000156D 08C0 or al,al ;AN000; end of line ? 0 0000156F 7442 je D_P_Value00 ;AN000; 1273 <2> 0 00001571 E8F100 call D_P_0099 ;AN000; make asc(0..9) to bin(0..9) 0 00001574 7239 jc D_P_Value_Err0 ;AN000; 1276 <2> 0 00001576 30E4 xor ah,ah ;AN000; 0 00001578 89C5 mov bp,ax ;AN000; save binary number 0 0000157A D1E2 shl dx,1 ;AN000; to have 2*x 0 0000157C D1D1 rcl cx,1 ;AN000; shift left w/ carry 0 0000157E E8D200 call D_P_Check_OVF ;AN000; Overflow occurred ? 0 00001581 722C jc D_P_Value_Err0 ;AN000; then error, exit 1283 <2> 0 00001583 89D3 mov bx,dx ;AN000; save low(2*x) 0 00001585 89C8 mov ax,cx ;AN000; save high(2*x) 0 00001587 D1E2 shl dx,1 ;AN000; to have 4*x 0 00001589 D1D1 rcl cx,1 ;AN000; shift left w/ carry 0 0000158B E8C500 call D_P_Check_OVF ;AN000; Overflow occurred ? 0 0000158E 721F jc D_P_Value_Err0 ;AN000; then error, exit 1290 <2> 0 00001590 D1E2 shl dx,1 ;AN000; to have 8*x 0 00001592 D1D1 rcl cx,1 ;AN000; shift left w/ carry 0 00001594 E8BC00 call D_P_Check_OVF ;AN000; Overflow occurred ? 0 00001597 7216 jc D_P_Value_Err0 ;AN000; then error, exit 1295 <2> 0 00001599 01DA add dx,bx ;AN000; now have 10*x 0 0000159B 11C1 adc cx,ax ;AN000; 32bit ADD 0 0000159D E8B300 call D_P_Check_OVF ;AN000; Overflow occurred ? 0 000015A0 720D jc D_P_Value_Err0 ;AN000; then error, exit 1300 <2> 0 000015A2 01EA add dx,bp ;AN000; Add the current one degree decimal 0 000015A4 83D100 adc cx,0 ;AN000; if carry, add 1 to high 16bit 0 000015A7 E8A900 call D_P_Check_OVF ;AN000; Overflow occurred ? 0 000015AA 7203 jc D_P_Value_Err0 ;AN000; then error, exit 1305 <2> 0 000015AC 46 inc si ;AN000; update pointer 0 000015AD EBBB jmp short D_P_Value_Loop ;AN000; loop until NULL encountered 1308 <2> ; 1309 <2> D_P_Value_Err0: ;AN000; 0 000015AF 5B pop bx ;AN000; 0 000015B0 E98D00 jmp D_P_Value_Err ;AN000; Bridge 1312 <2> ; 1313 <2> D_P_Value00: ;AN000; 0 000015B3 5B pop bx ;AN000; restore control pointer 0 000015B4 2EF606[0E00]02 test byte [psdata_seg:D_P_Flags2],D_P_Neg ;AC034; here cx,dx = 32bit value 0 000015BA 740A je D_P_Value01 ;AN000; was it negative ? 1317 <2> 0 000015BC F7D1 not cx ;AN000; + 0 000015BE F7D2 not dx ;AN000; |- Make 2's complement 0 000015C0 83C201 add dx,1 ;AN000; | 0 000015C3 83D100 adc cx,0 ;AN000; + 1322 <2> D_P_Value01: ;AN000; / nval =0 0 000015C6 268B7706 mov si,[es:bx + D_P_Value_List] ;AN000; si points to value list 0 000015CA 268A04 mov al,[es:si] ;AN000; get nval 0 000015CD 3C00 cmp al,D_P_nval_None ;AN000; no value list ? 0 000015CF 7507 jne D_P_Value02 ;AN000; 1327 <2> 0 000015D1 B001 mov al,D_P_Number ;AN000; Set type 0 000015D3 B4FF mov ah,D_P_No_Tag ;AN000; No ITEM_TAG set 0 000015D5 EB74 jmp D_P_Value_Exit ;AN000; 0 000015D7 90 nop ; identicalise 1332 <2> 1333 <2> D_P_Value02: ;AN000; / nval = 1 1334 <2> %IF Val1SW ;AN000;(Check if value list id #1 is supported) 1335 <2> ;(tm07) cmp al,D_P_nval_Range ;AN000; have range list ? 1336 <2> ;(tm07) jne D_P_Value03 ;AN000; 1337 <2> 0 000015D8 46 inc si ;AN000; 0 000015D9 268A04 mov al,[es:si] ;AN000; al = number of range 0 000015DC 3C00 cmp al,D_P_No_nrng ;AN000; (tm07) 0 000015DE 7460 je D_P_Value03 ;AN000; (tm07) 1342 <2> 0 000015E0 46 inc si ;AN000; si points to 1st item_tag 1344 <2> D_P_Val02_Loop: ;AN000; 0 000015E1 2EF606[0E00]80 test byte [psdata_seg:D_P_Flags2],D_P_Signed ;AC034; 0 000015E7 751E jne D_P_Val02_Sign ;AN000; 1347 <2> 0 000015E9 263B4C03 cmp cx,[es:si+D_P_Val_XH] ;AN000; comp cx with XH 0 000015ED 7236 jb D_P_Val02_Next ;AN000; 1350 <2> 0 000015EF 7706 ja D_P_Val_In ;AN000; 1352 <2> 0 000015F1 263B5401 cmp dx,[es:si+D_P_Val_XL] ;AN000; comp dx with XL 0 000015F5 722E jb D_P_Val02_Next ;AN000; 1355 <2> 1356 <2> D_P_Val_In: ;AN000; 1357 <2> ;;;;;; cmp cx,es:D_P_Val_YH] ; comp cx with YH (tm01) 0 000015F7 263B4C07 cmp cx,[es:si+D_P_Val_YH] ;AN000; comp cx with YH (tm01) 0 000015FB 7728 ja D_P_Val02_Next ;AN000; 1360 <2> 0 000015FD 723A jb D_P_Val_Found ;AN000; 1362 <2> 0 000015FF 263B5405 cmp dx,[es:si+D_P_Val_YL] ;AN000; comp dx with YL 0 00001603 7720 ja D_P_Val02_Next ;AN000; 1365 <2> 0 00001605 EB32 jmp short D_P_Val_Found ;AN000; 1367 <2> 1368 <2> D_P_Val02_Sign: ;AN000; 0 00001607 263B4C03 cmp cx,[es:si+D_P_Val_XH] ;AN000; comp cx with XH 0 0000160B 7C18 jl D_P_Val02_Next ;AN000; 1371 <2> 0 0000160D 7F06 jg D_P_SVal_In ;AN000; 1373 <2> 0 0000160F 263B5401 cmp dx,[es:si+D_P_Val_XL] ;AN000; comp dx with XL 0 00001613 7C10 jl D_P_Val02_Next ;AN000; 1376 <2> 1377 <2> D_P_SVal_In: ;AN000; 0 00001615 263B4C07 cmp cx,[es:si+D_P_Val_YH] ;AN000; comp cx with YH 0 00001619 7F0A jg D_P_Val02_Next ;AN000; 1380 <2> 0 0000161B 7C1C jl D_P_Val_Found ;AN000; 1382 <2> 0 0000161D 263B5405 cmp dx,[es:si+D_P_Val_YL] ;AN000; comp dx with YL 0 00001621 7F02 jg D_P_Val02_Next ;AN000; 1385 <2> 0 00001623 EB14 jmp short D_P_Val_Found ;AN000; 1387 <2> 1388 <2> D_P_Val02_Next: ;AN000; 0 00001625 83C609 add si,D_P_Len_Range ;AN000; 0 00001628 FEC8 dec al ;AN000; loop nrng times in AL 0 0000162A 75B5 jne D_P_Val02_Loop ;AN000; 1392 <2> ; / Not found 1393 <2> D_P_Out_of_Range equ D_P_Out_Of_Range ; NASM port equate 0 0000162C 2EC706[0200]0600 mov word [psdata_seg:D_P_RC],D_P_Out_of_Range ;AC034; 0 00001633 B001 mov al,D_P_Number ;AN000; 0 00001635 B4FF mov ah,D_P_No_Tag ;AN000; No ITEM_TAG set 0 00001637 EB12 jmp short D_P_Value_Exit ;AN000; 1398 <2> 1399 <2> %ENDIF ;AN000;(of Val1SW) 1400 <2> %IF Val1SW+Val2SW ;AN000;(Check if value list id #1 or #2 is supported) 1401 <2> D_P_Val_Found: ;AN000; 0 00001639 B001 mov al,D_P_Number ;AN000; 0 0000163B 268A24 mov ah,[es:si] ;AN000; found ITEM_TAG set 0 0000163E EB0B jmp short D_P_Value_Exit ;AN000; 1405 <2> 1406 <2> %ENDIF ;AN000;(of Val1SW+Val2SW) 1407 <2> D_P_Value03: ;AN000; / nval = 2 1408 <2> %IF Val2SW ;AN000;(Check if value list id #2 is supported) 1409 <2> ;;;; cmp al,D_P_nval_Value ; have match list ? ASSUME nval=2, 1410 <2> ;;;; jne D_P_Value04 ; even if it is 3 or more. 1411 <2> ;(tm07) inc si ;AN000; 1412 <2> ;(tm07) mov al,[es:si] ;AN000; al = nrng 1413 <2> mov ah,D_P_Len_Range ;AN000; 1414 <2> mul ah ;AN000; Skip nrng field 1415 <2> inc ax ;AN000; 1416 <2> add si,ax ;AN000; si points to nnval 1417 <2> mov al,[es:si] ;AN000; get nnval 1418 <2> inc si ;AN000; si points to 1st item_tag 1419 <2> D_P_Val03_Loop: ;AN000; 1420 <2> cmp cx,[es:si+D_P_Val_XH] ;AN000; comp cx with XH 1421 <2> jne D_P_Val03_Next ;AN000; 1422 <2> 1423 <2> cmp dx,[es:si+D_P_Val_XL] ;AN000; comp dx with XL 1424 <2> je D_P_Val_Found ;AN000; 1425 <2> 1426 <2> D_P_Val03_Next: ;AN000; 1427 <2> add si,D_P_Len_Value ;AN000; points to next value choice 1428 <2> dec al ;AN000; loop nval times in AL 1429 <2> jne D_P_Val03_Loop ;AN000; 1430 <2> ;AN000; / Not found 1431 <2> D_P_Not_in_Val equ D_P_Not_In_Val ; NASM port equate 1432 <2> mov word [psdata_seg:D_P_RC],D_P_Not_in_Val ;AC034; 1433 <2> mov al,D_P_Number ;AN000; 1434 <2> mov ah,D_P_No_Tag ;AN000; No ITEM_TAG set 1435 <2> jmp short D_P_Value_Exit ;AN000; 1436 <2> 1437 <2> %ENDIF ;AN000;(of Val2SW) 1438 <2> D_P_Value04: ;AN000; / nval = 3 or else 1439 <2> D_P_Value_Err: ;AN000; 0 00001640 2EC706[0200]0900 mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; 0 00001647 B003 mov al,D_P_String ;AN000; Set type 0 00001649 B4FF mov ah,D_P_No_Tag ;AN000; No ITEM_TAG set 1443 <2> D_P_Value_Exit: ;AN000; 0 0000164B E80EFD call D_P_Fill_Result ;AN000; 0 0000164E 5E pop si ;AN000; 0 0000164F 5A pop dx ;AN000; 0 00001650 59 pop cx ;AN000; 0 00001651 58 pop ax ;AN000; 0 00001652 C3 ret ;AN000; 1450 <2> D_P_Value endp ;AN000; 1451 <2> ;PAGE ;AN000; 1452 <2> ;*********************************************************************** 1453 <2> ; D_P_Check_OVF 1454 <2> ; 1455 <2> ; Function: Check if overflow is occurred with consideration of 1456 <2> ; signed or un-signed numeric value 1457 <2> ; 1458 <2> ; Input: Flag register 1459 <2> ; 1460 <2> ; Output: CY = 1 : Overflow 1461 <2> ; 1462 <2> ; Vars: D_P_Flags(R) 1463 <2> ;*********************************************************************** 1464 <2> D_P_Check_OVF proc ;AN000; 0 00001653 9C pushf ;AN000; 0 00001654 2EF606[0E00]02 test byte [psdata_seg:D_P_Flags2],D_P_Neg ;AC034; is it negative value ? 0 0000165A 7502 jne D_P_COVF ;AN000; if no, check overflow 1468 <2> 0 0000165C 9D popf ;AN000; by the CY bit 0 0000165D C3 ret ;AN000; 1471 <2> 1472 <2> D_P_COVF: ;AN000; 0 0000165E 9D popf ;AN000; else, 0 0000165F 7002 jo D_P_COVF00 ;AN000; check overflow by the OF 1475 <2> 0 00001661 F8 clc ;AN000; indicate it with CY bit 0 00001662 C3 ret ;AN000; CY=0 means no overflow 1478 <2> 1479 <2> D_P_COVF00: ;AN000; 0 00001663 F9 stc ;AN000; and CY=1 means overflow 0 00001664 C3 ret ;AN000; 1482 <2> D_P_Check_OVF endp ;AN000; 1483 <2> %ENDIF ;AN000;(of FarSW) 1484 <2> ;*********************************************************************** 1485 <2> ; D_P_0099; 1486 <2> ; 1487 <2> ; Function: Make ASCII 0-9 to Binary 0-9 1488 <2> ; 1489 <2> ; Input: AL = character code 1490 <2> ; 1491 <2> ; Output: CY = 1 : AL is not number 1492 <2> ; CY = 0 : AL contains binary value 1493 <2> ;*********************************************************************** 1494 <2> D_P_0099 proc ;AN000; 0 00001665 3C30 cmp al,"0" ;AN000; 0 00001667 7208 jb D_P_0099Err ;AN000; must be 0 =< al =< 9 1497 <2> 0 00001669 3C39 cmp al,"9" ;AN000; 0 0000166B 7704 ja D_P_0099Err ;AN000; must be 0 =< al =< 9 1500 <2> 0 0000166D 2C30 sub al,"0" ;AN000; make char -> bin 0 0000166F F8 clc ;AN000; indicate no error 0 00001670 C3 ret ;AN000; 1504 <2> 1505 <2> D_P_0099Err: ;AN000; 0 00001671 F9 stc ;AN000; indicate error 0 00001672 C3 ret ;AN000; 1508 <2> D_P_0099 endp ;AN000; 1509 <2> ;PAGE ;AN000; 1510 <2> ;*********************************************************************** 1511 <2> ; D_P_Simple_String 1512 <2> ; 1513 <2> ; Function: See value list for the simple string 1514 <2> ; and make result buffer. 1515 <2> ; 1516 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 1517 <2> ; ES:BX -> CONTROL block 1518 <2> ; 1519 <2> ; Output: None 1520 <2> ; 1521 <2> ; Use: D_P_Fill_Result, D_P_String_Comp 1522 <2> ; 1523 <2> ; Vars: D_P_RC(W) 1524 <2> ;*********************************************************************** 1525 <2> D_P_Simple_String proc ;AN000; 0 00001673 50 push ax ;AN000; 0 00001674 53 push bx ;AN000; 0 00001675 52 push dx ;AN000; 0 00001676 57 push di ;AN000; 0 00001677 268B7F06 mov di,[es:bx + D_P_Value_List] ;AN000; di points to value list 0 0000167B 268A05 mov al,[es:di] ;AN000; get nval 0 0000167E 08C0 or al,al ;AN000; no value list ? 0 00001680 7504 jne D_P_Sim00 ;AN000; then 1534 <2> 0 00001682 B4FF mov ah,D_P_No_Tag ;AN000; No ITEM_TAG set 0 00001684 EB4C jmp short D_P_Sim_Exit ;AN000; and set result buffer 1537 <2> 1538 <2> D_P_Sim00: ;AN000; 1539 <2> %IF Val3SW+KeySW ;AN000;(Check if keyword or value list id #3 is supported) 0 00001686 3C03 cmp al,D_P_nval_String ;AN000; String choice list provided ? 0 00001688 753F jne D_P_Sim01 ;AN000; if no, syntax error 1542 <2> 0 0000168A 47 inc di ;AN000; 0 0000168B 268A05 mov al,[es:di] ;AN000; al = nrng 0 0000168E B409 mov ah,D_P_Len_Range ;AN000; 0 00001690 F6E4 mul ah ;AN000; Skip nrng field 0 00001692 40 inc ax ;AN000; ax = (nrng*9)+1 0 00001693 01C7 add di,ax ;AN000; di points to nnval 0 00001695 268A05 mov al,[es:di] ;AN000; get nnval 0 00001698 B405 mov ah,D_P_Len_Value ;AN000; 0 0000169A F6E4 mul ah ;AN000; Skip nnval field 0 0000169C 40 inc ax ;AN000; ax = (nnval*5)+1 0 0000169D 01C7 add di,ax ;AN000; di points to nstrval 0 0000169F 268A05 mov al,[es:di] ;AN000; get nstrval 0 000016A2 47 inc di ;AC035; add '2' to 0 000016A3 47 inc di ;AC035; DI reg 1557 <2> ;AN000; di points to 1st string in list 1558 <2> ;(replaced ;AC035;) add di,2 ;AN000; di points to 1st string in list 1559 <2> D_P_Sim_Loop: ;AN000; 0 000016A4 268B2D mov bp,[es:di] ;AN000; get string pointer 0 000016A7 E83200 call D_P_String_Comp ;AN000; compare it with operand 0 000016AA 7312 jnc D_P_Sim_Found ;AN000; found on list ? 1563 <2> 0 000016AC 83C703 add di,D_P_Len_String ;AN000; if no, point to next choice 0 000016AF FEC8 dec al ;AN000; loop nstval times in AL 0 000016B1 75F1 jne D_P_Sim_Loop ;AN000; 1567 <2> ;AN000; / Not found 0 000016B3 2EC706[0200]0800 mov word [psdata_seg:D_P_RC],D_P_Not_In_Str ;AC034; 0 000016BA B4FF mov ah,D_P_No_Tag ;AN000; No ITEM_TAG set 0 000016BC EB14 jmp short D_P_Sim_Exit ;AN000; 1571 <2> 1572 <2> D_P_Sim_Found: ;AN000; 0 000016BE 268A65FF mov ah,[es:di-1] ;AN000; set item_tag 0 000016C2 B002 mov al,D_P_List_Idx ;AN000; 0 000016C4 268B15 mov dx,[es:di] ;AN000; get address of STRING 0 000016C7 EB0B jmp short D_P_Sim_Exit0 ;AN000; 1577 <2> %ENDIF ;AN000;(of Val3SW+KeySW) 1578 <2> D_P_Sim01: ;AN000; 0 000016C9 2EC706[0200]0900 mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; 0 000016D0 B4FF mov ah,D_P_No_Tag ;AN000; No ITEM_TAG set 1581 <2> D_P_Sim_Exit: ;AN000; 0 000016D2 B003 mov al,D_P_String ;AN000; Set type 1583 <2> D_P_Sim_Exit0: ;AN000; 0 000016D4 E885FC call D_P_Fill_Result ;AN000; 0 000016D7 5F pop di ;AN000; 0 000016D8 5A pop dx ;AN000; 0 000016D9 5B pop bx ;AN000; 0 000016DA 58 pop ax ;AN000; 0 000016DB C3 ret ;AN000; 1590 <2> D_P_Simple_String endp ;AN000; 1591 <2> ;PAGE ;AN000; 1592 <2> ;*********************************************************************** 1593 <2> ; D_P_String_Comp: 1594 <2> ; 1595 <2> ; Function: Compare two string 1596 <2> ; 1597 <2> ; Input: psdata_seg:SI -> 1st string 1598 <2> ; ES:BP -> 2nd string (Must be upper case) 1599 <2> ; ES:BX -> CONTROL block 1600 <2> ; 1601 <2> ; Output: CY = 1 if not match 1602 <2> ; 1603 <2> ; Use: D_P_Chk_DBCS, D_P_Do_CAPS_Char 1604 <2> ; 1605 <2> ; Vars: D_P_KEYor_SW_Ptr(W), D_P_Flags(R). D_P_KEYorSW_Ptr 1606 <2> ;*********************************************************************** 1607 <2> D_P_String_Comp proc ;AN000; 0 000016DC 50 push ax ;AN000; 0 000016DD 55 push bp ;AN000; 0 000016DE 52 push dx ;AN000; 0 000016DF 56 push si ;AN000; 0 000016E0 B202 mov dl,D_P_DOSTBL_Char ;AN000; use character case map table 1613 <2> D_P_SCOM_Loop: ;AN000; 0 000016E2 2E8A04 mov al,[psdata_seg:si] ;AN000; get command character 0 000016E5 E8B302 call D_P_Chk_DBCS ;AN000; DBCS ? 0 000016E8 723C jc D_P_SCOM00 ;AN000; yes,DBCS 1617 <2> 0 000016EA E802FE call D_P_Do_CAPS_Char ;AN000; else, upper case map before comparison 1619 <2> %IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported) 0 000016ED 2EF606[0E00]08 test byte [psdata_seg:D_P_Flags2],D_P_Key_Cmp ;AC034; keyword search ? 0 000016F3 740D je D_P_SCOM04 ;AN000; 1622 <2> 0 000016F5 3C3D cmp al,D_P_Keyword ;AN000; "=" is delimiter 0 000016F7 751F jne D_P_SCOM03 ;AN000;IF "=" on command line AND (bp+1=> char after the "=" in synonym list) 1625 <2> 0 000016F9 26807E0100 cmp byte ptr [es:bp+1],D_P_NULL ;AN021; at end of keyword string in the control block THEN 1627 <2> D_P_SCOM_DIFFER equ D_P_SCOM_Differ ; NASM port label 0 000016FE 7571 jne D_P_SCOM_DIFFER ;AN021; 1629 <2> 0 00001700 EB13 jmp short D_P_SCOM05 ;AN000; keyword found in synonym list 1631 <2> 1632 <2> D_P_SCOM04: ;AN000; 0 00001702 2EF606[0E00]10 test byte [psdata_seg:D_P_Flags2],D_P_SW_Cmp ;AC034; switch search ? 0 00001708 740E je D_P_SCOM03 ;AN000; 1635 <2> 0 0000170A 3C3A cmp al,D_P_Colon ;AN000; ":" is delimiter, at end of switch on command line 0 0000170C 750A jne D_P_SCOM03 ;AN000; continue compares 1638 <2> 0 0000170E 26807E0000 cmp byte ptr [es:bp],D_P_NULL ;AN021; IF at end of switch on command AND 0 00001713 755C jne D_P_SCOM_DIFFER ;AN021; at end of switch string in the control block THEN 1641 <2> 1642 <2> D_P_SCOM05: ;AN000; found a match 0 00001715 46 inc si ;AN000; si points to just after "=" or ":" 0 00001716 EB5C jmp short D_P_SCOM_Same ;AN000; exit 1645 <2> 1646 <2> D_P_SCOM03: ;AN000; 1647 <2> %ENDIF ;AN000;(of KeySW+SwSW) 0 00001718 263A4600 cmp al,[es:bp] ;AN000; compare operand w/ a synonym 0 0000171C 751D jne D_P_SCOM_Differ0 ;AN000; if different, check ignore colon option 1650 <2> 0 0000171E 08C0 or al,al ;AN000; end of line 0 00001720 7452 je D_P_SCOM_Same ;AN000; if so, exit 1653 <2> 0 00001722 46 inc si ;AN000; update operand pointer 0 00001723 45 inc bp ;AN000; and synonym pointer 0 00001724 EB13 jmp short D_P_SCOM01 ;AN000; loop until NULL or "=" or ":" found in case 1657 <2> 1658 <2> D_P_SCOM00: ;AN000; Here al is DBCS leading byte 0 00001726 263A4600 cmp al,[es:bp] ;AN000; compare leading byte 0 0000172A 7545 jne D_P_SCOM_Differ ;AN000; if not match, say different 1661 <2> 0 0000172C 46 inc si ;AN000; else, load next byte 0 0000172D 2E8A04 mov al,[psdata_seg:si] ;AN000; and 0 00001730 45 inc bp ;AN000; 0 00001731 263A4600 cmp al,[es:bp] ;AN000; compare 2nd byte 0 00001735 753A jne D_P_SCOM_Differ ;AN000; if not match, say different, too 1667 <2> 0 00001737 46 inc si ;AN000; else update operand pointer 0 00001738 45 inc bp ;AN000; and synonym pointer 1670 <2> D_P_SCOM01: ;AN000; 0 00001739 EBA7 jmp short D_P_SCOM_Loop ;AN000; loop until NULL or "=" or "/" found in case 1672 <2> 1673 <2> D_P_SCOM_Differ0: ;AN000; 1674 <2> 1675 <2> %IF SwSW ;AN000;(tm10) 0 0000173B 2EF606[0E00]40 test byte [psdata_seg:D_P_Flags2],D_P_SW ;AC034;(tm10) 0 00001741 740F je D_P_not_applicable ;AN000;(tm10) 1678 <2> 0 00001743 26F747022000 test word [es:bx + D_P_Function_Flag],D_P_colon_is_not_necessary ;AN000;(tm10) 0 00001749 7407 je D_P_not_applicable ;AN000;(tm10) 1681 <2> 0 0000174B 26807E0000 cmp byte ptr [es:bp],D_P_NULL ;AN000;(tm10) 1683 <2> ;(deleted ;AN025;) jne D_P_not_applicable ;AN000;(tm10) 0 00001750 7422 je D_P_SCOM_Same ;AN025;(tm10) 1685 <2> 1686 <2> D_P_not_applicable: ;AN000;(tm10) 1687 <2> %ENDIF ;AN000;(tm10) 1688 <2> 0 00001752 26F7071000 test word [es:bx + D_P_Match_Flag],D_P_Ig_Colon ;AN000; ignore colon option specified ? 0 00001757 7418 je D_P_SCOM_Differ ;AN000; if no, say different. 1691 <2> 0 00001759 3C3A cmp al,D_P_Colon ;AN000; End up with ":" and 0 0000175B 7509 jne D_P_SCOM02 ;AN000; subseqently 1694 <2> 0 0000175D 26807E0000 cmp byte ptr [es:bp],D_P_NULL ;AN000; NULL ? 0 00001762 750D jne D_P_SCOM_Differ ;AN000; if no, say different 1697 <2> 0 00001764 EB0E jmp short D_P_SCOM_Same ;AN000; else, say same 1699 <2> 1700 <2> D_P_SCOM02: ;AN000; 0 00001766 3C00 cmp al,D_P_NULL ;AN000; end up NULL and : 0 00001768 7507 jne D_P_SCOM_Differ ;AN000; 1703 <2> 0 0000176A 26807E003A cmp byte ptr [es:bp],D_P_Colon ;AN000; if no, say different 0 0000176F 7403 je D_P_SCOM_Same ;AN000; else, say same 1706 <2> 1707 <2> D_P_SCOM_Differ: ;AN000; 0 00001771 F9 stc ;AN000; indicate not found 0 00001772 EB06 jmp short D_P_SCOM_Exit ;AN000; 1710 <2> 1711 <2> D_P_SCOM_Same: ;AN000; 0 00001774 2E8936[1100] mov [psdata_seg:D_P_KEYorSW_Ptr],si ;AC034; for later use by keyword or switch 0 00001779 F8 clc ;AN000; indicate found 1714 <2> D_P_SCOM_Exit: ;AN000; 0 0000177A 5E pop si ;AN000; 0 0000177B 5A pop dx ;AN000; 0 0000177C 5D pop bp ;AN000; 0 0000177D 58 pop ax ;AN000; 0 0000177E C3 ret ;AN000; 1720 <2> D_P_String_Comp endp ;AN000; 1721 <2> ;PAGE ;AN000; 1722 <2> ;*********************************************************************** 1723 <2> %IF DateSW ;AN000;(Check if date format is supported) 1724 <2> ; D_P_Date_Format 1725 <2> ; 1726 <2> ; Function: Convert a date string to DOS date format for int 21h 1727 <2> ; with format validation. 1728 <2> ; 1729 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 1730 <2> ; ES:BX -> CONTROL block 1731 <2> ; 1732 <2> ; Output: None 1733 <2> ; 1734 <2> ; Use: D_P_Fill_Result, D_P_Set_CDI, D_P_Get_DecNum 1735 <2> ; 1736 <2> ; Vars: D_P_RC(W), D_P_1st_Val(RW), D_P_2nd_Val(RW), D_P_3rd_Val(RW) 1737 <2> ;*********************************************************************** 1738 <2> D_P_Date_Format proc ;AN000; 1739 <2> push ax ;AN000; 1740 <2> push cx ;AN000; 1741 <2> push dx ;AN000; 1742 <2> push si ;AN000; 1743 <2> push bx ;AN000; 1744 <2> push si ;AN000; 1745 <2> call D_P_Set_CDI ;AN000; set country dependent information before process 1746 <2> ; mov bl,[psdata_seg:si].D_P_CDI_DateS ;load date separator ;AN020; (deleted) 1747 <2> ; note: the country info is still needed 1748 <2> ; to determine the order of the fields, 1749 <2> ; but the separator char is no longer used. 1750 <2> pop si ;AN000; 1751 <2> mov word [psdata_seg:D_P_1st_Val],0 ;AC034; set initial value 1752 <2> mov word [psdata_seg:D_P_2nd_Val],0 ;AC034; set initial value 1753 <2> mov word [psdata_seg:D_P_3rd_Val],0 ;AC034; set initial value 1754 <2> call D_P_Get_DecNum ;AN000; get 1st number 1755 <2> jc D_P_DateF_Err0 ;AN000;-----------------------+ 1756 <2> 1757 <2> mov [psdata_seg:D_P_1st_Val],ax ;AC034; | 1758 <2> or bl,bl ;AN000; end of line ? | 1759 <2> je D_P_DateF_YMD ;AN000; | 1760 <2> 1761 <2> call D_P_Get_DecNum ;AN000; get 2nd number | 1762 <2> jc D_P_DateF_Error ;AN000; | 1763 <2> 1764 <2> mov [psdata_seg:D_P_2nd_Val],ax ;AC034; | 1765 <2> or bl,bl ;AN000; end of line ? | 1766 <2> je D_P_DateF_YMD ;AN000; | 1767 <2> 1768 <2> call D_P_Get_DecNum ;AN000; get 3rd number | 1769 <2> D_P_DateF_Err0: ;AN000; Bridge <-----------+ 1770 <2> jc D_P_DateF_Error ;AN000; 1771 <2> 1772 <2> mov [psdata_seg:D_P_3rd_Val],ax ;AC034; 1773 <2> or bl,bl ;AN000; end of line ? 1774 <2> jne D_P_DateF_Error ;AN000; 1775 <2> 1776 <2> D_P_DateF_YMD: ;AN000; 1777 <2> D_P_Country_Info equ D_P_COUNTRY_INFO ; NASM port label 1778 <2> mov bx,[psdata_seg:D_P_Country_Info + D_P_CDI_DateF] ;AC034; get date format 1779 <2> cmp bx,D_P_Date_YMD ;AN000; 1780 <2> je D_P_DateF00 ;AN000; 1781 <2> 1782 <2> mov ax,[psdata_seg:D_P_1st_Val] ;AC034; 1783 <2> or ah,ah ;AN000; 1784 <2> jne D_P_DateF_Error ;AN000; 1785 <2> 1786 <2> mov cl,al ;AN000; set month 1787 <2> mov ax,[psdata_seg:D_P_2nd_Val] ;AC034; 1788 <2> or ah,ah ;AN000; if overflow, error. 1789 <2> jne D_P_DateF_Error ;AN000; 1790 <2> 1791 <2> mov ch,al ;AN000; set date 1792 <2> mov dx,[psdata_seg:D_P_3rd_Val] ;AC034; set year 1793 <2> cmp bx,D_P_Date_DMY ;AN000; from here format = MDY 1794 <2> jne D_P_DateF01 ;AN000; if it is DMY 1795 <2> 1796 <2> xchg ch,cl ;AN000; then swap M <-> D 1797 <2> D_P_DateF01: ;AN000; 1798 <2> jmp short D_P_DateF02 ;AN000; 1799 <2> 1800 <2> D_P_DateF00: ;AN000; / here format = YMD 1801 <2> mov dx,[psdata_seg:D_P_1st_Val] ;AC034; set year 1802 <2> mov ax,[psdata_seg:D_P_2nd_Val] ;AC034; 1803 <2> or ah,ah ;AN000; if overflow, error 1804 <2> jne D_P_DateF_Error ;AN000; 1805 <2> 1806 <2> mov cl,al ;AN000; set month 1807 <2> mov ax,[psdata_seg:D_P_3rd_Val] ;AC034; 1808 <2> or ah,ah ;AN000; if overflow, error 1809 <2> jne D_P_DateF_Error ;AN000; 1810 <2> 1811 <2> mov ch,al ;AN000; set date 1812 <2> D_P_DateF02: ;AN000; 1813 <2> cmp dx,100 ;AN000; year is less that 100 ? 1814 <2> jae D_P_DateF03 ;AN000; 1815 <2> 1816 <2> add dx,1900 ;AN000; set year 19xx 1817 <2> D_P_DateF03: ;AN000; 1818 <2> pop bx ;AN000; recover CONTROL block 1819 <2> pop si ;AN000; recover string pointer 1820 <2> mov ah,D_P_No_Tag ;AN000; set 1821 <2> mov al,D_P_Date_F ;AN000; result 1822 <2> call D_P_Fill_Result ;AN000; buffer 1823 <2> jmp short D_P_Date_Format_Exit ;AN000; to Date 1824 <2> 1825 <2> D_P_DateF_Error: ;AN000; 1826 <2> pop bx ;AN000; recover CONTROL block 1827 <2> pop si ;AN000; recover string pointer 1828 <2> mov ah,D_P_No_Tag ;AN000; set 1829 <2> mov al,D_P_String ;AN000; result 1830 <2> call D_P_Fill_Result ;AN000; buffer to string 1831 <2> mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; indicate syntax error 1832 <2> D_P_Date_Format_Exit: ;AN000; 1833 <2> pop dx ;AN000; 1834 <2> pop cx ;AN000; 1835 <2> pop ax ;AN000; 1836 <2> ret ;AN000; 1837 <2> D_P_Date_Format endp ;AN000; 1838 <2> %ENDIF ;AN000;(of DateSW) 1839 <2> ;PAGE ;AN000; 1840 <2> ;*********************************************************************** 1841 <2> %IF TimeSW+DateSW ;AN000;(Check if time or date format is supported) 1842 <2> ; D_P_Set_CDI: 1843 <2> ; 1844 <2> ; Function: Read CDI from DOS if it has not been read yet 1845 <2> ; 1846 <2> ; Input: None 1847 <2> ; 1848 <2> ; Output: psdata_seg:SI -> CDI 1849 <2> ; 1850 <2> ; Use: INT 21h w/ AH = 38h 1851 <2> ;*********************************************************************** 1852 <2> D_P_Set_CDI proc ;AN000; 1853 <2> lea si,[D_P_Country_Info] ;AC034; 1854 <2> cmp word [psdata_seg:si + D_P_CDI_DateF],D_P_NeedToBeRead ;AN000; already read ? 1855 <2> je D_P_Read_CDI ;AN000; 1856 <2> 1857 <2> jmp short D_P_Set_CDI_Exit ;AN000; then do nothing 1858 <2> 1859 <2> D_P_Read_CDI: ;AN000; else read CDI thru DOS 1860 <2> push ds ;AN000; 1861 <2> push dx ;AN000; 1862 <2> push ax ;AN000; 1863 <2> push PSDATA_SEG ;AC023; 1864 <2> pop ds ;AN000; set segment register 1865 <2> mov ax,D_P_DOS_Get_CDI ;AN000; get country information 1866 <2> mov dx,si ;AN000; set offset of CDI in local data area 1867 <2> int 21h ;AN000; 1868 <2> pop ax ;AN000; 1869 <2> pop dx ;AN000; 1870 <2> pop ds ;AN000; 1871 <2> D_P_Set_CDI_Exit: ;AN000; 1872 <2> ret ;AN000; 1873 <2> D_P_Set_CDI endp ;AN000; 1874 <2> ;PAGE ;AN000; 1875 <2> ;*********************************************************************** 1876 <2> ; D_P_Get_DecNum: 1877 <2> ; 1878 <2> ; Function: Read a chcrater code from psdata_seg:SI until specified delimiter 1879 <2> ; or NULL encountered. And make a decimal number. 1880 <2> ; 1881 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 1882 <2> ; 1883 <2> ; Output: BL = delimiter code or NULL 1884 <2> ; AX = Decimal number 1885 <2> ; SI advanced to the next number 1886 <2> ; CY = 1 : Syntax error, AL = Latest examineed number 1887 <2> ; 1888 <2> ; Use: D_P_0099 1889 <2> ;*********************************************************************** 1890 <2> D_P_Get_DecNum proc ;AN000; 1891 <2> push cx ;AN000; 1892 <2> push dx ;AN000; 1893 <2> xor cx,cx ;AN000; cx will have final value 1894 <2> D_P_GetNum_Loop: ;AN000; 1895 <2> mov al,[psdata_seg:si] ;AN000; load character 1896 <2> or al,al ;AN000; end of line ? 1897 <2> je D_P_GetNum00 ;AN000; if yes, exit 1898 <2> 1899 <2> cmp byte [psdata_seg:D_P_Got_Time],0 ;AC034; ;is this numeric in a time field? ;AC023 1900 <2> je D_P_Do_Date_Delims ;AN000;no, go check out Date delimiters ;AC023 1901 <2> 1902 <2> ; Determine which delimiter(s) to check for. Colon & period or period only 1903 <2> cmp bl,D_P_colon_period ;AN032; ;Time 1904 <2> jne D_P_Do_Time_Delim1 ;AN032; ;only check for period 1905 <2> 1906 <2> cmp al,D_P_Colon ;AN032; ;Is this a valid delimiter ? 1907 <2> je D_P_GetNum01 ;AN032; ;yes, exit 1908 <2> 1909 <2> D_P_Do_Time_Delim1: ;AN000; 1910 <2> cmp al,D_P_Period ;;AC032;;AC023;Is this a valid delimiter ? 1911 <2> je D_P_GetNum01 ;AC023; yes, exit 1912 <2> 1913 <2> jmp short D_P_Neither_Delims ;AN023; 1914 <2> 1915 <2> D_P_Do_Date_Delims: ;AN000; 1916 <2> ;Regardless of the date delimiter character specified in the country 1917 <2> ;dependent information, check for the presence of any one of these 1918 <2> ;three field delimiters: "-", "/", or ".". 1919 <2> cmp al,D_P_Minus ;AN020;is this a date delimiter character? 1920 <2> je D_P_GetNum01 ;AN020;if yes, exit 1921 <2> 1922 <2> cmp al,D_P_Slash ;AN020;is this a date delimiter character? 1923 <2> je D_P_GetNum01 ;AN020;if yes, exit 1924 <2> 1925 <2> cmp al,D_P_Period ;AN020;is this a date delimiter character? 1926 <2> je D_P_GetNum01 ;AN000; if yes, exit 1927 <2> 1928 <2> D_P_Neither_Delims: ;AN023; 1929 <2> 1930 <2> call D_P_0099 ;AN000; convert it to binary 1931 <2> jc D_P_GetNum_Exit ;AN000; if error exit 1932 <2> 1933 <2> mov ah,0 ;AN000; 1934 <2> xchg ax,cx ;AN000; 1935 <2> mov dx,10 ;AN000; 1936 <2> mul dx ;AN000; ax = ax * 10 1937 <2> or dx,dx ;AN000; overflow 1938 <2> jne D_P_GetNum02 ;AN000; then exit 1939 <2> 1940 <2> add ax,cx ;AN000; 1941 <2> jc D_P_GetNum_Exit ;AN000; 1942 <2> 1943 <2> xchg ax,cx ;AN000; 1944 <2> inc si ;AN000; 1945 <2> jmp short D_P_GetNum_Loop ;AN000; 1946 <2> 1947 <2> D_P_GetNum00: ;AN000; 1948 <2> mov bl,al ;AN000; set bl to NULL 1949 <2> clc ;AN000; indicate no error 1950 <2> jmp short D_P_GetNum_Exit ;AN000; 1951 <2> 1952 <2> D_P_GetNum01: ;AN000; 1953 <2> inc si ;AN000; si points to next number 1954 <2> clc ;AN000; indicate no error 1955 <2> jmp short D_P_GetNum_Exit ;AN000; 1956 <2> 1957 <2> D_P_GetNum02: ;AN000; 1958 <2> stc ;AN000; indicate error 1959 <2> D_P_GetNum_Exit: ;AN000; 1960 <2> mov ax,cx ;AN000;return value 1961 <2> pop dx ;AN000; 1962 <2> pop cx ;AN000; 1963 <2> ret ;AN000; 1964 <2> D_P_Get_DecNum endp ;AN000; 1965 <2> %ENDIF ;AN000;(of TimeSW+DateSW) 1966 <2> ;PAGE ;AN000; 1967 <2> ;*********************************************************************** 1968 <2> %IF TimeSW ;AN000;(Check if time format is supported) 1969 <2> ; D_P_Time_Format 1970 <2> ; 1971 <2> ; Function: Convert a time string to DOS time format for int 21h 1972 <2> ; with format validation. 1973 <2> ; 1974 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 1975 <2> ; ES:BX -> CONTROL block 1976 <2> ; 1977 <2> ; Output: None 1978 <2> ; 1979 <2> ; Use: D_P_Fill_Result, D_P_Set_CDI, D_P_Get_DecNum, D_P_Time_2412 1980 <2> ; 1981 <2> ; Vars: D_P_RC(W), D_P_Flags(R), D_P_1st_Val(RW), D_P_2nd_Val(RW) 1982 <2> ; D_P_3rd_Val(RW), D_P_4th_Val(RW) 1983 <2> ;*********************************************************************** 1984 <2> D_P_Time_Format proc ;AN000; 1985 <2> push ax ;AN000; 1986 <2> push cx ;AN000; 1987 <2> push dx ;AN000; 1988 <2> push si ;AN000; 1989 <2> push bx ;AN000; 1990 <2> push si ;AN000; 1991 <2> call D_P_Set_CDI ;AN000; Set country independent 1992 <2> ; information before process 1993 <2> ;(AN032; deleted) mov bl,[psdata_seg:si].D_P_CDI_TimeS ;load time separator 1994 <2> ;(AN032; deleted) mov bh,[psdata_seg:si].D_P_CDI_Dec ;load decimal separator 1995 <2> test byte ptr [psdata_seg:si + D_P_CDI_TimeF],1 ;AN000; 24 hour system 1996 <2> pop si ;AN000; 1997 <2> jne D_P_TimeF00 ;AN000; if no, means 12 hour system 1998 <2> 1999 <2> call D_P_Time_2412 ;AN000; this routine handle "am" "pm" 2000 <2> D_P_TimeF00: ;AN000; 2001 <2> mov word [psdata_seg:D_P_1st_Val],0 ;AC034; set initial value 2002 <2> mov word [psdata_seg:D_P_2nd_Val],0 ;AC034; set initial value 2003 <2> mov word [psdata_seg:D_P_3rd_Val],0 ;AC034; set initial value 2004 <2> mov word [psdata_seg:D_P_4th_Val],0 ;AC034; set initial value 2005 <2> mov byte [psdata_seg:D_P_Got_Time],1 ;AN023;AC034;; use time delimiter 2006 <2> mov bl,D_P_colon_period ;AN032; flag, indicates use of 2007 <2> ; delimiters between hours, 2008 <2> ; minutes,seconds 2009 <2> call D_P_Get_DecNum ;AN000; get 1st number 2010 <2> jc D_P_TimeF_Err0 ;AN000; 2011 <2> 2012 <2> mov [psdata_seg:D_P_1st_Val],ax ;AC034; 2013 <2> or bl,bl ;AN000; end of line ? 2014 <2> D_P_TimeF_Rlt equ D_P_TimeF_RLT ; NASM port label 2015 <2> je D_P_TimeF_Rlt ;AN000; 2016 <2> 2017 <2> call D_P_Get_DecNum ;AN000; get 2nd number 2018 <2> jc D_P_TimeF_Err0 ;AC038; if OK 2019 <2> 2020 <2> mov [psdata_seg:D_P_2nd_Val],ax ;AC034; 2021 <2> or bl,bl ;AN000; end of line ? 2022 <2> je D_P_TimeF_Rlt ;AN000; 2023 <2> 2024 <2> ;(;AN032; deleted) mov bl,bh ;set decimal separator 2025 <2> mov bl,D_P_period_only ;AN032; flag, which to decimal separator 2026 <2> call D_P_Get_DecNum ;AN000; get 3rd number 2027 <2> jc D_P_TimeF_Err0 ;AC039; if problem, bridge to error 2028 <2> 2029 <2> mov [psdata_seg:D_P_3rd_Val],ax ;AC034; 2030 <2> or bl,bl ;AN000; end of line ? 2031 <2> ;(DELETED ;AN039;) je D_P_TimeF_Rlt ;AN000; 2032 <2> jne D_P_Time_4 ;AN039; NOT END OF LINE, 2033 <2> ;AN039; GO TO 4TH NUMBER 2034 <2> D_P_Time_Again equ D_P_TIME_AGAIN ; NASM port equate 2035 <2> test byte [psdata_seg:D_P_Flags1],D_P_Time_Again ;AN039; HAS TIME PARSE 2036 <2> ;AN039; BEEN REPEATED? 2037 <2> jnz D_P_TimeF_Rlt ;AN039; yes, this is really 2038 <2> ;AN039; the end of line 2039 <2> ;AN039; no, time has not been repeated 2040 <2> mov si,[psdata_seg:D_P_SI_Save] ;AN039; get where parser quit 2041 <2> ;AN039; in command line 2042 <2> cmp byte ptr [si-1],D_P_Comma ;AN039; look at delimiter 2043 <2> ;AN039; from command line 2044 <2> jne D_P_TimeF_Rlt ;AN039; was not a comma, this is 2045 <2> ;AN039; really end of line 2046 <2> ;AN039; is comma before hundredths, 2047 <2> ;AN039; redo TIME 2048 <2> mov byte ptr [si-1],D_P_Period ;AN039; change that ambiguous 2049 <2> ;AN039; comma to a decimal point 2050 <2> ;AN039; parse can understand 2051 <2> mov word [psdata_seg:D_P_Flags],0 ;AN039; Clear all internal flags 2052 <2> or byte [psdata_seg:D_P_Flags1],D_P_Time_Again ;AN039; indicate TIME 2053 <2> ;AN039; is being repeated 2054 <2> mov cx,[psdata_seg:D_P_ORIG_ORD] ;AN039; ORIGINAL ORDINAL FROM CX 2055 <2> mov sp,[psdata_seg:D_P_ORIG_STACK] ;AN039; ORIGINAL VALUE 2056 <2> ;AN039; OF STACK FROM SP 2057 <2> mov si,[psdata_seg:D_P_ORIG_SI] ;AN039; ORIGINAL START 2058 <2> ;AN039; PARSE POINTER FROM SI 2059 <2> D_P_Redo_Time equ D_P_REDO_TIME ; NASM port label 2060 <2> jmp D_P_Redo_Time ;AN039; go try TIME again 2061 <2> ; =============================================================== 2062 <2> D_P_Time_4: ;AN039; READY FOR 4TH (HUNDREDTHS) NUMBER 2063 <2> call D_P_Get_DecNum ;AN000; get 4th number 2064 <2> D_P_TimeF_Err0: ;AN000; Bridge 2065 <2> jc D_P_TimeF_Error ;AN000; 2066 <2> 2067 <2> mov [psdata_seg:D_P_4th_Val],ax ;AC034; 2068 <2> or bl,bl ;AN000; After hundredth, no data allowed 2069 <2> jne D_P_TimeF_Error ;AN000; if some, then error 2070 <2> 2071 <2> D_P_TimeF_RLT: ;AN000; 2072 <2> mov ax,[psdata_seg:D_P_1st_Val] ;AC034; 2073 <2> or ah,ah ;AN000; if overflow then error 2074 <2> jne D_P_TimeF_Err ;AN000; 2075 <2> 2076 <2> D_P_Time12am equ D_P_time12am ; NASM port equate 2077 <2> test byte [psdata_seg:D_P_Flags1],D_P_Time12am ;AN038;if "am" specified 2078 <2> jz D_P_Time_notAM ;AN038;skip if no "AM" specified 2079 <2> ;since "AM" was specified, 2080 <2> cmp al,12 ;AN038: if hour specified as later than noon 2081 <2> ja D_P_TimeF_Err ;AN038; error if "AM" on more than noon 2082 <2> jne D_P_Time_notAM ;AN038; for noon exactly, 2083 <2> 2084 <2> xor al,al ;AN038; set hour = zero 2085 <2> D_P_Time_notAM: ;AN038; 2086 <2> test byte [psdata_seg:D_P_Flags2],D_P_Time12 ;AC034; if 12 hour system and pm is specified 2087 <2> je D_P_TimeSkip00 ;AN000; then 2088 <2> 2089 <2> cmp al,12 ;AN038; if 12:00 o'clock already 2090 <2> je D_P_TimeSkip00 ;AN038; it is PM already 2091 <2> 2092 <2> add al,12 ;AN000; add 12 hours to make it afternoon 2093 <2> jc D_P_TimeF_Err ;AN000; if overflow then error 2094 <2> 2095 <2> cmp al,24 ;AN038; after adding 12, now cannot be >24 2096 <2> ja D_P_TimeF_Err ;AN038; if too big, error 2097 <2> 2098 <2> D_P_TimeSkip00: ;AN000; 2099 <2> mov dl,al ;AN000; set hour 2100 <2> mov ax,[psdata_seg:D_P_2nd_Val] ;AC034; 2101 <2> or ah,ah ;AN000; if overflow then error 2102 <2> jne D_P_TimeF_Err ;AN000; 2103 <2> 2104 <2> mov dh,al ;AN000; set minute 2105 <2> mov ax,[psdata_seg:D_P_3rd_Val] ;AC034; 2106 <2> or ah,ah ;AN000; if overflow then error 2107 <2> jne D_P_TimeF_Err ;AN000; 2108 <2> 2109 <2> mov cl,al ;AN000; set second 2110 <2> mov ax,[psdata_seg:D_P_4th_Val] ;AC034; 2111 <2> or ah,ah ;AN000; if overflow then error 2112 <2> jne D_P_TimeF_Err ;AN000; 2113 <2> 2114 <2> mov ch,al ;AN000; set hundredth 2115 <2> pop bx ;AN000; recover CONTROL block 2116 <2> pop si ;AN000; recover string pointer 2117 <2> mov ah,D_P_No_Tag ;AN000; set 2118 <2> mov al,D_P_Time_F ;AN000; result 2119 <2> call D_P_Fill_Result ;AN000; buffer 2120 <2> jmp short D_P_Time_Format_Exit ;AN000; to time 2121 <2> 2122 <2> D_P_TimeF_Error: ;AN000; 2123 <2> D_P_TimeF_Err: ;AN000; 2124 <2> pop bx ;AN000; recover CONTROL block 2125 <2> pop si ;AN000; recover string pointer 2126 <2> mov ah,D_P_No_Tag ;AN000; set 2127 <2> mov al,D_P_String ;AN000; result 2128 <2> call D_P_Fill_Result ;AN000; buffer to string 2129 <2> mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; return syntax error 2130 <2> D_P_Time_Format_Exit: ;AN000; 2131 <2> mov byte [psdata_seg:D_P_Got_Time],0 ;AN023;AC034;; finished with this time field 2132 <2> pop dx ;AN000; 2133 <2> pop cx ;AN000; 2134 <2> pop ax ;AN000; 2135 <2> ret ;AN000; 2136 <2> D_P_Time_Format endp ;AN000; 2137 <2> ;PAGE ;AN000; 2138 <2> ;*********************************************************************** 2139 <2> ; D_P_Time_2412: 2140 <2> ; 2141 <2> ; Function: Remove "a", "p", "am", or "pm" from the end of stinrg 2142 <2> ; 2143 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 2144 <2> ; 2145 <2> ; Output: Set D_P_Time12 flag when the string is terminated by "p" 2146 <2> ; or "pm" 2147 <2> ; 2148 <2> ; Vars: D_P_Flags(W) 2149 <2> ;*********************************************************************** 2150 <2> D_P_Time_2412 proc ;AN000; 2151 <2> push ax ;AN000; 2152 <2> push si ;AN000; 2153 <2> D_P_T12_Loop: ;AN000; 2154 <2> mov al,[psdata_seg:si] ;AN000; Move 2155 <2> inc si ;AN000; si 2156 <2> or al,al ;AN000; to 2157 <2> jne D_P_T12_Loop ;AN000; end of string 2158 <2> 2159 <2> mov al,[psdata_seg:si-2] ;AN000; get char just before NULL 2160 <2> or al,D_P_Make_Lower ;AN000; lower case map 2161 <2> cmp al,"p" ;AN000; only "p" of "pm" ? 2162 <2> je D_P_T1200 ;AN000; 2163 <2> 2164 <2> cmp al,"a" ;AN000; only "a" of "am" ? 2165 <2> je D_P_T1201 ;AN000; 2166 <2> 2167 <2> cmp al,"m" ;AN000; "m" of "am" or "pm" 2168 <2> jne D_P_T12_Exit ;AN000; 2169 <2> 2170 <2> dec si ;AN000; 2171 <2> mov al,[psdata_seg:si-2] ;AN000; 2172 <2> D_P_Make_lower equ D_P_Make_Lower ; NASM port equate 2173 <2> or al,D_P_Make_lower ;AN000; lower case map 2174 <2> cmp al,"p" ;AN000; "p" of "pm" ? 2175 <2> je D_P_T1200 ;AN000; 2176 <2> 2177 <2> cmp al,"a" ;AN000; "a" of "am" ? 2178 <2> je D_P_T1201 ;AN000; go process "a" 2179 <2> 2180 <2> jmp short D_P_T12_Exit ;AN000; no special chars found 2181 <2> 2182 <2> D_P_T1200: ;AN000; "P" found 2183 <2> or byte [psdata_seg:D_P_Flags2],D_P_Time12 ;AC034; flag "PM" found 2184 <2> jmp short D_P_Tclr_chr ;AN038; go clear the special char 2185 <2> 2186 <2> D_P_T1201: ;AN000; "A" found 2187 <2> D_P_Time12AM equ D_P_time12am ; NASM port equate 2188 <2> or byte [psdata_seg:D_P_Flags1],D_P_Time12AM ;AN038; flag "AM" found 2189 <2> D_P_Tclr_chr: ;AN038; 2190 <2> mov byte ptr [psdata_seg:si-2],D_P_NULL ;AN000; null out special char 2191 <2> D_P_T12_Exit: ;AN000; 2192 <2> pop si ;AN000; 2193 <2> pop ax ;AN000; 2194 <2> ret ;AN000; 2195 <2> D_P_Time_2412 endp ;AN000; 2196 <2> %ENDIF ;AN000;(of TimeSW) 2197 <2> ;PAGE ;AN000; 2198 <2> ;*********************************************************************** 2199 <2> %IF CmpxSW ;AN000;(Check if complex item is supported) 2200 <2> ; D_P_Complex_Format: 2201 <2> ; 2202 <2> ; Function: Check if the input string is valid complex format. 2203 <2> ; And set the result buffer. 2204 <2> ; 2205 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 2206 <2> ; ES:BX -> CONTROL block 2207 <2> ; 2208 <2> ; Output: None 2209 <2> ; 2210 <2> ; Use: D_P_Fill_Result, D_P_Chk_DBCS, D_P_Chk_EOL, D_P_Skip_Delim 2211 <2> ; D_P_Quoted_str, D_P_Chk_DSQuote 2212 <2> ; 2213 <2> ; Vars: D_P_RC(W), D_P_SI_Save(W), D_P_SaveSI_Cmpx(R), D_P_Save_EOB(R) 2214 <2> ;*********************************************************************** 2215 <2> D_P_Complex_Format proc ;AN000; 2216 <2> push ax ;AN000; 2217 <2> push bx ;AN000; 2218 <2> push si ;AN000; 2219 <2> mov bx,[psdata_seg:D_P_SaveSI_Cmpx] ;AC034; bx points to user buffer 2220 <2> cmp byte ptr [bx],D_P_Lparen ;AN000; 1st char = left parentheses 2221 <2> jne D_P_Cmpx_Err ;AN000; 2222 <2> 2223 <2> xor ah,ah ;AN000; ah = parentheses counter 2224 <2> D_P_Cmpx_Loop: ;AN000; 2225 <2> mov al,[bx] ;AN000; load character from command buffer 2226 <2> call D_P_Chk_EOL ;AN000; if it is one of EOL 2227 <2> je D_P_CmpxErr0 ;AN000; then error exit. 2228 <2> 2229 <2> cmp al,D_P_Lparen ;AN000; left parentheses ? 2230 <2> jne D_P_Cmpx00 ;AN000; then 2231 <2> 2232 <2> inc ah ;AC035; add '1' to AH reg 2233 <2> ;AN000; increment parentheses counter 2234 <2> ;(replaced ;AC035;) add ah,1 ;AN000; increment parentheses counter 2235 <2> jc D_P_CmpxErr0 ;AN000; if overflow, error 2236 <2> D_P_Cmpx00: ;AN000; 2237 <2> cmp al,D_P_Rparen ;AN000; right parentheses ? 2238 <2> jne D_P_Cmpx01 ;AN000; then 2239 <2> 2240 <2> dec ah ;AC035; subtract '1' from AH reg 2241 <2> ;AN000; decrement parentheses counter 2242 <2> ;(changed ;AC035;) sub ah,1 ;AN000; decrement parentheses counter 2243 <2> jc D_P_CmpxErr0 ;AN000; if overflow error 2244 <2> 2245 <2> je D_P_Cmpx03 ;AN000; ok, valid complex 2246 <2> 2247 <2> D_P_Cmpx01: ;AN000; 2248 <2> ;(deleted ;AN025;) call D_P_Chk_DSQuote ;AN000; double or single quotation mark ? 3/17/KK 2249 <2> cmp al,D_P_DQuote ;AN025; double quotation mark? 2250 <2> jne D_P_Cmpx04 ;AN000; 3/17/KK 2251 <2> 2252 <2> mov [psdata_seg:si],al ;AN000; here quoted string is found in the complex list. 2253 <2> inc si ;AN000; 2254 <2> inc bx ;AN000; bx points to 2nd character 2255 <2> call D_P_Quoted_Str ;AN000; skip pointers until closing of quoted string 2256 <2> jc D_P_CmpxErr0 ;AN000; if error in quoted string syntax then exit 2257 <2> 2258 <2> jmp short D_P_Cmpx05 ;AN000; 2259 <2> 2260 <2> D_P_Cmpx04: ;AN000; 2261 <2> call D_P_Chk_DBCS ;AN000; was it a lead byte of DBCS ? 2262 <2> jnc D_P_Cmpx02 ;AN000; 2263 <2> 2264 <2> mov [psdata_seg:si],al ;AN000; then store 1st byte 2265 <2> inc si ;AN000; 2266 <2> inc bx ;AN000; 2267 <2> mov al,[bx] ;AN000; load 2nd byte 2268 <2> D_P_Cmpx02: ;AN000; 2269 <2> mov [psdata_seg:si],al ;AN000; store SBCS or 2nd byte of DBCS 2270 <2> D_P_Cmpx05: ;AN000; 2271 <2> inc si ;AN000; 2272 <2> inc bx ;AN000; 2273 <2> jmp short D_P_Cmpx_Loop ;AN000; loop 2274 <2> ;---- ;AN000; 2275 <2> D_P_Cmpx03: ;AN000; 2276 <2> mov byte ptr [psdata_seg:si],al ;AN000; 2277 <2> mov byte ptr [psdata_seg:si+1],D_P_NULL ;AN000; 2278 <2> mov byte ptr [bx],D_P_NULL ;AN000; replace right parentheses with NULL 2279 <2> mov si,bx ;AN000; skip whitespaces 2280 <2> inc si ;AN000; after 2281 <2> call D_P_Skip_Delim ;AN000; right parentheses 2282 <2> mov [psdata_seg:D_P_SI_Save],si ;AC034; save next pointer, SI 2283 <2> jmp short D_P_Cmpx_Exit ;AN000; 2284 <2> 2285 <2> D_P_CmpxErr0: ;AN000; 2286 <2> mov si,[psdata_seg:D_P_Save_EOB] ;AC034; if EOF encountered, restore 2287 <2> mov byte ptr [psdata_seg:si],D_P_NULL ;AN000; EOB mark 2288 <2> D_P_Cmpx_Err: ;AN000; 2289 <2> mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; 2290 <2> D_P_Cmpx_Exit: ;AN000; 2291 <2> mov ah,D_P_No_Tag ;AN000; 2292 <2> mov al,D_P_Complex ;AN000; 2293 <2> pop si ;AN000; 2294 <2> pop bx ;AN000; 2295 <2> call D_P_Fill_Result ;AN000; 2296 <2> pop ax ;AN000; 2297 <2> ret ;AN000; 2298 <2> D_P_Complex_Format endp ;AN000; 2299 <2> %ENDIF ;AN000;(of CpmxSW) 2300 <2> ;PAGE ;AN000; 2301 <2> ;*********************************************************************** 2302 <2> %IF QusSW ;AN000;(Check if quoted string is supported) 2303 <2> ; D_P_Quoted_Format: 2304 <2> ; 2305 <2> ; Function: Check if the input string is valid quoted string format. 2306 <2> ; And set the result buffer. 2307 <2> ; 2308 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 2309 <2> ; ES:BX -> CONTROL block 2310 <2> ; 2311 <2> ; Output: None 2312 <2> ; 2313 <2> ; Use: D_P_Fill_Result, D_P_Chk_DBCS, D_P_Chk_EOL, D_P_Skip_Delim 2314 <2> ; D_P_Chk_DSQuote, D_P_Quoted_Str 2315 <2> ; 2316 <2> ; Vars: D_P_RC(W), D_P_SI_Save(W), D_P_SaveSI_Cmpx(R),D_P_Save_EOB(R) 2317 <2> ;*********************************************************************** 2318 <2> D_P_Quoted_Format proc ;AN000; 0 0000177F 50 push ax ;AN000; 0 00001780 53 push bx ;AN000; 0 00001781 56 push si ;AN000; 0 00001782 2E8B1E[0F00] mov bx,[psdata_seg:D_P_SaveSI_Cmpx] ;AC034; bx points to user buffer 0 00001787 8A07 mov al,byte ptr [bx] ;AN000; get 1st character 2324 <2> ;(deleted ;AN025;) call D_P_Chk_DSQuote ;AN000; is it single or double quote ? 0 00001789 3C22 cmp al,D_P_DQuote ;AN025; double quotation mark? 0 0000178B 7521 jne D_P_Qus_Err ;AN000; if no, error 2327 <2> 2328 <2> ; mov [psdata_seg:si],al ;AN000; move it to internal buffer 2329 <2> ; inc si ;AN000; 0 0000178D 43 inc bx ;AN000; bx points to 2nd character 0 0000178E E82F00 call D_P_Quoted_Str ;AN000; skip pointers to the closing of quoted string 0 00001791 7212 jc D_P_Qus_Err0 ;AN000; if invali quoted string syntax, exit 2333 <2> 0 00001793 2EC6440100 mov byte ptr [psdata_seg:si+1],D_P_NULL ;AN000; end up with NULL 0 00001798 89DE mov si,bx ;AN000; 0 0000179A 46 inc si ;AN000; 0 0000179B E82201 call D_P_Skip_Delim ;AN000; skip whitespaces after closing quote 0 0000179E 2E8936[0400] mov [psdata_seg:D_P_SI_Save],si ;AC034; save next pointer, SI 0 000017A3 EB10 jmp short D_P_Qus_Exit ;AN000; 2340 <2> 2341 <2> D_P_Qus_Err0: ;AN000; 0 000017A5 2E8B36[1300] mov si,[psdata_seg:D_P_Save_EOB] ;AC034; if EOF encountered, restore 0 000017AA 2EC60400 mov byte ptr [psdata_seg:si],D_P_NULL ;AN000; EOB mark 2344 <2> D_P_Qus_Err: ;AN000;AN000 0 000017AE 2EC706[0200]0900 mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; indicate syntax error 2346 <2> D_P_Qus_Exit: ;AN000; 0 000017B5 B4FF mov ah,D_P_No_Tag ;AN000; set 0 000017B7 B009 mov al,D_P_Quoted_String ;AN000; result 0 000017B9 5E pop si ;AN000; buffer 0 000017BA 5B pop bx ;AN000; to 0 000017BB E89EFB call D_P_Fill_Result ;AN000; quoted string 0 000017BE 58 pop ax ;AN000; 0 000017BF C3 ret ;AN000; 2354 <2> D_P_Quoted_Format endp ;AN000; 2355 <2> %ENDIF ;AN000;(of QusSW) 2356 <2> ;PAGE ;AN000; 2357 <2> ;*********************************************************************** 2358 <2> ; D_P_Chk_DSQuote; 2359 <2> ; 2360 <2> ; Function: Check if AL is double quotation or single quotation 2361 <2> ; 2362 <2> ; Input: AL = byte to be examineed 2363 <2> ; 2364 <2> ; Output: ZF on if AL is single or double quotetaion 2365 <2> ; 2366 <2> ; Vars: D_P_SorD_Quote(W) 2367 <2> ;*********************************************************************** 2368 <2> %IF QusSW+CmpxSW ;AN000;(Check if quoted string or complex item is supported) 2369 <2> ;(deleted ;AN025;) D_P_Chk_DSQuote proc ; 2370 <2> ;(deleted ;AN025;) mov D_P_SorD_Quote,D_P_SQuote ; 3/17/87 assume single quote 2371 <2> ;(deleted ;AN025;) cmp al,D_P_DQuote ; 1st char = double quotation ? 2372 <2> ;(deleted ;AN025;) jne D_P_CDSQ00 ; 3/17/87 2373 <2> ;(deleted ;AN025;) mov D_P_SorD_Quote,al ; 3/17/87 set bigning w/ double quote 2374 <2> ;(deleted ;AN025;) ret ; 3/17/87 2375 <2> ;(deleted ;AN025;) D_P_CDSQ00: ; 3/17/87 2376 <2> ;(deleted ;AN025;) cmp al,D_P_SQuote ; 1st char = single quotation ? 2377 <2> ;(deleted ;AN025;) ret ; 2378 <2> ;(deleted ;AN025;) D_P_Chk_DSQuote endp ; 2379 <2> ; PAGE ;AN000; 2380 <2> ;*********************************************************************** 2381 <2> ; D_P_Quoted_Str: 2382 <2> ; 2383 <2> ; Function: Copy chracacter from ES:BX to psdata_seg:SI until closing single 2384 <2> ; (double) quotation found. 2385 <2> ; 2386 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 2387 <2> ; ES:BX -> Operand in command buffer 2388 <2> ; 2389 <2> ; Output: CY on indicates EOF encounterd before closing quotation 2390 <2> ; BX and SI 2391 <2> ; 2392 <2> ; 2393 <2> ; Vars: D_P_SorD_Quote(R) 2394 <2> ;*********************************************************************** 2395 <2> D_P_Quoted_Str proc ;AN000; 0 000017C0 50 push ax ;AN000; 2397 <2> D_P_Qus_Loop: ;AN000; 0 000017C1 8B07 mov ax,[bx] ;AN000; 3/17/87 0 000017C3 E82001 call D_P_Chk_EOL ;AN000; 0 000017C6 7424 je D_P_Qustr_Err0 ;AN000; 2401 <2> 2402 <2> ;(deleted ;AN025;) cmp al,D_P_SorD_Quote ;AN000; quotation ? 3/17/87 0 000017C8 3C22 cmp al,D_P_DQuote ;AN025; double quote? 0 000017CA 750D jne D_P_Qus00 ;AN000; 2405 <2> 2406 <2> ;(deleted ;AN025;) cmp ah,D_P_SorD_Quote ;AN000; contiguous quotation 3/17/87 0 000017CC 80FC22 cmp ah,D_P_DQuote ;AN025; double quote? 0 000017CF 751E jne D_P_Qus02 ;AN000; 2409 <2> 2410 <2> ;(deleted ;AN025:) mov word ptr [psdata_seg:si],ax ;AN000; 3/17/87 0 000017D1 2E8804 mov byte ptr [psdata_seg:si],al ;AN025; save one of the quotes 2412 <2> ;(deleted ;AN025:) add si,2 ;AN000; 2413 <2> 0 000017D4 46 inc si ;AC035; add '1' to SI reg 2415 <2> ;AN025; adjust target index 2416 <2> ;(changed ;AC035;) add si,1 ;AN025; adjust target index 0 000017D5 43 inc bx ;AC035; add '2' to 0 000017D6 43 inc bx ;AC035; BX reg 2419 <2> ;AN000; adjust source index by 2 to skip extra quote 2420 <2> ;(changed ;AC035;) add bx,2 ;AN000; adjust source index by 2 to skip extra quote 0 000017D7 EBE8 jmp short D_P_Qus_Loop ;AN000; 2422 <2> 2423 <2> D_P_Qus00: ;AN000; 0 000017D9 E8BF01 call D_P_Chk_DBCS ;AN000; was it a lead byte of DBCS ? 0 000017DC 7307 jnc D_P_Qus01 ;AN000; 2426 <2> 0 000017DE 2E8804 mov [psdata_seg:si],al ;AN000; store 1st byte 0 000017E1 46 inc si ;AN000; 0 000017E2 43 inc bx ;AN000; 0 000017E3 8A07 mov al,[bx] ;AN000; load 2nd byte 2431 <2> D_P_Qus01: ;AN000; 0 000017E5 2E8804 mov [psdata_seg:si],al ;AN000; store SBCS or 2nd byte of DBCS 0 000017E8 46 inc si ;AN000; 0 000017E9 43 inc bx ;AN000; 0 000017EA EBD5 jmp short D_P_Qus_Loop ;AN000; 2436 <2> 2437 <2> D_P_Qustr_Err0: ;AN000; 0 000017EC F9 stc ;AN000; indicate error 0 000017ED EB05 jmp short D_P_Quoted_Str_Exit ;AN000; 2440 <2> 2441 <2> D_P_Qus02: ;AN000; 0 000017EF 2EC60400 mov byte ptr [psdata_seg:si],0 ;AN000; 0 000017F3 F8 clc ;AN000; indicate no error 2444 <2> D_P_Quoted_Str_Exit: ;AN000; 0 000017F4 58 pop ax ;AN000; 0 000017F5 C3 ret ;AN000; 2447 <2> D_P_Quoted_Str endp ;AN000; 2448 <2> %ENDIF ;AN000;(of QusSW+CmpxSW) 2449 <2> ;PAGE ;AN000; 2450 <2> ;*********************************************************************** 2451 <2> %IF FileSW+DrvSW ;AN000;(Check if file spec or drive only is supported) 2452 <2> ; D_P_File_Format; 2453 <2> ; 2454 <2> ; Function: Check if the input string is valid file spec format. 2455 <2> ; And set the result buffer. 2456 <2> ; 2457 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 2458 <2> ; ES:BX -> CONTROL block 2459 <2> ; 2460 <2> ; Output: None 2461 <2> ; 2462 <2> ; Use: D_P_Fill_Result, D_P_Chk_DBCS, D_P_FileSp_Chk 2463 <2> ; 2464 <2> ; Vars: D_P_RC(W), D_P_SI_Save(W), D_P_Terminator(W), D_P_SaveSI_Cmpx(R) 2465 <2> ; D_P_SaveSI_Cmpx(R) 2466 <2> ;*********************************************************************** 2467 <2> D_P_File_Format proc ;AN000; 0 000017F6 50 push ax ;AN000; 0 000017F7 57 push di ;AN000; 0 000017F8 56 push si ;AN000; 2471 <2> D_P_SaveSI_cmpx equ D_P_SaveSI_Cmpx ; NASM port label 0 000017F9 2E8B3E[0F00] mov di,[psdata_seg:D_P_SaveSI_cmpx] ;AC034; get user buffer address 2473 <2> D_P_FileF_Loop0: ;AN000; / skip special characters 0 000017FE 2E8A04 mov al,[psdata_seg:si] ;AN000; load character 0 00001801 08C0 or al,al ;AN000; end of line ? 0 00001803 7413 je D_P_FileF_Err ;AN000; if yes, error exit 2477 <2> 0 00001805 E85F00 call D_P_FileSp_Chk ;AN000; else, check if file special character 0 00001808 7524 jne D_P_FileF03 ;AN000; if yes, 2480 <2> 2481 <2> ;AN033; deleted inc di ;skip 2482 <2> ;AN033; deleted inc si ; the 2483 <2> ;AN033; deleted jmp short D_P_FileF_Loop0 ; character 0 0000180A 2EC606[AA00]01 mov byte [psdata_seg:D_P_err_flag],D_P_error_filespec ;AN033;AC034;; set error flag- bad char. 0 00001810 5E pop si ;AN033; 0 00001811 2EC60400 mov byte ptr [psdata_seg:si],D_P_NULL ;AN033; 0 00001815 5F pop di ;AN033; 0 00001816 EB3F jmp short D_P_FileF02 ;AN033; 2489 <2> 2490 <2> 2491 <2> D_P_FileF_Err: ;AN000; 0 00001818 5E pop si ;AN000; 0 00001819 2EC60400 mov byte ptr [psdata_seg:si],D_P_NULL ;AN000; 2494 <2> ;(deleted ;AN030;) mov di,D_P_SaveSI_cmpx ;AN000; get user buffer address 2495 <2> ;(deleted ;AN030;) mov D_P_SI_Save,di ;AN000; update pointer to user buffer 0 0000181D 5F pop di ;AN000; 0 0000181E 26F7070100 test word [es:bx + D_P_Match_Flag],D_P_Optional ;AN000; is it optional ? 0 00001823 7532 jne D_P_FileF02 ;AN000; 2499 <2> 0 00001825 2EC706[0200]0200 mov word [psdata_seg:D_P_RC],D_P_Op_Missing ;AC034; 3/17/87 0 0000182C EB29 jmp short D_P_FileF02 ;AN000; 2502 <2> 2503 <2> D_P_FileF03: ;AN000; 0 0000182E 58 pop ax ;AN000; discard save si 0 0000182F 56 push si ;AN000; save new si 2506 <2> D_P_FileF_Loop1: ;AN000; 0 00001830 2E8A04 mov al,[psdata_seg:si] ;AN000; load character (not special char) 0 00001833 08C0 or al,al ;AN000; end of line ? 0 00001835 741E je D_P_FileF_RLT ;AN000; 2510 <2> 0 00001837 E82D00 call D_P_FileSp_Chk ;AN000; File special character ? 0 0000183A 740B je D_P_FileF00 ;AN000; 2513 <2> 0 0000183C E85C01 call D_P_Chk_DBCS ;AN000; no, then DBCS ? 0 0000183F 7302 jnc D_P_FileF01 ;AN000; 0 00001841 47 inc di ;AN000; if yes, skip next byte 0 00001842 46 inc si ;AN000; 2518 <2> D_P_FileF01: ;AN000; 0 00001843 47 inc di ;AN000; 0 00001844 46 inc si ;AN000; 0 00001845 EBE9 jmp short D_P_FileF_Loop1 ;AN000; 2522 <2> ; 2523 <2> D_P_FileF00: ;AN000; 0 00001847 2EA2[0800] mov [psdata_seg:D_P_Terminator],al ;AC034; 0 0000184B 2EC60400 mov byte ptr [psdata_seg:si],D_P_NULL ;AN000; update end of string 0 0000184F 47 inc di ;AN000; 0 00001850 2E893E[0400] mov [psdata_seg:D_P_SI_Save],di ;AC034; update next pointer in command line 2528 <2> D_P_FileF_RLT: ;AN000; 0 00001855 5E pop si ;AN000; 0 00001856 5F pop di ;AN000; 2531 <2> D_P_FileF02: ;AN000; 2532 <2> 0 00001857 58 pop ax ;AN000; (tm14) 0 00001858 A90002 test ax,D_P_File_Spc ;AN000; (tm14) 0 0000185B 7409 je D_P_Drv_Only_Exit ;AN000; (tm14) 2536 <2> 0 0000185D 50 push ax ;AN000; (tm14) 2538 <2> 0 0000185E B4FF mov ah,D_P_No_Tag ;AN000; set 0 00001860 B005 mov al,D_P_File_Spec ;AN000; result 0 00001862 E8F7FA call D_P_Fill_Result ;AN000; buffer to file spec 0 00001865 58 pop ax ;AN000; 2543 <2> 2544 <2> D_P_Drv_Only_Exit: ;AN000; (tm14) 2545 <2> 0 00001866 C3 ret ;AN000; 2547 <2> D_P_File_Format endp ;AN000; 2548 <2> ;PAGE ;AN000; 2549 <2> ;*********************************************************************** 2550 <2> ; D_P_FileSp_Chk 2551 <2> ; 2552 <2> ; Function: Check if the input byte is one of file special characters 2553 <2> ; 2554 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 2555 <2> ; AL = character code to be examineed 2556 <2> ; 2557 <2> ; Output: ZF = 1 , AL is one of special characters 2558 <2> ;*********************************************************************** 2559 <2> D_P_FileSp_Chk proc ;AN000; 0 00001867 53 push bx ;AN000; 0 00001868 51 push cx ;AN000; 0 00001869 8D1E[A100] lea bx,[D_P_FileSp_Char] ;AC034; special character table 0 0000186D B90900 mov cx,D_P_FileSp_Len ;AN000; load length of it 2564 <2> D_P_FileSp_Loop: ;AN000; 0 00001870 2E3A07 cmp al,[psdata_seg:bx] ;AN000; is it one of special character ? 0 00001873 7404 je D_P_FileSp_Exit ;AN000; 2567 <2> 0 00001875 43 inc bx ;AN000; 0 00001876 E2F8 loop D_P_FileSp_Loop ;AN000; 2570 <2> 0 00001878 41 inc cx ;AN000; reset ZF 2572 <2> D_P_FileSp_Exit: ;AN000; 0 00001879 59 pop cx ;AN000; 0 0000187A 5B pop bx ;AN000; 0 0000187B C3 ret ;AN000; 2576 <2> D_P_FileSp_Chk endp ;AN000; 2577 <2> %ENDIF ;AN000;(of FileSW+DrvSW) 2578 <2> ;PAGE ;AN000; 2579 <2> ;*********************************************************************** 2580 <2> %IF DrvSW ;AN000;(Check if drive only is supported) 2581 <2> ; D_P_Drive_Format; 2582 <2> ; 2583 <2> ; Function: Check if the input string is valid drive only format. 2584 <2> ; And set the result buffer. 2585 <2> ; 2586 <2> ; Input: psdata_seg:SI -> D_P_STRING_BUF 2587 <2> ; ES:BX -> CONTROL block 2588 <2> ; 2589 <2> ; Output: None 2590 <2> ; 2591 <2> ; Use: D_P_Fill_Result, D_P_Chk_DBCS 2592 <2> ; 2593 <2> ; Vars: D_P_RC(W) 2594 <2> ;*********************************************************************** 2595 <2> D_P_Drive_Format proc ;AN000; 0 0000187C 50 push ax ;AN000; 0 0000187D 52 push dx ;AN000; 0 0000187E 2E8A04 mov al,[psdata_seg:si] ;AN000; 0 00001881 08C0 or al,al ;AN000; if null string 0 00001883 7438 je D_P_Drv_Exit ;AN000; do nothing 2601 <2> 0 00001885 E81301 call D_P_Chk_DBCS ;AN000; is it leading byte ? 0 00001888 722C jc D_P_Drv_Err ;AN000; 2604 <2> 0 0000188A 2E837C013A cmp word ptr [psdata_seg:si+1],D_P_Colon ;AN000; "d", ":", 0 ? 0 0000188F 740E je D_P_DrvF00 ;AN000; 2607 <2> 0 00001891 26F7071000 test word [es:bx + D_P_Match_Flag],D_P_Ig_Colon ;AN000; colon can be ignored? 0 00001896 741E je D_P_Drv_Err ;AN000; 2610 <2> 0 00001898 2E807C0100 cmp byte ptr [psdata_seg:si+1],D_P_NULL ;AN000; "d", 0 ? 0 0000189D 7517 jne D_P_Drv_Err ;AN000; 2613 <2> 2614 <2> D_P_DrvF00: ;AN000; 0 0000189F 0C20 or al,D_P_Make_Lower ;AN000; lower case 0 000018A1 3C61 cmp al,"a" ;AN000; drive letter must 0 000018A3 7211 jb D_P_Drv_Err ;AN000; in range of 2618 <2> 0 000018A5 3C7A cmp al,"z" ;AN000; "a" - "z" 0 000018A7 770D ja D_P_Drv_Err ;AN000; if no, error 2621 <2> 0 000018A9 2C60 sub al,"a"-1 ;AN000; make text drive to binary drive 0 000018AB 88C2 mov dl,al ;AN000; set 0 000018AD B4FF mov ah,D_P_No_Tag ;AN000; result 0 000018AF B006 mov al,D_P_Drive ;AN000; buffer 0 000018B1 E8A8FA call D_P_Fill_Result ;AN000; to drive 0 000018B4 EB07 jmp short D_P_Drv_Exit ;AN000; 2628 <2> 2629 <2> D_P_Drv_Err: ;AN000; 0 000018B6 2EC706[0200]0900 mov word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; 2631 <2> D_P_Drv_Exit: ;AN000; 0 000018BD 5A pop dx ;AN000; 0 000018BE 58 pop ax ;AN000; 0 000018BF C3 ret ;AN000; 2635 <2> D_P_Drive_Format endp ;AN000; 2636 <2> %ENDIF ;AN000;(of DrvSW) 2637 <2> ;PAGE ;AN000; 2638 <2> ;*********************************************************************** 2639 <2> ; D_P_Skip_Delim; 2640 <2> ; 2641 <2> ; Function: Skip delimiters specified in the PARMS list, white space 2642 <2> ; and comma. 2643 <2> ; 2644 <2> ; Input: DS:SI -> Command String 2645 <2> ; ES:DI -> Parameter List 2646 <2> ; 2647 <2> ; Output: CY = 1 if the end of line encounterd 2648 <2> ; CY = 0 then SI move to 1st non-delimiter character 2649 <2> ; AL = Last examineed character 2650 <2> ; 2651 <2> ; Use: D_P_Chk_EOL, D_P_Chk_Delim, 2652 <2> ; 2653 <2> ; Vars: D_P_Flags(R) 2654 <2> ;*********************************************************************** 2655 <2> D_P_Skip_Delim proc ;AN000; 2656 <2> D_P_Skip_Delim_Loop: ;AN000; 0 000018C0 AC LODSB ;AN000; 0 000018C1 E82200 call D_P_Chk_EOL ;AN000; is it EOL character ? 0 000018C4 7418 je D_P_Skip_Delim_CY ;AN000; if yes, exit w/ CY on 2660 <2> 0 000018C6 E85300 call D_P_Chk_Delim ;AN000; is it one of delimiters ? 0 000018C9 7516 jne D_P_Skip_Delim_NCY ;AN000; if no, exit w/ CY off 2663 <2> 0 000018CB 2EF606[0E00]20 test byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; extra delim or comma found ? 0 000018D1 74ED je D_P_Skip_Delim_Loop ;AN000; if no, loop 2666 <2> 0 000018D3 2EF606[0E00]41 test byte [psdata_seg:D_P_Flags2],D_P_SW+D_P_equ ;AC034; /x , or xxx=zzz , (tm08) 0 000018D9 7409 je short D_P_Exit_At_Extra ;AN000; no switch, no keyword (tm08) 2669 <2> 0 000018DB 4E dec si ;AN000; backup si for next call (tm08) 0 000018DC EB06 jmp short D_P_Exit_At_Extra ;AN000; else exit w/ CY off 2672 <2> 2673 <2> D_P_Skip_Delim_CY: ;AN000; 0 000018DE F9 stc ;AN000; indicate EOL 0 000018DF EB01 jmp short D_P_Skip_Delim_Exit ;AN000; 2676 <2> 2677 <2> D_P_Skip_Delim_NCY: ;AN000; 0 000018E1 F8 clc ;AN000; indicate non delim 2679 <2> D_P_Skip_Delim_Exit: ;AN000; in this case, need 0 000018E2 4E dec si ;AN000; backup index pointer 0 000018E3 C3 ret ;AN000; 2682 <2> 2683 <2> D_P_Exit_At_Extra: ;AN000; 0 000018E4 F8 clc ;AN000; indicate extra delim 0 000018E5 C3 ret ;AN000; 2686 <2> D_P_Skip_Delim endp ;AN000; 2687 <2> ;PAGE ;AN000; 2688 <2> ;*********************************************************************** 2689 <2> ; D_P_Chk_EOL; 2690 <2> ; 2691 <2> ; Function: Check if AL is one of End of Line characters. 2692 <2> ; 2693 <2> ; Input: AL = character code 2694 <2> ; ES:DI -> Parameter List 2695 <2> ; 2696 <2> ; Output: ZF = 1 if one of End of Line characters 2697 <2> ;********************************************************************** 2698 <2> D_P_Chk_EOL proc ;AN000; 0 000018E6 53 push bx ;AN000; 0 000018E7 51 push cx ;AN000; 0 000018E8 3C0D cmp al,D_P_CR ;AN000; Carriage return ? 0 000018EA 742D je D_P_Chk_EOL_Exit ;AN000; 2703 <2> 0 000018EC 3C00 cmp al,D_P_NULL ;AN000; zero ? 0 000018EE 7429 je D_P_Chk_EOL_Exit ;AN000; 2706 <2> 2707 <2> %IF LFEOLSW ;AN028; IF LF TO BE ACCEPTED AS EOL 0 000018F0 3C0A cmp al,D_P_LF ;AN000; Line feed ? 0 000018F2 7425 je D_P_Chk_EOL_Exit ;AN000; 2710 <2> %ENDIF ;AN028; 2711 <2> 0 000018F4 26807D0202 cmp byte ptr [es:di + D_P_Num_Extra],D_P_I_Have_EOL ;AN000; EOL character specified ? 0 000018F9 721E jb D_P_Chk_EOL_Exit ;AN000; 2714 <2> 0 000018FB 31DB xor bx,bx ;AN000; 0 000018FD 268A5D03 mov bl,[es:di + D_P_Len_Extra_Delim] ;AN000; get length of delimiter list 0 00001901 83C304 add bx,D_P_Len_PARMS ;AN000; skip it 0 00001904 26803900 cmp byte ptr [es:bx+di],D_P_I_Use_Default ;AN000; No extra EOL character ? 0 00001908 740D je D_P_Chk_EOL_NZ ;AN000; 2720 <2> 0 0000190A 31C9 xor cx,cx ;AN000; Get number of extra chcracter 0 0000190C 268A09 mov cl,[es:bx+di] ;AN000; 2723 <2> D_P_Chk_EOL_Loop: ;AN000; 0 0000190F 43 inc bx ;AN000; 0 00001910 263A01 cmp al,[es:bx+di] ;AN000; Check extra EOL character 0 00001913 7404 je D_P_Chk_EOL_Exit ;AN000; 2727 <2> 0 00001915 E2F8 loop D_P_Chk_EOL_Loop ;AN000; 2729 <2> 2730 <2> D_P_Chk_EOL_NZ: ;AN000; 0 00001917 3C0D cmp al,D_P_CR ;AN000; reset ZF 2732 <2> D_P_Chk_EOL_Exit: ;AN000; 0 00001919 59 pop cx ;AN000; 0 0000191A 5B pop bx ;AN000; 0 0000191B C3 ret ;AN000; 2736 <2> D_P_Chk_EOL endp ;AN000; 2737 <2> ;PAGE ;AN000; 2738 <2> ;*********************************************************************** 2739 <2> ; D_P_Chk_Delim; 2740 <2> ; 2741 <2> ; Function: Check if AL is one of delimiter characters. 2742 <2> ; if AL+[si] is DBCS blank, it is replaced with two SBCS 2743 <2> ; blanks. 2744 <2> ; 2745 <2> ; Input: AL = character code 2746 <2> ; DS:SI -> Next Character 2747 <2> ; ES:DI -> Parameter List 2748 <2> ; 2749 <2> ; Output: ZF = 1 if one of delimiter characters 2750 <2> ; SI points to the next character 2751 <2> ; Vars: D_P_Terminator(W), D_P_Flags(W) 2752 <2> ;*********************************************************************** 2753 <2> D_P_Chk_Delim proc ;AN000; 0 0000191C 53 push bx ;AN000; 0 0000191D 51 push cx ;AN000; 0 0000191E 2EC606[0800]20 mov byte [psdata_seg:D_P_Terminator],D_P_Space ;AC034; Assume terminated by space 0 00001924 2E8026[0E00]DF and byte [psdata_seg:D_P_Flags2],0ffh-D_P_Extra ;AC034; 0 0000192A 3C20 cmp al,D_P_Space ;AN000; Space ? 0 0000192C 7436 je D_P_Chk_Delim_Exit ;AN000; 2760 <2> 0 0000192E 3C09 cmp al,D_P_TAB ;AN000; TAB ? 0 00001930 7432 je D_P_Chk_Delim_Exit ;AN000; 2763 <2> 0 00001932 3C2C cmp al,D_P_Comma ;AN000; Comma ? 0 00001934 7431 je D_P_Chk_Delim_Exit0 ;AN000; 2766 <2> 2767 <2> D_P_Chk_Delim00: ;AN000; 0 00001936 3C81 cmp al,D_P_DBSP1 ;AN000; 1st byte of DBCS Space ? 0 00001938 750C jne D_P_Chk_Delim01 ;AN000; 2770 <2> 0 0000193A 803C40 cmp byte ptr [si],D_P_DBSP2 ;AN000; 2nd byte of DBCS Space ? 0 0000193D 7507 jne D_P_Chk_Delim01 ;AN000; 2773 <2> 0 0000193F B020 mov al,D_P_Space ;AN000; 0 00001941 46 inc si ;AN000; make si point to next character 0 00001942 38C0 cmp al,al ;AN000; Set ZF 0 00001944 EB1E jmp short D_P_Chk_Delim_Exit ;AN000; 2778 <2> 2779 <2> D_P_Chk_Delim01: ;AN000; 0 00001946 26807D0201 cmp byte ptr [es:di + D_P_Num_Extra],D_P_I_Have_Delim ;AN000; delimiter character specified ? 0 0000194B 7217 jb D_P_Chk_Delim_Exit ;AN000; 2782 <2> 0 0000194D 31C9 xor cx,cx ;AN000; 0 0000194F 268A4D03 mov cl,[es:di + D_P_Len_Extra_Delim] ;AN000; get length of delimiter list 0 00001953 09C9 or cx,cx ;AN000; No extra Delim character ? 0 00001955 740B je D_P_Chk_Delim_NZ ;AN000; 2787 <2> 0 00001957 BB0300 mov bx,D_P_Len_PARMS-1 ;AN000; set bx to 1st extra delimiter 2789 <2> D_P_Chk_Delim_Loop: ;AN000; 0 0000195A 43 inc bx ;AN000; 0 0000195B 263A01 cmp al,[es:bx+di] ;AN000; Check extra Delim character 0 0000195E 7407 je D_P_Chk_Delim_Exit0 ;AN000; 2793 <2> 0 00001960 E2F8 loop D_P_Chk_Delim_Loop ;AN000; examine all extra delimiter 2795 <2> 2796 <2> D_P_Chk_Delim_NZ: ;AN000; 0 00001962 3C20 cmp al,D_P_Space ;AN000; reset ZF 2798 <2> D_P_Chk_Delim_Exit: ;AN000; 2799 <2> ;;;; jne D_P_ChkDfin 2800 <2> ;;;; mov psdata_seg:D_P_Terminator,al ;AN034; 2801 <2> D_P_ChkDfin: ;AN000; 0 00001964 59 pop cx ;AN000; 0 00001965 5B pop bx ;AN000; 0 00001966 C3 ret ;AN000; 2805 <2> 2806 <2> D_P_Chk_Delim_Exit0: ;AN000; 0 00001967 2EA2[0800] mov [psdata_seg:D_P_Terminator],al ;AC034; keep terminated delimiter 2808 <2> D_P_Equ equ D_P_equ ; NASM port equate 0 0000196B 2EF606[0E00]01 test byte [psdata_seg:D_P_Flags2],D_P_Equ ;AN027;AC034;; if terminating a key= 0 00001971 7506 jnz D_P_No_Set_Extra ;AN027; then do not set the EXTRA bit 2811 <2> 0 00001973 2E800E[0E00]20 or byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; flag terminated extra delimiter or comma 2813 <2> D_P_No_Set_Extra: ;AN027; 0 00001979 38C0 cmp al,al ;AN000; set ZF 0 0000197B EBE7 jmp short D_P_Chk_Delim_Exit ;AN000; 2816 <2> 2817 <2> D_P_Chk_Delim endp ;AN000; 2818 <2> ;PAGE ;AN000; 2819 <2> ;*********************************************************************** 2820 <2> ; D_P_Chk_Switch; 2821 <2> ; 2822 <2> ; Function: Check if AL is the switch character not in first position of 2823 <2> ; D_P_STRING_BUF 2824 <2> ; 2825 <2> ; Input: AL = character code 2826 <2> ; BX = current pointer within D_P_String_Buf 2827 <2> ; SI =>next char on command line (following the one in AL) 2828 <2> ; 2829 <2> ; Output: CF = 1 (set)if AL is switch character, and not in first 2830 <2> ; position, and has no chance of being part of a date string, 2831 <2> ; i.e. should be treated as a delimiter. 2832 <2> 2833 <2> ; CF = 0 (reset, cleared) if AL is not a switch char, is in the first 2834 <2> ; position, or is a slash but may be part of a date string, i.e. 2835 <2> ; should not be treated as a delimiter. 2836 <2> ; 2837 <2> ; Vars: D_P_Terminator(W) 2838 <2> 2839 <2> ; Use: D_P_0099 2840 <2> ;*********************************************************************** 2841 <2> D_P_Chk_Switch proc ;AN000; 2842 <2> 2843 <2> ;AN020;; Function: Check if AL is the switch character from 2nd position of D_P_STRING_BUF 2844 <2> ;AN020;; Output: ZF = 1 if switch character 2845 <2> ;AN020;; lea bp,D_P_STRING_BUF ;AN000; 2846 <2> ;AN020;; cmp bx,bp ;AN000; 1st position ? 2847 <2> ;AN020;; je D_P_Chk_S_Exit_1 ;AN000; 2848 <2> ;AN020;; cmp al,D_P_Switch ;AN000; 2849 <2> ;AN020;; jmp short D_P_Chk_S_Exit_0 ;AN000; 2850 <2> ;AN020;;D_P_Chk_S_Exit_1: ;AN000; 2851 <2> ;AN020;; cmp al,D_P_Switch ;AN000; (tm08) 2852 <2> ;AN020;; jne D_P_Nop ;AN000; (tm08) 2853 <2> ;AN020;; or D_P_Flags2,D_P_SW ;AN000; (tm08) It could be valid switch 2854 <2> ;AN020;;D_P_Nop: ;AN000; (tm08) 2855 <2> ;AN020;; inc bp ;AN000; 2856 <2> ;AN020;; cmp bx,bp ;AN000; reset ZF 2857 <2> ;AN020;;D_P_Chk_S_Exit_0: ;AN000; 2858 <2> ;AN020;; jne D_P_Chk_S_Exit ;AN000; 2859 <2> ;AN020;; mov D_P_Terminator,al ;AN000; store switch character 2860 <2> ;AN020;;D_P_Chk_S_Exit: ;AN000; 2861 <2> 2862 <2> D_P_String_Buf equ D_P_STRING_BUF ; NASM port label 0 0000197D 8D2E[1700] LEA BP,[D_P_String_Buf] ;AN020;AC034; BP=OFFSET of D_P_String_Buf even in group addressing 2864 <2> ; .IF THEN ;AN020;IF not first char THEN 0 00001981 39EB cmp BX,BP ;AN000; 0 00001983 740A je D_P_STRUC_L2 ;AN000; 2867 <2> 2868 <2> ; .IF THEN ;AN020;otherwise see if a slash 0 00001985 3C2F cmp AL,D_P_Switch ;AN000; 0 00001987 7503 jne D_P_STRUC_L5 ;AN000; 2871 <2> 0 00001989 F9 STC ;AN020;not in first position and is slash, now see if might be in date string 2873 <2> %IF DateSw ;AN020;caller looking for date, see if this may be part of one 2874 <2> PUSH AX ;AN020;save input char 2875 <2> MOV AL,[PSDATA_SEG:BX-1] ;AN026;AL=char before the current char 2876 <2> CALL D_P_0099 ;AN020;return carry set if not numeric 2877 <2> ; .IF NC ;AND ;AN020;IF previous char numeric AND 2878 <2> jc D_P_STRUC_L7 ;AN000; 2879 <2> 2880 <2> MOV AL,[SI] ;AN020;AL=char after the current char 2881 <2> CALL D_P_0099 ;AN020;return carry set if not numeric 2882 <2> ;(deleted) .IF NC THEN ;AN020;IF next char numeric THEN could be a date 2883 <2> ;(deleted) CLC ;AN020;reset CF so "/" not treated as a delimiter 2884 <2> ;(deleted) .ENDIF ;AN026; 2885 <2> ; .ENDIF ;AN020;ENDIF looks like date (number/number) 2886 <2> D_P_STRUC_L7: ;AN000; 2887 <2> POP AX ;AN020;restore AL to input char 2888 <2> %ENDIF ;AN020;DateSw 2889 <2> ; .ELSE ;AN020; 0 0000198A EB0E jmp short D_P_STRUC_L1 ;AN000; 2891 <2> 2892 <2> D_P_STRUC_L5: ;AN000; 0 0000198C F8 CLC ;AN020;not a slash 2894 <2> ; .ENDIF ;AN020; 2895 <2> ; .ELSE ;AN020;is first char in the buffer, ZF=0 0 0000198D EB0B jmp short D_P_STRUC_L1 ;AN000; 2897 <2> 2898 <2> D_P_STRUC_L2: ;AN000; 2899 <2> ; .IF THEN ;AN020; 0 0000198F 3C2F cmp AL,D_P_Switch ;AN000; 0 00001991 7506 jne D_P_STRUC_L12 ;AN000; 2902 <2> 0 00001993 2E800E[0E00]40 OR byte [psdata_seg:D_P_Flags2],D_P_SW ;AN020;AC034;;could be valid switch, first char and is slash 2904 <2> ; .ENDIF ;AN020; 2905 <2> D_P_STRUC_L12: ;AN000; 0 00001999 F8 CLC ;AN020;CF=0 indicating first char 2907 <2> ; .ENDIF ;AN020; 2908 <2> D_P_STRUC_L1: ;AN000; 2909 <2> 0 0000199A C3 ret ;AN000; 2911 <2> D_P_Chk_Switch endp ;AN000; 2912 <2> ; PAGE ;AN000; 2913 <2> ;************************************************************************** 2914 <2> ; D_P_Chk_DBCS: 2915 <2> ; 2916 <2> ; Function: Check if a specified byte is in ranges of the DBCS lead bytes 2917 <2> ; 2918 <2> ; Input: 2919 <2> ; AL = Code to be examineed 2920 <2> ; 2921 <2> ; Output: 2922 <2> ; If CF is on then a lead byte of DBCS 2923 <2> ; 2924 <2> ; Use: INT 21h w/AH=63 2925 <2> ; 2926 <2> ; Vars: D_P_DBCSEV_Seg(RW), D_P_DBCSEV_Off(RW) 2927 <2> ;*************************************************************************** 2928 <2> D_P_Chk_DBCS PROC ;AN000; 2929 <2> ; 0 0000199B 1E PUSH DS ;AN000; 0 0000199C 56 PUSH SI ;AN000; 0 0000199D 53 PUSH bx ;AN000; (tm11) 0 0000199E 2E833E[0B00]00 CMP word [psdata_seg:D_P_DBCSEV_SEG],0 ;AC034; ALREADY SET ? 0 000019A4 7527 JNE D_P_DBCS00 ;AN000; 2935 <2> 0 000019A6 50 PUSH AX ;AN000; 2937 <2> ; PUSH BX ;AN000; (tm11) 0 000019A7 1E PUSH ds ;AN000; (tm11) 0 000019A8 51 PUSH CX ;AN000; 0 000019A9 52 PUSH DX ;AN000; 0 000019AA 57 PUSH DI ;AN000; 0 000019AB 55 PUSH BP ;AN000; 0 000019AC 06 PUSH ES ;AN000; 0 000019AD 31F6 XOR SI,SI ;AN000; 0 000019AF 8EDE MOV DS,SI ;AN000; 0 000019B1 B80063 MOV AX,D_P_DOS_GetEV ;AN000; GET DBCS EV CALL 0 000019B4 CD21 INT 21H ;AN000; 2948 <2> 2949 <2> ; MOV AX,DS ;AN000; (tm11) 2950 <2> ; OR AX,AX ;AN000; (tm11) 0 000019B6 8CDB MOV bx,DS ;AN000; (tm11) 0 000019B8 09DB OR bx,bx ;AN000; (tm11) 0 000019BA 07 POP ES ;AN000; 0 000019BB 5D POP BP ;AN000; 0 000019BC 5F POP DI ;AN000; 0 000019BD 5A POP DX ;AN000; 0 000019BE 59 POP CX ;AN000; 2958 <2> ; POP BX ;AN000; (tm11) 0 000019BF 1F POP ds ;AN000; (tm11) 0 000019C0 58 POP AX ;AN000; 0 000019C1 7429 JE D_P_NON_DBCS ;AN000; 2962 <2> 2963 <2> D_P_DBCS02: ;AN000; 0 000019C3 2E8936[0900] MOV [psdata_seg:D_P_DBCSEV_OFF],SI ;AC034; save EV offset 2965 <2> ; MOV psdata_seg:D_P_DBCSEV_SEG,DS ;AC034; save EV segment 0 000019C8 2E891E[0B00] MOV [psdata_seg:D_P_DBCSEV_SEG],bx ;AC034; save EV segment (tm11) 2967 <2> D_P_DBCS00: ;AN000; 0 000019CD 2E8B36[0900] MOV SI,[psdata_seg:D_P_DBCSEV_OFF] ;AC034; load EV offset 0 000019D2 2E8E1E[0B00] MOV DS,[psdata_seg:D_P_DBCSEV_SEG] ;AC034; and segment 2970 <2> 2971 <2> D_P_DBCS_LOOP: ;AN000; 0 000019D7 833C00 CMP WORD PTR [SI],0 ;AN000; zero vector ? 0 000019DA 7410 JE D_P_NON_DBCS ;AN000; then exit 2974 <2> 0 000019DC 3A04 CMP AL,[SI] ;AN000; 0 000019DE 7208 JB D_P_DBCS01 ;AN000; Check if AL is in 2977 <2> 0 000019E0 3A4401 CMP AL,[SI+1] ;AN000; range of 0 000019E3 7703 JA D_P_DBCS01 ;AN000; the vector 2980 <2> 0 000019E5 F9 STC ;AN000; if yes, indicate DBCS and exit 0 000019E6 EB05 JMP short D_P_DBCS_EXIT ;AN000; 2983 <2> 2984 <2> D_P_DBCS01: ;AN000; 0 000019E8 46 INC SI ;AC035; add '2' to 0 000019E9 46 INC SI ;AC035; SI reg 2987 <2> ;AN000; get next vector 2988 <2> ;(changed ;AC035;) ADD SI,2 ;AN000; get next vector 0 000019EA EBEB JMP short D_P_DBCS_LOOP ;AN000; loop until zero vector found 2990 <2> 2991 <2> D_P_NON_DBCS: ;AN000; 0 000019EC F8 CLC ;AN000; indicate SBCS 2993 <2> D_P_DBCS_EXIT: ;AN000; 0 000019ED 5B POP bx ;AN000; (tm11) 0 000019EE 5E POP SI ;AN000; 0 000019EF 1F POP DS ;AN000; 0 000019F0 C3 RET ;AN000; 2998 <2> D_P_Chk_DBCS ENDP ;AN000; 535 <1> ;=== Pop trace listing source 536 <1> 537 <1> 538 <1> ; (no prior section) ; code ends 88 %include "forswtch.mac" 1 <1> ;FORMAT Pre-defined switches 2 <1> SWITCH_S EQU 0001h ; System transfer 3 <1> SWITCH_V EQU 0002h ; Volume ID prompt 4 <1> SWITCH_BACKUP EQU 0004h 5 <1> SWITCH_C EQU 0008h 6 <1> SWITCH_T EQU 0010h 7 <1> SWITCH_N EQU 0020h 8 <1> SWITCH_1 EQU 0040h 9 <1> SWITCH_4 EQU 0080h 10 <1> SWITCH_8 EQU 0100h 11 <1> SWITCH_B EQU 0200h 12 <1> SWITCH_SELECT EQU 0400h 13 <1> SWITCH_AUTOTEST EQU 0800h 14 <1> SWITCH_F EQU 1000h 15 <1> SWITCH_FS EQU 2000h 16 <1> 17 <1> %IF ShipDisk 18 <1> 19 <1> SWITCH_Z EQU 4000h ;an000; dms;1 sector/cluster switch 20 <1> 21 <1> %ENDIF 22 <1> 23 <1> ; 24 <1> ; The following is a list of equates to define each IBM defined diskette size 25 <1> ; for use with the /F switch 26 <1> 27 <1> 28 <1> Size_160 equ 0001h ;Flag settings for size switch ;AN000; 29 <1> Size_180 equ 0002h ; ;AN000; 30 <1> Size_320 equ 0004h ; ;AN000; 31 <1> Size_360 equ 0008h ; ;AN000; 32 <1> Size_720 equ 0010h ; ;AN000; 33 <1> Size_1200 equ 0020h ; ;AN000; 34 <1> Size_1440 equ 0040h ; ;AN000; 35 <1> 36 <1> 37 <1> 89 [list +] 90 91 ; 92 ;***************************************************************************** 93 ; Public Data 94 ;***************************************************************************** 95 ; 96 97 Public FS_String_Buffer 98 Public Command_Line 99 Public Fatal_Error 100 Public Vol_Label_Count 101 Public Vol_Label_Buffer 102 Public PSP_Segment 103 Public Command_Old_Ptr 104 105 106 ; 107 ;***************************************************************************** 108 ; Public Routines 109 ;***************************************************************************** 110 ; 111 112 113 Public Main_Init 114 115 ; 116 ;***************************************************************************** 117 ; External Routine Declarations 118 ;***************************************************************************** 119 ; 120 121 Extrn Main_Routine:Near 122 Extrn SysLoadMsg:Near 123 Extrn Get_11_Characters:Near 124 Extrn ControlC_Handler:Near 125 Extrn SysDispMsg:Near 126 Extrn SysLoadMsg:Near 127 128 %IF FSExec ;/FS: conditional assembly ;an018; dms; 129 130 Extrn EXEC_FS_Format:Near 131 132 %ENDIF ;/FS: conditional assembly end ;an018;dms; 133 134 Extrn GetDeviceParameters:Near 135 ; 136 ;***************************************************************************** 137 ; External Data Declarations 138 ;***************************************************************************** 139 ; 140 141 Extrn SwitchMap:Word 142 Extrn ExitStatus:Byte 143 Extrn Drive:Byte 144 Extrn DriveLetter:Byte 145 Extrn TranSrc:Byte 146 Extrn TrackCnt:Word 147 Extrn NumSectors:Word 148 Extrn BIOSFile:Byte 149 Extrn DOSFile:Byte 150 Extrn CommandFile:Byte 151 Extrn MsgNeedDrive:Byte 152 Extrn MsgBadVolumeID:Byte 153 Extrn MsgBadDrive:Byte 154 Extrn MsgAssignedDrive:Byte 155 Extrn MsgNetDrive:Byte 156 Extrn Parse_Error_Msg:Byte 157 Extrn Extended_Error_Msg:Byte 158 Extrn SizeMap:Byte 159 Extrn MsgSameSwitch:Byte 160 Extrn Org_AX:word ;an000; dms;AX on prog. entry 161 Extrn DeviceParameters:Byte ;an000; dms; 162 Extrn FAT_Flag:Byte ;an000; dms; 163 Extrn Sublist_MsgParse_Error:Dword ;an000; dms; 164 165 === Switch to base=001900h -> "CODE" 166 section code 167 168 ;***************************************************************************** 169 ;Routine name: Main_Init 170 ;***************************************************************************** 171 ; 172 ;Description: Main control routine for init section 173 ; 174 ;Called Procedures: Message (macro) 175 ; Check_DOS_Version 176 ; Init_Input_Output 177 ; Validate_Target_Drive 178 ; Hook_CNTRL_C 179 ; 180 ;Input: None 181 ; 182 ;Output: None 183 ; 184 ;Change History: Created 5/1/87 MT 185 ; 186 ;Psuedocode 187 ; --------- 188 ; 189 ; Get PSP segment 190 ; Fatal_Error = NO 191 ; Setup I/O (CALL Init_Input_Output) 192 ; IF !Fatal_Error 193 ; Check target drive letter (CALL Validate_Target_Drive) 194 ; IF !Fatal_Error 195 ; Set up Control Break (CALL Hook_CNTRL_C) 196 ; IF !Fatal_Error 197 ; CALL Main_Routine 198 ; ENDIF 199 ; ENDIF 200 ; ENDIF 201 ; Exit program 202 ;***************************************************************************** 203 204 Procedure Main_Init ; ;AN000; 205 206 0 000019F1 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 0 000019F9 58 0 000019FA B462CD21 DOS_Call GetCurrentPSP ;Get PSP segment address 0 000019FE 891E[0100] mov [PSP_Segment],bx ;Save it for later 210 No equ NO ; NASM port equate 0 00001A02 C606[1A01]00 mov byte [Fatal_Error],No ;Init the error flag ;AN000; 0 00001A07 E82700 call Init_Input_Output ;Setup messages and parse ;AN000; 213 Yes equ YES ; NASM port equate 0 00001A0A 803E[1A01]FF cmp byte [Fatal_Error],Yes ;Error occur? ;AN000; 215 ; $IF NE ;Nope, keep going ;AN000; 0 00001A0F 7417 JE DD_IF1 0 00001A11 E88C02 call Validate_Target_Drive ;Check drive letter ;AN000; 0 00001A14 803E[1A01]FF cmp byte [Fatal_Error],Yes ;Error occur? ;AN000; 219 ; $IF NE ;Nope, keep going ;AN000; 0 00001A19 740D JE DD_IF2 0 00001A1B E82803 call Hook_CNTRL_C ;Set CNTRL -Break hook ;AN000; 0 00001A1E 803E[1A01]FF cmp byte [Fatal_Error],Yes ;Error occur? ;AN000; 223 ; $IF NE ;Nope, keep going ;AN000; 0 00001A23 7403 JE DD_IF3 0 00001A25 E8[0000] call Main_Routine ;Go do the real program ;AN000; 226 ; $ENDIF ; ;AN000; 227 DD_IF3: 228 ; $ENDIF ; ;AN000; 229 DD_IF2: 230 ; $ENDIF ; ;AN000; 231 DD_IF1: 0 00001A28 A0[0000] mov al,[ExitStatus] ;Get Errorlevel ;AN000; 0 00001A2B B44CCD21 DOS_Call Exit ;Exit program ;AN000; 0 00001A2F CD20 int 20h ;If other exit fails ;AN000; 235 236 Main_Init endp ; ;AN000; 237 238 ;***************************************************************************** 239 ;Routine name: Init_Input_Output 240 ;***************************************************************************** 241 ; 242 ;Description: Initialize messages, Parse command line, allocate memory as 243 ; needed. If there is a /FS switch, go handle it first as 244 ; syntax of IFS format may be different from FAT format. 245 ; 246 ;Called Procedures: Preload_Messages 247 ; Parse_For_FS_Switch 248 ; Parse_Command_Line 249 ; 250 ;Change History: Created 4/1/87 MT 251 ; 252 ;Input: PSP command line at 81h and length at 80h 253 ; Fatal_Error = No 254 ; 255 ;Output: Fatal_Error = YES/NO 256 ; 257 ;Psuedocode 258 ;---------- 259 ; 260 ; Load messages (CALL Preload_Messages) 261 ; IF !Fatal_Error 262 ; See if EXEC another file system (CALL Parse_For_FS_Switch) 263 ; IF !FATAL_Error (in this case means FS was found and exec'd) 264 ; CALL Parse_Command_Line 265 ; IF !Fatal_Error 266 ; CALL Interpret_Parse 267 ; ENDIF 268 ; ENDIF 269 ; ENDIF 270 ; ret 271 ;***************************************************************************** 272 273 Procedure Init_Input_Output ; ;AN000; 274 0 00001A31 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 0 00001A39 58 0 00001A3A E81800 call Preload_Messages ;Load up message retriever ;AN000; 277 278 %IF FSExec ;/FS: conditional assembly ;an018; dms; 279 280 cmp byte [Fatal_Error],YES ;Quit? ;AN000; 281 ; $IF NE ;Nope, keep going ;AN000; 282 JE DD_IF7 283 call Check_For_FS_Switch ;Specify FS other than FAT? ;AN000; 284 285 %ENDIF ;/FS: conditional assembly end ;an018;dms; 286 0 00001A3D 803E[1A01]FF cmp byte [Fatal_Error],YES ;drive is invalid for format? ;an000; 288 ; $if ne ;no ;an000; 0 00001A42 7410 JE DD_IF8 0 00001A44 E82500 call Parse_Command_Line ;Parse in command line input ;AN000; 0 00001A47 803E[1A01]FF cmp byte [Fatal_Error],YES ;Quit? ;AN000; 292 ; $IF NE ;Nope, keep going ;AN000; 0 00001A4C 7406 JE DD_IF9 0 00001A4E E82C03 call Determine_FAT_Non_FAT;see if drive was non_FAT ;an000; 0 00001A51 E80003 call Check_For_Invalid_Drive;Drive joined? ;an000; 296 ; $ENDIF ; ;AN000; 297 DD_IF9: 298 ; $ENDIF ; ;AN000; 299 DD_IF8: 300 301 %IF FSExec ;/FS: conditional assembly ;an018; dms; 302 303 ; $ENDIF ; ;an000; 304 DD_IF7: 305 306 %ENDIF ;/FS: conditional assembly end ;an018;dms; 307 0 00001A54 C3 ret ; ;AN000; 309 310 Init_Input_Output endp ; ;AN000; 311 312 ;***************************************************************************** 313 ;Routine name: Preload_Messages 314 ;***************************************************************************** 315 ; 316 ;Description: Preload messages using common message retriever routines. 317 ; 318 ;Called Procedures: SysLoadMsg 319 ; 320 ; 321 ;Change History: Created 5/1/87 MT 322 ; 323 ;Input: Fatal_Error = NO 324 ; 325 ;Output: Fatal_Error = YES/NO 326 ; 327 ;Psuedocode 328 ;---------- 329 ; 330 ; Preload All messages (Call SysLoadMsg) 331 ; IF error 332 ; Display SysLoadMsg error message 333 ; Fatal_Error = YES 334 ; ENDIF 335 ; ret 336 ;***************************************************************************** 337 338 Procedure Preload_Messages ; ;AN000; 339 ; 0 00001A55 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 0 00001A5D 58 0 00001A5E E8[0000] call SysLoadMsg ;Preload the messages ;AN000; 342 ; $IF C ;Error? ;AN000; 0 00001A61 7308 JNC DD_IF13 0 00001A63 E8[0000] call SysDispMsg ;Display preload msg ;AN000; 0 00001A66 C606[1A01]FF mov byte [Fatal_Error], YES ;Indicate error exit ;AN000; 346 ; $ENDIF ; ;AN000; 347 DD_IF13: 0 00001A6B C3 ret ; ;AN000; 349 350 Preload_Messages endp ; ;AN000; 351 352 353 354 msgSameSwitch equ MsgSameSwitch ; NASM port label 355 356 %IF FSExec ;/FS: conditional assembly ;an018; dms; 357 358 359 ;***************************************************************************** 360 ;Routine name: Check_For_FS_Switch 361 ;***************************************************************************** 362 ; 363 ;Description: Parse to see if /FS switch entered, and if so, go EXEC the 364 ; asked for file system. Set Fatal_Error = YES if FS found 365 ; If we do find /FS, we need to build a string of xxxxxfmt.exe,0 366 ; where xxxxx is the first 5 characters or less of /FS:xxxxx 367 ; 368 ;Called Procedures: Parse_For_FS_Switch 369 ; EXEC_FS_Format 370 ; 371 ;Change History: Created 6/21/87 MT 372 ; 373 ;Input: Fatal_Error = NO 374 ; 375 ;Output: Fatal_Error = YES/NO 376 ; Exit_Status set 377 ; 378 ;Psuedocode 379 ;---------- 380 ; 381 ; Parse for /FS switch (CALL Parse_For_FS_Switch) 382 ; IF !FATAL_ERROR 383 ; IF /FS found 384 ; Point at what was entered on /FS:xxxxx 385 ; DO 386 ; LEAVE end of entered string 387 ; Got good char, move into path 388 ; ENDDO already got 5 chars (max in xxxxxfmt.exe) 389 ; Tack on the rest of the string (fmt.exe,0) 390 ; Go exec the needed format (CALL EXEC_FS_Format) 391 ; ENDIF 392 ; ENDIF 393 ; ret 394 ;***************************************************************************** 395 396 Procedure Check_For_FS_Switch ; ;AN000; 397 ;AN000; 398 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 399 call Parse_For_FS_Switch ;See if /FS entered ;AN000; 400 cmp byte [Fatal_Error],YES ;Bad stuff entered?? ;AN000; 401 ; $IF NE ;Nope, cruise onward ;AN000; 402 JE DD_IF15 403 cmp word [Switch_String_Buffer + Switch_Pointer],offset Switch_FS_Control + Keyword ; ;AN000; 404 ; $IF E ;We got the switch ;AN000; 405 JNE DD_IF16 406 mov byte [Switch_FS_Control + Keyword],20h ;an000; dms;remove switch from table 407 Switch_FS equ SWITCH_FS ; NASM port equate 408 test word [SwitchMap],Switch_FS ;Have this already? ;AN002; 409 ; $IF Z ;Nope ;AN002; 410 JNZ DD_IF17 411 push ds ;Get addressibility ;AN000; 412 pop es ; " " " " ;AN000; 413 ; 414 assume ds:nothing,es:data ; ;AN000; 415 ; 416 mov ax,[es:Switch_String_Buffer + Switch_String_Seg] ;Get the entered FS ;AN000; 417 mov ds,ax ; ;AN000; 418 mov si,[es:Switch_String_Buffer + Switch_String_Off] ; ;AN000; 419 mov cx,FS_String_Max_Length ; ;AN000; 420 mov di,offset FS_String_Buffer ; ;AN000; 421 ; $DO ;Move whatever user entered ;AN000; 422 DD_DO18: 423 ASCIIZ_End equ Asciiz_End ; NASM port equate 424 cmp byte ptr [si],ASCIIZ_End ;End of the string? ;AN000; 425 ; $LEAVE E ;Yep ;AN000; 426 JE DD_EN18 427 movsb ;Put character in buffer ;AN000; 428 dec cx ;Dec character counter 429 cmp cx,0 ;Nope, reached max # chars? ;AN000; 430 ; $ENDDO E ;Yes ;AN000; 431 JNE DD_DO18 432 DD_EN18: 433 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 434 mov cx,Len_FS_String_End ;Tack the FMT.EXE onto it ;AN000; 435 mov si,offset FS_String_End ;DI still points at string ;AN000; 436 rep movsb ;We now have Asciiz path! ;AN000; 437 call EXEC_FS_Format ;Go try to EXEC it..... ;AN000; 438 ; $ELSE ; ;AN002; 439 JMP SHORT DD_EN17 440 DD_IF17: 441 Message msgSameSwitch ; ;AN002; 442 mov byte [Fatal_Error],Yes ; ;AN002; 443 ; $ENDIF ; ;AN002; 444 DD_EN17: 445 ; $ENDIF ; ;AN000; 446 DD_IF16: 447 ; $ENDIF ; ;AN000; 448 DD_IF15: 449 ret ; ;AN000; 450 451 Check_For_FS_Switch endp ; ;AN000; 452 453 ;***************************************************************************** 454 ;Routine name: Parse_For_FS_Switch 455 ;***************************************************************************** 456 ; 457 ;Description: Copy the command line. Parse the new command line (Parse routines 458 ; destroy the data being parsed, so need to work on copy so that 459 ; complete command line can be passed to child format). 460 ; The only thing we care about is if the /FS: switch exists, so 461 ; parse until end of command line found. If there was an error, 462 ; and it occurred on the /FS switch, then give parse error, 463 ; otherwise ignore the parse error, because it might be something 464 ; file system specific that doesn't meet DOS syntax rules. Also 465 ; check for drive letter, as it is alway required. 466 ; 467 ;Called Procedures: Message (macro) 468 ; SysLoadMsg 469 ; Preload_Error 470 ; SysParse 471 ; 472 ;Change History: Created 5/1/87 MT 473 ; 474 ;Input: Command line at 80h in PSP 475 ; Fatal_Error = NO 476 ; PSP_Segment 477 ; 478 ;Output: Fatal_Error = YES/NO 479 ; 480 ;Psuedocode 481 ;---------- 482 ; Copy command line to buffer 483 ; DO 484 ; Parse command line (Call SysParse) 485 ; LEAVE end of parse 486 ; ENDDO found /FS 487 ; IF drive letter not found (This assumes drive letter before switches) 488 ; Tell user 489 ; Fatal_Error = YES 490 ; ENDIF 491 ; ret 492 ;***************************************************************************** 493 494 Procedure Parse_For_FS_Switch ; ;AN000; 495 ; 496 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 497 Init equ INIT ; NASM port equate 498 mov byte [Drive_Letter_Buffer + Drive_Number],Init ; ;AN000; 499 mov cx,[PSP_Segment] ;Get segment of PSP ;AN000; 500 mov ds,cx ; " " " " ;AN000; 501 assume ds:nothing ; 502 ; 503 mov si,Command_Line_Parms ;Point at command line ;AN000; 504 mov di,offset Command_Line_Buffer wrt data ;Where to put a copy of it ;AN000; 505 mov cx,Command_Line_Length ;How long was input? ;AN000; 506 repnz movsb ;Copy it ;AN000; 507 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 508 xor cx,cx ; ;AN000; 509 xor dx,dx ;Required for SysParse call ;AN000; 510 mov si,offset Command_Line_Buffer ;Pointer to parse line ;AN000; 511 mov di,offset Switch_FS_Table ;Pointer to control table ;AN000; 512 ; $DO ;Setup parse call ;AN000; 513 DD_DO25: 514 call SysParse ;Go parse ;AN000; 515 cmp ax,End_Of_Parse ;Check for end of parse ;AN000; 516 ; $LEAVE E,OR ;Exit if it is end, or ;AN000; 517 JE DD_EN25 518 cmp ax,Operand_Missing ; exit if positional missing ;AN000; 519 ; $LEAVE E ;In other words, no drive letter;AN000; 520 JE DD_EN25 521 cmp word [Switch_String_Buffer + Switch_Pointer],offset Switch_FS_Control + Keyword ;AN000; 522 ; $ENDDO E ;Exit if we find /FS ;AN000; 523 JNE DD_DO25 524 DD_EN25: 525 cmp byte [Drive_Letter_Buffer + Drive_Type],Type_Drive ;Check for drive letter found;AN000; 526 ; $IF NE ;Did we not find one? ;AN000; 527 JE DD_IF28 528 msgNeedDrive equ MsgNeedDrive ; NASM port label 529 MESSAGE msgNeedDrive ;Must enter drive letter ;AN000; 530 mov byte [Fatal_Error],Yes ;Indicate error on exit ;AN000; 531 ; $ENDIF ; ;AN000; 532 DD_IF28: 533 ret ; ;AN000; 534 535 Parse_For_FS_Switch endp ; ;AN000; 536 537 538 %ENDIF ;/FS: conditional assembly end ;an018;dms; 539 540 541 ;***************************************************************************** 542 ;Routine name: Parse_Command_Line 543 ;***************************************************************************** 544 ; 545 ;Description: Parse the command line. Check for errors, and display error and 546 ; exit program if found. Use parse error messages except in case 547 ; of no parameters, which has its own message 548 ; 549 ;Called Procedures: Message (macro) 550 ; SysParse 551 ; Interpret_Parse 552 ; 553 ;Change History: Created 5/1/87 MT 554 ; 555 ;Input: Fatal_Error = NO 556 ; PSP_Segment 557 ; 558 ;Output: Fatal_Error = YES/NO 559 ; 560 ; 561 ;Psuedocode 562 ;---------- 563 ; 564 ; Assume Fatal_Error = NO on entry 565 ; SEARCH 566 ; EXITIF Fatal_Error = YES,OR (This can be set by Interpret_Parse) 567 ; Parse command line (CALL SysParse) 568 ; EXITIF end of parsing command line 569 ; Figure out last thing parsed (Call Interpret_Parse) 570 ; ORELSE 571 ; See if parse error 572 ; LEAVE parse error,OR 573 ; See what was parsed (Call Interpret_Parse) 574 ; LEAVE if interpret error such as bad volume label 575 ; ENDLOOP 576 ; Display parse error message and print error operand 577 ; Fatal_Error = YES 578 ; ENDSRCH 579 ; ret 580 ;***************************************************************************** 581 582 Procedure Parse_Command_Line ; ;AN000; 583 0 00001A6C 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 0 00001A74 58 0 00001A75 1E push ds 0 00001A76 8B0E[0100] mov cx,[PSP_Segment] ;Get segment of PSP ;AN000; 0 00001A7A 8ED9 mov ds,cx ; " " " " ;AN000; 588 589 assume ds:nothing,es:data 590 0 00001A7C 31C9 xor cx,cx ;Parse table @DI ;AN000; 0 00001A7E 31D2 xor dx,dx ;Parse line @SI ;AN000; 0 00001A80 BE8100 mov si,Command_Line_Parms ;Pointer to parse line ;AN000; 0 00001A83 268936[1B01] mov word ptr [es:Command_Old_Ptr],si 0 00001A88 BF[1D01] mov di,offset Command_Line_Table ;Pointer to control table ;AN000; 596 ; $SEARCH ;Loop until all parsed ;AN000; 597 DD_DO30: 0 00001A8B 26803E[1A01]FF cmp byte [es:Fatal_Error],Yes ;Interpret something bad? ;AN000; 599 ; $EXITIF E,OR ;If so, don't parse any more ;AN000; 0 00001A91 7408 JE DD_LL31 0 00001A93 E8A5F6 call SysParse ;Go parse ;AN000; 0 00001A96 83F8FF cmp ax,End_Of_Parse ;Check for end of parse ;AN000; 603 ; $EXITIF E ;Is it? ;AN000; 0 00001A99 7502 JNE DD_IF30 605 DD_LL31: 606 ;All done ;AN000; 607 ; $ORELSE ;Not end ;AN000; 0 00001A9B EB3B JMP SHORT DD_SR30 609 DD_IF30: 0 00001A9D 83F800 cmp ax,0 ;Check for parse error ;AN000; 611 ; $LEAVE NE ;Stop if there was one ;AN000; 0 00001AA0 750A JNE DD_EN30 0 00001AA2 268936[1B01] mov word ptr [es:Command_Old_Ptr],si 0 00001AA7 E83000 call Interpret_Parse ;Go find what we parsed ;AN000; 615 ; $ENDLOOP ;Parse error, see what it was ;AN000; 0 00001AAA EBDF JMP SHORT DD_DO30 617 DD_EN30: 0 00001AAC C60400 mov byte ptr [si],0 0 00001AAF 57 push di 0 00001AB0 50 push ax 0 00001AB1 BF[0000] mov di,offset Sublist_MsgParse_Error 0 00001AB4 26A1[1B01] mov ax,word ptr [es:Command_Old_Ptr] 0 00001AB8 26894502 mov word ptr [es:di+2],ax 0 00001ABC 268C5D04 mov word ptr [es:di+4],ds 0 00001AC0 58 pop ax 0 00001AC1 5F pop di 0 00001AC2 1EBA[0000]8EDAA3 PARSE_MESSAGE ;Display parse error ;AN000; 0 00001AC9 [0000]BA[0000]E8 0 00001ACF [0000]1F 0 00001AD2 26C606[1A01]FF mov byte [es:Fatal_Error],YES ;Indicate death! ;AN000; 629 ; $ENDSRCH ; ;AN000; 630 DD_SR30: 0 00001AD8 1F pop ds ; ;AN000; 0 00001AD9 C3 ret ; ;AN000; 633 634 Parse_Command_Line endp ; ;AN000; 635 636 ;***************************************************************************** 637 ;Routine name: Interpret_Parse 638 ;***************************************************************************** 639 ; 640 ;Description: Set the SwitchMap field with the switches found on the 641 ; command line. Get the drive letter. /FS will be handled before 642 ; here, will not be seen in this parse or accepted. Also, if /V 643 ; see if volume label entered and verify it is good, setting up 644 ; FCB for later create 645 ; 646 ;Called Procedures: Get_11_Characters 647 ; 648 ;Change History: Created 5/1/87 MT 649 ; 650 ;Input: Fatal_Error = NO 651 ; 652 ;Output: SwitchMap set 653 ; DriveLetter set 654 ; DriveNum set A=0,B=1 etc... 655 ; Command_Line = YES/NO 656 ; Fatal_Error = YES/NO 657 ; 658 ;Psuedocode 659 ;---------- 660 ; 661 ; IF Drive letter parsed 662 ; Drive = Parsed drive number -1 663 ; DriveLetter = (Parsed drive number - 1) +'A' 664 ; ENDIF 665 ; IF /1 666 ; or SwitchMap,Switch_1 667 ; ENDIF 668 ; IF /4 669 ; or SwitchMap,Switch_4 670 ; ENDIF 671 ; IF /8 672 ; or SwitchMap,Switch_8 673 ; ENDIF 674 ; IF /S 675 ; or SwitchMap,Switch_S 676 ; ENDIF 677 ; IF /BACKUP 678 ; or SwitchMap,Switch_BACKUP 679 ; ENDIF 680 ; IF /B 681 ; or SwitchMap,Switch_B 682 ; ENDIF 683 ; IF /T 684 ; or SwitchMap,Switch_T 685 ; TrackCnt = entered value 686 ; ENDIF 687 ; IF /N 688 ; or SwitchMap,Switch_N 689 ; NumSectors = entered value 690 ; ENDIF 691 ; IF /SELECT 692 ; or SwitchMap,Switch_SELECT 693 ; ENDIF 694 ; IF /V 695 ; or SwitchMap,Switch_V 696 ; IF string entered 697 ; Build ASCIIZ string for next call (CALL Build_String) 698 ; Verify DBCS and setup FCB (CALL Get_11_Characters) 699 ; Command_Line = YES 700 ; IF error 701 ; Invalid label message 702 ; Fatal_Error = YES 703 ; ENDIF 704 ; ENDIF 705 ; ENDIF 706 ; IF /AUTOTEST 707 ; or SwitchMap,Switch_AUTOTEST 708 ; ENDIF 709 ; 710 ; IF /F 711 ; or SwitchMap,Switch_F 712 ; or Size_Map,Item_Tag 713 ; ENDIF 714 ; IF /Z (only if assembled) 715 ; or SwitchMap,Switch_Z 716 ; ENDIF 717 ; ret 718 ;***************************************************************************** 719 720 Procedure Interpret_Parse ; ;AN000; 721 0 00001ADA 1E push ds ;Save segment ;AN000; 0 00001ADB 56 push si ;Restore SI for parser ;AN000; 0 00001ADC 51 push cx ; ;AN000; 0 00001ADD 57 push di ; 0 00001ADE 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 0 00001AE6 58 0 00001AE7 803E[E402]06 cmp byte [Drive_Letter_Buffer + Drive_Type],Type_Drive ;Have drive letter? ;AN000; 728 ; $IF E ;Yes, save info ;AN000; 0 00001AEC 750D JNE DD_IF36 0 00001AEE A0[E802] mov al,[Drive_Letter_Buffer + Drive_Number] ;Get drive entered ;AN000; 0 00001AF1 FEC8 dec al ;Make it 0 based ;AN000; 0 00001AF3 A2[0000] mov [Drive],al ; " " " " ;AN000; 0 00001AF6 0441 add al,'A' ;Make it a drive letter ;AN000; 0 00001AF8 A2[0000] mov [DriveLetter],al ;Save it ;AN000; 735 ; $ENDIF ; ;AN000; 736 DD_IF36: 0 00001AFB 813E[F302][7401] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_1_Control + Keyword ;;AN000; 738 ; $IF E ; ;AN000; 0 00001B01 750A JNE DD_IF38 0 00001B03 C606[7401]20 mov byte [Switch_1_Control + Keyword],20h ;an000; dms;remove switch from table 741 Switch_1 equ SWITCH_1 ; NASM port equate 0 00001B08 830E[0000]40 or word [SwitchMap],Switch_1 ; ;AN000; 743 ; $ENDIF ; ;AN000; 744 DD_IF38: 0 00001B0D 813E[F302][6801] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_4_Control + Keyword ;;AN000; 746 ; $IF E ; ;AN000; 0 00001B13 750B JNE DD_IF40 0 00001B15 C606[6801]20 mov byte [Switch_4_Control + Keyword],20h ;an000; dms;remove switch from table 749 Switch_4 equ SWITCH_4 ; NASM port equate 0 00001B1A 810E[0000]8000 or word [SwitchMap],Switch_4 ; ;AN000; 751 ; $ENDIF ; ;AN000; 752 DD_IF40: 0 00001B20 813E[F302][8001] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_8_Control + Keyword ;;AN000; 754 ; $IF E ; ;AN000; 0 00001B26 750B JNE DD_IF42 0 00001B28 C606[8001]20 mov byte [Switch_8_Control + Keyword],20h ;an000; dms;remove switch from table 757 Switch_8 equ SWITCH_8 ; NASM port equate 0 00001B2D 810E[0000]0001 or word [SwitchMap],Switch_8 ; ;AN000; 759 ; $ENDIF ; ;AN000; 760 DD_IF42: 0 00001B33 813E[F302][5C01] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_S_Control + Keyword ;;AN000; 762 ; $IF E ; ;AN000; 0 00001B39 750A JNE DD_IF44 0 00001B3B C606[5C01]20 mov byte [Switch_S_Control + Keyword],20h ;an000; dms;remove switch from table 765 Switch_S equ SWITCH_S ; NASM port equate 0 00001B40 830E[0000]01 or word [SwitchMap],Switch_S ; ;AN000; 767 ; $ENDIF ; ;AN000; 768 DD_IF44: 0 00001B45 813E[F302][C101] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_Backup_Control + Keyword ;AN000; 770 ; $IF E ; ;AN000; 0 00001B4B 750A JNE DD_IF46 0 00001B4D C606[C101]20 mov byte [Switch_Backup_Control + Keyword],20h ;an000; dms;remove switch from table 773 Switch_Backup equ SWITCH_BACKUP ; NASM port equate 0 00001B52 830E[0000]04 or word [SwitchMap],Switch_Backup ; ;AN000; 775 ; $ENDIF ; ;AN000; 776 DD_IF46: 0 00001B57 813E[F302][B001] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_Select_Control + Keyword ;AN000; 778 ; $IF E ; ;AN000; 0 00001B5D 750B JNE DD_IF48 0 00001B5F C606[B001]20 mov byte [Switch_Select_Control + Keyword],20h ;an000; dms;remove switch from table 781 Switch_Select equ SWITCH_SELECT ; NASM port equate 0 00001B64 810E[0000]0004 or word [SwitchMap],Switch_Select ; ;AN000; 783 ; $ENDIF ; ;AN000; 784 DD_IF48: 0 00001B6A 813E[F302][8C01] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_B_Control + Keyword ;AN000; 786 ; $IF E ; ;AN000; 0 00001B70 750B JNE DD_IF50 0 00001B72 C606[8C01]20 mov byte [Switch_B_Control + Keyword],20H 789 Switch_B equ SWITCH_B ; NASM port equate 0 00001B77 810E[0000]0002 or word [SwitchMap],Switch_B ; ;AN000; 791 ; $ENDIF ; ;AN000; 792 DD_IF50: 0 00001B7D 813E[FB02][9801] cmp word [Switch_Num_Buffer + Switch_Num_Pointer],offset Switch_T_Control + Keyword ;AN000; 794 ; $IF E ; ;AN000; 0 00001B83 752B JNE DD_IF52 0 00001B85 C606[9801]20 mov byte [Switch_T_Control + Keyword],20h ;an000; dms;remove switch from table 0 00001B8A C706[FB02]0000 mov word [Switch_Num_Buffer + Switch_Num_Pointer],0 ;Init for next switch ;AN008; 798 Switch_T equ SWITCH_T ; NASM port equate 0 00001B90 F706[0000]1000 test word [SwitchMap],Switch_T ;Don't allow if switch already ;AN002; 800 ; $IF Z ; entered ;AN002; 0 00001B96 750D JNZ DD_IF53 0 00001B98 830E[0000]10 or word [SwitchMap],Switch_T ; ;AN000; 0 00001B9D A1[FD02] mov ax,[Switch_Num_Buffer + Switch_Number_Low] ;Get entered tracks ;AN000; 0 00001BA0 A3[0000] mov [TrackCnt],ax ;1024 or less, so always dw ;AN000; 805 ; $ELSE ; ;AN002; 0 00001BA3 EB0B JMP SHORT DD_EN53 807 DD_IF53: 0 00001BA5 BA[0000]E8[0000] Message msgSameSwitch ; ;AN002; 0 00001BAB C606[1A01]FF mov byte [Fatal_Error],Yes ; ;AN002; 810 ; $ENDIF ; ;AN000; 811 DD_EN53: 812 ; $ENDIF ; ;AN002; 813 DD_IF52: 0 00001BB0 813E[FB02][A401] cmp word [Switch_Num_Buffer + Switch_Num_Pointer],offset Switch_N_Control + Keyword ;AN000; 815 ; $IF E ; ;AN000; 0 00001BB6 752D JNE DD_IF57 0 00001BB8 C606[A401]20 mov byte [Switch_N_Control + Keyword],20h ;an000; dms;remove switch from table 0 00001BBD C706[FB02]0000 mov word [Switch_Num_Buffer + Switch_Num_Pointer],0 ;Init for next switch ;AN008; 819 Switch_N equ SWITCH_N ; NASM port equate 0 00001BC3 F706[0000]2000 test word [SwitchMap],Switch_N ;Make sure switch not already ;AN002; 821 ; $IF Z ; entered ;AN002; 0 00001BC9 750F JNZ DD_IF58 0 00001BCB 830E[0000]20 or word [SwitchMap],Switch_N ; ;AN000; 0 00001BD0 A1[FD02] mov ax,[Switch_Num_Buffer + Switch_Number_Low] ;Get entered tracks ;AN000; 0 00001BD3 30E4 xor ah,ah ;clear high byte ;an000; 0 00001BD5 A3[0000] mov [NumSectors],ax ;Save tracks per sector ;AN000; 827 ; $ELSE ; ;AN002; 0 00001BD8 EB0B JMP SHORT DD_EN58 829 DD_IF58: 0 00001BDA BA[0000]E8[0000] Message msgSameSwitch ; ;AN002; 0 00001BE0 C606[1A01]FF mov byte [Fatal_Error],Yes ; ;AN002; 832 ; $ENDIF ; ;AN000; 833 DD_EN58: 834 ; $ENDIF ; ;AN002; 835 DD_IF57: 0 00001BE5 813E[0303][5001] cmp word [Switch_String_Buffer + Switch_String_Pointer],offset Switch_V_Control + Keyword ;AN000; 837 ; $IF E ;If /v and haven't already done ;AN000; 0 00001BEB 7560 JNE DD_IF62 0 00001BED C706[0303]0000 mov word [Switch_String_Buffer + Switch_String_Pointer],0 ;Init for next switch ;AN008; 0 00001BF3 C606[5001]20 mov byte [Switch_V_Control + Keyword],20h ;an000; dms;remove switch from table 841 Switch_V equ SWITCH_V ; NASM port equate 0 00001BF8 F706[0000]0200 test word [SwitchMap],Switch_V ; it - Only allow one /V entry ;AN002; 843 ; $IF Z ; ;AN002; 0 00001BFE 7542 JNZ DD_IF63 0 00001C00 830E[0000]02 or word [SwitchMap],Switch_V ;Set /v indicator ;AN000; 0 00001C05 8B36[0703] mov si,[Switch_String_Buffer + Switch_String_Seg] ;Get string address ;;AN000; 0 00001C09 8EDE mov ds,si ; ;AN000; 848 849 assume ds:nothing 850 0 00001C0B 268B36[0503] mov si,[es:Switch_String_Buffer + Switch_String_Off] ; ;AN000; 0 00001C10 803C00 cmp byte ptr [si],None ;Is there a string there? ;AN000; 853 ; $IF NE ;Yep ;AN000; 0 00001C13 742B JE DD_IF64 0 00001C15 FC cld ; ;AN000; 0 00001C16 BF[1A00] mov di,offset Vol_Label_Buffer ;Point at buffer to move string;AN000; 0 00001C19 B90C00 mov cx,Label_Length+1 ;Max length of string ;AN000; 0 00001C1C F3A4 rep movsb ;This will copy string & always ;AN000; 859 ; leave ASCIIZ end in buffer, ; ; 860 ; which is init'd to 13 dup(0) ; ; 0 00001C1E BE[1A00] mov si,offset Vol_Label_Buffer ;Point at string ;AN000; 0 00001C21 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS,ES to Data segment ;AN000; 0 00001C29 58 0 00001C2A C606[0000]FF mov byte [Command_Line],YES ;Set flag indicating vol label ;AN000; 0 00001C2F E8[0000] call Get_11_Characters ;Check DBCS and build FCB ;AN000; 865 ; $IF C ;Bad DBCS setup ;AN000; 0 00001C32 730C JNC DD_IF65 867 msgBadVolumeID equ MsgBadVolumeID ; NASM port label 0 00001C34 BA[0000]E8[0000] Message msgBadVolumeID ;Tell user ;AN000; 0 00001C3A 26C606[1A01]FF mov byte [es:Fatal_Error],YES ;Indicate time to quit ;AN000; 870 ; $ENDIF ; ;AN000; 871 DD_IF65: 872 ; $ENDIF ; ;AN000; 873 DD_IF64: 874 ; $ELSE ; ;AN002; 0 00001C40 EB0B JMP SHORT DD_EN63 876 DD_IF63: 0 00001C42 BA[0000]E8[0000] Message msgSameSwitch ; ;AN002; 0 00001C48 C606[1A01]FF mov byte [Fatal_Error],Yes ; ;AN002; 879 ; $ENDIF ; ;AN002; 880 DD_EN63: 881 ; $ENDIF ; ;AN000; 882 DD_IF62: 0 00001C4D 813E[F302][D201] cmp word [Switch_Buffer + Switch_Pointer],offset Switch_Autotest_Control + Keyword ;AN000; 884 ; $IF E ; ;AN000; 0 00001C53 750B JNE DD_IF71 0 00001C55 C606[D201]20 mov byte [Switch_Autotest_Control + Keyword],20h ;an000; dms;remove switch from table 887 Switch_Autotest equ SWITCH_AUTOTEST ; NASM port equate 0 00001C5A 810E[0000]0008 or word [SwitchMap],Switch_Autotest ; ;AN000; 889 ; $ENDIF ; ;AN000; 890 DD_IF71: 891 892 %IF ShipDisk 893 894 cmp word [Switch_Buffer + Switch_Pointer],offset Switch_Z_Control + Keyword ;an000; dms;/Z switch? 895 ; $IF E ; ;an000; dms;yes 896 JNE DD_IF73 897 mov byte [Switch_Z_Control + Keyword],20h ;an000; dms;remove switch from table 898 Switch_Z equ SWITCH_Z ; NASM port equate 899 or word [SwitchMap],Switch_Z ; ;an000; dms;signal switch found 900 ; $ENDIF ; ;an000; dms; 901 DD_IF73: 902 903 %ENDIF 904 0 00001C60 813E[0303][E501] cmp word [Switch_String_Buffer + Switch_Pointer],offset Switch_F_Control + Keyword ; ;AN000; 906 ; $IF E ; ;AN000; 0 00001C66 7533 JNE DD_IF75 0 00001C68 C606[E501]20 mov byte [Switch_F_Control + Keyword],20h ;an000; dms;remove switch from table 0 00001C6D C706[0303]0000 mov word [Switch_String_Buffer + Switch_Pointer],0 ;an000; dms; clear out ptr for next iteration 0 00001C73 C706[FB02]0000 mov word [Switch_Num_Buffer + Switch_Num_Pointer],0 ;Init for next switch ;AN008; 911 Switch_F equ SWITCH_F ; NASM port equate 0 00001C79 F706[0000]0010 test word [SwitchMap],Switch_F ; it - do this because SysParse ;AN002; 913 ; $IF Z ; reuses string buffer each time;AN002; 0 00001C7F 750F JNZ DD_IF76 0 00001C81 810E[0000]0010 or word [SwitchMap],Switch_F ; ;AN000; 0 00001C87 A0[0203] mov al,[Switch_String_Buffer + Switch_String_Item_Tag] ; Indicate what size;AN000; 0 00001C8A 0806[0000] or [SizeMap],al ; ;AN000; 918 ; $ELSE ; ;AN002; 0 00001C8E EB0B JMP SHORT DD_EN76 920 DD_IF76: 0 00001C90 BA[0000]E8[0000] Message msgSameSwitch ; ;AN002; 0 00001C96 C606[1A01]FF mov byte [Fatal_Error],Yes ; ;AN002; 923 ; $ENDIF ; ;AN002; 924 DD_EN76: 925 ; $ENDIF ; ;AN000; 926 DD_IF75: 0 00001C9B 5F pop di ;Restore parse regs ;AN000; 0 00001C9C 59 pop cx ; ;AN000; 0 00001C9D 5E pop si ; ;AN000; 0 00001C9E 1F pop ds ; ;AN000; 0 00001C9F C3 ret ; ;AN000; 932 933 Interpret_Parse endp ; ;AN000; 934 935 936 937 ;***************************************************************************** 938 ;Routine name: Validate_Target_Drive 939 ;***************************************************************************** 940 ; 941 ;Description: Control routine for validating the specified format target drive. 942 ; If any of the called routines find an error, they will print 943 ; message and terminate program, without returning to this routine 944 ; 945 ;Called Procedures: Check_Target_Drive 946 ; Check_For_Network 947 ; Check_Translate_Drive 948 ; 949 ;Change History: Created 5/1/87 MT 950 ; 951 ;Input: Fatal_Error = NO 952 ; 953 ;Output: Fatal_Error = YES/NO 954 ; 955 ;Psuedocode 956 ;---------- 957 ; 958 ; CALL Check_Target_Drive 959 ; IF !Fatal_Error 960 ; CALL Check_For_Network 961 ; IF !Fatal_Error 962 ; CALL Check_Translate_Drive 963 ; ENDIF 964 ; ENDIF 965 ; ret 966 ;***************************************************************************** 967 968 Procedure Validate_Target_Drive ; ;AN000; 969 ; 0 00001CA0 E81500 call Check_Target_Drive ;See if valid drive letter ;AN000; 0 00001CA3 803E[1A01]FF cmp byte [Fatal_Error],YES ;Can we continue? ;AN000; 972 ; $IF NE ;Yep ;AN000; 0 00001CA8 740D JE DD_IF80 0 00001CAA E83E00 call Check_For_Network ;See if Network drive letter ;AN000; 0 00001CAD 803E[1A01]FF cmp byte [Fatal_Error],YES ;Can we continue? ;AN000; 976 ; $IF NE ;Yep ;AN000; 0 00001CB2 7403 JE DD_IF81 0 00001CB4 E86500 call Check_Translate_Drive ;See if Subst, Assigned ;AN000; 979 ; $ENDIF ;- Fatal_Error passed back ;AN000; 980 DD_IF81: 981 ; $ENDIF ; ;AN000; 982 DD_IF80: 0 00001CB7 C3 ret ; ;AN000; 984 985 Validate_Target_Drive endp ; ;AN000; 986 987 ;***************************************************************************** 988 ;Routine name: Check_Target_Drive 989 ;***************************************************************************** 990 ; 991 ;Description: Check to see if valid DOS drive by checking if drive is 992 ; removable. If error, the drive is invalid. Save default 993 ; drive info. 994 ; 995 ;Called Procedures: Message (macro) 996 ; 997 ;Change History: Created 5/1/87 MT 998 ; 999 ;Input: Fatal_Error = NO 1000 ; 1001 ;Output: BIOSFile = default drive letter 1002 ; DOSFile = default drive letter 1003 ; CommandFile = default drive letter 1004 ; Fatal_Error = YES/NO 1005 ; 1006 ;Psuedocode 1007 ;---------- 1008 ; 1009 ; Get default drive (INT 21h, AH = 19h) 1010 ; Convert it to drive letter 1011 ; Save into BIOSFile,DOSFile,CommandFile 1012 ; See if drive removable (INT 21h, AX=4409h IOCtl) 1013 ; IF error - drive invalid 1014 ; Display Invalid drive message 1015 ; Fatal_Error= YES 1016 ; ENDIF 1017 ; ret 1018 ;***************************************************************************** 1019 1020 Procedure Check_Target_Drive ; ;AN000; 1021 ; 0 00001CB8 B419CD21 DOS_Call Get_Default_Drive ;Find the current drive ;AC000; 0 00001CBC 0441 add al,'A' ;Convert to drive letter ; ; 0 00001CBE A2[0000] mov [BIOSFile],al ;Put it into path strings ; ; 0 00001CC1 A2[0000] mov [DOSFile],al ; " " " " ; ; 0 00001CC4 A2[0000] mov [CommandFile],al ; " " " " ; ; 0 00001CC7 8A1E[0000] mov bl,[Drive] ;Set up for next call ;AN000; 0 00001CCB FEC3 inc bl ;A=1,B=2 for IOCtl call ;AN000; 0 00001CCD B009 mov al,09h ;See if drive is local ;AC000; 0 00001CCF B444CD21 DOS_Call IOCtl ;-this will fail if bad drive ;AC000; 1031 ; $IF C ;CY means invalid drive ;AC000; 0 00001CD3 7315 JNC DD_IF84 0 00001CD5 1EBA[0000]8EDAA3 Extended_Message ;Print message ;AC000; 0 00001CDC [0000]BA[0000]E8 0 00001CE2 [0000]1F 0 00001CE5 C606[1A01]FF mov byte [Fatal_Error],Yes ;Indicate error ;AN000; 1035 ; $ENDIF ; ;AN000; 1036 DD_IF84: 0 00001CEA C3 ret ;And we're outa here ;AN000; 1038 1039 Check_Target_Drive endp ; ;AN000; 1040 1041 ;***************************************************************************** 1042 ;Routine name: Check_For_Network 1043 ;***************************************************************************** 1044 ; 1045 ;Description: See if target drive isn't local, or if it is a shared drive. If 1046 ; so, exit with error message. The IOCtl call is not checked for 1047 ; an error because it is called previously in another routine, and 1048 ; invalid drive is the only error it can generate. That condition 1049 ; would not get this far 1050 ; 1051 ;Called Procedures: Message (macro) 1052 ; 1053 ;Change History: Created 5/1/87 MT 1054 ; 1055 ;Input: Drive 1056 ; Fatal_Error = NO 1057 ; 1058 ;Output: Fatal_Error = YES/NO 1059 ; 1060 ;Psuedocode 1061 ;---------- 1062 ; See if drive is local (INT 21h, AX=4409 IOCtl) 1063 ; IF not local 1064 ; Display network message 1065 ; Fatal_ERROR = YES 1066 ; ELSE 1067 ; IF 8000h bit set on return 1068 ; Display assign message 1069 ; Fatal_Error = YES 1070 ; ENDIF 1071 ; ENDIF 1072 ; ret 1073 ;***************************************************************************** 1074 1075 Procedure Check_For_Network ; ;AN000; 1076 ; 0 00001CEB 8A1E[0000] mov bl,[Drive] ;Drive is 0=A, 1=B ; ; 0 00001CEF FEC3 inc bl ;Get 1=A, 2=B for IOCtl call ; ; 0 00001CF1 B009 mov al,09h ;See if drive is local or remote;AC000; 0 00001CF3 B444CD21 DOS_CALL IOCtl ;We will not check for error ;AC000; 0 00001CF7 F7C20012 test dx,Net_Check ;if (x & 1200H)(redir or shared); ; 1082 ; $IF NZ ;Found a net drive ;AC000; 0 00001CFB 740D JZ DD_IF86 0 00001CFD BA[0000]E8[0000] Message MsgNetDrive ;Tell 'em ;AC000; 0 00001D03 C606[1A01]FF mov byte [Fatal_Error],Yes ;Indicate bad stuff ;AN000; 1086 ; $ELSE ;Local drive, now check assign ;AN000; 0 00001D08 EB11 JMP SHORT DD_EN86 1088 DD_IF86: 0 00001D0A F7C20080 test dx,Assign_Check ;8000h bit is bad news ; ; 1090 ; $IF NZ ;Found it ;AC000; 0 00001D0E 740B JZ DD_IF88 0 00001D10 BA[0000]E8[0000] Message MsgAssignedDrive ;Tell error ;AC000; 0 00001D16 C606[1A01]FF mov byte [Fatal_Error],Yes ;Indicate bad stuff ;AN000; 1094 ; $ENDIF ; ;AN000; 1095 DD_IF88: 1096 ; $ENDIF ; ;AN000; 1097 DD_EN86: 0 00001D1B C3 ret ; ;AN000; 1099 1100 Check_For_Network endp ; ;AN000; 1101 1102 ;***************************************************************************** 1103 ;Routine name: Check_Translate_Drive 1104 ;***************************************************************************** 1105 ; 1106 ;Description: Do a name translate call on the drive letter to see if it is 1107 ; assigned by SUBST or ASSIGN 1108 ; 1109 ;Called Procedures: Message (macro) 1110 ; 1111 ;Change History: Created 5/1/87 MT 1112 ; 1113 ;Input: Drive 1114 ; Fatal_Error = NO 1115 ; 1116 ;Output: Fatal_Error = YES/NO 1117 ; 1118 ;Psuedocode 1119 ;---------- 1120 ; Put drive letter in ASCIIZ string "d:\",0 1121 ; Do name translate call (INT 21) 1122 ; IF drive not same 1123 ; Display assigned message 1124 ; Fatal_Error = YES 1125 ; ENDIF 1126 ; ret 1127 ;***************************************************************************** 1128 1129 Procedure Check_Translate_Drive ; ;AN000; 1130 ; 0 00001D1C 8A1E[0000] mov bl,[Drive] ;Get drive ; ; 0 00001D20 001E[0000] add byte ptr [TranSrc],bl ;Make string "d:\" ; ; 0 00001D24 BE[0000] mov si,offset TranSrc ;Point to translate string ; ; 0 00001D27 1E push ds ;Set ES=DS (Data segment) ; ; 0 00001D28 07 pop es ; " " " " ; ; 0 00001D29 BF[9A00] mov di,offset Command_Line_Buffer ;Point at output buffer ; ; 0 00001D2C B460CD21 DOS_Call xNameTrans ;Get real path ;AC000; 0 00001D30 8A1E[0000] mov bl,byte ptr [TranSrc] ;Get drive letter from path ; ; 0 00001D34 3A1E[9A00] cmp bl,byte ptr [Command_Line_Buffer] ;Did drive letter change? ; ; 1140 ; $IF NE ;If not the same, it be bad ;AC000; 0 00001D38 740B JE DD_IF91 0 00001D3A BA[0000]E8[0000] Message MsgAssignedDrive ;Tell user ;AC000; 0 00001D40 C606[1A01]FF mov byte [Fatal_Error],Yes ;Setup error flag ;AN000; 1144 ; $ENDIF ; ;AN000; 1145 DD_IF91: 0 00001D45 C3 ret ; ;AN000; 1147 1148 Check_Translate_Drive endp ; ;AN000; 1149 1150 ;***************************************************************************** 1151 ;Routine name: Hook_CNTRL_C 1152 ;***************************************************************************** 1153 ; 1154 ;Description: Change the interrupt handler for INT 13h to point to the 1155 ; ControlC_Handler routine 1156 ; 1157 ;Called Procedures: None 1158 ; 1159 ;Change History: Created 4/21/87 MT 1160 ; 1161 ;Input: None 1162 ; 1163 ;Output: None 1164 ; 1165 ;Psuedocode 1166 ;---------- 1167 ; 1168 ; Point at ControlC_Handler routine 1169 ; Set interrupt handler (INT 21h, AX=2523h) 1170 ; ret 1171 ;***************************************************************************** 1172 1173 Procedure Hook_CNTRL_C ; ;AN000; 1174 ; 0 00001D46 B023 mov al,23H ;Specify CNTRL handler ; ; 0 00001D48 BA[0000] mov dx, offset ControlC_Handler ;Point at it ; ; 0 00001D4B 1E push ds ;Save data seg ; ; 0 00001D4C 0E push cs ;Point to code segment ; ; 0 00001D4D 1F pop ds ; ; ; 0 00001D4E B425CD21 DOS_Call Set_Interrupt_Vector ;Set the INT 23h handler ;AC000; 0 00001D52 1F pop ds ;Get Data degment back ; ; 0 00001D53 C3 ret ; ;AN000; 1183 1184 Hook_CNTRL_C endp ; ;AN000; 1185 1186 ;========================================================================= 1187 ; Check_For_Invalid_Drive : This routine checks the AX received by 1188 ; FORMAT on its entry. This value will 1189 ; tell us if we are attempting to format 1190 ; a JOINED drive. 1191 ; 1192 ; Inputs : Org_AX - AX on entry to FORMAT 1193 ; 1194 ; Outputs : Fatal_Error - Yes if AL contained FFh 1195 ;========================================================================= 1196 1197 Procedure Check_For_Invalid_Drive ;an000; dms; 1198 0 00001D54 50 push ax ;an000; dms;save ax 0 00001D55 803E[0000]FF cmp byte [FAT_Flag],Yes ;an000; dms;FAT system? 1201 ; $if e ;an000; dms;yes 0 00001D5A 751F JNE DD_IF93 0 00001D5C A1[0000] mov ax,[Org_AX] ;an000; dms;get its org. value 0 00001D5F 3CFF cmp al,0ffh ;an000; dms;Invalid drive? 1205 ; $if e ;an000; dms;yes 0 00001D61 7518 JNE DD_IF94 0 00001D63 C606[1A01]FF mov byte [Fatal_Error],YES ;an000; dms;flag an error 0 00001D68 B80F00 mov ax,Invalid_Drive;an000; dms;error message 0 00001D6B 1EBA[0000]8EDAA3 Extended_Message ;an000; dms;tell error 0 00001D72 [0000]BA[0000]E8 0 00001D78 [0000]1F 1210 ; $endif ;an000; dms; 1211 DD_IF94: 1212 ; $endif ;an000; dms; 1213 DD_IF93: 0 00001D7B 58 pop ax ;an000; dms; 0 00001D7C C3 ret ;an000; dms; 1216 1217 Check_For_Invalid_Drive endp ;an000; dms; 1218 1219 1220 ;========================================================================= 1221 ; Determine_FAT_Non_FAT - This routine determines whether or 1222 ; not a device is formatted to a FAT 1223 ; specification versus a Non-FAT 1224 ; specification. 1225 ; 1226 ; Inputs : DX - Pointer to device parameters buffer 1227 ; 1228 ; Outputs : DeviceParameters - buffer containing BPB. 1229 ; 1230 ; Date : 11/6/87 1231 ;========================================================================= 1232 1233 Procedure Determine_FAT_Non_FAT ;an012; dms; 1234 0 00001D7D 50 push ax ;an012; dms;save regs 0 00001D7E 52 push dx ;an012; dms; 1237 1238 deviceParameters equ DeviceParameters ; NASM port label 0 00001D7F 8D16[0000] lea dx, [deviceParameters] ;an012; dms;point to buffer 1240 DP_SpecialFunctions equ DP_SPECIALFUNCTIONS ; NASM port equate 0 00001D83 C606[0000]00 mov byte [deviceParameters + DP_SpecialFunctions], 0 ;an012; dms;get default BPB 0 00001D88 E8[0000] call GetDeviceParameters ;an012; dms;make the call 1243 ; $if nc ;an012; dms;no error occurred 0 00001D8B 721C JC DD_IF97 1245 BPB_NumberOfFATS equ BPB_NUMBEROFFATS ; NASM port equate 0 00001D8D 803E[0C00]00 cmp byte [DeviceParameters + DP_BPB + BPB_NumberOfFATS],00h ;an012; dms;non-FAT system? 1247 ; $if e ;an012; dms;yes 0 00001D92 7510 JNE DD_IF98 0 00001D94 C606[0000]00 mov byte [FAT_Flag],No ;an012; dms;signal system non-FAT 0 00001D99 B8075F mov ax,5f07h ;an012; dms;allow access to disk 0 00001D9C 8A16[0000] mov dl,[Drive] ;an012; dms;get 0 based driver number 0 00001DA0 CD21 int 21h ;an012; dms;allow access to the drive 1253 ; $else ;an012; dms;FAT system 0 00001DA2 EB05 JMP SHORT DD_EN98 1255 DD_IF98: 0 00001DA4 C606[0000]FF mov byte [FAT_Flag],Yes ;an012; dms;flag FAT system 1257 ; $endif ;an012; dms; 1258 DD_EN98: 1259 ; $endif ;an012; dms; 1260 DD_IF97: 1261 0 00001DA9 5A pop dx ;an012; dms;restore regs 0 00001DAA 58 pop ax ;an012; dms; 1264 0 00001DAB C3 ret ;an012; dms; 1266 1267 Determine_FAT_Non_FAT endp ;an012; dms; 1268 1269 1270 1271 1272 ; (no prior section) ; code ends 1273 end === Trace listing source: forlabel.lst 1 2 ;***************************************************************************** 3 ;***************************************************************************** 4 ; 5 ;UTILITY NAME: FORMAT.COM 6 ; 7 ;MODULE NAME: FORLABEL.SAL 8 ; 9 ; Interpret_Parse 10 ; | 11 ;* | 12 ;=======================|=================== =============== 13 ;==VolID==Get_New_Label===Get_11_Characters===Change_Blanks= 14 ; ====================== =================================== 15 ; ============== 16 ; ==Skip_Blanks= 17 ; ============== 18 ; =========================================== 19 ; ==Check_DBCS_Overrun==Check_DBCS_Character= 20 ; =========================================== 21 ; ================== 22 ; ==Copy_FCB_String= 23 ; ================= 24 ;***************************************************************************** 25 ;***************************************************************************** 26 === Switch to base=000080h -> "DATA" 27 section data public align=16 class=DATA 28 ; (no prior section) ; data ends 29 === Switch to base=001900h -> "CODE" 30 section code public align=16 class=CODE 31 assume cs:code,ds:data 32 ; (no prior section) ; code ends 33 34 [list -] 134 <1> 36 %include "formacro.mac" 1 <1> ; 2 <1> ;****************************************************************************** 3 <1> ; Message Macro Definitions 4 <1> ;****************************************************************************** 5 <1> ; 6 <1> 7 <1> EXTRN Display_Interface:near 8 <1> 9 <1> 10 <1> ; NASM original macros 11 <1> 12 <1> ;----------------------------------------------------------------------------- 13 <1> 14 <1> %imacro Message 1.nolist 15 <1> mov dx,offset %1 wrt data 16 <1> call Display_Interface 17 <1> %endmacro 18 <1> 19 <1> ;----------------------------------------------------------------------------- 20 <1> 21 <1> %imacro Parse_Message 0.nolist 22 <1> push ds 23 <1> mov dx,data 24 <1> mov ds,dx 25 <1> mov word ptr [Parse_Error_Msg],ax 26 <1> mov dx,offset Parse_Error_Msg ; ;AN000; 27 <1> call Display_Interface ; ;AN000; 28 <1> pop ds ; 29 <1> %endmacro 30 <1> 31 <1> ;----------------------------------------------------------------------------- 32 <1> 33 <1> %imacro Extended_Message 0.nolist 34 <1> push ds 35 <1> mov dx,data 36 <1> mov ds,dx 37 <1> mov word ptr [Extended_Error_Msg],ax 38 <1> mov dx,offset Extended_Error_Msg wrt data 39 <1> call Display_Interface ; ;AN000; 40 <1> pop ds 41 <1> %endmacro 42 <1> 43 <1> ; 44 <1> ;***************************************************************************** 45 <1> ; General Macro's 46 <1> ;***************************************************************************** 47 <1> ; 48 <1> 49 <1> %imacro Procedure 1.nolist 50 <1> %1 proc 51 <1> Public %1 52 <1> %endmacro 53 <1> 54 <1> ;----------------------------------------------------------------------------- 55 <1> 56 <1> %imacro DOS_Call 1.nolist 57 <1> mov ah, %1 58 <1> int 21h 59 <1> %endmacro 60 <1> ;----------------------------------------------------------------------------- 61 <1> 62 <1> %imacro Popff 0.nolist 63 <1> jmp strict short $+3 64 <1> iret 65 <1> push cs 66 <1> call near $-2 67 <1> %endmacro 68 <1> 69 <1> ;----------------------------------------------------------------------------- 70 <1> 71 <1> %imacro Set_Data_Segment 0.nolist 72 <1> push ax 73 <1> mov ax,data ;Point to data segment 74 <1> mov ds,ax ; 75 <1> push ds 76 <1> pop es 77 <1> pop ax 78 <1> assume ds:data,es:data 79 <1> %endmacro 80 <1> 81 <1> ; end of NASM original macros 37 %include "syscall.mac" 1 <1> ; SCCSID = @(#)syscall.asm 1.1 85/04/10 2 <1> ;BREAK 3 <1> ;SUBTTL system call definitions 4 <1> ;PAGE 5 <1> 6 <1> Abort EQU 0 ; 0 0 7 <1> Std_Con_Input EQU 1 ; 1 1 8 <1> Std_Con_Output EQU 2 ; 2 2 9 <1> Std_Aux_Input EQU 3 ; 3 3 10 <1> Std_Aux_Output EQU 4 ; 4 4 11 <1> Std_Printer_Output EQU 5 ; 5 5 12 <1> Raw_Con_IO EQU 6 ; 6 6 13 <1> Raw_Con_Input EQU 7 ; 7 7 14 <1> Std_Con_Input_No_Echo EQU 8 ; 8 8 15 <1> Std_Con_String_Output EQU 9 ; 9 9 16 <1> Std_Con_String_Input EQU 10 ; 10 A 17 <1> Std_Con_Input_Status EQU 11 ; 11 B 18 <1> Std_Con_Input_Flush EQU 12 ; 12 C 19 <1> Disk_Reset EQU 13 ; 13 D 20 <1> Set_Default_Drive EQU 14 ; 14 E 21 <1> FCB_Open EQU 15 ; 15 F 22 <1> FCB_Close EQU 16 ; 16 10 23 <1> Dir_Search_First EQU 17 ; 17 11 24 <1> Dir_Search_Next EQU 18 ; 18 12 25 <1> FCB_Delete EQU 19 ; 19 13 26 <1> FCB_Seq_Read EQU 20 ; 20 14 27 <1> FCB_Seq_Write EQU 21 ; 21 15 28 <1> FCB_Create EQU 22 ; 22 16 29 <1> FCB_Rename EQU 23 ; 23 17 30 <1> Get_Default_Drive EQU 25 ; 25 19 31 <1> Set_DMA EQU 26 ; 26 1A 32 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 33 <1> ; C A V E A T P R O G R A M M E R ; 34 <1> ; ; 35 <1> Get_Default_DPB EQU 31 ; 31 1F 36 <1> ; ; 37 <1> ; C A V E A T P R O G R A M M E R ; 38 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 39 <1> FCB_Random_Read EQU 33 ; 33 21 40 <1> FCB_Random_Write EQU 34 ; 34 22 41 <1> Get_FCB_File_Length EQU 35 ; 35 23 42 <1> Get_FCB_Position EQU 36 ; 36 24 43 <1> Set_Interrupt_Vector EQU 37 ; 37 25 44 <1> Create_Process_Data_Block EQU 38 ; 38 26 45 <1> FCB_Random_Read_Block EQU 39 ; 39 27 46 <1> FCB_Random_Write_Block EQU 40 ; 40 28 47 <1> Parse_File_Descriptor EQU 41 ; 41 29 48 <1> Get_Date EQU 42 ; 42 2A 49 <1> Set_Date EQU 43 ; 43 2B 50 <1> Get_Time EQU 44 ; 44 2C 51 <1> Set_Time EQU 45 ; 45 2D 52 <1> Set_Verify_On_Write EQU 46 ; 46 2E 53 <1> ; Extended functionality group 54 <1> Get_DMA EQU 47 ; 47 2F 55 <1> Get_Version EQU 48 ; 48 30 56 <1> Keep_Process EQU 49 ; 49 31 57 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 58 <1> ; C A V E A T P R O G R A M M E R ; 59 <1> ; ; 60 <1> Get_DPB EQU 50 ; 50 32 61 <1> ; ; 62 <1> ; C A V E A T P R O G R A M M E R ; 63 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 64 <1> Set_CTRL_C_Trapping EQU 51 ; 51 33 65 <1> Get_InDOS_Flag EQU 52 ; 52 34 66 <1> Get_Interrupt_Vector EQU 53 ; 53 35 67 <1> Get_Drive_Freespace EQU 54 ; 54 36 68 <1> Char_Oper EQU 55 ; 55 37 69 <1> International EQU 56 ; 56 38 70 <1> ; Directory Group 71 <1> MKDir EQU 57 ; 57 39 72 <1> RMDir EQU 58 ; 58 3A 73 <1> CHDir EQU 59 ; 59 3B 74 <1> ; File Group 75 <1> Creat EQU 60 ; 60 3C 76 <1> Open EQU 61 ; 61 3D 77 <1> Close EQU 62 ; 62 3E 78 <1> Read EQU 63 ; 63 3F 79 <1> Write EQU 64 ; 64 40 80 <1> Unlink EQU 65 ; 65 41 81 <1> LSeek EQU 66 ; 66 42 82 <1> CHMod EQU 67 ; 67 43 83 <1> IOCtl EQU 68 ; 68 44 84 <1> XDup EQU 69 ; 69 45 85 <1> XDup2 EQU 70 ; 70 46 86 <1> Current_Dir EQU 71 ; 71 47 87 <1> ; Memory Group 88 <1> Alloc EQU 72 ; 72 48 89 <1> Dealloc EQU 73 ; 73 49 90 <1> Setblock EQU 74 ; 74 4A 91 <1> ; Process Group 92 <1> Exec EQU 75 ; 75 4B 93 <1> Exit EQU 76 ; 76 4C 94 <1> WaitProcess EQU 77 ; 77 4D 95 <1> Find_First EQU 78 ; 78 4E 96 <1> ; Special Group 97 <1> Find_Next EQU 79 ; 79 4F 98 <1> ; SPECIAL SYSTEM GROUP 99 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 100 <1> ; C A V E A T P R O G R A M M E R ; 101 <1> ; ; 102 <1> Set_Current_PDB EQU 80 ; 80 50 103 <1> Get_Current_PDB EQU 81 ; 81 51 104 <1> Get_In_Vars EQU 82 ; 82 52 105 <1> SetDPB EQU 83 ; 83 53 106 <1> ; ; 107 <1> ; C A V E A T P R O G R A M M E R ; 108 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 109 <1> Get_Verify_On_Write EQU 84 ; 84 54 110 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 111 <1> ; C A V E A T P R O G R A M M E R ; 112 <1> ; ; 113 <1> Dup_PDB EQU 85 ; 85 55 114 <1> ; ; 115 <1> ; C A V E A T P R O G R A M M E R ; 116 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 117 <1> Rename EQU 86 ; 86 56 118 <1> File_Times EQU 87 ; 87 57 119 <1> AllocOper EQU 88 ; 88 58 120 <1> ; Network extention system calls 121 <1> GetExtendedError EQU 89 ; 89 59 122 <1> CreateTempFile EQU 90 ; 90 5A 123 <1> CreateNewFile EQU 91 ; 91 5B 124 <1> LockOper EQU 92 ; 92 5C Lock and Unlock 125 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 126 <1> ; C A V E A T P R O G R A M M E R ; 127 <1> ; ; 128 <1> ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall, 129 <1> ; CloseByName, CloseUser, 130 <1> ; CloseUserProcess, 131 <1> ; GetOpenFileList 132 <1> ; ; 133 <1> ; C A V E A T P R O G R A M M E R ; 134 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 135 <1> UserOper EQU 94 ; 94 5E Get and Set 136 <1> AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel 137 <1> xNameTrans EQU 96 ; 96 60 138 <1> PathParse EQU 97 ; 97 61 139 <1> GetCurrentPSP EQU 98 ; 98 62 140 <1> Hongeul EQU 99 ; 99 63 141 <1> ECS_CALL EQU 99 ; 99 63 ;; DBCS support 142 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 143 <1> ; C A V E A T P R O G R A M M E R ; 144 <1> ; ; 145 <1> Set_Printer_Flag EQU 100 ; 100 64 146 <1> ; ; 147 <1> ; C A V E A T P R O G R A M M E R ; 148 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 149 <1> GetExtCntry EQU 101 ; 101 65 150 <1> GetSetCdPg EQU 102 ; 102 66 151 <1> ExtHandle EQU 103 ; 103 67 152 <1> Commit EQU 104 ; 104 68 153 <1> GetSetMediaID EQU 105 ; 105 69 154 <1> IFS_IOCTL EQU 107 ; 107 6B 155 <1> ExtOpen EQU 108 ; 108 6C 156 <1> ; 157 <1> ; 158 <1> Set_Oem_Handler EQU 248 ; 248 F8 159 <1> OEM_C1 EQU 249 ; 249 F9 160 <1> OEM_C2 EQU 250 ; 250 FA 161 <1> OEM_C3 EQU 251 ; 251 FB 162 <1> OEM_C4 EQU 252 ; 252 FC 163 <1> OEM_C5 EQU 253 ; 253 FD 164 <1> OEM_C6 EQU 254 ; 254 FE 165 <1> OEM_C7 EQU 255 ; 255 FF 38 %include "forequ.mac" 1 <1> ; ; ; 2 <1> 3 <1> NO equ 0 4 <1> YES equ ~ NO 5 <1> FSExec equ NO ;an018; dms;conditional assembly 6 <1> ShipDisk equ NO ;an000; dms;ship disk flag 7 <1> 8 <1> Boot_ID equ 0AA55h 9 <1> DOS_Found equ 0 10 <1> 11 <1> Not_Include equ 0 12 <1> Do_Include equ 1 13 <1> 14 <1> INIT equ 0 15 <1> 16 <1> FAT12_File_System equ 01h 17 <1> FAT16_File_System equ 04h 18 <1> New_File_System equ 06h 19 <1> 20 <1> FS_String_Max_Length equ 5 21 <1> 22 <1> Paragraph_Size equ 16 ; ;AN005; 23 <1> Len_FS_String_Buffer equ 13 24 <1> 25 <1> Net_Check equ 1200h 26 <1> Assign_Check equ 8000h 27 <1> 28 <1> Found_Yes equ 1 29 <1> Found_No equ 0 30 <1> 31 <1> Asciiz_End equ 0 32 <1> DBCS equ 81h 33 <1> DBCS_Blank equ 40h 34 <1> DBCS_Vector_Size equ 2 35 <1> End_Of_Vector equ 0 36 <1> 37 <1> 38 <1> Blank equ " " 39 <1> 40 <1> Label_Length equ 11 41 <1> CR equ 13 42 <1> 43 <1> DBCS_VECTOR equ NO 44 <1> 45 <1> ;Limits 46 <1> BIG_FAT_THRESHOLD equ 4086 47 <1> 48 <1> ;------------------------------------------------------------------------------- 49 <1> 50 <1> 51 <1> 52 <1> 53 <1> 54 <1> DRNUM EQU 5CH 55 <1> 56 <1> 57 <1> 58 <1> ; Exit status defines 59 <1> ExitOK equ 0 60 <1> ExitCtrlC equ 3 61 <1> ExitFatal equ 4 62 <1> ExitNo equ 5 63 <1> 64 <1> 65 <1> ;------------------------------------------------------------------------------- 66 <1> ; These are the data structures which we will need 67 <1> 68 <1> 69 <1> Media_ID struc 0 00001DB0 ???? Media_ID_Info_Level dw ? 0 00001DB2 ???????? Media_ID_Serial_Number dd ? 72 00000006 <1> Media_ID_Volume_Label db 11 dup(?) 0 00001DC1 ???????????????? Media_ID_File_System db 8 dup(?) 74 <1> Media_ID ends 75 <1> 76 <1> 77 <1> Relative_Sector_Buffer struc ; ;AN000; 78 <1> 0 00001DB0 ???? Start_Sector_Low dw ? ;Low word of RBA sector ;AN000; 0 00001DB2 ???? Start_Sector_High dw ? ;High word of RBA sector ;AN000; 0 00001DB4 ???? Number_Sectors dw ? ;Number of sectors ;AN000; 0 00001DB6 ???? Buffer_Offset dw ? ;Address of data buffer ;AN000; 0 00001DB8 ???? Buffer_Segment dw ? ; ;AN000; 84 <1> 85 <1> Relative_Sector_Buffer ends ; ;AN000; 86 <1> 87 <1> 88 <1> ;Per system file data structure 89 <1> 90 <1> a_FileStructure struc 0 00001DB0 ???? fileHandle DW ? 0 00001DB2 ???? fileSizeInParagraphs DW ? 0 00001DB4 ???????? fileSizeInBytes DD ? 0 00001DB8 ???????? fileOffset DD ? 0 00001DBC ???? fileStartSegment DW ? 0 00001DBE ???? fileDate DW ? 0 00001DC0 ???? fileTime DW ? 98 <1> a_FileStructure ends 99 <1> 100 <1> ;------------------------------------------------------------------------------- 101 <1> 102 <1> LOGBOOTSECT equ 1 103 <1> Set_Drv_Owner equ 0Fh ; IOCTL subfunction 104 <1> Custom_Media equ 0F0H ; Media byte for custom format 105 <1> Dual_8_Media equ 0FFh ; Dual sided 8 sectored 106 <1> Single_8_Media equ 0FEh ; Single sided 8 sectored 107 <1> Dual_9_Media equ 0FDh ; Dual sided 9 sectored 108 <1> Single_9_Media equ 0FCh ; Single sided 9 sectored 109 <1> Dual_15_Media equ 0F9h ; Dual sided 15 sectored 110 <1> Fixed_Disk equ 0F8h ; Fixed Disk 111 <1> Invalid_Drive equ 000Fh ; Extended error 15 112 <1> Max_Format_Size equ 0FFFFh ; Max bytes to Format ;an015; dms; 113 <1> Multi_Track_Format equ 02h ; Multi-track format ;an015; dms; 114 <1> Single_Track_Format equ 00h ; Single track format ;an015; dms; 115 <1> Select_Disk_Message equ 0ADC1h ; an016; dms; 39 %include "forswtch.mac" 1 <1> ;FORMAT Pre-defined switches 2 <1> SWITCH_S EQU 0001h ; System transfer 3 <1> SWITCH_V EQU 0002h ; Volume ID prompt 4 <1> SWITCH_BACKUP EQU 0004h 5 <1> SWITCH_C EQU 0008h 6 <1> SWITCH_T EQU 0010h 7 <1> SWITCH_N EQU 0020h 8 <1> SWITCH_1 EQU 0040h 9 <1> SWITCH_4 EQU 0080h 10 <1> SWITCH_8 EQU 0100h 11 <1> SWITCH_B EQU 0200h 12 <1> SWITCH_SELECT EQU 0400h 13 <1> SWITCH_AUTOTEST EQU 0800h 14 <1> SWITCH_F EQU 1000h 15 <1> SWITCH_FS EQU 2000h 16 <1> 17 <1> %IF ShipDisk 18 <1> 19 <1> SWITCH_Z EQU 4000h ;an000; dms;1 sector/cluster switch 20 <1> 21 <1> %ENDIF 22 <1> 23 <1> ; 24 <1> ; The following is a list of equates to define each IBM defined diskette size 25 <1> ; for use with the /F switch 26 <1> 27 <1> 28 <1> Size_160 equ 0001h ;Flag settings for size switch ;AN000; 29 <1> Size_180 equ 0002h ; ;AN000; 30 <1> Size_320 equ 0004h ; ;AN000; 31 <1> Size_360 equ 0008h ; ;AN000; 32 <1> Size_720 equ 0010h ; ;AN000; 33 <1> Size_1200 equ 0020h ; ;AN000; 34 <1> Size_1440 equ 0040h ; ;AN000; 35 <1> 36 <1> 37 <1> 40 [list +] 41 42 ; 43 ;***************************************************************************** 44 ; Equates 45 ;***************************************************************************** 46 ; 47 48 None equ 0 49 StdIn equ 0 50 StdOut equ 1 51 StdErr equ 2 52 Tab equ 09h 53 Label_Buffer_length equ 80h 54 Create_Worked equ 0 ;an024; 55 56 57 ; 58 ;***************************************************************************** 59 ; External Data Declarations 60 ;***************************************************************************** 61 ; 62 63 Extrn SwitchMap:Word 64 Extrn Switch_String_Buffer:Byte 65 Extrn VolFCB:Byte 66 Extrn MsgBadCharacters:Byte 67 Extrn MsgLabelPrompt:Byte 68 Extrn MsgBadVolumeID:Byte 69 Extrn MsgCRLF:Byte 70 Extrn VolNam:Byte 71 Extrn Vol_Label_Count:Byte 72 Extrn VolDrive:Byte 73 Extrn Drive:Byte 74 Extrn Command_Line:Byte 75 Extrn Vol_Label_Buffer:Byte 76 Extrn DelDrive:Byte 77 Extrn DelFCB:Byte 78 === Switch to base=001900h -> "CODE" 79 section code 80 81 ;************************************************************************************************ 82 ;Routine name Volid 83 ;************************************************************************************************ 84 ; 85 ;Description: Get volume id from command line /V:xxxxxxx if it is there, or 86 ; else prompt user for volume label, parse the input. At this 87 ; point setup the FCB and create the volume label. If failure, 88 ; prompt user that they entered bad input, and try again. 89 ; 90 ; Note: This routine in 3.30 and prior used to check for /V 91 ; switch. Volume labels are always required now, so /V 92 ; is ignored, except to get volume label on command line. 93 ; 94 ;Called Procedures: Message (macro) 95 ; Get_New_Label 96 ; 97 ;Change History: Created 5/1/87 MT 98 ; 99 ;Input: Switch_V 100 ; Command_Line = YES/NO 101 ; 102 ;Output: None 103 ; 104 ;Psuedocode 105 ;---------- 106 ; 107 ; Save registers 108 ; IF /V switch entered 109 ; IF /v:xxxxx form not entered 110 ; CALL Get_New_Label ;Return string in Volume_Label 111 ; ENDIF 112 ; ELSE 113 ; CALL Get_New_Label ;Return string in Volume_Label 114 ; ENDIF 115 ; DO 116 ; Create volume label 117 ; LEAVE Create Ok 118 ; Display Bad Character message 119 ; CALL Get_New_Label ;Return string in Volume_Label 120 ; ENDDO 121 ; Restore registers 122 ; ret 123 ;***************************************************************************** 124 125 Procedure Volid ; ;AN000; 126 0 00001DB0 1E push ds ;Save registers ;AN000; 0 00001DB1 56 push si ; " " " " ;AN000; 129 Switch_V equ SWITCH_V ; NASM port equate 0 00001DB2 F706[0000]0200 test word [SwitchMap],Switch_V ;Was /V entered ;AN000; 131 ; $IF NZ ;Yes, see if label entered also ;AN000; 0 00001DB8 740C JZ DD_IF1 0 00001DBA 803E[0000]FF cmp byte [Command_Line],YES ;Is there a string there? ;AN000; 134 ; $IF NE ;Nope ;AN000; 0 00001DBF 7403 JE DD_IF2 0 00001DC1 E83000 call Get_New_Label ;Go get volume label from user ;AN000; 137 ; $ENDIF ; ;AN000; 138 DD_IF2: 139 ; $ELSE ;Label not entered on cmd line ;AN000; 0 00001DC4 EB03 JMP SHORT DD_EN1 141 DD_IF1: 0 00001DC6 E82B00 call Get_New_Label ;Go get label from user ;AN000; 143 ; $ENDIF ; ;AN000; 144 DD_EN1: 145 drive equ Drive ; NASM port label 0 00001DC9 8A16[0000] mov dl,[drive] ;Get drive number A=0 ;AN000; 0 00001DCD FEC2 inc dl ;Make it 1 based ;AN000; 0 00001DCF 8816[0000] mov [DelDrive],dl ;Put into FCBs ;AN000; 0 00001DD3 8816[0000] mov [VolDrive],dl ; ;AN000; 0 00001DD7 BA[0000] mov dx,offset DelFCB ;Point at FCB to delete label ;AN000; 0 00001DDA B413CD21 DOS_Call FCB_Delete ;Do the delete ;AN000; 0 00001DDE BA[0000] mov dx,offset VolFCB ;Point at FCB for create ;AN000; 0 00001DE1 B416CD21 DOS_CALL FCB_Create ;Go create it ;AN000; 0 00001DE5 80FA00 cmp dl,Create_Worked ;See if the create worked ;an024; 155 ; $IF E ;an024; 0 00001DE8 7507 JNE DD_IF6 0 00001DEA BA[0000] mov dx,offset VolFCB ;Point to the FCB created ;an022; dms; 0 00001DED B410CD21 DOS_Call FCB_Close ;Close the newly created FCB ;an022; dms; 159 ; $ENDIF ;an024; 160 DD_IF6: 161 0 00001DF1 5E pop si ;Restore registers ;AN000; 0 00001DF2 1F pop ds ; " " " " ;AN000; 0 00001DF3 C3 ret ; ;AN000; 165 166 Volid endp ; ;AN000; 167 168 ;***************************************************************************** 169 ;Routine name: Get_New_Label 170 ;***************************************************************************** 171 ; 172 ;Description: Prompts, inputs and verifies a volume label string. Continues 173 ; to prompt until valid vol label is input 174 ; 175 ;Called Procedures: Message (macro) 176 ; Build_String 177 ; Get_11_Characters 178 ; 179 ;Change History: Created 3/18/87 MT 180 ; 181 ;Input: None 182 ; 183 ;Output: Volume_Label holds 184 ; 185 ;Psuedocode 186 ;---------- 187 ; 188 ; DO 189 ; Display new volume label prompt 190 ; Input vol label 191 ; IF No error (NC) 192 ; Build Asciiz string with label, pointer DS:SI (CALL Build_String) 193 ; Call Get_11_Characters (Error returned CY) 194 ; ENDIF 195 ; LEAVE no error (NC) 196 ; Display label error 197 ; ENDDO 198 ; ret 199 ;***************************************************************************** 200 201 Procedure Get_New_Label ; ;AN000; 202 203 ; $DO ;Loop until we get good one ;AN000; 204 DD_DO8: 205 msgLabelPrompt equ MsgLabelPrompt ; NASM port label 0 00001DF4 BA[0000]E8[0000] Message msgLabelPrompt ;Prompt to input Vol label ;AN000; 0 00001DFA B8000C mov ax,(Std_Con_Input_Flush << 8) + 0 ;an000; dms;clean out input 0 00001DFD CD21 int 21h ;an000; dms; 0 00001DFF BA[0000] mov dx,offset Vol_Label_Count ;an000; dms;beginning of buffer 0 00001E02 B40A mov ah,Std_Con_String_Input ;an000; dms;get input 0 00001E04 CD21 int 21h ;an000; dms; 0 00001E06 B8000C mov ax,(Std_Con_Input_Flush << 8) + 0 ;an000; dms; clean out input 0 00001E09 CD21 int 21h ;an000; dms; 214 ; $IF NC ;Read ok if NC, Bad sets CY ;AN000; 0 00001E0B 7206 JC DD_IF9 0 00001E0D BE[0000] mov si,offset Vol_Label_Buffer ;Get pointer to string ;AN000; 0 00001E10 E81700 call Get_11_Characters ;Handle DBCS stuff on input ;AN000; 218 ; $ENDIF ;Ret CY if error ;AN000; 219 DD_IF9: 220 ; $LEAVE NC ;Done if NC ;AN000; 0 00001E13 730E JNC DD_EN8 0 00001E15 BA[0000]E8[0000] Message MsgCRLF ;next line ;an020; dms; 223 msgBadVolumeID equ MsgBadVolumeID ; NASM port label 0 00001E1B BA[0000]E8[0000] Message msgBadVolumeID ;Tell user error ;AN000; 225 ; $ENDDO ;Try again ;AN000; 0 00001E21 EBD1 JMP SHORT DD_DO8 227 DD_EN8: 0 00001E23 BA[0000]E8[0000] Message MsgCRLF ;an000; dms;next line 0 00001E29 C3 ret ; ;AN000; 230 231 Get_New_Label endp ; ;AN000; 232 233 ;***************************************************************************** 234 ;Routine name: Get_11_Characters 235 ;***************************************************************************** 236 ; 237 ;Description: Handle DBCS considerations, and build FCB to create vol label 238 ; 239 ; 240 ;Called Procedures: Change_Blanks 241 ; Skip_Blanks 242 ; Check_DBCS_Overrun 243 ; Copy_FCB_String 244 ; 245 ;Change History: Created 5/12/87 MT 246 ; 247 ;Input: DS:SI = Asciiz string containing volume label input 248 ; Command_Line = YES/NO 249 ; 250 ;Output: Volname will contain an 8.3 volume label in FCB 251 ; CY set on invalid label 252 ; 253 ;Psuedocode 254 ;---------- 255 ; Save regs used 256 ; Scan line replacing all DBCS blanks with SBCS (CALL_Change_Blanks) 257 ; Skip over leading blanks (Call Skip_Blanks) 258 ; IF leading blanks ,AND 259 ; IF Command line 260 ; Indicate invalid label (STC) 261 ; ELSE 262 ; See if DBCS character at 11th byte (CALL Check_DBCS_Overrun) 263 ; IF DBCS character at 11th byte 264 ; Indicate invalid label (STC) 265 ; ELSE 266 ; Put string into FCB (CALL Copy_FCB_STRING) 267 ; CLC 268 ; ENDIF 269 ; ENDIF 270 ; Restore regs 271 ; ret 272 ;***************************************************************************** 273 274 Procedure Get_11_Characters ; ;AN000; 275 0 00001E2A E81C00 call Change_Blanks ;Change DBCS blanks to SBCS ;AN000; 0 00001E2D E85300 call Skip_Blanks ;Skip over leading blanks ;AN000; 278 ; $IF C,AND ;Find leading blanks? ;AN000; 0 00001E30 730A JNC DD_IF13 0 00001E32 803E[0000]FF cmp byte [Command_Line],YES ;Is this command line input? ;AN000; 281 ; $IF E ;Yes ;AN000; 0 00001E37 7503 JNE DD_IF13 0 00001E39 F9 stc ;Indicate error (CY set) ;AN000; 284 ; $ELSE ;Leading blanks ok ;AN000; 0 00001E3A EB0C JMP SHORT DD_EN13 286 DD_IF13: 0 00001E3C E88A00 call Check_DBCS_Overrun ;Is DBCS char at 11th byte? ;AN000; 288 ; $IF C ;Yes ;AN000; 0 00001E3F 7303 JNC DD_IF15 0 00001E41 F9 stc ;Indicate invalid label ;AN000; 291 ; $ELSE ;No, good characters ;AN000; 0 00001E42 EB04 JMP SHORT DD_EN15 293 DD_IF15: 0 00001E44 E85F00 call Copy_FCB_String ;Put string into FCB ;AN000; 0 00001E47 F8 clc ;Indicate everything A-OK! ;AN000; 296 ; $ENDIF ; ;AN000; 297 DD_EN15: 298 ; $ENDIF ; ;AN000; 299 DD_EN13: 0 00001E48 C3 ret ; ;AN000; 301 302 Get_11_Characters endp ; ;AN000; 303 304 ;***************************************************************************** 305 ;Routine name: Change_Blanks 306 ;***************************************************************************** 307 ; 308 ;Description: Replace all DBCS blanks with SBCS blanks, end string with 309 ; Asciiz character if one doesn't already exist 310 ; 311 ;Called Procedures: Check_DBCS_Character 312 ; 313 ;Change History: Created 6/12/87 MT 314 ; 315 ;Input: DS:SI = String containing volume label input 316 ; 317 ;Output: DS:SI = ASCIIZ string with all DBCS blanks replaced with 2 SBCS blanks 318 ; 319 ; 320 ;Psuedocode 321 ;---------- 322 ; 323 ; Save pointer to string 324 ; DO 325 ; LEAVE End of string (0) 326 ; See if DBCS character (Check_DBCS_Character) 327 ; IF CY (DBCS char found) 328 ; IF first byte DBCS blank, AND 329 ; IF second byte DBCS blank 330 ; Convert to SBCS blanks 331 ; ENDIF 332 ; Point to next byte to compensate for DBCS character 333 ; ENDIF 334 ; ENDDO 335 ; Tack on ASCIIZ character to string 336 ; Restore pointer to string 337 ; 338 ;***************************************************************************** 339 340 Procedure Change_Blanks ; ;AN000; 341 0 00001E49 56 push si ;Save pointer to string ;AN000; 0 00001E4A 51 push cx ; ;AN000; 0 00001E4B 50 push ax ; ;AN000; 0 00001E4C 31C9 xor cx,cx ; ;AN000; 346 ; $DO ;Do while not CR ;AN000; 347 DD_DO19: 0 00001E4E 803C00 cmp byte ptr [si],Asciiz_End ;Is it end of string? ;AN000; 349 ; $LEAVE E,OR ;All done if so ;AN000; 0 00001E51 7429 JE DD_EN19 0 00001E53 803C0D cmp byte ptr [si],CR ;Is it CR? ;AN000; 352 ; $LEAVE E,OR ;Exit if yes,end of label ;AN000; 0 00001E56 7424 JE DD_EN19 0 00001E58 41 inc cx ;Count the character ;AN000; 355 Label_Buffer_Length equ Label_Buffer_length ; NASM port equate 0 00001E59 81F98000 cmp cx,Label_Buffer_Length ;Reached max chars? (80h) ;AN000; 357 ; $LEAVE E ;Exit if so ;AN000; 0 00001E5D 741D JE DD_EN19 0 00001E5F 8A04 mov al,byte ptr [si] ;Get char to test for DBCS ;AN000; 0 00001E61 E89D00 call Check_DBCS_Character ;Test for dbcs lead byte ;AN000; 361 ; $IF C ;We have a lead byte ;AN000; 0 00001E64 7313 JNC DD_IF21 0 00001E66 803C81 cmp byte ptr [si],DBCS ;Is it a lead blank? ;AN000; 364 ; $IF E,AND ;If a dbcs char ;AN000; 0 00001E69 750D JNE DD_IF22 0 00001E6B 807C0140 cmp byte ptr [si+1],DBCS_Blank ;Is it an Asian blank? ;AN000; 367 ; $IF E ;If an Asian blank ;AN000; 0 00001E6F 7507 JNE DD_IF22 0 00001E71 C6440120 mov byte ptr [si+1],Blank ;set up moves ;AN000; 0 00001E75 C60420 mov byte ptr [si],Blank ; to replace ;AN000; 371 ; $ENDIF ; ;AN000; 372 DD_IF22: 0 00001E78 46 inc si ;Point to dbcs char ;AN000; 374 ; $ENDIF ;End lead byte test ;AN000; 375 DD_IF21: 0 00001E79 46 inc si ;Point to si+1 ;AN000; 377 ; $ENDDO ;End do while ;AN000; 0 00001E7A EBD2 JMP SHORT DD_DO19 379 DD_EN19: 0 00001E7C C60400 mov byte ptr [si],Asciiz_End ;Mark end of string ;AN000; 0 00001E7F 58 pop ax ;Restore regs ;AN000; 0 00001E80 59 pop cx ; ;AN000; 0 00001E81 5E pop si ; ;AN000; 0 00001E82 C3 ret ;return to caller ;AN000; 385 386 Change_Blanks endp ; ;AN000; 387 388 ;***************************************************************************** 389 ;Routine name: Skip_Blanks 390 ;***************************************************************************** 391 ; 392 ;Description: Scan ASCIIZ string for leading blanks, return pointer to first 393 ; non-blank character. Set CY if blanks found 394 ; 395 ;Called Procedures: None 396 ; 397 ;Change History: Created 6/12/87 MT 398 ; 399 ;Input: DS:SI = ASCIIZ string containing volume label input 400 ; 401 ;Output: DS:SI = Input string starting at first non-blank character 402 ; CY set if blanks found 403 ; 404 ; 405 ; 406 ;Psuedocode 407 ;---------- 408 ; 409 ; Save original pointer, DI register 410 ; DO 411 ; Look at character from string 412 ; LEAVE End of string (0) 413 ; IF character is blank,OR 414 ; IF character is tab 415 ; INC pointer (SI) 416 ; Indicate blank 417 ; ELSE 418 ; Indicate non-blank 419 ; ENDIF 420 ; ENDDO non-blank 421 ; Get back pointer 422 ; Cmp string pointer to original pointer 423 ; IF NE 424 ; STC 425 ; ELSE 426 ; CLC 427 ; ENDIF 428 ; ret 429 ;***************************************************************************** 430 431 Procedure Skip_Blanks ; ;AN000; 432 0 00001E83 57 push di ;Preserve DI, just in case ;AN000; 0 00001E84 56 push si ;Save pointer to string ;AN000; 435 ; $DO ;Look at entire ASCIIZ string ;AN000; 436 DD_DO26: 437 ASCIIZ_End equ Asciiz_End ; NASM port equate 0 00001E85 803C00 cmp byte ptr [si],ASCIIZ_End ;End of string? ;AN000; 439 ; $LEAVE E ;Yep, exit loop ;AN000; 0 00001E88 7411 JE DD_EN26 0 00001E8A 803C20 cmp byte ptr [si],Blank ;Find a blank? ;AN000; 442 ; $IF E,OR ;Yes ;AN000; 0 00001E8D 7405 JE DD_LL28 444 TAB equ Tab ; NASM port equate 0 00001E8F 803C09 cmp byte ptr [si],TAB ;Is it tab? ;AN000; 446 ; $IF E ;Yes ;AN000; 0 00001E92 7504 JNE DD_IF28 448 DD_LL28: 0 00001E94 46 inc si ;Bump pointer to next character ;AN000; 0 00001E95 F8 clc ;Indicate found blank ;AN000; 451 ; $ELSE ;Not blank or tab ;AN000; 0 00001E96 EB01 JMP SHORT DD_EN28 453 DD_IF28: 0 00001E98 F9 stc ;Force exit ;AN000; 455 ; $ENDIF ; ;AN000; 456 DD_EN28: 457 ; $ENDDO C ;Go look at next character ;AN000; 0 00001E99 73EA JNC DD_DO26 459 DD_EN26: 0 00001E9B 5F pop di ;Get back original pointer ;AN000; 0 00001E9C 39F7 cmp di,si ;Are they the same? ;AN000; 462 ; $IF NE ;If not equal blanks were found ;AN000; 0 00001E9E 7403 JE DD_IF32 0 00001EA0 F9 stc ;Set CY ;AN000; 465 ; $ELSE ;No leading blanks found ;AN000; 0 00001EA1 EB01 JMP SHORT DD_EN32 467 DD_IF32: 0 00001EA3 F8 clc ;Clear CY ;AN000; 469 ; $ENDIF ; ;AN000; 470 DD_EN32: 0 00001EA4 5F pop di ;Restore DI ;AN000; 0 00001EA5 C3 ret ; ;AN000; 473 474 Skip_Blanks endp ; ;AN000; 475 476 477 ;***************************************************************************** 478 ;Routine name: Copy_FCB_String 479 ;***************************************************************************** 480 ; 481 ;Description: Build an 11 character string in the FCB from ASCIIZ string 482 ; If nothing entered, than terminated with 0. Also add drive 483 ; number in FCB 484 ; 485 ;Called Procedures: None 486 ; 487 ;Change History: Created 6/12/87 MT 488 ; 489 ;Input: DS:SI = String containing volume label input 490 ; 491 ;Output: VOLNAM is filled in with Volume label string 492 ; 493 ; 494 ; 495 ;Psuedocode 496 ;---------- 497 ; 498 ; Save regs 499 ; Init VolNam to blanks 500 ; DO 501 ; LEAVE if character is end of ASCIIZ string 502 ; Mov character to FCB 503 ; Inc counter 504 ; ENDDO all 11 chars done 505 ; Restore regs 506 ;***************************************************************************** 507 508 Procedure Copy_FCB_String ; ;AN000; 509 0 00001EA6 57 push di ; ;AN000; 0 00001EA7 51 push cx ; ;AN000; 0 00001EA8 56 push si ;Save pointer to string ;AN000; 0 00001EA9 FC cld ;Set string direction to up ;AN000; 514 Volnam equ VolNam ; NASM port label 0 00001EAA BF[0000] mov di,offset Volnam ;Init FCB field to blanks ;AN000; 0 00001EAD B020 mov al,Blank ; " " " " ;AN000; 0 00001EAF B90B00 mov cx,Label_Length ; " " " " ;AN000; 0 00001EB2 F3AA rep stosb ; " " " " ;AN000; 0 00001EB4 5E pop si ;Get back pointer to string ;AN000; 0 00001EB5 BF[0000] mov di,offset VolNam ;Point at FCB field ;AN000; 0 00001EB8 31C9 xor cx,cx ;Init counter ;AN000; 522 ; $DO ;Copy characters over ;AN000; 523 DD_DO35: 0 00001EBA 803C00 cmp byte ptr [si],ASCIIZ_End ;End of String? ;AN000; 525 ; $LEAVE E ;Yes, don't copy - leave blanks ;AN000; 0 00001EBD 7407 JE DD_EN35 0 00001EBF A4 movsb ;Nope, copy character ;AN000; 0 00001EC0 41 inc cx ;Bump up count ;AN000; 0 00001EC1 83F90B cmp cx,Label_Length ;Have we moved 11? ;AN000; 530 ; $ENDDO E ;Quit if so ;AN000; 0 00001EC4 75F4 JNE DD_DO35 532 DD_EN35: 0 00001EC6 59 pop cx ; ;AN000; 0 00001EC7 5F pop di ; ;AN000; 0 00001EC8 C3 ret ; ;AN000; 536 537 Copy_FCB_String endp ; ;AN000; 538 539 540 ;***************************************************************************** 541 ;Routine name: Check_DBCS_Overrun 542 ;***************************************************************************** 543 ; 544 ;Description: Check 11th byte, if the string is that long, to see 545 ; if it is a DBCS character that is split down the middle. Must 546 ; scan entire string to properly find DBCS characters, due to 547 ; the fact a second byte of a DBCS character can fall into 548 ; the range of the first byte environment vector, and thus look 549 ; like a DBCS char when it really isn't 550 ; 551 ;Called Procedures: Check_DBCS_Character 552 ; 553 ;Change History: Created 6/12/87 MT 554 ; 555 ;Input: DS:SI = String containing volume label input 556 ; 557 ;Output: CY set if DBCS character at bytes 11-12 in string 558 ; 559 ;***************************************************************************** 560 561 Procedure Check_DBCS_Overrun ; ;AN000; 562 0 00001EC9 56 push si ;Save pointer ;AN000; 0 00001ECA 50 push ax ;Save registers ;AN000; 0 00001ECB 51 push cx ; " " " " ;AN000; 0 00001ECC 89F1 mov cx,si ;Get start of string ;AN000; 0 00001ECE 83C10B add cx,Label_Length ;Find where to check for overrun;AN000; 568 569 Check_DBCS_OverRun_Cont: ;Scan string for DBCS chars ;AN000; 570 0 00001ED1 803C00 cmp byte ptr [si],ASCIIZ_End ;End of string? ;AN000; 0 00001ED4 7422 je DBCS_Good_Exit ;Yep ;AN000; 573 0 00001ED6 8A04 mov al,[si] ;Get character for routine ;AN000; 0 00001ED8 E82600 call Check_DBCS_Character ;See if DBCS leading character ;AN000; 576 ; $if c ;DBCS if CY set ;AN000; 0 00001EDB 7311 JNC DD_IF38 0 00001EDD 46 inc si ;Next byte to handle DBCS ;AN000; 0 00001EDE 39CE cmp si,cx ;Is DBCS char spanning 11-12? ;AN000; 580 ; $if e ;truncate string 0 00001EE0 750A JNE DD_IF39 0 00001EE2 C644FF20 mov byte ptr [si-1],20h;blank it out 0 00001EE6 C60420 mov byte ptr [si],20h ;blank it out 0 00001EE9 EB0D jmp DBCS_Good_Exit ;exit 0 00001EEB 90 nop ; identicalise 586 ; $endif ; 587 DD_IF39: 588 ; $else ;Not DBCS character ;an000; dms; 0 00001EEC EB07 JMP SHORT DD_EN38 590 DD_IF38: 0 00001EEE 8A04 mov al,[si] ;Get character for routine ;an000; dms; 0 00001EF0 E85B00 call Scan_For_Invalid_Char ;See if invalid vol ID char ;an000; dms; 0 00001EF3 7207 jc DBCS_Bad_Exit ;Bad char entered - exit ;an000; dms; 594 ; $endif ; ;an000; dms; 595 DD_EN38: 596 0 00001EF5 46 inc si ;Point to next character ;an000; dms; 0 00001EF6 EBD9 jmp Check_DBCS_OverRun_Cont ;Continue looping ;an000; dms; 599 600 DBCS_Good_Exit: 601 ;an000; dms; 0 00001EF8 F8 clc ;Signal no error ;an000; dms; 0 00001EF9 EB02 jmp DBCS_Exit ;Exit routine ;an000; dms; 0 00001EFB 90 nop ; identicalise 605 606 DBCS_Bad_Exit: ;an000; dms; 607 0 00001EFC F9 stc ;Signal error ;an000; dms; 609 610 DBCS_Exit: ;an000; dms; 611 0 00001EFD 59 pop cx ;Restore registers ;AN000; 0 00001EFE 58 pop ax ; " " " " ;AN000; 0 00001EFF 5E pop si ;Restore string pointer ;AN000; 0 00001F00 C3 ret ; ;AN000; 616 617 Check_DBCS_Overrun endp ; ;AN000; 618 619 ;***************************************************************************** 620 ;Routine name: Check_DBCS_Character 621 ;***************************************************************************** 622 ; 623 ;Description: Check if specified byte is in ranges of DBCS vectors 624 ; 625 ;Called Procedures: None 626 ; 627 ;Change History: Created 6/12/87 MT 628 ; 629 ;Input: AL = Character to check for DBCS lead character 630 ; DBCS_Vector = YES/NO 631 ; 632 ;Output: CY set if DBCS character 633 ; DBCS_VECTOR = YES 634 ; 635 ; 636 ;Psuedocode 637 ;---------- 638 ; Save registers 639 ; IF DBCS vector not found 640 ; Get DBCS environmental vector (INT 21h 641 ; Point at first set of vectors 642 ; ENDIF 643 ; SEARCH 644 ; LEAVE End of DBCS vectors 645 ; EXITIF Character > X1,AND (X1,Y1) are environment vectors 646 ; EXITIF Character < Y1 647 ; STC (DBCS character) 648 ; ORELSE 649 ; Inc pointer to next set of vectors 650 ; ENDLOOP 651 ; CLC (Not DBCS character) 652 ; ENDSRCH 653 ; Restore registers 654 ; ret 655 ;***************************************************************************** 656 657 Procedure Check_DBCS_Character ; ;AN000; 658 0 00001F01 1E push ds ;Save registers ;AN000; 0 00001F02 56 push si ; " " " " ;AN000; 0 00001F03 50 push ax ; " " " " ;AN000; 0 00001F04 1E push ds ; " " " " ;AN000; 0 00001F05 07 pop es ;Establish addressability ;AN000; 664 Yes equ YES ; NASM port equate 0 00001F06 26803E0000FF cmp byte [es:DBCS_VECTOR],Yes ;Have we set this yet? ;AN000; 0 00001F0C 50 push ax ;Save input character ;AN000; 667 ; $IF NE ;Nope ;AN000; 0 00001F0D 7417 JE DD_IF43 0 00001F0F B000 mov al,0 ;Get DBCS environment vectors ;AN000; 0 00001F11 B463CD21 DOS_Call Hongeul ; " " " " ;AN000; 0 00001F15 26C6060000FF mov byte [es:DBCS_VECTOR],YES ;Indicate we've got vector ;AN000; 0 00001F1B 268936[1100] mov [es:DBCS_Vector_Off],si ;Save the vector ;AN000; 0 00001F20 8CD8 mov ax,ds ; ;AN000; 0 00001F22 26A3[1300] mov [es:DBCS_Vector_Seg],ax ; ;AN000; 675 ; $ENDIF ; for next time in ;AN000; 676 DD_IF43: 0 00001F26 58 pop ax ;Restore input character ;AN000; 0 00001F27 268B36[1300] mov si,[es:DBCS_Vector_Seg] ;Get saved vector pointer ;AN000; 0 00001F2C 8EDE mov ds,si ; ;AN000; 0 00001F2E 268B36[1100] mov si,[es:DBCS_Vector_Off] ; ;AN000; 681 ; $SEARCH ;Check all the vectors ;AN000; 682 DD_DO45: 0 00001F33 833C00 cmp word ptr [si],End_Of_Vector ;End of vector table? ;AN000; 684 ; $LEAVE E ;Yes, done ;AN000; 0 00001F36 7411 JE DD_EN45 0 00001F38 3A04 cmp al,[si] ;See if char is in vector ;AN000; 687 ; $EXITIF AE,AND ;If >= to lower, and ;AN000; 0 00001F3A 7208 JNAE DD_IF45 0 00001F3C 3A4401 cmp al,[si+1] ; =< than higher range ;AN000; 690 ; $EXITIF BE ; then DBCS character ;AN000; 0 00001F3F 7703 JNBE DD_IF45 0 00001F41 F9 stc ;Set CY to indicate DBCS ;AN000; 693 ; $ORELSE ;Not in range, check next ;AN000; 0 00001F42 EB06 JMP SHORT DD_SR45 695 DD_IF45: 0 00001F44 83C602 add si,DBCS_Vector_Size ;Get next DBCS vector ;AN000; 697 ; $ENDLOOP ;We didn't find DBCS char ;AN000; 0 00001F47 EBEA JMP SHORT DD_DO45 699 DD_EN45: 0 00001F49 F8 clc ;Clear CY for exit ;AN000; 701 ; $ENDSRCH ; ;AN000; 702 DD_SR45: 0 00001F4A 58 pop ax ;Restore registers ;AN000; 0 00001F4B 5E pop si ; " " " " ;AN000; 0 00001F4C 1F pop ds ;Restore data segment ;AN000; 0 00001F4D C3 ret ; ;AN000; 707 708 Check_DBCS_Character endp ; ;AN000; 709 710 ;========================================================================= 711 ; Scan_For_Invalid_Char : This routine scans the bad character table 712 ; to determine if the referenced character is 713 ; invalid. 714 ; 715 ; Inputs : Bad_Char_Table - Table of bad characters 716 ; Bad_Char_Table_Len - Length of table 717 ; AL - Character to be searched for 718 ; 719 ; Outputs : CY - Bad character 720 ; NC - Character good 721 ;========================================================================= 722 723 Procedure Scan_For_Invalid_Char ;an000; dms; 724 0 00001F4E 50 push ax ;an000; dms;save ax 0 00001F4F 51 push cx ;an000; dms;save cx 0 00001F50 57 push di ;an000; dms;save di 728 0 00001F51 8D3E[0000] lea di,[Bad_Char_Table] ;an000; dms;point to bad character table 0 00001F55 B91100 mov cx,Bad_Char_Table_Len ;an000; dms;get its length 0 00001F58 90 nop ; identicalise 0 00001F59 F2AE repnz scasb ;an000; dms;scan the table 0 00001F5B 83F900 cmp cx,0000h ;an000; dms;did we find the character 734 ; $if e ;an000; dms;no - a good character 0 00001F5E 7503 JNE DD_IF51 0 00001F60 F8 clc ;an000; dms;flag a good character 737 ; $else ;an000; dms;yes - a bad character 0 00001F61 EB01 JMP SHORT DD_EN51 739 DD_IF51: 0 00001F63 F9 stc ;an000; dms;flag a bad character 741 ; $endif ;an000; dms; 742 DD_EN51: 743 0 00001F64 5F pop di ;an000; dms;restore di 0 00001F65 59 pop cx ;an000; dms;restore cx 0 00001F66 58 pop ax ;an000; dms;restore ax 747 0 00001F67 C3 ret ;an000; dms; 749 750 Scan_For_Invalid_Char endp ;an000; dms; 751 752 753 ; (no prior section) ; code ends 754 === Switch to base=000080h -> "DATA" 755 section data 756 757 Bad_Char_Table label byte ;an000; dms;table of invalid vol ID chars 0 00000780 2A db "*" 0 00000781 3F db "?" 0 00000782 5B db "[" 0 00000783 5D db "]" 0 00000784 3A db ":" 0 00000785 3C db "<" 0 00000786 7C db "|" 0 00000787 3E db ">" 0 00000788 2B db "+" 0 00000789 3D db "=" 0 0000078A 3B db ";" 0 0000078B 2C db "," 0 0000078C 2F db "/" 0 0000078D 5C db "\" 0 0000078E 2E db '.' 0 0000078F 22 db '"' 0 00000790 20 db " " 775 Bad_Char_Table_Len equ $-Bad_Char_Table;an000; dms;length of table 776 0 00000791 0000 DBCS_Vector_Off dw 0 ; 0 00000793 0000 DBCS_Vector_Seg dw 0 ; 779 780 ; (no prior section) ; data ends 781 end === Trace listing source: format.lst 1 ;page 84,132 2 ; SCCSID = @(#)format.asm 1.26 85/10/20 3 ; SCCSID = @(#)format.asm 1.26 85/10/20 4 ;*************************************************************** 5 ; 6 ; 86-DOS FORMAT DISK UTILITY 7 ; 8 ; This routine formats a new disk,clears the FAT and DIRECTORY then 9 ; optionally copies the SYSTEM and COMMAND.COM to this new disk 10 ; 11 ; SYNTAX: FORMAT [drive + /switch1 + /switch2]...[/switch16] 12 ; 13 ; Regardless of the drive designator , the user will be prompted to 14 ; insert the diskette to be formatted. 15 ; 16 ;*************************************************************** 17 18 ; 5/12/82 ARR Mod to ask for volume ID 19 ; 5/19/82 ARR Fixed rounding bug in CLUSCAL: 20 ; REV 1.5 21 ; Added rev number message 22 ; Added dir attribute to DELALL FCB 23 ; REV 2.00 24 ; Redone for 2.0 25 ; REV 2.10 26 ; 5/1/83 ARR Re-do to transfer system on small memory systems 27 ; REV 2.20 28 ; 6/17/83 system size re-initialization bug -- mjb001 29 ; Rev 2.25 30 ; 8/31/83 16-bit fat insertion 31 ; Rev 2.26 32 ; 11/2/83 MZ fix signed compare problems for bad sectors 33 ; Rev 2.27 34 ; 11/8/83 EE current directories are always saved and restored 35 ; Rev 2.28 36 ; 11/9/83 NP Printf and changed to an .EXE file 37 ; Rev 2.29 38 ; 11/11/83 ARR Fixed ASSIGN detection to use NameTrans call to see 39 ; if drive letter remapped. No longer IBM only 40 ; Rev 2.30 41 ; 11/13/83 ARR SS does NOT = CS, so all use of BP needs CS override 42 ; Rev 2.31 43 ; 12/27/83 ARR REP STOSB instruction at Clean: changed to be 44 ; sure ES = CS. 45 46 47 48 === Switch to base=001900h -> "CODE" 49 section code public align=16 class=CODE 50 ; (no prior section) ; code ends 51 52 53 === Switch to base=000080h -> "DATA" 54 section data public align=16 class=DATA 55 ; (no prior section) ; data ends 56 === Switch to base=005740h -> "END_OF_MEMORY" 57 section End_Of_Memory public align=16 class=BUFFERS 58 ; (no prior section) ; End_Of_Memory ends 59 60 === Switch to base=001900h -> "CODE" 61 section code 62 63 assume cs:code,ds:nothing,es:nothing 64 65 ;------------------------------------------------------------------------------- 66 ; Define as public for debugging 67 68 ; procedures 69 public GetSize 70 public AddToSystemSize 71 public Phase1Initialisation 72 public SetStartSector 73 public SetfBigFat 74 public Phase2Initialisation 75 public DiskFormat 76 public BadSector 77 public DisplayCurrentTrack 78 public WriteFileSystem 79 public Done 80 public CurrentLogicalSector 81 public PrintErrorAbort 82 public GetDeviceParameters 83 public SetDeviceParameters 84 public Multiply_32_Bits 85 86 public START 87 public FatAllocated 88 public MEMERRJ 89 public MEM_OK 90 public RDFRST 91 public NEEDSYS 92 public INITCALL 93 public SWITCHCHK 94 public SYSLOOP 95 public FRMTPROB 96 public GETTRK 97 public TRKFND 98 public CLRTEST 99 public CMPTRKS 100 public BadClus 101 ; public DoBig 102 ; public DoSet 103 public DRTFAT 104 public CLEARED 105 public LOUSE 106 public LOUSEP 107 public FATWRT 108 public SYSOK 109 public STATUS 110 public REPORTC 111 public ONCLUS 112 public MORE 113 public FEXIT 114 public SYSPRM 115 public fexitJ 116 public DoPrompt 117 public TARGPRM 118 public IsRemovable 119 public CheckRemove 120 public IsRemove 121 public NotRemove 122 public DSKPRM 123 public GOPRNIT 124 public crlf 125 public PrintString 126 public std_printf 127 public READDOS 128 public RDFILS 129 public FILESDONE 130 public CLSALL 131 public GOTBIOS 132 public GOTDOS 133 public CLSALLJ 134 public GOTCOM 135 public WRITEDOS 136 public GOTALLBIO 137 public BIOSDONE 138 public GOTNDOS 139 public PARTDOS 140 public GOTALLDOS 141 public DOSDONE 142 public PARTCOM 143 public GOTALLCOM 144 public COMDONE 145 public MAKEFIL 146 public CheckMany 147 public CLOSETARG 148 public IOLOOP 149 public GOTTARG 150 public GSYS 151 public TESTSYS 152 public GETOFFS 153 ; public TESTSYSDISK ; dcl 8/23/86 154 public SETBIOS 155 public BIOSCLS 156 public SETBIOSSIZ 157 public DOSOPNOK 158 public DOSCLS 159 public SETDOSSIZ 160 public GotComHand 161 public COMCLS 162 public SETCOMSIZ 163 public GETFSIZ 164 public READFILE 165 public WRITEFILE 166 public FILIO 167 public NORMIO 168 public IORETP 169 public IORET 170 public NORMALIZE 171 public GotDeviceParameters 172 public LoadSectorTable 173 public NotBigTotalSectors 174 public NotBig 175 public FormatLoop 176 public FormatDone 177 public ContinueFormat 178 public ReportBadTrack 179 public NoMoreTracks 180 public WriteDIRloop 181 public Main_Routine 182 public ControlC_Handler 183 184 ; bytes 185 public fBigFat 186 public formatError 187 public ROOTSTR 188 public DBLFLG 189 DRIVE equ drive ; NASM port label 190 public DRIVE 191 public FILSTAT 192 public USERDIRS 193 public VOLFCB 194 public VOLNAM 195 public TRANSRC 196 public TRANDST 197 public INBUFF 198 public driveLetter 199 public systemDriveLetter 200 public CommandFile 201 public ExitStatus 202 VolDrive equ VOLDRIVE ; NASM port label 203 public VolDrive 204 public DelFCB 205 DelDrive equ DelDRIVE ; NASM port label 206 public DelDrive 207 208 ; words 209 public startSector 210 public fatSpace 211 public firstHead 212 public firstCylinder 213 public tracksLeft 214 public tracksPerDisk 215 public sectorsInRootDirectory 216 public directorySector 217 public printStringPointer 218 public MSTART 219 public MSIZE 220 public TempHandle 221 public BEGSEG 222 public SWITCHMAP 223 public SWITCHCOPY 224 public FAT 225 public CLUSSIZ 226 public SECSIZ 227 public SYSTRKS 228 public SECTORS 229 public currentHead 230 public currentCylinder 231 public PercentComplete 232 public Formatted_Tracks_High 233 public Formatted_Tracks_Low 234 235 ; other 236 public deviceParameters 237 public Disk_Access 238 public formatPacket 239 ;------------------------------------------------------------------------------- 240 === Switch to base=000080h -> "DATA" 241 section data 242 extrn msgAssignedDrive:byte 243 extrn msgBadDosVersion:byte 244 extrn msgDirectoryWriteError:byte 245 extrn msgFormatComplete:byte 246 extrn msgFormatNotSupported:byte 247 extrn msgFATwriteError:byte 248 extrn msgInvalidDeviceParameters:byte 249 extrn msgLabelPrompt:byte 250 extrn msgNeedDrive:byte 251 extrn msgNoSystemFiles:byte 252 extrn msgNetDrive:byte 253 extrn msgInsertDisk:byte 254 extrn msgHardDiskWarning:byte 255 extrn msgSystemTransfered:byte 256 extrn msgFormatAnother?:byte 257 extrn msgBadCharacters:byte 258 extrn msgBadDrive:byte 259 extrn msgInvalidParameter:byte 260 extrn msgParametersNotSupported:byte 261 extrn msgReInsertDisk:byte 262 extrn msgInsertDosDisk:byte 263 extrn msgFormatFailure:byte 264 extrn ContinueMsg:Byte 265 extrn msgNotSystemDisk:byte 266 extrn msgDiskUnusable:byte 267 extrn msgOutOfMemory:byte 268 extrn msgCurrentTrack:byte 269 extrn msgWriteProtected:byte 270 extrn msgInterrupt:byte 271 extrn msgCRLF:byte 272 extrn Fatal_Error:Byte 273 extrn Read_Write_Relative:Byte 274 extrn PSP_Segment:Word 275 extrn Parse_Error_Msg:Byte 276 extrn Extended_Error_Msg:Byte 277 extrn MsgVerify:Byte 278 === Switch to base=001900h -> "CODE" 279 section code ; data ends 280 281 282 debug equ 0 283 [list -] 283 ****************** warning: out: ... for DOS Version 4.00 ... [-w+user] 283 ****************** warning: out: BPB.INC... [-w+user] 283 ****************** warning: out: IOCTL.INC... [-w+user] 283 ****************** warning: out: BPB.INC... [-w+user] 283 ****************** warning: out: ... CLONE version build switch on ... [-w+user] 300 301 302 ;------------------------------------------------------------------------------- 303 ; And this is the actual data 304 === Switch to base=000080h -> "DATA" 305 section data 306 public deviceParameters 307 public bios 308 public dos 309 public command 310 public FAT_Flag 311 0 000007A0 00 validSavedDeviceParameters db 0 313 savedDeviceParameters: ; NASM structure instance 314 A_DEVICEPARAMETERS_size equ A_DEVICEPARAMETERS_struc_size ; NASM port equate 315 istruc A_DEVICEPARAMETERS 0 000007A1 ?? iend 317 deviceParameters: ; NASM structure instance 318 istruc A_DEVICEPARAMETERS 0 000008C5 ?? iend 320 321 Disk_Access: ; NASM structure instance 322 A_DISKACCESS_CONTROL_size equ A_DISKACCESS_CONTROL_struc_size ; NASM port equate 323 istruc A_DISKACCESS_CONTROL 0 000009E9 ?? iend 325 326 formatPacket: ; NASM structure instance 327 A_FORMATPACKET_size equ A_FORMATPACKET_struc_size ; NASM port equate 328 istruc A_FORMATPACKET 0 000009EB ??0100 at FP_TRACKCOUNT, dw 1 330 iend 331 RWPacket: ; NASM structure instance 332 A_TRACKREADWRITEPACKET_size equ A_TRACKREADWRITEPACKET_struc_size ; NASM port equate 333 istruc A_TRACKREADWRITEPACKET 0 000009F2 ?? iend 0 000009FF 000000000000000000 RW_TRF_Area db 512 dup(0) 0 00000A08 000000000000000000 0 00000A11 000000000000000000 0 00000A1A 000000000000000000 0 00000A23 000000000000000000 0 00000A2C 000000000000000000 0 00000A35 000000000000000000 0 00000A3E 000000000000000000 0 00000A47 000000000000000000 0 00000A50 000000000000000000 0 00000A59 000000000000000000 0 00000A62 000000000000000000 0 00000A6B 000000000000000000 0 00000A74 000000000000000000 0 00000A7D 000000000000000000 0 00000A86 000000000000000000 0 00000A8F 000000000000000000 0 00000A98 000000000000000000 0 00000AA1 000000000000000000 0 00000AAA 000000000000000000 0 00000AB3 000000000000000000 0 00000ABC 000000000000000000 0 00000AC5 000000000000000000 0 00000ACE 000000000000000000 0 00000AD7 000000000000000000 0 00000AE0 000000000000000000 0 00000AE9 000000000000000000 0 00000AF2 000000000000000000 0 00000AFB 000000000000000000 0 00000B04 000000000000000000 0 00000B0D 000000000000000000 0 00000B16 000000000000000000 0 00000B1F 000000000000000000 0 00000B28 000000000000000000 0 00000B31 000000000000000000 0 00000B3A 000000000000000000 0 00000B43 000000000000000000 0 00000B4C 000000000000000000 0 00000B55 000000000000000000 0 00000B5E 000000000000000000 0 00000B67 000000000000000000 0 00000B70 000000000000000000 0 00000B79 000000000000000000 0 00000B82 000000000000000000 0 00000B8B 000000000000000000 0 00000B94 000000000000000000 0 00000B9D 000000000000000000 0 00000BA6 000000000000000000 0 00000BAF 000000000000000000 0 00000BB8 000000000000000000 0 00000BC1 000000000000000000 0 00000BCA 000000000000000000 0 00000BD3 000000000000000000 0 00000BDC 000000000000000000 0 00000BE5 000000000000000000 0 00000BEE 000000000000000000 0 00000BF7 0000000000000000 336 0 00000BFF ???? startSector dw ? 0 00000C01 ???????? fatSpace dd ? 0 00000C05 00 fBigFat db FALSE 340 0 00000C06 ???? firstHead dw ? 0 00000C08 ???? firstCylinder dw ? 0 00000C0A ???? tracksLeft dw ? 0 00000C0C ???? tracksPerDisk dw ? 345 0 00000C0E 0000 Formatted_Tracks_Low dw 0 0 00000C10 0000 Formatted_Tracks_High dw 0 348 349 350 public NumSectors ,TrackCnt 0 00000C12 FFFF NumSectors dw 0FFFFh 0 00000C14 FFFF TrackCnt dw 0FFFFh 0 00000C16 FFFF PercentComplete dw 0FFFFh ;Init non-zero so msg will display first time 354 355 public Old_Dir 0 00000C18 00 Old_Dir db FALSE 357 358 public fLastChance 0 00000C19 00 fLastChance db FALSE ; Flags reinvocation from 360 ; LastChanceToSaveIt. Used by DSKPRM 361 0 00000C1A ???? sectorsInRootDirectory dw ? 363 0 00000C1C 00000000 directorySector dd 0 365 0 00000C20 00 formatError db 0 367 0 00000C21 0000 printStringPointer dw 0 369 370 ; Exit status defines 0 00000C23 00 ExitStatus db 0 372 ExitOK equ 0 373 ExitCtrlC equ 3 374 ExitFatal equ 4 375 ExitNo equ 5 376 ExitDriveNotReady equ 6 ;an017; dms;drive not ready error 377 ExitWriteProtect equ 7 ;an017; dms;write protect error 378 0 00000C24 ?? ROOTSTR DB ? 0 00000C25 3A5C00 DB ":\",0 0 00000C28 00 DBLFLG DB 0 ;Initialize flags to zero 0 00000C29 ???????? IOCNT DD ? 0 00000C2D ???? MSTART DW ? ; Start of sys file buffer (para#) 0 00000C2F ???? MSIZE DW ? ; Size of above in paragraphs 0 00000C31 ???? TempHandle DW ? 0 00000C33 ?? FILSTAT DB ? ; In memory status of files 387 ; XXXXXX00B BIOS not in 388 ; XXXXXX01B BIOS partly in 389 ; XXXXXX10B BIOS all in 390 ; XXXX00XXB DOS not in 391 ; XXXX01XXB DOS partly in 392 ; XXXX10XXB DOS all in 393 ; XX00XXXXB COMMAND not in 394 ; XX01XXXXB COMMAND partly in 395 ; XX10XXXXB COMMAND all in 396 397 00000494 USERDIRS DB DIRSTRLEN+3 DUP(?) ; Storage for users current directory 398 0 00000C7A 0000 Paras_Per_Fat dw 0000h ;an000;holds fat para count 0 00000C7C 0000 Fat_Init_Value dw 0000h ;an000;initializes the FAT 401 402 bios: ; NASM structure instance 403 a_FileStructure_size equ a_FileStructure_struc_size ; NASM port equate 404 istruc a_FileStructure 0 00000C7E ?? iend 406 BiosAttributes EQU attr_hidden + attr_system + attr_read_only 407 408 dos: ; NASM structure instance 409 istruc a_FileStructure 0 00000C90 ?? iend 411 DosAttributes EQU attr_hidden + attr_system + attr_read_only 412 413 command: ; NASM structure instance 414 istruc a_FileStructure 0 00000CA2 ?? iend 416 CommandAttributes EQU 0 0 00000CB4 583A5C434F4D4D414E CommandFile DB "X:\COMMAND.COM",0 0 00000CBD 442E434F4D00 0 00000CC3 000000000000000000 CommandFile_Buffer DB 127 dup(0) ;an000;allow room for copy 0 00000CCC 000000000000000000 0 00000CD5 000000000000000000 0 00000CDE 000000000000000000 0 00000CE7 000000000000000000 0 00000CF0 000000000000000000 0 00000CF9 000000000000000000 0 00000D02 000000000000000000 0 00000D0B 000000000000000000 0 00000D14 000000000000000000 0 00000D1D 000000000000000000 0 00000D26 000000000000000000 0 00000D2F 000000000000000000 0 00000D38 000000000000000000 0 00000D41 00 419 0 00000D42 434F4D4D414E442E43 Command_Com DB "COMMAND.COM",0 0 00000D4B 4F4D00 421 0 00000D4E FF000000000008 VOLFCB DB -1,0,0,0,0,0,8 0 00000D55 00 VOLDRIVE DB 0 0 00000D56 202020202020202020 VOLNAM DB " " 0 00000D5F 2020 0 00000D61 08 DB 8 426 000005C2 DB 26 DUP(?) 427 0 00000D7C FF000000000008 DelFCB DB -1,0,0,0,0,0,8 0 00000D83 00 DelDRIVE DB 0 0 00000D84 3F3F3F3F3F3F3F3F3F DelNAM DB "???????????" 0 00000D8D 3F3F 0 00000D8F 08 DB 8 432 000005F0 DB 26 DUP(?) 433 0 00000DAA 413A434F4E0000 TRANSRC DB "A:CON",0,0 ; Device so we don't hit the drive 0 00000DB1 413A5C000000000000 TRANDST DB "A:\",0,0,0,0,0,0,0,0,0,0 0 00000DBA 00000000 436 0 00000DBE ???? BEGSEG DW ? 0 00000DC0 ???? SWITCHMAP DW ? 0 00000DC2 ???? SWITCHCOPY DW ? 0 00000DC4 ???? FAT DW ? 0 00000DC6 ???? DW ? 0 00000DC8 ???? CLUSSIZ DW ? 0 00000DCA ???? SECSIZ DW ? 0 00000DCC ???? SYSTRKS DW ? 0 00000DCE ???? SECTORS DW ? 0 00000DD0 5000 INBUFF DB 80,0 447 00000632 DB 80 DUP(?) 448 449 0 00000E22 00 drive db 0 0 00000E23 78 driveLetter db "x" 0 00000E24 78 systemDriveLetter db "x" 453 0 00000E25 ???????? CTRL_BREAK_VECTOR dd ? ;ac010; dms;Holds CTRL-Break 455 ; vector 456 0 00000E29 ???????? Command_Path dd ? ;an011; dms;hold pointer to 458 ; COMMAND's path 459 0 00000E2D 434F4D535045433D00 Comspec_ID db "COMSPEC=",00 ;an011; dms;Comspec target 461 462 0 00000E36 ???? Environ_Segment dw ? ;an011; dms;hold segment of 464 ; environ. vector 465 ;======== Disk Table ========== ;an012; dms; 466 ;Used if NumberOfFATs in BPB 467 ;is 0. 468 0 00000E38 0000A87F0308000200 DiskTable dw 0, 32680, 0803h, 512, 0 0 00000E41 00 0 00000E42 0400000002040002FF dw 4h, 0000h, 0402h, 512, Fbig 0 00000E4B 00 0 00000E4C 0800000003080002FF dw 8h, 0000h, 0803h, 512, Fbig 0 00000E55 00 0 00000E56 1000000004100002FF dw 10h, 0000h, 1004h, 512, Fbig 0 00000E5F 00 0 00000E60 2000000005200002FF dw 20h, 0000h, 2005h, 512, Fbig 0 00000E69 00 474 475 public Org_AX ;an000; dms;make it known 0 00000E6A ???? Org_AX dw ? ;an000; dms;AX on entry 477 0 00000E6C ???? Cluster_Boundary_Adj_Factor dw ? ;an000; dms; 0 00000E6E ???? Cluster_Boundary_SPT_Count dw ? ;an000; dms; 480 False equ FALSE ; NASM port equate 0 00000E70 00 Cluster_Boundary_Flag db False ;an000; dms; 0 00000E71 ???? Cluster_Boundary_Buffer_Seg dw ? ;an000; dms; 483 0 00000E73 ???? Relative_Sector_Low dw ? ;an000; dms; 0 00000E75 ???? Relative_Sector_High dw ? ;an000; dms; 486 0 00000E77 ?? FAT_Flag db ? ;an000; dms; 0 00000E78 ???? Tracks_To_Format dw ? ;an015; dms; 0 00000E7A ???? Track_Count dw ? ;an015; dms; 0 00000E7C 00 Format_End db FALSE ;an015; dms; 491 492 public Msg_Allocation_Unit_Val 493 0 00000E7D ???????? Msg_Allocation_Unit_Val dd ? ;an019; dms; 495 496 === Switch to base=001900h -> "CODE" 497 section code ; data ends 498 499 ;For FORPROC and FORMES modules 500 501 secsiz equ SECSIZ ; NASM port label 502 clussiz equ CLUSSIZ ; NASM port label 503 inbuff equ INBUFF ; NASM port label 504 505 PUBLIC crlf,std_printf 506 507 switchmap equ SWITCHMAP ; NASM port label 508 public driveLetter,fatSpace 509 public fBigFat, PrintString,currentHead,currentCylinder 510 extrn CheckSwitches:near,LastChanceToSaveIt:near 511 extrn Volid:near 512 extrn WriteBootSector:near,OemDone:near 513 extrn AccessDisk:near 514 extrn Main_Init:near 515 extrn Read_Disk:near 516 extrn Write_Disk:near 517 === Switch to base=000080h -> "DATA" 518 section data 519 extrn BiosFile:byte,DosFile:byte === Switch to base=001900h -> "CODE" 520 section code ; data ends 521 522 ;For FORPROC module 523 524 EXTRN FormatAnother?:near,Yes?:near,REPORT:NEAR,USER_STRING:NEAR === Switch to base=000080h -> "DATA" 525 section data 526 extrn syssiz:dword,biosiz:dword === Switch to base=001900h -> "CODE" 527 section code ; data ends 528 529 DOSVER_LOW EQU 0300H+20 530 DOSVER_HIGH EQU 0300H+20 531 532 RECLEN EQU fcb_RECSIZ+7 533 RR EQU fcb_RR+7 534 535 PSP_Environ equ 2ch ;an011; dms;location of 536 ; environ. segment 537 ; in PSP 538 539 Fbig equ 0ffh ;an000; dms;flag for big FAT 540 541 ..start: 542 START: 0 00001F70 31DB xor bx,bx ; ;AN000; 0 00001F72 53 push bx ; ;AN000; 0 00001F73 50B8[0000]8ED81E07 Set_Data_Segment ; ;AC000; 0 00001F7B 58 0 00001F7C A3[CA06] mov [Org_AX],ax ;an000; dms;save ax on entry 0 00001F7F E9[0000] jmp Main_Init ; ;AC000; 548 549 550 Main_Routine: ; ;AN000; 551 ; Set memory requirements 0 00001F82 8B1E[0000] mov bx,[PSP_Segment] ;Shrink to free space for FAT ;AC000; 0 00001F86 8EC3 mov es,bx ; ;AC000; 0 00001F88 BB[0000] mov bx,End_Of_Memory ; ;AC000; 0 00001F8B 2B1E[0000] sub bx,[PSP_Segment] ; ;AC000; 0 00001F8F B44ACD21 DOS_Call Setblock ; ;AC000; 557 0 00001F93 E8E011 call Get_Disk_Access ;an014; dms; 559 DAC_Access_Flag equ DAC_ACCESS_FLAG ; NASM port equate 0 00001F96 803E[4A02]FF cmp byte [Disk_Access + DAC_Access_Flag],0ffh ;an014; dms;is access already allowed? 561 ; $if ne ;an014; dms;no, don't change status 0 00001F9B 740C JE DD_IF1 0 00001F9D 8D16[4902] lea dx,[Disk_Access] ;an014; dms;point to parm block 0 00001FA1 C606[4A02]01 mov byte [Disk_Access + DAC_Access_Flag],01h ;an014; dms;signal disk access 0 00001FA6 E8A711 call Set_Disk_Access_On_Off ;an014;dms;allow disk access 566 ; $endif ;an014; dms; 567 DD_IF1: 568 0 00001FA9 E86109 CALL Phase1Initialisation 0 00001FAC 7317 jnc FatAllocated 571 0 00001FAE BA[0000]E8[0000] Message msgFormatFailure ; ;AC000; 573 Fexit equ FEXIT ; NASM port label 0 00001FB4 E9E402 jmp Fexit 575 576 MEMERR: 0 00001FB7 B8[0000] mov ax, data 0 00001FBA 8ED8 mov ds, ax 0 00001FBC BA[0000]E8[0000] Message msgOutOfMemory ; ;AC000; 580 ;call PrintString 0 00001FC2 E9D602 JMP FEXIT 582 583 FatAllocated: 584 0 00001FC5 F706[2006]0100 TEST word [SWITCHMAP],SWITCH_S 0 00001FCB 7436 JZ INITCALL 0 00001FCD BBFFFF MOV BX,0FFFFH 588 ALLOC equ Alloc ; NASM port equate 0 00001FD0 B448 MOV AH,ALLOC 0 00001FD2 CD21 INT 21H 0 00001FD4 09DB OR BX,BX 0 00001FD6 740A JZ MEMERRJ ;No memory 0 00001FD8 891E[8F04] MOV [MSIZE],BX 0 00001FDC B448 MOV AH,ALLOC 0 00001FDE CD21 INT 21H 0 00001FE0 7302 JNC MEM_OK 597 MEMERRJ: 0 00001FE2 EBD3 JMP MEMERR ;No memory 599 600 MEM_OK: 0 00001FE4 A3[8D04] MOV [MSTART],AX 602 603 RDFRST: 0 00001FE7 C706[E004]0000 mov word [bios + fileSizeInParagraphs],0 ;mjb001 initialize file size 0 00001FED C706[F204]0000 mov word [dos + fileSizeInParagraphs],0 ;mjb001 ... 0 00001FF3 C706[0405]0000 mov word [command + fileSizeInParagraphs],0 ;mjb001 ... 0 00001FF9 E8B903 CALL READDOS ;Read BIOS and DOS 0 00001FFC 7305 JNC INITCALL ;OK -- read next file 609 NEEDSYS: 0 00001FFE E8C702 CALL SYSPRM ;Prompt for system disk 0 00002001 EBE4 JMP RDFRST ;Try again 612 613 INITCALL: 0 00002003 E80C0A CALL Phase2Initialisation 615 616 SWITCHCHK: 0 00002006 8B16[2006] MOV DX,[SWITCHMAP] 0 0000200A 8916[2206] MOV [SWITCHCOPY],DX 619 620 SYSLOOP: 621 ;Must intialize for each iteration 622 623 SYSSIZ equ syssiz ; NASM port label 0 0000200E C706[0000]0000 MOV WORD [SYSSIZ],0 0 00002014 C706[0200]0000 MOV WORD [SYSSIZ+2],0 0 0000201A C606[8804]00 MOV BYTE [DBLFLG],0 0 0000201F C606[8304]00 mov byte [ExitStatus], ExitOK 0 00002024 8B16[2206] MOV DX,[SWITCHCOPY] 0 00002028 8916[2006] MOV [SWITCHMAP],DX ;Restore original Switches 630 ; DiskFormat will handle call for new disk 631 DISKFORMAT equ DiskFormat ; NASM port label 0 0000202C E86B0A CALL DISKFORMAT ;Format the disk 0 0000202F 7318 JNC GETTRK 634 FRMTPROB: 635 636 SwitchMap equ SWITCHMAP ; NASM port label 637 Switch_Select equ SWITCH_SELECT ; NASM port equate 0 00002031 F706[2006]0004 test word [SwitchMap],Switch_Select ;an017; dms;SELECT option? 639 ; $if z ;an017; dms;no - display message 0 00002037 750B JNZ DD_IF3 0 00002039 BA[0000]E8[0000] Message msgFormatFailure ; ;AC000; 0 0000203F C606[8304]04 mov byte [ExitStatus], ExitFatal ;an017; dms; 643 ; $endif ;an017; dms; 644 DD_IF3: 0 00002044 E82602 CALL MORE ;See if more disks to format 0 00002047 EBC5 JMP SHORT SYSLOOP 647 648 ;Mark any bad sectors in the FATs 649 ;And keep track of how many bytes there are in bad sectors 650 651 GETTRK: 652 BADSECTOR equ BadSector ; NASM port label 0 00002049 E8530B CALL BADSECTOR ;Do bad track fix-up 0 0000204C 72E3 JC FRMTPROB ;Had an error in Formatting - can't recover 0 0000204E 83F800 CMP AX,0 ;Are we finished? 0 00002051 7503 JNZ TRKFND ;No - check error conditions 0 00002053 E91101 JMP DRTFAT ;Yes 658 TRKFND: 0 00002056 8B1E[D506] mov bx,word ptr [Relative_Sector_High] ;get the high word of the sector ;an000; dms; 0 0000205A 09DB OR BX,BX 0 0000205C 7512 JNZ CLRTEST 0 0000205E 8B1E[D306] mov bx,word ptr [Relative_Sector_Low] ;get the high word of the sector ;an000; dms; 663 STARTSECTOR equ startSector ; NASM port label 0 00002062 3B1E[5F04] CMP BX,[STARTSECTOR] ;Are any sectors in the system area bad? 0 00002066 7308 JAE CLRTEST ; MZ 2.26 unsigned compare 0 00002068 BA[0000]E8[0000] Message msgDiskUnusable ; ;AC000; 0 0000206E EBC1 JMP FRMTPROB ;Bad disk -- try again 668 CLRTEST: 0 00002070 A3[2E06] MOV [SECTORS],AX ;Save the number of sectors on the track 0 00002073 F706[2006]0100 TEST word [SWITCHMAP],SWITCH_S ;If system requested calculate size 0 00002079 7462 JZ BAD100 0 0000207B 803E[8804]00 CMP BYTE [DBLFLG],0 ;Have we already calculated System space? 0 00002080 752D JNZ CMPTRKS ;Yes -- all ready for the compare 0 00002082 FE06[8804] INC BYTE [DBLFLG] ;No -- set the flag 675 GETBIOSIZE equ GetBioSize ; NASM port label 0 00002086 E89501 CALL GETBIOSIZE ; Get the size of the BIOS 0 00002089 8B16[0200] MOV DX,WORD PTR [SYSSIZ+2] 0 0000208D A1[0000] MOV AX,WORD PTR [SYSSIZ] 679 BIOSIZ equ biosiz ; NASM port label 0 00002090 8916[0200] MOV WORD PTR [BIOSIZ+2],DX 0 00002094 A3[0000] MOV WORD PTR [BIOSIZ],AX 682 GETDOSSIZE equ GetDosSize ; NASM port label 0 00002097 E88F01 CALL GETDOSSIZE 684 GETCMDSIZE equ GetCmdSize ; NASM port label 0 0000209A E89701 CALL GETCMDSIZE 0 0000209D 8B16[0200] MOV DX,WORD PTR [BIOSIZ+2] 0 000020A1 A1[0000] MOV AX,WORD PTR [BIOSIZ] 688 BPB_BytesPerSector equ BPB_BYTESPERSECTOR ; NASM port equate 0 000020A4 F736[2C01] DIV word [deviceParameters + DP_BPB + BPB_BytesPerSector] 0 000020A8 0306[5F04] ADD AX,[STARTSECTOR] 0 000020AC A3[2C06] MOV [SYSTRKS],AX ;Space FAT,Dir,and system files require 692 CMPTRKS: 0 000020AF 8B1E[D506] mov bx,word ptr [Relative_Sector_High] ;get the high word of the sector ;an000; dms; 0 000020B3 09DB OR BX,BX 0 000020B5 7526 JNZ BAD100 0 000020B7 8B1E[D306] mov bx,word ptr [Relative_Sector_Low] ;get the low word of the sector ;an000; dms; 0 000020BB 3B1E[2C06] CMP BX,[SYSTRKS] 0 000020BF 771C JA BAD100 ; MZ 2.26 unsigned compare 0 000020C1 C606[8304]04 mov byte [ExitStatus], ExitFatal 0 000020C6 BA[0000]E8[0000] Message msgNotSystemDisk ; ;AC000; 0 000020CC 8326[2006]FE AND word [SWITCHMAP],~ SWITCH_S ;Turn off system transfer switch 0 000020D1 C706[0200]0000 MOV WORD [SYSSIZ+2],0 ;No system to transfer 0 000020D7 C706[0000]0000 MOV WORD [SYSSIZ],0 ;No system to transfer 704 BAD100: 705 706 DP_DeviceType equ DP_DEVICETYPE ; NASM port equate 0 000020DD 803E[2601]05 CMP byte [deviceParameters + DP_DeviceType], DEV_HARDDISK ;an000; dms;hard disk? 708 ; $if e ;an000; dms; yes 0 000020E2 7505 JNE DD_IF5 0 000020E4 E8700F call Get_Bad_Sector_Hard ;an000; dms;see if a sector is bad 711 ; $else ;an000; dms;floppy disk 0 000020E7 EB03 JMP SHORT DD_EN5 713 DD_IF5: 0 000020E9 E80F10 call Get_Bad_Sector_Floppy ;an000; dms;mark entire track bad 715 ; $endif ;an000; dms; 716 DD_EN5: 717 0 000020EC E95AFF JMP GETTRK 719 720 ; Inputs: BX = Cluster number 721 ; Outputs: The given cluster is marked as invalid 722 ; Zero flag is set if the cluster was already marked bad 723 ; Registers modified: DX,SI 724 ; No other registers affected 725 726 ;========================================================================= 727 ; BADCLUS : Marks off a bad cluster in the FAT 728 ; If a cluster has already been marked bad it 729 ; will return with ZR. 730 ; 731 ; Inputs : DX:AX - Cluster Number 732 ; 733 ; Outputs : Cluster is marked invalid 734 ; ZR set if cluster already marked bad 735 ;========================================================================= 736 737 BadClus proc near ;an000; mark bad clusters 738 0 000020EF 57 push di ;an000; save affected regs 0 000020F0 50 push ax 0 000020F1 53 push bx 0 000020F2 51 push cx 0 000020F3 52 push dx 0 000020F4 06 push es 745 0 000020F5 8E06[6304] mov es, word ptr [fatSpace + 2] ;an005; obtain seg of FAT 0 000020F9 803E[6504]FF CMP byte [fBigFat],TRUE ;an005; 16 bit fat? 747 ****************** warning: byte data exceeds bounds [-w+number-overflow] 748 ; $if ne ;an005; no - 12-bit fat 0 000020FE 7438 JE DD_IF8 0 00002100 50 push ax ;an000; save ax - contains low cluster number 0 00002101 89D6 mov si,dx ;an000; pick up high word of cluster 0 00002103 89C7 mov di,ax ;an000; pick up low word of cluster 0 00002105 B90200 mov cx,2 ;an000; divide by 2 0 00002108 E8440D call Divide_32_Bits ;an000; 32 bit divide 755 0 0000210B 01F8 add ax,di ;an000; add in low word of result 0 0000210D 11F2 adc dx,si ;an000; pick up low word carry 758 ;cluster = cluster * 1.5 759 fatspace equ fatSpace ; NASM port label 0 0000210F 0306[6104] add ax,word ptr [fatspace] ;an005; add 0 0 00002113 83D200 adc dx,0 ;an000; pick up carry 762 0 00002116 89D3 mov bx,dx ;an000; get high word for adjust 0 00002118 8CC1 mov cx,es ;an005; place seg in ax 0 0000211A E87F11 call BadClus_Address_Adjust ;an000; adjust segment offset 0 0000211D 8EC1 mov es,cx ;an000; new segment 0 0000211F 89C6 mov si,ax ;an000; new offset 768 0 00002121 BAF70F MOV DX,0FF7h ;an005; bad cluster flag 0 00002124 B8FF0F MOV AX,0FFFh ;an005; mask value 771 0 00002127 59 pop cx ;an000; restore ax in cx - low cluster number 0 00002128 F7C10100 test cx,1 ;an000; is old clus num odd? 774 ; $if nz ;an005; yes 0 0000212C 7408 JZ DD_IF9 0 0000212E B104 mov cl,4 ;an005; set shift count 0 00002130 D3E0 SHL AX,cl ;an005; get only 12 bits - fff0 0 00002132 B104 mov cl,4 ;an005; set shift count 0 00002134 D3E2 SHL DX,cl ;an005; get 12 bits - ff70 780 ; $endif ;an005; 781 DD_IF9: 782 ; $else ;an005; 16-bit fats here 0 00002136 EB19 JMP SHORT DD_EN8 784 DD_IF8: 0 00002138 31F6 xor si,si ;an005; clear si 0 0000213A 89D3 mov bx,dx ;an000; get high word for multiply 0 0000213C B90200 mov cx,2 ;an000; multiply by 2 0 0000213F E8D60C call Multiply_32_Bits ;an000; 32 bit multiply 789 ; due to 2 bytes per 790 ; FAT cell. This gives 791 ; us an offset into the 792 ; FAT. 793 0 00002142 8CC1 mov cx,es ;an005; place seg in cx 0 00002144 E85511 call BadClus_Address_Adjust ;an000; adjust segment:offset 0 00002147 8EC1 mov es,cx ;an000; new segment 0 00002149 89C6 mov si,ax ;an000; new offset 798 0 0000214B BAF7FF MOV DX,0FFF7h ;an005; bad cluster value 0 0000214E B8FFFF MOV AX,0FFFFh ;an005; mask value 801 ; $endif 802 DD_EN8: 803 0 00002151 268B0C MOV CX,[es:SI] ;an005; get contents of fat cell 0 00002154 21C1 AND CX,AX ;an005; make it 12 or 16 bit 806 ; depending on value in AX 0 00002156 F7D0 NOT AX ;an005; set AX to 0 0 00002158 262104 AND [es:SI],AX ;an005; clear FAT entry 0 0000215B 260914 OR [es:SI],DX ;an005; flag it a bad cluster 0 0000215E 39CA CMP DX,CX ; return op == badval; 811 0 00002160 07 pop es 0 00002161 5A pop dx 0 00002162 59 pop cx 0 00002163 5B pop bx 0 00002164 58 pop ax 0 00002165 5F pop di 0 00002166 C3 return 819 820 badclus endp 821 822 DRTFAT: 0 00002167 F706[2006]0100 TEST word [SWITCHMAP],SWITCH_S ;If system requested, calculate size 0 0000216D 740E JZ CLEARED 0 0000216F 803E[8804]00 CMP BYTE [DBLFLG],0 ;Have we already calculated System space? 0 00002174 7507 JNZ CLEARED ;Yes 0 00002176 FE06[8804] INC BYTE [DBLFLG] ;No -- set the flag 828 GETSIZE equ GetSize ; NASM port label 0 0000217A E89700 CALL GETSIZE ;Calculate the system size 830 CLEARED: 0 0000217D E8190D call Ctrl_Break_Save ;ac010; dms;save CTRL-Break 0 00002180 E82A0D call Set_Ctrl_Break 0 00002183 E8580B CALL WriteFileSystem 834 0 00002186 730F JNC FATWRT 836 837 838 LOUSE: 839 0 00002188 E8350D call Reset_Ctrl_Break ;ac010; dms;restore CTRL-Break 0 0000218B BA[0000]E8[0000] Message msgDiskUnusable ; ;AC000; 0 00002191 E99DFE JMP FRMTPROB 843 844 LOUSEP: 0 00002194 1F POP DS 0 00002195 EBF1 JMP LOUSE 847 848 FATWRT: 849 0 00002197 1E PUSH DS 0 00002198 8A16[8206] MOV DL,[DRIVE] 0 0000219C FEC2 INC DL 853 GET_DPB equ Get_DPB ; NASM port equate 0 0000219E B432 MOV AH,GET_DPB 0 000021A0 CD21 INT 21H 0 000021A2 3CFF CMP AL,-1 0 000021A4 74EE JZ LOUSEP ;Something BAD has happened 0 000021A6 C7471D0000 MOV word [BX + dpb_next_free],0 ; Reset allocation to start of disk 0 000021AB C7471FFFFF MOV word [BX + dpb_free_cnt],-1 ; Force free space to be computed 0 000021B0 1F POP DS 0 000021B1 F706[2006]0100 TEST word [SWITCHMAP],SWITCH_S ;System desired 0 000021B7 742D JZ STATUS 0 000021B9 A0[8206] mov al, [drive] 0 000021BC E8[0000] call AccessDisk ; note what is current logical drive 0 000021BF E84F03 CALL WRITEDOS ;Write the BIOS & DOS 0 000021C2 7314 JNC SYSOK 0 000021C4 BA[0000]E8[0000] Message msgNotSystemDisk ; ;AC000; 0 000021CA C706[0200]0000 MOV WORD [SYSSIZ+2],0 ;No system transfered 0 000021D0 C706[0000]0000 MOV WORD [SYSSIZ],0 ;No system transfered 0 000021D6 EB0E JMP SHORT STATUS 871 872 SYSOK: 873 874 0 000021D8 F706[2006]000C test word [SwitchMap],(Switch_Select | SWITCH_AUTOTEST) ;Don't display if EXEC'd by ;AN000; 876 ; $IF Z ; Select ;AN000; 0 000021DE 7506 JNZ DD_IF13 0 000021E0 BA[0000]E8[0000] Message msgSystemTransfered ; ;AC000; 879 ; $ENDIF ;AN000; 880 DD_IF13: 881 STATUS: 882 0 000021E6 E8D70C call Reset_Ctrl_Break ;ac010; dms;restore CTRL-Break 884 885 CRLF equ crlf ; NASM port label 0 000021E9 E8C201 CALL CRLF 887 888 889 890 891 DISK_RESET equ Disk_Reset ; NASM port equate 0 000021EC B40D MOV AH,DISK_RESET 0 000021EE CD21 INT 21H 894 DONE equ Done ; NASM port label 0 000021F0 E8FB0B CALL DONE ;Final call to OEM module 0 000021F3 7303 JNC REPORTC 0 000021F5 E939FE JMP FRMTPROB ;Report an error 898 899 REPORTC: 900 901 ; 902 ;TEMP FIX for /AUTOTEST 903 ; 904 Switch_Autotest equ SWITCH_AUTOTEST ; NASM port equate 905 Switch_8 equ SWITCH_8 ; NASM port equate 0 000021F8 F706[2006]0009 test word [SwitchMap],(Switch_Autotest | Switch_8) ;TEMP 907 ; $IF Z 0 000021FE 7503 JNZ DD_IF15 909 VOLID equ Volid ; NASM port label 0 00002200 E8[0000] CALL VOLID 911 ; $ENDIF 912 DD_IF15: 0 00002203 F706[2006]000C test word [SwitchMap],(Switch_Select | SWITCH_AUTOTEST) ;Need to shut down the report? ;AN000; 914 ; $IF Z ;If exec'd by Select, we do ;AN000; 0 00002209 7503 JNZ DD_IF17 0 0000220B E8[0000] CALL REPORT ;Print report 917 ; $ENDIF ; ;AN000; 918 DD_IF17: 0 0000220E E85C00 CALL MORE ;See if more disks to format 0 00002211 E9FAFD JMP SYSLOOP ;If we returned from MORE then continue 921 922 ;****************************************** 923 ; Calculate the size in bytes of the system rounded up to sector and 924 ; cluster boundries, Answer in SYSSIZ 925 926 GetSize proc near 0 00002214 E80700 call GetBioSize 0 00002217 E80F00 call GetDosSize 0 0000221A E81700 call GetCmdSize 0 0000221D C3 return 931 GetSize endp 932 933 GetBioSize proc near 0 0000221E A1[E204] MOV AX,WORD PTR [bios + fileSizeInBytes] 0 00002221 8B16[E404] MOV DX,WORD PTR [bios + fileSizeInBytes+2] 0 00002225 E81700 CALL AddToSystemSize 0 00002228 C3 return 938 GetBioSize endp 939 940 GetDosSize proc near 0 00002229 A1[F404] MOV AX,WORD PTR [dos + fileSizeInBytes] 0 0000222C 8B16[F604] MOV DX,WORD PTR [dos + fileSizeInBytes+2] 0 00002230 E80C00 CALL AddToSystemSize 0 00002233 C3 return 945 GetDosSize endp 946 947 GetCmdSize proc near 0 00002234 A1[0605] MOV AX,WORD PTR [command + fileSizeInBytes] 0 00002237 8B16[0805] MOV DX,WORD PTR [command + fileSizeInBytes+2] 0 0000223B E80100 call AddToSystemSize 0 0000223E C3 return 952 GetCmdSize endp 953 954 ;Calculate the number of sectors used for the system 955 PUBLIC AddToSystemSize 956 AddToSystemSize proc near 0 0000223F 53 push bx 0 00002240 F736[2C01] DIV word [deviceParameters + DP_BPB + BPB_BytesPerSector] 0 00002244 09D2 OR DX,DX 0 00002246 7401 JZ FNDSIZ0 0 00002248 40 INC AX ; Round up to next sector 962 FNDSIZ0: 0 00002249 50 PUSH AX 0 0000224A 31D2 XOR DX,DX 0 0000224C 31DB xor bx,bx 966 BPB_SectorsPerCluster equ BPB_SECTORSPERCLUSTER ; NASM port equate 0 0000224E 8A1E[2E01] mov bl, [deviceParameters + DP_BPB + BPB_SectorsPerCluster] 0 00002252 F7F3 div bx 0 00002254 58 POP AX 0 00002255 09D2 OR DX,DX 0 00002257 7406 JZ ONCLUS 0 00002259 29DA SUB DX, bx 0 0000225B F7DA NEG DX 0 0000225D 01D0 ADD AX,DX ; Round up sector count to cluster 975 ; boundry 976 ONCLUS: 0 0000225F F726[2C01] MUL word [deviceParameters + DP_BPB + BPB_BytesPerSector] 0 00002263 0106[0000] ADD WORD PTR [SYSSIZ],AX 0 00002267 1116[0200] ADC WORD PTR [SYSSIZ+2],DX 0 0000226B 5B pop bx 0 0000226C C3 return 982 AddToSystemSize endp 983 984 MORE: 985 0 0000226D C706[6E04]0000 mov word [Formatted_Tracks_Low],0 ;Reinit the track counter ;AN000; 0 00002273 C706[7004]0000 mov word [Formatted_Tracks_High],0 ; in case of another format ;AN000; 0 00002279 F706[2006]000C test word [SwitchMap],(Switch_Select | SWITCH_AUTOTEST) ;Don't display if EXEC'd by ;AN000; 0 0000227F 7528 jnz ExitProgram ; Select ;AN000; 990 0 00002281 803E[2601]05 CMP byte [deviceParameters + DP_DeviceType], DEV_HARDDISK 0 00002286 7421 je ExitProgram 993 SWITCH_Select equ SWITCH_SELECT ; NASM port equate 0 00002288 F706[2006]000C test word [SwitchMap],(SWITCH_Select | SWITCH_AUTOTEST) ;If exec'd from select, then;AN000; 0 0000228E 7519 jnz ExitProgram ; don't give user choice ;AN000; 0 00002290 E8[0000] CALL FormatAnother? ;Get yes or no response 0 00002293 7214 JC ExitProgram 0 00002295 E81601 CALL CRLF 0 00002298 E91301 JMP CRLF 1000 1001 1002 FEXIT: 0 0000229B 50B8[0000]8ED81E07 Set_Data_Segment ;Make sure have addressability ;AN000; 0 000022A3 58 0 000022A4 C606[8304]04 mov byte [ExitStatus],ExitFatal 1005 1006 ExitProgram: 0 000022A9 F606[0000]FF test byte [validSavedDeviceParameters], 0ffH 0 000022AE 740C jz DoNotRestoreDeviceParameters 1009 DP_SpecialFunctions equ DP_SPECIALFUNCTIONS ; NASM port equate 0 000022B0 C606[0100]04 mov byte [savedDeviceParameters + DP_SpecialFunctions], TRACKLAYOUT_IS_GOOD 0 000022B5 8D16[0100] lea dx, [savedDeviceParameters] 0 000022B9 E8C007 call SetDeviceParameters 1013 DoNotRestoreDeviceParameters: 1014 0 000022BC E8A30F call Format_Access_Wrap_Up ;determine access status ;an000; dms;determine access status 0 000022BF A0[8304] mov al,[ExitStatus] ;Get Errorlevel ;AN000; 0 000022C2 B44CCD21 DOS_Call Exit ;Exit program ;AN000; 0 000022C6 CD20 int 20h ;If other exit fails ;AN000; 1019 1020 ; Prompt the user for a system diskette in the default drive 1021 SYSPRM: 1022 GET_DEFAULT_DRIVE equ Get_Default_Drive ; NASM port equate 0 000022C8 B419 MOV AH,GET_DEFAULT_DRIVE ;Will find out the default drive 0 000022CA CD21 INT 21H ;Default now in AL 0 000022CC 88C3 MOV BL,AL 0 000022CE FEC3 INC BL ; A = 1 0 000022D0 0441 ADD AL,41H ;Now in Ascii 0 000022D2 A2[8406] MOV [systemDriveLetter],AL ;Text now ok 0 000022D5 E85700 CALL IsRemovable 0 000022D8 731E JNC DoPrompt 1031 ; 1032 ; Media is non-removable. Switch sys disk to drive A. Check, though, to see 1033 ; if drive A is removable too. 1034 ; 0 000022DA B041 MOV AL,"A" 0 000022DC A2[8406] MOV BYTE PTR [systemDriveLetter],AL 0 000022DF A2[0000] MOV [BiosFile],AL 0 000022E2 A2[0000] MOV [DosFile],AL 0 000022E5 A2[1405] MOV [CommandFile],AL 0 000022E8 BB0100 MOV BX,1 0 000022EB E84100 CALL IsRemovable 0 000022EE 7308 JNC DoPrompt 0 000022F0 BA[0000]E8[0000] Message msgNoSystemFiles ; ;AC000; 1044 fexitJ: 0 000022F6 EBA3 JMP FEXIT 1046 1047 DoPrompt: 0 000022F8 A0[8406] mov al, [systemDriveLetter] 0 000022FB 2C41 sub al, 'A' 0 000022FD E8[0000] call AccessDisk 1051 msgInsertDOSDisk equ msgInsertDosDisk ; NASM port label 0 00002300 BA[0000]E8[0000] Message msgInsertDOSDisk ; ;AC000; 0 00002306 BA[0000]E8[0000] Message ContinueMsg 1054 ;lea dx, ptr_msgInsertDosDisk 1055 ;CALL std_printf ;Print first line 0 0000230C E8[0000] CALL USER_STRING ;Wait for a key 0 0000230F E89C00 CALL CRLF 0 00002312 E89900 call crlf 0 00002315 C3 return 1060 1061 TARGPRM: 0 00002316 A0[8206] mov al, [drive] 0 00002319 E8[0000] call AccessDisk 1064 MsgInsertDisk equ msgInsertDisk ; NASM port label 0 0000231C BA[0000]E8[0000] Message MsgInsertDisk ; ;AC000; 0 00002322 BA[0000]E8[0000] Message ContinueMsg ; 1067 ;lea DX, ptr_msgInsertDisk 1068 ;CALL std_printf ;Print first line 0 00002328 E8[0000] CALL USER_STRING ;Wait for a key 0 0000232B E88000 CALL CRLF 0 0000232E C3 return 1072 1073 ; 1074 ; Determine if the drive indicated in BX is removable or not. 1075 ; 1076 ; Inputs: BX has drive (0=def, 1=A) 1077 ; Outputs: Carry clear 1078 ; Removable 1079 ; Carry set 1080 ; not removable 1081 ; Registers modified: none 1082 1083 IsRemovable: 0 0000232F 50 SaveReg 1085 IOCTL equ IOCtl ; NASM port equate 0 00002330 B80844 MOV AX,(IOCTL << 8) | 8 ; Rem media check 0 00002333 CD21 INT 21H 0 00002335 7310 JNC CheckRemove 0 00002337 B80944 MOV AX,(IOCTL << 8) + 9 ; Is it a NET drive? 0 0000233A CD21 INT 21h 0 0000233C 7211 JC NotRemove ; Yipe, say non-removable 0 0000233E F7C20010 TEST DX,1000h 0 00002342 750B JNZ NotRemove ; Is NET drive, say non-removeable 0 00002344 EB06 JMP IsRemove ; Is local, say removable 0 00002346 90 nop ; identicalise 1096 CheckRemove: 0 00002347 A90100 TEST AX,1 0 0000234A 7503 JNZ NotRemove 1099 IsRemove: 0 0000234C F8 CLC 0 0000234D 58 RestoreReg 0 0000234E C3 return 1103 NotRemove: 0 0000234F F9 STC 0 00002350 58 RestoreReg 0 00002351 C3 return 1107 1108 1109 ; DiSKPRoMpt: 1110 ; 1111 ; This routine prompts for the insertion of the correct diskette 1112 ; into the Target drive, UNLESS we are being re-entrantly invoked 1113 ; from LastChanceToSaveIt. If the target is a Hardisk we issue a 1114 ; warning message. 1115 ; 1116 ; INPUTS: 1117 ; deviceParameters.DP_DeviceType 1118 ; fLastChance 1119 ; 1120 ; OUTPUTS: 1121 ; Prompt string 1122 ; fLastChance := FALSE 1123 ; 1124 ; Registers affected: 1125 ; Flags 1126 ; 1127 DSKPRM: 0 00002352 803E[7904]FF CMP byte [fLastChance],TRUE 1128 ****************** warning: byte data exceeds bounds [-w+number-overflow] 0 00002357 743C JE PrmptRet 1130 0 00002359 803E[2601]05 CMP byte [deviceParameters + DP_DeviceType], DEV_HARDDISK 1132 goprnit equ GOPRNIT ; NASM port label 0 0000235E 751A jne goprnit 0 00002360 BA[0000]E8[0000] Message msgHardDiskWarning ; ;AC000; 1135 ;lea dx, ptr_msgHardDiskWarning 1136 ;call std_printf 0 00002366 E8[0000] CALL Yes? 0 00002369 7308 jnc OkToFormatHardDisk 0 0000236B C606[8304]05 mov byte [ExitStatus], ExitNo 0 00002370 E936FF jmp ExitProgram 1141 1142 OkToFormatHardDisk: 0 00002373 E83800 CALL CRLF 0 00002376 E83500 CALL CRLF 0 00002379 C3 return 1146 1147 GOPRNIT: 0 0000237A A0[8206] mov al, [drive] 0 0000237D E8[0000] call AccessDisk 0 00002380 BA[0000]E8[0000] Message msgInsertDisk ; ;AC000; 0 00002386 BA[0000]E8[0000] Message ContinueMsg ; 1152 ;lea dx,ptr_msgInsertDisk 1153 ;CALL std_printf 0 0000238C E8[0000] CALL USER_STRING ;Wait for any key 0 0000238F E81C00 CALL CRLF 0 00002392 E81900 CALL CRLF 1157 1158 PrmptRet: 0 00002395 C606[7904]00 mov byte [fLastChance], FALSE 0 0000239A C3 return 1161 1162 1163 ;------------------------------------------------------------------------------- 1164 1165 ControlC_Handler: 0 0000239B B8[0000] mov ax, data 0 0000239E 8ED8 mov ds, ax 0 000023A0 BA[0000]E8[0000] Message msgInterrupt ; ;AC000; 0 000023A6 C606[8304]03 mov byte [ExitStatus], ExitCtrlC 0 000023AB E9FBFE jmp ExitProgram 1171 1172 1173 crlf: 1174 ;lea dx, msgCRLF 0 000023AE BA[0000] mov dx,offset msgCRLF ;CR,LF added to message ;AC000; 1176 PrintString: 1177 ;mov printStringPointer, dx 1178 ;lea dx, PrintStringPointer 1179 1180 std_printf: 1181 ;push dx 1182 ;call printf 0 000023B1 E8[0000] call Display_Interface ; ;AC000; 0 000023B4 C3 return 1185 1186 ;------------------------------------------------------------------------------- 1187 1188 1189 ;**************************************** 1190 ;Copy IO.SYS, MSDOS.SYS and COMMAND.COM into data area. 1191 ; Carry set if problems 1192 1193 READDOS: 0 000023B5 50 push ax ;save regs ;an025; dms; 0 000023B6 53 push bx ; ;an025; dms; 0 000023B7 06 push es ; ;an025; dms; 1197 0 000023B8 B452 mov ah,Get_In_Vars ;Find out boot drive ;an025; dms; 0 000023BA CD21 int 21h ; ;an025; dms; 1200 SysI_Boot_Drive equ SYSI_BOOT_DRIVE ; NASM port equate 0 000023BC 268A4743 mov al,byte ptr [es:bx + SysI_Boot_Drive] ;get 1 based drive ID ;an025; dms; 0 000023C0 0440 add al,40h ;Make it ASCII ;an025; dms; 0 000023C2 A2[0000] mov [BiosFile],al ;Stuff it in file specs. ;an025; dms; 0 000023C5 A2[0000] mov [DosFile],al ; ;an025; dms; 0 000023C8 A2[1405] mov [CommandFile],al ; ;an025; dms; 1206 0 000023CB 07 pop es ;restore regs ;an025; dms; 0 000023CC 5B pop bx ; ;an025; dms; 0 000023CD 58 pop ax ; ;an025; dms; 1210 0 000023CE E8A603 call Get_BIOS ; dcl 8/23/86 0 000023D1 7301 JNC RDFILS 0 000023D3 C3 return 1214 1215 RDFILS: 0 000023D4 C606[9304]00 MOV BYTE PTR [FILSTAT],0 0 000023D9 8B1E[DE04] MOV BX,[bios + fileHandle] 0 000023DD A1[8D04] MOV AX,[MSTART] 0 000023E0 89C2 MOV DX,AX 0 000023E2 0316[8F04] ADD DX,[MSIZE] ; CX first bad para 0 000023E6 A3[EA04] MOV [bios + fileStartSegment],AX 0 000023E9 8B0E[E004] MOV CX,[bios + fileSizeInParagraphs] 0 000023ED 01C8 ADD AX,CX 0 000023EF 39D0 CMP AX,DX 0 000023F1 7630 JBE GOTBIOS 0 000023F3 C606[9304]01 MOV BYTE PTR [FILSTAT],00000001B ; Got part of BIOS 0 000023F8 8B36[8F04] MOV SI,[MSIZE] 0 000023FC 31FF XOR DI,DI 0 000023FE E8E204 CALL DISIX4 0 00002401 1E push ds 0 00002402 8E1E[EA04] MOV DS,[bios + fileStartSegment] 1232 assume ds:nothing 0 00002406 E86404 CALL READFILE 0 00002409 1F pop ds 1235 assume ds:data 0 0000240A 7211 JC CLSALL 0 0000240C 31D2 XOR DX,DX 0 0000240E 89D1 MOV CX,DX 1239 LSEEK equ LSeek ; NASM port equate 0 00002410 B80142 MOV AX,(LSEEK << 8) | 1 0 00002413 CD21 INT 21H 0 00002415 A3[E604] MOV WORD PTR [bios + fileOffset],AX 0 00002418 8916[E804] MOV WORD PTR [bios + fileOffset+2],DX 1244 FILESDONE: 0 0000241C F8 CLC 1246 CLSALL: 0 0000241D 9C PUSHF 1248 ; CALL COMCLS ; dcl 8/23/86 0 0000241E E81604 call FILE_CLS ; dcl 8/23/86 0 00002421 9D POPF 0 00002422 C3 return 1252 1253 GOTBIOS: 0 00002423 C606[9304]02 MOV BYTE PTR [FILSTAT],00000010B ; Got all of BIOS 0 00002428 06 push es 0 00002429 C436[E204] LES SI,[bios + fileSizeInBytes] 0 0000242D 8CC7 MOV DI,ES 0 0000242F 07 pop es 0 00002430 1E push ds 0 00002431 8E1E[EA04] MOV DS,[bios + fileStartSegment] 1261 assume ds:nothing 0 00002435 E83504 CALL READFILE 0 00002438 1F pop ds 1264 assume ds:data 0 00002439 72E2 JC CLSALL 1266 0 0000243B 50 push ax ; dcl 8/23/86 0 0000243C 52 push dx ; dcl 8/23/86 1269 File_Cls equ FILE_CLS ; NASM port label 0 0000243D E8F703 call File_Cls ; dcl 8/23/86 0 00002440 E87403 call Get_DOS ; dcl 8/23/86 0 00002443 5A pop dx ; dcl 8/23/86 0 00002444 58 pop ax ; dcl 8/23/86 1274 0 00002445 7301 JNC Found_IBMDOS ;mt 12/8/86 P894 0 00002447 C3 return ;mt 12/8/86 1277 1278 Found_IBMDOS: ;mt 12/8/86 1279 0 00002448 8B1E[F004] MOV BX,[dos + fileHandle] 0 0000244C A3[FC04] MOV [dos + fileStartSegment],AX 0 0000244F 39D0 CMP AX,DX ; No room left? 0 00002451 74CA JZ CLSALL ; Yes 0 00002453 8B0E[F204] MOV CX,[dos + fileSizeInParagraphs] 0 00002457 01C8 ADD AX,CX 0 00002459 39D0 CMP AX,DX 0 0000245B 762D JBE GOTDOS 0 0000245D 800E[9304]04 OR BYTE PTR [FILSTAT],00000100B ; Got part of DOS 0 00002462 2B16[FC04] SUB DX,[dos + fileStartSegment] 0 00002466 89D6 MOV SI,DX 0 00002468 31FF XOR DI,DI 0 0000246A E87604 CALL DISIX4 0 0000246D 1E push ds 0 0000246E 8E1E[FC04] MOV DS,[dos + fileStartSegment] 1295 assume ds:nothing 0 00002472 E8F803 CALL READFILE 0 00002475 1F pop ds 1298 assume ds:data 0 00002476 72A5 JC CLSALL 0 00002478 31D2 XOR DX,DX 0 0000247A 89D1 MOV CX,DX 0 0000247C B80142 MOV AX,(LSEEK << 8) | 1 0 0000247F CD21 INT 21H 0 00002481 A3[F804] MOV WORD PTR [dos + fileOffset],AX 0 00002484 8916[FA04] MOV WORD PTR [dos + fileOffset+2],DX 0 00002488 EB92 JMP FILESDONE 1307 1308 GOTDOS: 0 0000248A 800E[9304]08 OR BYTE PTR [FILSTAT],00001000B ; Got all of DOS 0 0000248F 06 push es 0 00002490 C436[F404] LES SI,[dos + fileSizeInBytes] 0 00002494 8CC7 MOV DI,ES 0 00002496 07 pop es 0 00002497 1E push ds 0 00002498 8E1E[FC04] MOV DS,[dos + fileStartSegment] 1316 assume ds:nothing 0 0000249C E8CE03 CALL READFILE 0 0000249F 1F pop ds 1319 assume ds:data 1320 1321 NOTCLSALL equ NotCLSALL ; NASM port label 0 000024A0 7303 CLSALLJ: JNC NOTCLSALL ;PTM P894 mt 12/8/86 1323 clsall equ CLSALL ; NASM port label 0 000024A2 E978FF jmp clsall ; 1325 1326 NotCLSALL: 0 000024A5 50 push ax ; dcl 8/23/86 1328 0 000024A6 52 push dx ; dcl 8/23/86 1330 File_cls equ FILE_CLS ; NASM port label 0 000024A7 E88D03 call File_cls ; dcl 8/23/86 0 000024AA E82C0A call Get_Command_Path ;ac011; dms; get path of 1333 ; COMMAND.COM 0 000024AD E84703 call Get_COMMAND ;ac011; dms; Point to COMMAND 1335 ; and read it 0 000024B0 5A pop dx ; dcl 8/23/86 0 000024B1 58 pop ax ; dcl 8/23/86 1338 0 000024B2 7301 JNC Found_COMMAND ;mt 12/8/86 P894 0 000024B4 C3 return ;mt 12/8/86 1341 1342 Found_COMMAND: ;mt 12/8/86 0 000024B5 8B1E[0205] MOV BX,[command + fileHandle] 0 000024B9 A3[0E05] MOV [command + fileStartSegment],AX 0 000024BC 39D0 CMP AX,DX ; No room left? 0 000024BE 74E0 JZ CLSALLJ ; Yes 0 000024C0 8B0E[0405] MOV CX,[command + fileSizeInParagraphs] 0 000024C4 01C8 ADD AX,CX 0 000024C6 39D0 CMP AX,DX 0 000024C8 762E JBE GOTCOM 0 000024CA 800E[9304]10 OR BYTE PTR [FILSTAT],00010000B ; Got part of COMMAND 0 000024CF 2B16[0E05] SUB DX,[command + fileStartSegment] 0 000024D3 89D6 MOV SI,DX 0 000024D5 31FF XOR DI,DI 0 000024D7 E80904 CALL DISIX4 0 000024DA 1E push ds 0 000024DB 8E1E[0E05] MOV DS,[command + fileStartSegment] 1358 assume ds:nothing 0 000024DF E88B03 CALL READFILE 0 000024E2 1F pop ds 1361 assume ds:data 0 000024E3 72BB JC CLSALLJ 0 000024E5 31D2 XOR DX,DX 0 000024E7 89D1 MOV CX,DX 0 000024E9 B80142 MOV AX,(LSEEK << 8) | 1 0 000024EC CD21 INT 21H 0 000024EE A3[0A05] MOV WORD PTR [command + fileOffset],AX 0 000024F1 8916[0C05] MOV WORD PTR [command + fileOffset+2],DX 0 000024F5 E924FF JMP FILESDONE 1370 1371 GOTCOM: 0 000024F8 800E[9304]20 OR BYTE PTR [FILSTAT],00100000B ; Got all of COMMAND 0 000024FD 06 push es 0 000024FE C436[0605] LES SI,[command + fileSizeInBytes] 0 00002502 8CC7 MOV DI,ES 0 00002504 07 pop es 0 00002505 1E push ds 0 00002506 8E1E[0E05] MOV DS,[command + fileStartSegment] 1379 assume ds:nothing 0 0000250A E86003 CALL READFILE 0 0000250D 1F pop ds 1382 assume ds:data 0 0000250E E90CFF JMP CLSALL 1384 1385 ;************************************************** 1386 ;Write BIOS DOS COMMAND to the newly formatted disk. 1387 1388 ASSUME DS:DATA 1389 WRITEDOS: 0 00002511 B90700 MOV CX,BiosAttributes 0 00002514 BA[0000] MOV DX,OFFSET BiosFile 0 00002517 06 push es 0 00002518 C436[E204] LES SI,[bios + fileSizeInBytes] 0 0000251C 8CC7 MOV DI,ES 0 0000251E 07 pop es 0 0000251F E84201 CALL MAKEFIL 0 00002522 7290 retc 1398 0 00002524 891E[9104] MOV [TempHandle],BX 0 00002528 F606[9304]02 TEST BYTE [FILSTAT],00000010B 0 0000252D 7520 JNZ GOTALLBIO 0 0000252F E84502 call Get_BIOS ; dcl 8/23/86 0 00002532 7301 jnc Got_WBIOS ;mt 12/8/86 P894 0 00002534 C3 ret 1405 1406 Got_WBIOS: 1407 0 00002535 06 push es 0 00002536 C436[E604] LES SI,[bios + fileOffset] 0 0000253A 8CC7 MOV DI,ES 0 0000253C 07 pop es 0 0000253D 8936[8904] MOV WORD PTR [IOCNT],SI 0 00002541 893E[8B04] MOV WORD PTR [IOCNT+2],DI 0 00002545 BD[DE04] MOV BP,OFFSET bios 0 00002548 E87701 CALL GOTTARG 0 0000254B 72D5 retc 0 0000254D EB11 JMP SHORT BIOSDONE 1418 1419 GOTALLBIO: 0 0000254F 06 push es 0 00002550 C436[E204] LES SI,[bios + fileSizeInBytes] 0 00002554 8CC7 MOV DI,ES 0 00002556 07 pop es 0 00002557 1E push ds 0 00002558 8E1E[EA04] MOV DS,[bios + fileStartSegment] 1426 assume ds:nothing 0 0000255C E81B03 CALL WRITEFILE 0 0000255F 1F pop ds 1429 assume ds:data 1430 BIOSDONE: 0 00002560 8B1E[9104] MOV BX,[TempHandle] 0 00002564 8B0E[EE04] MOV CX,[bios + fileTime] 0 00002568 8B16[EC04] MOV DX,[bios + fileDate] 0 0000256C E83901 CALL CLOSETARG 0 0000256F B90700 MOV CX,DosAttributes 0 00002572 BA[0000] MOV DX,OFFSET DosFile 0 00002575 06 push es 0 00002576 C436[F404] LES SI,[dos + fileSizeInBytes] 0 0000257A 8CC7 MOV DI,ES 0 0000257C 07 pop es 0 0000257D E8E400 CALL MAKEFIL 0 00002580 72C9 retc 1443 1444 GOTNDOS: 0 00002582 891E[9104] MOV [TempHandle],BX 0 00002586 F606[9304]08 TEST BYTE [FILSTAT],00001000B 0 0000258B 753A JNZ GOTALLDOS 0 0000258D E82702 call Get_DOS ; dcl 8/23/86 0 00002590 7301 jnc Got_WDOS ;mt 12/8/86 P894 0 00002592 C3 ret 1451 1452 Got_WDOS: 0 00002593 BD[F004] MOV BP,OFFSET dos 0 00002596 F606[9304]04 TEST BYTE [FILSTAT],00000100B 0 0000259B 7513 JNZ PARTDOS 0 0000259D C706[F804]0000 MOV WORD PTR [dos + fileOffset],0 0 000025A3 C706[FA04]0000 MOV WORD PTR [dos + fileOffset+2],0 0 000025A9 E84201 CALL GETSYS3 0 000025AC 72D2 retc 0 000025AE EB28 JMP SHORT DOSDONE 1461 1462 PARTDOS: 0 000025B0 06 push es 0 000025B1 C436[F804] LES SI,[dos + fileOffset] 0 000025B5 8CC7 MOV DI,ES 0 000025B7 07 pop es 0 000025B8 8936[8904] MOV WORD PTR [IOCNT],SI 0 000025BC 893E[8B04] MOV WORD PTR [IOCNT+2],DI 0 000025C0 E8FF00 CALL GOTTARG 0 000025C3 72E7 retc 0 000025C5 EB11 JMP SHORT DOSDONE 1472 1473 GOTALLDOS: 0 000025C7 06 push es 0 000025C8 C436[F404] LES SI,[dos + fileSizeInBytes] 0 000025CC 8CC7 MOV DI,ES 0 000025CE 07 pop es 0 000025CF 1E push ds 0 000025D0 8E1E[FC04] MOV DS,[dos + fileStartSegment] 1480 assume ds:nothing 0 000025D4 E8A302 CALL WRITEFILE 0 000025D7 1F pop ds 1483 assume ds:data 1484 DOSDONE: 0 000025D8 8B1E[9104] MOV BX,[TempHandle] 0 000025DC 8B0E[0005] MOV CX,[dos + fileTime] 0 000025E0 8B16[FE04] MOV DX,[dos + fileDate] 0 000025E4 E8C100 CALL CLOSETARG 0 000025E7 B90000 MOV CX,CommandAttributes 0 000025EA E86809 call Command_Root ;an011; dms;adjust path for 1491 ;COMMAND.COM creation 0 000025ED BA[1405] MOV DX,OFFSET CommandFile 0 000025F0 06 push es 0 000025F1 C436[0605] LES SI,[command + fileSizeInBytes] 0 000025F5 8CC7 MOV DI,ES 0 000025F7 07 pop es 0 000025F8 E86900 CALL MAKEFIL 0 000025FB 72C6 retc 1499 0 000025FD 891E[9104] MOV [TempHandle],BX 0 00002601 F606[9304]20 TEST BYTE [FILSTAT],00100000B 0 00002606 753A JNZ GOTALLCOM 0 00002608 E8EC01 call Get_COMMAND ; dcl 8/23/86 0 0000260B 7301 jnc Got_WCOM ;mt 12/8/86 P894 0 0000260D C3 ret 1506 1507 Got_WCOM: 0 0000260E BD[0205] MOV BP,OFFSET command 0 00002611 F606[9304]10 TEST BYTE [FILSTAT],00010000B 0 00002616 7513 JNZ PARTCOM 0 00002618 C706[0A05]0000 MOV WORD PTR [command + fileOffset],0 0 0000261E C706[0C05]0000 MOV WORD PTR [command + fileOffset+2],0 0 00002624 E8C700 CALL GETSYS3 0 00002627 72D2 retc 0 00002629 EB28 JMP SHORT COMDONE 1516 1517 PARTCOM: 0 0000262B 06 push es 0 0000262C C436[0A05] LES SI,[command + fileOffset] 0 00002630 8CC7 MOV DI,ES 0 00002632 07 pop es 0 00002633 8936[8904] MOV WORD PTR [IOCNT],SI 0 00002637 893E[8B04] MOV WORD PTR [IOCNT+2],DI 0 0000263B E88400 CALL GOTTARG 0 0000263E 72E7 retc 0 00002640 EB11 JMP SHORT COMDONE 1527 1528 GOTALLCOM: 0 00002642 06 push es 0 00002643 C436[0605] LES SI,[command + fileSizeInBytes] 0 00002647 8CC7 MOV DI,ES 0 00002649 07 pop es 0 0000264A 1E push ds 0 0000264B 8E1E[0E05] MOV DS,[command + fileStartSegment] 1535 assume ds:nothing 0 0000264F E82802 CALL WRITEFILE 0 00002652 1F pop ds 1538 assume ds:data 1539 COMDONE: 0 00002653 8B1E[9104] MOV BX,[TempHandle] 0 00002657 8B0E[1205] MOV CX,[command + fileTime] 0 0000265B 8B16[1005] MOV DX,[command + fileDate] 0 0000265F E84600 CALL CLOSETARG 1544 ;**************************************************************** 1545 ; I don't see the need for the following code!! - RS 3.20 1546 ; CMP BYTE PTR [FILSTAT],00101010B 1547 ; JZ NOREDOS 1548 ;RDFRST2: 1549 ; CALL READDOS ; Start back with BIOS 1550 ; JNC NOREDOS 1551 ; CALL SYSPRM ;Prompt for system disk 1552 ; JMP RDFRST2 ;Try again 1553 ;NOREDOS: 1554 ;**************************************************************** 0 00002662 F8 CLC 0 00002663 C3 return 1557 1558 ;********************************************* 1559 ; Create a file on target disk 1560 ; CX = attributes, DX points to name 1561 ; DI:SI is size file is to have 1562 ; 1563 ; There is a bug in DOS 2.00 and 2.01 having to do with writes 1564 ; from the end of memory. In order to circumvent it this routine 1565 ; must create files with the length in DI:SI 1566 ; 1567 ; On return BX is handle, carry set if problem 1568 1569 MAKEFIL: 0 00002664 89D3 MOV BX,DX 0 00002666 FF37 PUSH WORD PTR [BX] 1572 DriveLetter equ driveLetter ; NASM port label 0 00002668 A0[8306] MOV AL,[DriveLetter] 0 0000266B 8807 MOV [BX],AL 1575 CREAT equ Creat ; NASM port equate 0 0000266D B43C MOV AH,CREAT 0 0000266F CD21 INT 21H 0 00002671 8F07 POP WORD PTR [BX] 0 00002673 89C3 MOV BX,AX 0 00002675 7219 JC CheckMany 0 00002677 89F9 MOV CX,DI 0 00002679 89F2 MOV DX,SI 0 0000267B B80042 MOV AX,LSEEK << 8 0 0000267E CD21 INT 21H ; Seek to eventual EOF 0 00002680 31C9 XOR CX,CX 1586 WRITE equ Write ; NASM port equate 0 00002682 B440 MOV AH,WRITE 0 00002684 CD21 INT 21H ; Set size of file to position 0 00002686 31C9 XOR CX,CX 0 00002688 89CA MOV DX,CX 0 0000268A B80042 MOV AX,LSEEK << 8 0 0000268D CD21 INT 21H ; Seek back to start 0 0000268F C3 return 1594 1595 ; 1596 ; Examine error code in AX to see if it is too-many-open-files. 1597 ; If it is, we abort right here. Otherwise we return. 1598 ; 1599 CheckMany: 0 00002690 83F804 CMP AX,error_too_many_open_files 0 00002693 75FA retnz 0 00002695 1EBA[0000]8EDAA3 Extended_Message ; ;AC006; 0 0000269C [0000]BA[0000]E8 0 000026A2 [0000]1F 0 000026A5 E9F3FB JMP FEXIT 1604 1605 ;********************************************* 1606 ; Close a file on the target disk 1607 ; CX/DX is time/date, BX is handle 1608 1609 CLOSETARG: 1610 FILE_TIMES equ File_Times ; NASM port equate 0 000026A8 B80157 MOV AX,(FILE_TIMES << 8) | 1 0 000026AB CD21 INT 21H 1613 CLOSE equ Close ; NASM port equate 0 000026AD B43E MOV AH,CLOSE 0 000026AF CD21 INT 21H 0 000026B1 C3 return 1617 1618 ;**************************************** 1619 ; Transfer system files 1620 ; BP points to data structure for file involved 1621 ; offset is set to current amount read in 1622 ; Start set to start of file in buffer 1623 ; TempHandle is handle to write to on target 1624 1625 IOLOOP: 0 000026B2 A0[8406] MOV AL,[systemDriveLetter] 0 000026B5 3A06[8306] CMP AL,[DriveLetter] 0 000026B9 7507 JNZ GOTTARG 0 000026BB B40D MOV AH,DISK_RESET 0 000026BD CD21 INT 21H 0 000026BF E854FC CALL TARGPRM ;Get target disk 1632 1633 GOTTARG: 1634 ASSUME DS:DATA 1635 ;Enter here if some of file is already in buffer, IOCNT must be set 1636 ; to size already in buffer. 0 000026C2 8B1E[9104] MOV BX,[TempHandle] 0 000026C6 8B36[8904] MOV SI,WORD PTR [IOCNT] 0 000026CA 8B3E[8B04] MOV DI,WORD PTR [IOCNT+2] 0 000026CE 1E push ds 0 000026CF 3E8E5E0C MOV DS,[ds:BP + fileStartSegment] 1642 assume ds:nothing 0 000026D3 E8A401 CALL WRITEFILE ; Write next part 0 000026D6 1F pop ds 1645 assume ds:data 0 000026D7 72D8 retc 1647 0 000026D9 06 push es 0 000026DA 3EC44608 LES AX,[ds:BP + fileOffset] 0 000026DE 3E3B4604 CMP AX,WORD PTR [ds:BP + fileSizeInBytes] 0 000026E2 750A JNZ GETSYS3 0 000026E4 8CC0 MOV AX,ES 0 000026E6 3E3B4606 CMP AX,WORD PTR [ds:BP + fileSizeInBytes+2] 0 000026EA 7502 JNZ GETSYS3 0 000026EC 07 pop es 0 000026ED C3 return ; Carry clear from CMP 1657 1658 GETSYS3: 1659 ;Enter here if none of file is in buffer 0 000026EE 07 pop es 0 000026EF B40D MOV AH,DISK_RESET 0 000026F1 CD21 INT 21H 0 000026F3 A1[8D04] MOV AX,[MSTART] ;Furthur IO done starting here 0 000026F6 3E89460C MOV [ds:BP + fileStartSegment],AX ;point to start of buffer 0 000026FA A0[8406] MOV AL,[systemDriveLetter] ;see if we have system disk 0 000026FD 3A06[8306] CMP AL,[DriveLetter] 0 00002701 7507 JNZ TESTSYS 1668 GSYS: 0 00002703 B40D MOV AH,DISK_RESET 0 00002705 CD21 INT 21H 0 00002707 E8BEFB CALL SYSPRM ;Prompt for system disk 1672 TESTSYS: 1673 ; CALL TESTSYSDISK ; dcl 8/23/86 0 0000270A 72F7 JC GSYS 0 0000270C 3E8B5E00 MOV BX,word ptr [DS:BP + fileHandle] ; CS over ARR 2.30 0 00002710 06 push es 0 00002711 3EC45608 LES DX,[DS:BP + fileOffset] ; CS over ARR 2.30 0 00002715 8CC1 MOV CX,ES 0 00002717 07 pop es 0 00002718 52 PUSH DX 0 00002719 B80042 MOV AX,LSEEK << 8 0 0000271C CD21 INT 21H 0 0000271E 5A POP DX 0 0000271F 06 push es 0 00002720 3EC47604 LES SI,[DS:BP + fileSizeInBytes] ; CS over ARR 2.30 0 00002724 8CC7 MOV DI,ES ;put high word in di 0 00002726 07 pop es 0 00002727 29D6 SUB SI,DX ;get low word value 0 00002729 19CF SBB DI,CX ; DI:SI is #bytes to go 0 0000272B 57 PUSH DI 0 0000272C 56 PUSH SI 0 0000272D 83C60F ADD SI,15 ;round up 1 para 0 00002730 83D700 ADC DI,0 ;pick up carry 0 00002733 E8B701 CALL DISID4 ;div 16 to get para count 0 00002736 89F0 MOV AX,SI ;put para count in ax 0 00002738 5E POP SI ;restore bytes remaining 0 00002739 5F POP DI ;restore bytes remaining 0 0000273A 3B06[8F04] CMP AX,[MSIZE] ;enough memory to read remainder? 0 0000273E 7609 JBE GOTSIZ2 ;yes 0 00002740 8B36[8F04] MOV SI,[MSIZE] 0 00002744 31FF XOR DI,DI 0 00002746 E89A01 CALL DISIX4 1703 GOTSIZ2: 0 00002749 8936[8904] MOV WORD PTR [IOCNT],SI ;save byte count for read 0 0000274D 893E[8B04] MOV WORD PTR [IOCNT+2],DI 0 00002751 1E push ds 0 00002752 8E1E[8D04] MOV DS,[MSTART] 1708 assume ds:nothing 0 00002756 E81401 CALL READFILE 0 00002759 1F pop ds 1711 assume ds:data 0 0000275A 7305 JNC GETOFFS 0 0000275C E8BEFC CALL CLSALL 0 0000275F EBA2 JMP GSYS 1715 GETOFFS: 0 00002761 31D2 XOR DX,DX ;clear dx 0 00002763 89D1 MOV CX,DX ;clear cx 0 00002765 B80142 MOV AX,(LSEEK << 8) | 1 0 00002768 CD21 INT 21H 0 0000276A 3E894608 MOV WORD PTR [DS:BP + fileOffset],AX ; CS over ARR 2.30 0 0000276E 3E89560A MOV WORD PTR [DS:BP + fileOffset+2],DX ; CS over ARR 2.30 1722 ;;;;;; CALL CLSALL 0 00002772 E93DFF JMP IOLOOP 1724 1725 ;************************************************* 1726 ; Test to see if correct system disk. Open handles 1727 1728 CRET12: 0 00002775 F9 STC 0 00002776 C3 return 1731 1732 ;TESTSYSDISK: ; dcl 8/23/86 1733 Get_BIOS: ; dcl 8/23/86 1734 OPEN equ Open ; NASM port equate 0 00002777 B8003D MOV AX,OPEN << 8 0 0000277A BA[0000] MOV DX,OFFSET BiosFile 0 0000277D CD21 INT 21H 0 0000277F 7303 JNC SETBIOS 1739 ; call CheckMany ; dcl 8/23/86 0 00002781 E90CFF jmp CheckMany ; dcl 8/23/86 1741 1742 SETBIOS: 1743 Bios equ bios ; NASM port label 0 00002784 A3[DE04] MOV [Bios + fileHandle],AX 0 00002787 89C3 MOV BX,AX 0 00002789 E8B000 CALL GETFSIZ 0 0000278C 833E[E004]00 CMP word [bios + fileSizeInParagraphs],0 0 00002791 740F JZ SETBIOSSIZ 0 00002793 3906[E004] CMP [bios + fileSizeInParagraphs],AX 0 00002797 7409 JZ SETBIOSSIZ 1751 BIOSCLS: 0 00002799 B43E MOV AH,CLOSE 0 0000279B 8B1E[DE04] MOV BX,[Bios + fileHandle] 0 0000279F CD21 INT 21H 1755 ; JMP CRET12 ; dcl 8/23/86 0 000027A1 C3 ret 1757 1758 SETBIOSSIZ: 0 000027A2 A3[E004] MOV [bios + fileSizeInParagraphs],AX 0 000027A5 8936[E204] MOV WORD PTR [bios + fileSizeInBytes],SI 0 000027A9 893E[E404] MOV WORD PTR [bios + fileSizeInBytes+2],DI 0 000027AD 8916[EC04] MOV [bios + fileDate],DX 0 000027B1 890E[EE04] MOV [bios + fileTime],CX 0 000027B5 F8 clc 0 000027B6 C3 ret ; dcl 8/23/86 1766 1767 Get_DOS: ; dcl 8/23/86 0 000027B7 B8003D MOV AX,OPEN << 8 0 000027BA BA[0000] MOV DX,OFFSET DosFile 0 000027BD CD21 INT 21H 0 000027BF 7303 JNC DOSOPNOK 1772 ; call CheckMany ; dcl 8/23/86 1773 ; JMP BIOSCLS ; dcl 8/23/86 Checkmany no ret. 0 000027C1 E9CCFE jmp CheckMany ; dcl 8/23/86 1775 1776 DOSOPNOK: 0 000027C4 A3[F004] MOV [dos + fileHandle],AX 0 000027C7 89C3 MOV BX,AX 0 000027C9 E87000 CALL GETFSIZ 0 000027CC 833E[F204]00 CMP word [dos + fileSizeInParagraphs],0 0 000027D1 740F JZ SETDOSSIZ 0 000027D3 3906[F204] CMP [dos + fileSizeInParagraphs],AX 0 000027D7 7409 JZ SETDOSSIZ 1784 1785 DOSCLS: 0 000027D9 B43E MOV AH,CLOSE 0 000027DB 8B1E[F004] MOV BX,[dos + fileHandle] 0 000027DF CD21 INT 21H 1789 ; JMP BIOSCLS ; dcl 8/23/86 0 000027E1 C3 ret ; dcl 8/23/86 1791 1792 SETDOSSIZ: 0 000027E2 A3[F204] MOV [dos + fileSizeInParagraphs],AX 0 000027E5 8936[F404] MOV WORD PTR [dos + fileSizeInBytes],SI 0 000027E9 893E[F604] MOV WORD PTR [dos + fileSizeInBytes+2],DI 0 000027ED 8916[FE04] MOV [dos + fileDate],DX 0 000027F1 890E[0005] MOV [dos + fileTime],CX 0 000027F5 F8 clc 0 000027F6 C3 ret ; dcl 8/23/86 1800 1801 1802 1803 Get_COMMAND: 0 000027F7 B8003D MOV AX,OPEN << 8 0 000027FA BA[1405] MOV DX,OFFSET CommandFile 0 000027FD CD21 INT 21H 0 000027FF 7303 JNC GotComHand 1808 ; call CheckMany ; dcl 8/23/86 1809 ; JMP DosCls ; dcl 8/23/86 1810 Checkmany equ CheckMany ; NASM port label 0 00002801 E98CFE jmp Checkmany ; dcl 8/23/86 1812 1813 GotComHand: 0 00002804 A3[0205] MOV [command + fileHandle],AX 0 00002807 89C3 MOV BX,AX 0 00002809 E83000 CALL GETFSIZ 0 0000280C 833E[0405]00 CMP word [command + fileSizeInParagraphs],0 0 00002811 740F JZ SETCOMSIZ 0 00002813 3906[0405] CMP [command + fileSizeInParagraphs],AX 0 00002817 7409 JZ SETCOMSIZ 1821 COMCLS: 0 00002819 B43E MOV AH,CLOSE 0 0000281B 8B1E[0205] MOV BX,[command + fileHandle] 0 0000281F CD21 INT 21H 1825 ; JMP DOSCLS ; dcl 8/23/86 0 00002821 C3 ret ; dcl 8/23/86 1827 1828 SETCOMSIZ: 0 00002822 A3[0405] MOV [command + fileSizeInParagraphs],AX 0 00002825 8936[0605] MOV WORD PTR [command + fileSizeInBytes],SI 0 00002829 893E[0805] MOV WORD PTR [command + fileSizeInBytes+2],DI 0 0000282D 8916[1005] MOV [command + fileDate],DX 0 00002831 890E[1205] MOV [command + fileTime],CX 0 00002835 F8 CLC 0 00002836 C3 return 1836 1837 FILE_CLS: ; dcl 8/23/86 0 00002837 B43E MOV AH,CLOSE ; dcl 8/23/86 0 00002839 CD21 INT 21H ; dcl 8/23/86 0 0000283B C3 ret ; dcl 8/23/86 1841 1842 ;******************************************* 1843 ; Handle in BX, return file size in para in AX 1844 ; File size in bytes DI:SI, file date in DX, file 1845 ; time in CX. 1846 1847 GETFSIZ: 0 0000283C B80242 MOV AX,(LSEEK << 8) | 2 0 0000283F 31C9 XOR CX,CX 0 00002841 89CA MOV DX,CX 0 00002843 CD21 INT 21H 0 00002845 89C6 MOV SI,AX 0 00002847 89D7 MOV DI,DX 0 00002849 83C00F ADD AX,15 ; Para round up 0 0000284C 83D200 ADC DX,0 0 0000284F 83E20F AND DX,0FH ; If the file is larger than this it 1857 ; is bigger than the 8086 address 1858 ; space! 0 00002852 B10C MOV CL,12 0 00002854 D3E2 SHL DX,CL 0 00002856 B104 MOV CL,4 0 00002858 D3E8 SHR AX,CL 0 0000285A 09D0 OR AX,DX 0 0000285C 50 PUSH AX 0 0000285D B80042 MOV AX,LSEEK << 8 0 00002860 31C9 XOR CX,CX 0 00002862 89CA MOV DX,CX 0 00002864 CD21 INT 21H 0 00002866 B80057 MOV AX,FILE_TIMES << 8 0 00002869 CD21 INT 21H 0 0000286B 58 POP AX 0 0000286C C3 return 1873 1874 ;******************************************** 1875 ; Read/Write file 1876 ; DS:0 is Xaddr 1877 ; DI:SI is byte count to I/O 1878 ; BX is handle 1879 ; Carry set if screw up 1880 ; 1881 ; I/O SI bytes 1882 ; I/O 64K - 1 bytes DI times 1883 ; I/O DI bytes 1884 1885 1886 READFILE: 1887 ; Must preserve AX,DX 0 0000286D 50 PUSH AX 0 0000286E 52 PUSH DX 0 0000286F 55 PUSH BP 1891 READ equ Read ; NASM port equate 0 00002870 BD003F MOV BP,READ << 8 0 00002873 E80D00 CALL FILIO 0 00002876 5D POP BP 0 00002877 5A POP DX 0 00002878 58 POP AX 0 00002879 C3 return 1898 1899 WRITEFILE: 0 0000287A 55 PUSH BP 0 0000287B BD0040 MOV BP,WRITE << 8 0 0000287E E80200 CALL FILIO 0 00002881 5D POP BP 0 00002882 C3 return 1905 1906 FILIO: 0 00002883 31D2 XOR DX,DX 0 00002885 89F1 MOV CX,SI 0 00002887 E30F JCXZ K64IO 0 00002889 89E8 MOV AX,BP 0 0000288B CD21 INT 21H 0 0000288D 72F3 retc 0 0000288F 01C2 ADD DX,AX 0 00002891 39C8 CMP AX,CX ; If not =, AX= 4086) 2015 ; 2016 Phase1Initialisation proc near 2017 2018 ; Get device parameters 0 0000290D 8D16[2501] lea dx, [deviceParameters] 0 00002911 C606[2501]00 mov byte [deviceParameters + DP_SpecialFunctions], 0 0 00002916 E87201 call GetDeviceParameters 0 00002919 7309 jnc GotDeviceParameters 0 0000291B BA[0000]E8[0000] Message msgFormatNotSupported ; ;AC000; 2024 ;lea dx, ptr_msgFormatNotSupported 2025 ;call std_printf 2026 fexit equ FEXIT ; NASM port label 0 00002921 E977F9 jmp fexit 2028 GotDeviceParameters: 2029 2030 ; Save the device parameters for when we exit 0 00002924 8D36[2501] lea si, [deviceParameters] 0 00002928 8D3E[0100] lea di, [savedDeviceParameters] 2033 a_DeviceParameters_struc_size equ A_DEVICEPARAMETERS_struc_size ; NASM port equate 0 0000292C B92401 mov cx, a_DeviceParameters_struc_size 0 0000292F 1E push ds 0 00002930 07 pop es 0 00002931 F3A4 rep movsb 2038 2039 ; Ensure that there is a valid number of sectors in the track table 2040 DP_TrackTableEntries equ DP_TRACKTABLEENTRIES ; NASM port equate 0 00002933 C706[2700]0000 mov word [savedDeviceParameters + DP_TrackTableEntries], 0 0 00002939 C606[0000]01 mov byte [validSavedDeviceParameters], 1 2043 2044 ; Initialise this to zero to know if CheckSwitches defined the track layout 0 0000293E C706[4B01]0000 mov word [deviceParameters + DP_TrackTableEntries], 0 2046 0 00002944 E82D06 call Set_BPB_Info ;an000; dms; Check to see if we are on 2048 ; FAT system. If not set BPB to proper 2049 ; values for format. 2050 SetMTsupp: 2051 2052 ; Check switches against parameters and use switches to modify device parameters 0 00002947 E8[0000] call CheckSwitches 0 0000294A 72C0 retc 2055 2056 DeviceParameters equ deviceParameters ; NASM port label 2057 %IF ShipDisk 2058 2059 Switch_Z equ SWITCH_Z ; NASM port equate 2060 test word [SwitchMap],Switch_Z ;an000; dms;1 sector/cluster disk? 2061 ; $if nz ;an000; dms;yes 2062 JZ DD_IF19 2063 mov byte [DeviceParameters + DP_BPB + BPB_SectorsPerCluster],01h ;an000; dms;set BPB accordingly 2064 Calc_Small_Fat equ Calc_Small_FAT ; NASM port label 2065 call Calc_Small_Fat ;an000; dms;calc FAT size 2066 ; $endif ;an000; dms; 2067 DD_IF19: 2068 2069 %ENDIF 2070 2071 0 0000294C 833E[4B01]00 cmp word [deviceParameters + DP_TrackTableEntries], 0 0 00002951 751A jne TrackLayoutSet ; There is a good track layout 2074 2075 ; Store sector table info 2076 BPB_SectorsPerTrack equ BPB_SECTORSPERTRACK ; NASM port equate 0 00002953 8B0E[3901] mov cx, [deviceParameters + DP_BPB + BPB_SectorsPerTrack] 0 00002957 890E[4B01] mov [deviceParameters + DP_TrackTableEntries], cx 0 0000295B B80100 mov ax, 1 2080 BPB_bytesPerSector equ BPB_BYTESPERSECTOR ; NASM port equate 0 0000295E 8B1E[2C01] mov bx, [deviceParameters + DP_BPB + BPB_bytesPerSector] 2082 DP_SectorTable equ DP_SECTORTABLE ; NASM port equate 0 00002962 8D3E[4D01] lea di, [deviceParameters + DP_SectorTable] 2084 LoadSectorTable: 0 00002966 AB stosw 0 00002967 93 xchg ax, bx 0 00002968 AB stosw 0 00002969 93 xchg ax, bx 0 0000296A 40 inc ax 0 0000296B E2F9 loop LoadSectorTable 2091 TrackLayoutSet: 2092 2093 ; 2094 ; directorySector = malloc( Bytes Per Sector ) 2095 ; 0 0000296D 8B1E[2C01] mov bx, [deviceParameters + DP_BPB + BPB_BytesPerSector] 0 00002971 83C30F add bx, 0fH 0 00002974 D1EB shr bx, 1 0 00002976 D1EB shr bx, 1 0 00002978 D1EB shr bx, 1 0 0000297A D1EB shr bx, 1 0 0000297C B448 mov ah, Alloc 0 0000297E CD21 int 21H 0 00002980 728A retc 0 00002982 A3[7E04] mov word ptr [directorySector+2], ax 0 00002985 31C0 xor ax,ax 0 00002987 A3[7C04] mov word ptr [directorySector], ax 2108 2109 ; 2110 ; fatSpace = malloc( Bytes Per Sector * Sectors Per FAT ) 2111 ; 0 0000298A A1[2C01] mov ax, [deviceParameters + DP_BPB + BPB_BytesPerSector] 0 0000298D 83C00F add ax, 0fH 0 00002990 D1E8 shr ax, 1 0 00002992 D1E8 shr ax, 1 0 00002994 D1E8 shr ax, 1 0 00002996 D1E8 shr ax, 1 2118 BPB_SectorsPerFAT equ BPB_SECTORSPERFAT ; NASM port equate 0 00002998 F726[3701] mul word [deviceParameters + DP_BPB + BPB_SectorsPerFAT] 0 0000299C A3[DA04] mov [Paras_Per_Fat],ax ;AN005;128k FAT 0 0000299F 89C3 mov bx,ax 0 000029A1 B448 mov ah,Alloc 0 000029A3 CD21 int 21H 0 000029A5 72D9 retc 0 000029A7 A3[6304] mov word ptr [fatSpace+2],ax 0 000029AA 31C0 xor ax,ax 0 000029AC A3[6104] mov word ptr [fatSpace],ax 2128 0 000029AF E80500 call SetStartSector 0 000029B2 E82B00 call SetfBigFat 2131 0 000029B5 F8 clc 0 000029B6 C3 return 2134 2135 Phase1Initialisation endp 2136 2137 ;------------------------------------------------------------------------------- 2138 2139 SetStartSector proc near 2140 2141 ; startSector = number of reserved sectors 2142 ; + number of FAT Sectors ( Number of FATS * Sectors Per FAT ) 2143 ; + number of directory sectors ( 32* Root Entries / bytes Per Sector ) 2144 ; ( above is rounded up ) 2145 2146 ; Calculate the number of directory sectors 2147 BPB_RootEntries equ BPB_ROOTENTRIES ; NASM port equate 0 000029B7 A1[3201] mov ax, [deviceParameters + DP_BPB + BPB_RootEntries] 0 000029BA BB2000 mov bx, dir_entry_struc_size 0 000029BD F7E3 mul bx 0 000029BF 0306[2C01] add ax, [deviceParameters + DP_BPB + BPB_bytesPerSector] 0 000029C3 48 dec ax 0 000029C4 31D2 xor dx,dx 0 000029C6 F736[2C01] div word [deviceParameters + DP_BPB + BPB_bytesPerSector] 0 000029CA A3[7A04] mov [sectorsInRootDirectory],ax 0 000029CD A3[5F04] mov [startSector], ax 2157 2158 ; Calculate the number of FAT sectors 0 000029D0 A1[3701] mov ax, [deviceParameters + DP_BPB + BPB_SectorsPerFAT] 2160 BPB_numberOfFATs equ BPB_NUMBEROFFATS ; NASM port equate 0 000029D3 F626[3101] mul byte [deviceParameters + DP_BPB + BPB_numberOfFATs] 2162 ; Add in the number of boot sectors 2163 BPB_ReservedSectors equ BPB_RESERVEDSECTORS ; NASM port equate 0 000029D7 0306[2F01] add ax, [deviceParameters + DP_BPB + BPB_ReservedSectors] 0 000029DB 0106[5F04] add [startSector], ax 2166 0 000029DF C3 return 2168 2169 SetStartSector endp 2170 2171 ;------------------------------------------------------------------------------- 2172 2173 SetfBigFat proc near 2174 ; 2175 ; fBigFat = ( ( (Total Sectors - Start Sector) / Sectors Per Cluster) >= 4086 ) 2176 ; 2177 BPB_BigTotalSectors equ BPB_BIGTOTALSECTORS ; NASM port equate 0 000029E0 833E[4301]00 cmp word [deviceParameters + DP_BPB + BPB_BigTotalSectors+2],0 ; > 32mb part? ;AN000; 2179 ; $IF NE ;Yes, big FAT ;AC000; 0 000029E5 7407 JE DD_IF21 0 000029E7 C606[6504]FF mov byte [fBigFat], TRUE ;Set flag ;AN000; 2181 ****************** warning: byte data exceeds bounds [-w+number-overflow] 2182 ; $ELSE ;Nope, < 32,b ;AC000; 0 000029EC EB23 JMP SHORT DD_EN21 2184 DD_IF21: 0 000029EE A1[4101] mov ax,[deviceParameters + DP_BPB + BPB_BigTotalSectors] ;Assume this used ;AN000; 0 000029F1 83F800 cmp ax,0 ;Was this field used? ;AN000; 2187 ; $IF E ;Nope, use the other sector field;AN000; 0 000029F4 7503 JNE DD_IF23 2189 BPB_TotalSectors equ BPB_TOTALSECTORS ; NASM port equate 0 000029F6 A1[3401] mov ax, [deviceParameters + DP_BPB + BPB_TotalSectors] ; ;AC000; 2191 ;** Fix for PTM PCDOS P51 2192 ; $ENDIF ; ;AN000; 2193 DD_IF23: 0 000029F9 2B06[5F04] sub ax,[startSector] ;Get sectors in data area 0 000029FD 31D2 xor dx,dx 0 000029FF 31DB xor bx,bx 2197 BPB_sectorsPerCluster equ BPB_SECTORSPERCLUSTER ; NASM port equate 0 00002A01 8A1E[2E01] mov bl,[deviceParameters + DP_BPB + BPB_sectorsPerCluster] 0 00002A05 F7F3 div bx ;Get total clusters 0 00002A07 3DF60F cmp ax,BIG_FAT_THRESHOLD ;Is clusters >= 4086? 2201 ; $IF AE 0 00002A0A 7205 JNAE DD_IF25 2203 fBigFAT equ fBigFat ; NASM port label 0 00002A0C C606[6504]FF mov byte [fBigFAT],TRUE ;16 bit FAT if >=4096 2204 ****************** warning: byte data exceeds bounds [-w+number-overflow] 2205 ;** END fix for PTM PCDOS P51 2206 ; $ENDIF 2207 DD_IF25: 2208 ; $ENDIF 2209 DD_EN21: 0 00002A11 C3 return 2211 2212 SetfBigFat endp 2213 2214 ;------------------------------------------------------------------------------- 2215 ; 2216 ; Phase2Initialisation: 2217 ; Use device parameters to build information that will be 2218 ; required for each format 2219 ; 2220 ; Algorithm: 2221 ; Calculate first head/cylinder to format 2222 ; Calculate number of tracks to format 2223 ; Calculate the total bytes on the disk and save for later printout 2224 ; First initialise the directory buffer 2225 ; 2226 Phase2Initialisation proc near 2227 2228 ; Calculate first track/head to format (round up - kludge) 2229 BPB_HiddenSectors equ BPB_HIDDENSECTORS ; NASM port equate 0 00002A12 A1[3D01] mov ax, [deviceParameters + DP_BPB + BPB_HiddenSectors] 0 00002A15 8B16[3F01] mov dx, [deviceParameters + DP_BPB + BPB_HiddenSectors + 2] 0 00002A19 0306[3901] add ax, [deviceParameters + DP_BPB + BPB_SectorsPerTrack] 0 00002A1D 83D200 adc dx, 0 0 00002A20 48 dec ax 0 00002A21 83DA00 sbb dx, 0 0 00002A24 F736[3901] div word [deviceParameters + DP_BPB + BPB_SectorsPerTrack] 0 00002A28 31D2 xor dx,dx 2238 BPB_Heads equ BPB_HEADS ; NASM port equate 0 00002A2A F736[3B01] div word [deviceParameters + DP_BPB + BPB_Heads] 0 00002A2E A3[6804] mov [firstCylinder], ax 0 00002A31 8916[6604] mov [firstHead], dx 2242 2243 ; Calculate the total number of tracks to be formatted (round down - kludge) 0 00002A35 A1[3401] mov ax, [deviceParameters + DP_BPB + BPB_TotalSectors] 0 00002A38 31D2 xor dx,dx 2246 ; if (TotalSectors == 0) then use BigTotalSectors 0 00002A3A 09C0 or ax,ax 0 00002A3C 7507 jnz NotBigTotalSectors 0 00002A3E A1[4101] mov ax, [deviceParameters + DP_BPB + BPB_BigTotalSectors] 0 00002A41 8B16[4301] mov dx, [deviceParameters + DP_BPB + BPB_BigTotalSectors + 2] 2251 2252 NotBigTotalSectors: 0 00002A45 F736[3901] div word [deviceParameters + DP_BPB + BPB_SectorsPerTrack] 0 00002A49 A3[6C04] mov [tracksPerDisk], ax 2255 2256 ; Initialise the directory buffer 2257 ; Clear out the Directory Sector before any information is inserted. 0 00002A4C 8B0E[2C01] mov cx, [deviceParameters + DP_BPB + BPB_BytesPerSector] 0 00002A50 C43E[7C04] les di, [directorySector] 0 00002A54 31C0 xor ax,ax 0 00002A56 F3AA rep stosb 2262 0 00002A58 A1[2C01] mov ax, [deviceParameters + DP_BPB + BPB_BytesPerSector] 0 00002A5B 31D2 xor dx, dx 0 00002A5D BB2000 mov bx, dir_entry_struc_size 0 00002A60 F7F3 div bx 0 00002A62 89C1 mov cx, ax 2268 0 00002A64 C41E[7C04] les bx, [directorySector] 2270 ; If Old_Dir = TRUE then put the first letter of each directory entry must be 0E5H 0 00002A68 30C0 xor al, al 2272 old_Dir equ Old_Dir ; NASM port label 0 00002A6A 803E[7804]FF cmp byte [old_Dir], TRUE 2273 ****************** warning: byte data exceeds bounds [-w+number-overflow] 0 00002A6F 7502 jne StickE5 0 00002A71 B0E5 mov al, 0e5H 2276 StickE5: 0 00002A73 268807 mov [es:bx], al 0 00002A76 83C320 add bx, dir_entry_struc_size 2279 stickE5 equ StickE5 ; NASM port label 0 00002A79 E2F8 loop stickE5 2281 0 00002A7B C3 ret 2283 2284 Phase2Initialisation endp 2285 2286 ;------------------------------------------------------------------------------- 2287 ; 2288 ; SetDeviceParameters: 2289 ; Set the device parameters 2290 ; 2291 ; Input: 2292 ; drive 2293 ; dx - pointer to device parameters 2294 ; 2295 SetDeviceParameters proc near 2296 0 00002A7C B80D44 mov ax, (IOCTL << 8) | GENERIC_IOCTL 0 00002A7F 8A1E[8206] mov bl, [drive] 0 00002A83 FEC3 inc bl 0 00002A85 B94008 mov cx, (RAWIO << 8) | SET_DEVICE_PARAMETERS 0 00002A88 CD21 int 21H 0 00002A8A C3 return 2303 2304 SetDeviceParameters endp 2305 2306 ;------------------------------------------------------------------------------- 2307 ; 2308 ; GetDeviceParameters: 2309 ; Get the device parameters 2310 ; 2311 ; Input: 2312 ; drive 2313 ; dx - pointer to device parameters 2314 ; 2315 GetDeviceParameters proc near 2316 0 00002A8B B80D44 mov ax, (IOCTL << 8) | GENERIC_IOCTL 0 00002A8E 8A1E[8206] mov bl, [drive] 0 00002A92 FEC3 inc bl 0 00002A94 B96008 mov cx, (RAWIO << 8) | GET_DEVICE_PARAMETERS 0 00002A97 CD21 int 21H 0 00002A99 C3 return 2323 2324 GetDeviceParameters endp 2325 2326 ;------------------------------------------------------------------------------- 2327 ; 2328 ; DiskFormat: 2329 ; Format the tracks on the disk 2330 ; Since we do our SetDeviceParameters here, we also need to 2331 ; detect the legality of /N /T if present and abort with errors 2332 ; if not. 2333 ; This routine stops as soon as it encounters a bad track 2334 ; Then BadSector is called to report the bad track, and it continues 2335 ; the format 2336 ; 2337 ; Algorithm: 2338 ; Initialise in memory FAT 2339 ; current track = first 2340 ; while not done 2341 ; if format track fails 2342 ; DiskFormatErrors = true 2343 ; return 2344 ; next track 2345 2346 DiskFormat proc near 2347 2348 2349 ; 2350 ; Initialise fatSpace 2351 ; 2352 2353 0 00002A9A 06 push es 2355 0 00002A9B E8C803 call Fat_Init ;an000; initialize the FAT 2357 0 00002A9E 8B3E[6304] mov di, word ptr [fatspace+2] ;an000; get segment of FAT 0 00002AA2 8EC7 mov es, di ;an000; place it in es 0 00002AA4 8B3E[6104] mov di, word ptr [fatSpace] ;Should be 0 2361 BPB_MediaDescriptor equ BPB_MEDIADESCRIPTOR ; NASM port equate 0 00002AA8 A0[3601] mov al, [deviceParameters + DP_BPB + BPB_MediaDescriptor] 0 00002AAB B4FF mov ah, 0ffH 0 00002AAD AB stosw 0 00002AAE B8FF00 mov ax, 00ffH 0 00002AB1 F606[6504]FF test byte [fBigFat], TRUE 2366 ****************** warning: byte data exceeds bounds [-w+number-overflow] 0 00002AB6 7403 jz NotBig 0 00002AB8 B8FFFF mov ax, 0ffffH 0 00002ABB AB NotBig: stosw 0 00002ABC 07 pop es 2371 2372 ; don't bother to do the formatting if /c was given 0 00002ABD F706[2006]0800 test word [switchmap], SWITCH_C 0 00002AC3 7403 jz Keep_Going 0 00002AC5 E9D000 jmp FormatDone ;FormatDone is to far away 2376 2377 Keep_Going: 2378 foofoo equ INSTALL_FAKE_BPB | TRACKLAYOUT_IS_GOOD 0 00002AC8 C606[2501]05 mov byte [deviceParameters + DP_SpecialFunctions], foofoo 0 00002ACD 8D16[2501] lea dx, [deviceParameters] 2381 0 00002AD1 E8A8FF call SetDeviceParameters 2383 0 00002AD4 E84007 call Cluster_Buffer_Allocate ;an000; dms;get room for retry buffer 2385 0 00002AD7 E8F508 call Prompt_User_For_Disk ;an016; dms; 2387 2388 switch_8 equ SWITCH_8 ; NASM port equate 0 00002ADA F706[2006]0001 test word [switchmap],switch_8 ; DCL 5/12/86 avoid Naples AH=18h 2390 stdBpB equ StdBPB ; NASM port label 0 00002AE0 7561 jnz stdBpB ; lackof support for 8 sectors/track 2392 2393 ; DCL 5/12/86 2394 ; Always do the STATUS_FOR_FORMAT test, as we don't know if the machine 2395 ; has this support. For 3.2 /N: & /T: were not documented & therefore 2396 ; not fully supported thru the ROM of Aquarius & Naples & Royal Palm 2397 2398 ;test SwitchMap, SWITCH_N or SWITCH_T ; IF ( /N or /T ) ;; DCL 5/12/86 2399 ;jz StdBPB 2400 ; THEN check if 2401 ; supported 2402 FP_SpecialFunctions equ FP_SPECIALFUNCTIONS ; NASM port equate 0 00002AE2 C606[4B02]01 mov byte [formatPacket + FP_SpecialFunctions], STATUS_FOR_FORMAT 0 00002AE7 B80D44 mov ax, (IOCTL << 8) | GENERIC_IOCTL 0 00002AEA 8A1E[8206] mov bl, [drive] 0 00002AEE FEC3 inc bl 0 00002AF0 B94208 mov cx, (RAWIO << 8) | FORMAT_TRACK 0 00002AF3 8D16[4B02] lea dx, [formatPacket] 0 00002AF7 CD21 int 21H 2410 ; switch ( FormatStatusCall) 2411 2412 ;cmp FormatPacket.FP_SpecialFunctions, Format_No_ROM_Support 2413 ;jb NTSupported ; 0 returned from IBMBIO 2414 ;ja IllegalComb ; 2 returned - ROM Support 2415 ; Illegal Combination! 2416 FormatPacket equ formatPacket ; NASM port label 0 00002AF9 803E[4B02]00 cmp byte [FormatPacket + FP_SpecialFunctions],0 0 00002AFE 7443 je NTSupported 0 00002B00 803E[4B02]02 cmp byte [FormatPacket + FP_SpecialFunctions],2 2420 ; $IF E ; ;AC000; 0 00002B05 750D JNE DD_IF28 0 00002B07 BA[0000]E8[0000] Message msgInvalidParameter ; ;AC000; 2423 Yes equ YES ; NASM port equate 0 00002B0D C606[0000]FF mov byte [Fatal_Error],Yes ;Indicate quittin'type err! ;AN000; 2425 ; $ELSE ; ; ; 0 00002B12 EB25 JMP SHORT DD_EN28 2427 DD_IF28: 0 00002B14 803E[4B02]03 cmp byte [FormatPacket + FP_SpecialFunctions],3 ; ; ; 2429 ; $IF E ; ;AC000; 0 00002B19 750B JNE DD_IF30 2431 Error_Not_Ready equ error_not_ready ; NASM port equate 0 00002B1B B81500 mov ax,Error_Not_Ready ;flag not ready ;an000;dms; 0 00002B1E E82601 call CheckError ; set error level ;an017; dms; 2434 FrmtProb equ FRMTPROB ; NASM port label 0 00002B21 E90DF5 jmp FrmtProb ; exit program ;an017; dms; 2436 ; $ELSE ; DCL No ROM support is okay ; ; 0 00002B24 EB13 JMP SHORT DD_EN30 2438 DD_IF30: 2439 ; except for /N: & /T: ; ; 0 00002B26 F706[2006]3000 test word [SwitchMap], SWITCH_N | SWITCH_T ; DCL 5/12/86 ; ; 2441 ; $IF NZ ; ;AC000; 0 00002B2C 740B JZ DD_IF32 0 00002B2E BA[0000]E8[0000] Message msgParametersNotSupported ; ;AC000; 0 00002B34 C606[0000]FF mov byte [Fatal_Error],Yes ;Indicate quittin'type err! ;AN000; 2445 ; $ENDIF ; ;AN000; 2446 DD_IF32: 2447 ; $ENDIF ; ;AN000; 2448 DD_EN30: 2449 ; $ENDIF ; ;AN000; 2450 DD_EN28: 0 00002B39 803E[0000]FF cmp byte [Fatal_Error],Yes ; ;AN000; 0 00002B3E 7503 jne StdBPB ; ;AN000; 0 00002B40 E958F7 jmp Fexit 2454 ; 2455 ; We have the support to carry out the FORMAT 2456 ; 2457 NTSupported: 2458 StdBPB: 2459 ;call DSKPRM ; prompt user for disk ;; DCL 5/12/86 0 00002B43 C606[4B02]00 mov byte [FormatPacket + FP_SpecialFunctions], 0 0 00002B48 A1[6604] mov ax, [firstHead] 2462 FP_Head equ FP_HEAD ; NASM port equate 0 00002B4B A3[4C02] mov [formatPacket + FP_Head], ax 0 00002B4E A1[6804] mov ax, [firstCylinder] 2465 FP_Cylinder equ FP_CYLINDER ; NASM port equate 0 00002B51 A3[4E02] mov [formatPacket + FP_Cylinder], ax 0 00002B54 8B0E[6C04] mov cx, [tracksPerDisk] 0 00002B58 890E[6A04] mov [tracksLeft], cx 0 00002B5C C606[DC06]00 mov byte [Format_End],False ;an015; dms;flag not at end of format 0 00002B61 E8EC07 call Calc_Max_Tracks_To_Format ;an015; dms;max track count for FormatTrack call 2471 FormatLoop: 0 00002B64 E81F08 call Format_Loop ;an015; dms;Format until CY occurs 2473 2474 True equ TRUE ; NASM port equate 0 00002B67 803E[DC06]FF cmp byte [Format_End],True ;an015; dms;End of Format? 2475 ****************** warning: byte data exceeds bounds [-w+number-overflow] 2476 ; $if e ;an015; dms;yes 0 00002B6C 7508 JNE DD_IF36 2478 FormatError equ formatError ; NASM port label 0 00002B6E C606[8004]00 mov byte [FormatError],0 ;an015; dms;signal good format 0 00002B73 F8 clc ;an015; dms;clear CY 2481 ; $else ;an015; dms;bad format 0 00002B74 EB21 JMP SHORT DD_EN36 2483 DD_IF36: 0 00002B76 E8CE00 call CheckError ;an015; dms;determine type of error 2485 ; $if nc ;an015; dms; 0 00002B79 721C JC DD_IF38 0 00002B7B E8[0000] call LastChanceToSaveIt ;an015; dms;acceptable error? 2488 ; $if c ;an015; dms;yes 0 00002B7E 7308 JNC DD_IF39 0 00002B80 C606[8004]01 mov byte [FormatError],1 ;an015; dms;signal error type 0 00002B85 F8 clc ;an015; dms;clear CY 2492 ; $else ;an015; dms;not acceptable error 0 00002B86 EB0F JMP SHORT DD_EN39 2494 DD_IF39: 0 00002B88 E82CFE call SetStartSector ;an015; dms;start from scratch 2496 SetFBigFat equ SetfBigFat ; NASM port label 0 00002B8B E852FE call SetFBigFat ;an015; dms; 0 00002B8E 50 push ax ;an015; dms; 0 00002B8F E880FE call Phase2Initialisation ;an015; dms; 0 00002B92 F8 clc ;an015; dms; 0 00002B93 58 pop ax ;an015; dms; 0 00002B94 E903FF jmp DiskFormat ;an015; dms;try again 2503 ; $endif ;an015; dms; 2504 DD_EN39: 2505 ; $endif ;an015; dms; 2506 DD_IF38: 2507 ; $endif ;an015; dms; 2508 DD_EN36: 0 00002B97 C3 return 2510 2511 FormatDone: 0 00002B98 C606[8004]00 mov byte [FormatError],0 0 00002B9D F8 clc 0 00002B9E C3 return 2515 2516 DiskFormat endp 2517 2518 2519 ;------------------------------------------------------------------------------- 2520 ; 2521 ; BadSector: 2522 ; Reports the bad sectors. 2523 ; Reports the track where DiskFormat stopped. 2524 ; From then on it formats until it reaches a bad track, or end, 2525 ; and reports that. 2526 ; 2527 ; Output: 2528 ; Carry: set --> fatal error 2529 ; if Carry not set 2530 ; ax - The number of consecutive bad sectors encountered 2531 ; ax == 0 --> no more bad sectors 2532 ; bx - The logical sector number of the first bad sector 2533 ; 2534 ; Algorithm: 2535 ; if DiskFormatErrors 2536 ; DiskFormatErrors = false 2537 ; return current track 2538 ; else 2539 ; next track 2540 ; while not done 2541 ; if format track fails 2542 ; return current track 2543 ; next track 2544 ; return 0 2545 2546 BadSector proc near 2547 2548 2549 ; don't bother to do the formatting if /c was given 0 00002B9F F706[2006]0800 test word [switchmap], SWITCH_C 0 00002BA5 7545 jnz NoMoreTracks 2552 0 00002BA7 F606[8004]FF test byte [formatError], 0ffH 0 00002BAC 7408 jz ContinueFormat 0 00002BAE C606[8004]00 mov byte [formatError], 0 0 00002BB3 EB2F jmp ReportBadTrack 0 00002BB5 90 nop ; identicalise 2558 2559 ContinueFormat: 0 00002BB6 E80908 call Adj_Track_Count ;an015; dms;decrease track counter 0 00002BB9 E8FC06 call NextTrack ;an015; dms;adjust head and cylinder 0 00002BBC 803E[DC06]FF cmp byte [Format_End],True ;an015; dms;end of format? 2562 ****************** warning: byte data exceeds bounds [-w+number-overflow] 2563 ; $if ne ;an015; dms;no 0 00002BC1 741D JE DD_IF44 0 00002BC3 E8C007 call Format_Loop ;an015; dms;format until CY 0 00002BC6 803E[DC06]FF cmp byte [Format_End],True ;an015; dms;end of format? 2566 ****************** warning: byte data exceeds bounds [-w+number-overflow] 2567 ; $if ne ;an015; dms;no 0 00002BCB 740E JE DD_IF45 0 00002BCD E87700 call CheckError ;an015; dms;must be error - which error? 2570 ; $if nc ;an015; dms;non-fatal error? 0 00002BD0 7207 JC DD_IF46 0 00002BD2 E81D02 call CurrentLogicalSector ;an015; dms;yes - get position 0 00002BD5 A1[3901] mov ax,[DeviceParameters + DP_BPB + BPB_SectorsPerTrack] ;an015; dms; set track size 0 00002BD8 F8 clc ;an015; dms;signal O.K. to continue 2575 ; $endif ;an015; dms; 2576 DD_IF46: 2577 ; $else ;an015; dms; 0 00002BD9 EB03 JMP SHORT DD_EN45 2579 DD_IF45: 0 00002BDB EB0F jmp NoMoreTracks ;an015; dms;end of format 0 00002BDD 90 nop ; identicalise 2582 ; $endif ;an015; dms; 2583 DD_EN45: 2584 ; $else ;an015; dms; 0 00002BDE EB03 JMP SHORT DD_EN44 2586 DD_IF44: 0 00002BE0 EB0A jmp NoMoreTracks ;an015; dms;end of format 0 00002BE2 90 nop ; identicalise 2589 ; $endif ;an015; dms; 2590 DD_EN44: 0 00002BE3 C3 return ;an015; dms; 2592 2593 ReportBadTrack: 0 00002BE4 E80B02 call CurrentLogicalSector 0 00002BE7 A1[3901] mov ax, [deviceParameters + DP_BPB + BPB_SectorsPerTrack] 0 00002BEA F8 clc 0 00002BEB C3 return 2598 2599 NoMoreTracks: 0 00002BEC F706[2006]000C test word [SwitchMap],(Switch_Select | SWITCH_AUTOTEST) ;Don't display done msg;AN000; 2601 ; $IF Z ; if EXEC'd by SELECT ;AN000; 0 00002BF2 7506 JNZ DD_IF52 0 00002BF4 BA[0000]E8[0000] Message msgFormatComplete ; ;AC000; 2604 ; $ENDIF ; ;AN000; 2605 DD_IF52: 0 00002BFA B80000 mov ax, 0 0 00002BFD F8 clc 0 00002BFE C3 return 2609 2610 BadSector endp 2611 2612 2613 2614 ;------------------------------------------------------------------------------- 2615 === Switch to base=000080h -> "DATA" 2616 section data 2617 2618 ;ptr_msgCurrentTrack dw offset msgCurrentTrack 0 00000E81 0000 currentHead dw 0 0 00000E83 0000 currentCylinder dw 0 2621 === Switch to base=001900h -> "CODE" 2622 section code ; data ends 2623 2624 ;========================================================================= 2625 ; Calc_Current_Head_Cyl : Obtain the current head and cylinder of the 2626 ; track being formatted. 2627 ; 2628 ; Inputs: FP_Cylinder - Cylinder of track being formatted 2629 ; FP_Head - Head of track being formatted 2630 ;========================================================================= 2631 2632 Procedure Calc_Current_Head_Cyl ;an000; dms; 2633 0 00002BFF 51 push cx ;an000; dms;save cx 0 00002C00 8B0E[4E02] mov cx,[FormatPacket + FP_Cylinder] ;an000; dms;get current cylinder 2636 CurrentCylinder equ currentCylinder ; NASM port label 0 00002C04 890E[E306] mov [CurrentCylinder],cx ;an000; dms;put into variable 0 00002C08 8B0E[4C02] mov cx,[FormatPacket + FP_Head] ;an000; dms;get current head 2639 CurrentHead equ currentHead ; NASM port label 0 00002C0C 890E[E106] mov [CurrentHead],cx ;an000; dms;put into variable 0 00002C10 59 pop cx ;an000; dms;restore cx 0 00002C11 C3 ret ;an000; dms; 2643 2644 Calc_Current_Head_Cyl endp ;an000; dms; 2645 2646 2647 DisplayCurrentTrack proc near 2648 0 00002C12 52 push dx ; ;AN000; 0 00002C13 51 push cx ; ;AN000; 0 00002C14 50 push ax ;an015; dms; 2652 0 00002C15 A1[D806] mov ax,[Tracks_To_Format] ;an015; dms;get track count 2654 0 00002C18 0106[6E04] add [Formatted_Tracks_Low],ax ;Indicate formatted a track ;AN000; 0 00002C1C 8316[7004]00 adc word [Formatted_Tracks_High],0 ; ;AN000; 0 00002C21 A1[6E04] mov ax,[Formatted_Tracks_Low] ; ;AN000; 0 00002C24 8B1E[7004] mov bx,[Formatted_Tracks_High] ; ;AN000; 0 00002C28 B96400 mov cx,100 ;Make integer calc for div ;AN000; 0 00002C2B E8EA01 call Multiply_32_Bits ; BX:AX = (Cyl * Head *100) ;AN000; 0 00002C2E 89DA mov dx,bx ;Set up divide ;AN000; 2662 TracksPerDisk equ tracksPerDisk ; NASM port label 0 00002C30 F736[6C04] div word [TracksPerDisk] ;% = (Cyl * Head *100)/ # tracks;AN000; 0 00002C34 3B06[7604] cmp ax,[PercentComplete] ;Only print message when change ;AN000; 2665 ; $IF NE ;To avoid excess cursor splat ;AN000; 0 00002C38 7409 JE DD_IF54 0 00002C3A A3[7604] mov [PercentComplete],ax ;Save it if changed ;AN000; 0 00002C3D BA[0000]E8[0000] Message msgCurrentTrack ; ;AC000; 2669 ; $ENDIF ; 2670 DD_IF54: 0 00002C43 58 pop ax ;an015; dms; 0 00002C44 59 pop cx ;Restore register ;AN000; 0 00002C45 5A pop dx ; ;AN000; 0 00002C46 C3 return 2675 2676 DisplayCurrentTrack endp 2677 2678 2679 ;------------------------------------------------------------------------------- 2680 ; CheckError: 2681 ; Input: 2682 ; ax - extended error code 2683 ; Ouput: 2684 ; carry set if error is fatal 2685 ; Message printed if Not Ready or Write Protect 2686 ; 2687 CheckError proc near 0 00002C47 83F813 cmp ax, error_write_protect 0 00002C4A 7430 je WriteProtectError 0 00002C4C 83F815 cmp ax, error_not_ready 0 00002C4F 7458 je NotReadyError 0 00002C51 833E[E306]00 cmp word [currentCylinder], 0 0 00002C56 7507 jne CheckRealErrors 0 00002C58 833E[E106]00 cmp word [currentHead], 0 0 00002C5D 7477 je BadTrackZero 2696 2697 CheckRealErrors: 0 00002C5F 83F817 cmp ax, error_CRC 0 00002C62 7416 je JustABadTrack 0 00002C64 83F81B cmp ax, error_sector_not_found 0 00002C67 7411 je JustABadTrack 0 00002C69 83F81D cmp ax, error_write_fault 0 00002C6C 740C je JustABadTrack 0 00002C6E 83F81E cmp ax, error_read_fault 0 00002C71 7407 je JustABadTrack 0 00002C73 83F81F cmp ax, error_gen_failure 0 00002C76 7402 je JustABadTrack 2708 0 00002C78 F9 stc 0 00002C79 C3 ret 2711 2712 JustABadTrack: 0 00002C7A F8 clc 0 00002C7B C3 ret 2715 2716 WriteProtectError: 2717 2718 Switch_SELECT equ SWITCH_SELECT ; NASM port equate 0 00002C7C F706[2006]0004 test word [SwitchMap],Switch_SELECT ;an017; dms;SELECT option? 2720 ; $if z ;an017; dms;no - display messages 0 00002C82 751E JNZ DD_IF56 0 00002C84 BA[0000]E8[0000] Message msgCRLF ; ;AC006; 0 00002C8A BA[0000]E8[0000] Message msgCRLF ; ;AC006; 0 00002C90 1EBA[0000]8EDAA3 Extended_Message ; ;AC006; 0 00002C97 [0000]BA[0000]E8 0 00002C9D [0000]1F 2725 ; $else ;an017; dms;yes - set error level 0 00002CA0 EB05 JMP SHORT DD_EN56 2727 DD_IF56: 0 00002CA2 C606[8304]07 mov byte [ExitStatus],ExitWriteProtect ;an017; dms;signal write protect error 2729 ; $endif ;an017; dms; 2730 DD_EN56: 2731 0 00002CA7 F9 stc ;an017; dms;signal fatal error 0 00002CA8 C3 ret ;an017; dms;return to caller 2734 2735 NotReadyError: 0 00002CA9 F706[2006]0004 test word [SwitchMap],Switch_SELECT ;an017; dms; SELECT option? 2737 ; $if z ;an017; dms; no - display messages 0 00002CAF 751E JNZ DD_IF59 0 00002CB1 BA[0000]E8[0000] Message msgCRLF ; ;AC006; 0 00002CB7 BA[0000]E8[0000] Message msgCRLF ; ;AC006; 0 00002CBD 1EBA[0000]8EDAA3 Extended_Message ; ;AC006; 0 00002CC4 [0000]BA[0000]E8 0 00002CCA [0000]1F 2742 ; $else ;an017; dms;yes - set error level 0 00002CCD EB05 JMP SHORT DD_EN59 2744 DD_IF59: 0 00002CCF C606[8304]06 mov byte [ExitStatus],ExitDriveNotReady ;an017; dms;signal drive not ready 2746 ; $endif ;an017; dms; 2747 DD_EN59: 0 00002CD4 F9 stc 0 00002CD5 C3 ret 2750 2751 2752 BadTrackZero: 0 00002CD6 BA[0000]E8[0000] Message msgDiskUnusable ; ;AC000; 0 00002CDC F9 stc 0 00002CDD C3 ret 2756 2757 CheckError endp 2758 2759 ;------------------------------------------------------------------------------- 2760 ; WriteFileSystem: 2761 ; Write the boot sector and FATs out to disk 2762 ; Clear the directory sectors to zero 2763 ; 2764 2765 WriteFileSystem proc near 2766 2767 0 00002CDE E8[0000] call WriteBootSector 0 00002CE1 7301C3 retc 2770 0 00002CE4 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS,ES = DATA ;AN000; 0 00002CEC 58 2772 ; Write out each of the FATs 0 00002CED 1E push ds ;ac005; dms;save ds 0 00002CEE 31C9 xor cx, cx 0 00002CF0 268A0E[3101] mov cl, [es:deviceParameters + DP_BPB + BPB_numberOfFATs] ; ;AC000; 0 00002CF5 268B16[2F01] mov dx, [es:deviceParameters + DP_BPB + BPB_ReservedSectors] ; ;AC000; 0 00002CFA 26A0[8206] mov al, [es:drive] ; ;AC000; 2778 FatSpace equ fatSpace ; NASM port label 0 00002CFE 268B1E[6304] mov bx,word ptr [es:FatSpace+2] ;Get segment of memory Fat ;AC000; 0 00002D03 8EDB mov ds,bx ; ;AN000; 0 00002D05 268B1E[6104] mov bx,word ptr [es:FatSpace] ; ;AN000; 2782 0 00002D0A 89DE mov si,bx ;ac005; dms;set up for add. calc 2784 SEG_ADJ equ seg_adj ; NASM port label 0 00002D0C E8C200 call SEG_ADJ ;ac005; dms;get adjusted seg:off 0 00002D0F 89F3 mov bx,si ;ac005; dms;get new off 2787 assume ds:nothing,es:data ; ;AN000; 2788 2789 ; $do ;ac005; dms;while FATS > 0 2790 DD_DO62: 0 00002D11 83F900 cmp cx,00 ;ac005; dms;FATS remaining? 2792 ; $leave e ;ac005; dms;no 0 00002D14 741E JE DD_EN62 0 00002D16 53 push bx ;ac005; dms;save FAT offset 0 00002D17 1E push ds ;ac005; dms;save FAT segment 0 00002D18 51 push cx ;ac005; dms;save FAT count 0 00002D19 52 push dx ;ac005; dms;reserved FAT sector 2798 WRITE_FAT equ write_fat ; NASM port label 0 00002D1A E87F00 call WRITE_FAT ;ac005; dms;write the FAT 0 00002D1D 5A pop dx ;ac005; dms;get 1st. FAT sector 0 00002D1E 59 pop cx ;ac005; dms;get FAT count 0 00002D1F 1F pop ds ;ac005; dms;restore FAT segment 0 00002D20 5B pop bx ;ac005; dms;restore FAT offset 2804 ; $if c ;ac005; dms;an error occurred 0 00002D21 7309 JNC DD_IF64 0 00002D23 BA[0000]E8[0000] Message msgFATwriteError;ac005; dms;say why failed 0 00002D29 E96FF5 jmp FEXIT ;ac005; dms;exit format 2808 ; $endif ;ac005; dms; 2809 DD_IF64: 0 00002D2C 260316[3701] add dx, [es:deviceParameters + DP_BPB + BPB_SectorsPerFAT] ; ;AC000; 0 00002D31 49 dec cx ;ac005; dms;decrease FAT count 2812 ; $enddo ;ac005; dms; 0 00002D32 EBDD JMP SHORT DD_DO62 2814 DD_EN62: 2815 0 00002D34 1F pop ds ;ac005; dms;restore ds 2817 assume ds:data ;ac005; dms; 2818 2819 2820 ; Clear the directory 2821 2822 ; Now write the initialised directory sectors out to disk 0 00002D35 26A1[3701] mov ax, [es:deviceParameters + DP_BPB + BPB_SectorsPerFAT] ; ;AC000; 0 00002D39 31D2 xor dx,dx 0 00002D3B 53 push bx ;an000; dms;save bx 0 00002D3C 31DB xor bx,bx ;an000; dms;clear bx 2827 BPB_NumberOfFATs equ BPB_NUMBEROFFATS ; NASM port equate 0 00002D3E 268A1E[3101] mov bl,[es:DeviceParameters + DP_BPB + BPB_NumberOfFATs] ;an000; dms;get FAT count 0 00002D43 F7E3 mul bx ;an000; dms;get total FAT sectors 0 00002D45 5B pop bx ;an000; dms;restore bx 2831 0 00002D46 268B16[2F01] mov dx, [es:deviceParameters + DP_BPB + BPB_ReservedSectors] ; ;AC000; 0 00002D4B 01C2 add dx, ax 0 00002D4D 268B0E[7A04] mov cx, [es:sectorsInRootDirectory] ; ;AC000; 2835 WriteDIRloop: 0 00002D52 51 push cx 0 00002D53 52 push dx 0 00002D54 26A0[8206] mov al, [es:drive] ; ;AC000; 0 00002D58 B90100 mov cx, 1 0 00002D5B 26C51E[7C04] lds bx, [es:directorySector] ; ;AC000; 2841 2842 assume ds:nothing,es:data ; ;AN000; 2843 2844 ;Assume dir is alway contined in first 32mb of partition 2845 0 00002D60 26C706[0200]0000 mov word [es:Read_Write_Relative + Start_Sector_High],0 ; ;AC000; 0 00002D67 E8[0000] Call Write_Disk ; ;AN000; 0 00002D6A 7309 jnc Dir_OK ; ;AC000; 0 00002D6C BA[0000]E8[0000] Message msgDirectoryWriteError ; ;AC000; 2850 FExit equ FEXIT ; NASM port label 0 00002D72 E926F5 jmp FExit ; ;AN000; 2852 Dir_OK: ; ;AN000; 0 00002D75 5A pop dx 0 00002D76 83C201 add dx, 1 0 00002D79 59 pop cx 2856 WriteDIRLoop equ WriteDIRloop ; NASM port label 0 00002D7A E2D6 loop WriteDIRLoop 2858 0 00002D7C 50B8[0000]8ED81E07 Set_Data_Segment ;Set DS to DATA segment ;AN000; 0 00002D84 58 2860 ; Ok, we can tell the device driver that we are finished formatting 0 00002D85 C706[2700]0000 mov word [savedDeviceParameters + DP_TrackTableEntries], 0 0 00002D8B C606[0100]04 mov byte [savedDeviceParameters + DP_SpecialFunctions], TRACKLAYOUT_IS_GOOD 0 00002D90 8D16[0100] lea dx, [savedDeviceParameters] 0 00002D94 E8E5FC call SetDeviceParameters 2865 0 00002D97 B40D MOV AH,DISK_RESET ; Flush any directories in 0 00002D99 CD21 INT 21H ; buffers 2868 0 00002D9B C3 return 2870 2871 2872 WriteFileSystem endp 2873 2874 ;========================================================================= 2875 ; WRITE_FAT : This routine writes the logical sector count requested. 2876 ; It will write a maximum of 40h sectors. If more 2877 ; than 40h exists it will continue looping until 2878 ; all sectors have been written. 2879 ; 2880 ; Inputs : AL - Drive letter 2881 ; DS:BX - Segment:offset of transfer address 2882 ; CX - Sector count 2883 ; DX - 1st. sector 2884 ; 2885 ; Outputs : Logical sectors written 2886 ;========================================================================= 2887 2888 procedure write_fat 2889 0 00002D9C 268B0E[3701] mov cx, [es:deviceParameters + DP_BPB + BPB_SectorsPerFAT] ; ;AC000; 2891 2892 ; $do ;an000;while sectors left 2893 DD_DO67: 0 00002DA1 83F900 cmp cx,00h ;an000;any sectors? 2895 ; $leave e ;an000;no 0 00002DA4 742A JE DD_EN67 2897 0 00002DA6 83F940 cmp cx,40h 2899 ; $if a ;an000;yes 0 00002DA9 761C JNA DD_IF69 0 00002DAB 51 push cx ;an000;save cx 0 00002DAC B94000 mov cx,40h 0 00002DAF 50 push ax ;an000;save ax 2904 write_disk equ Write_Disk ; NASM port label 0 00002DB0 E8[0000] call write_disk ;an000;write it 0 00002DB3 58 pop ax ;an000;restore ax 0 00002DB4 59 pop cx ;an000;restore cx 0 00002DB5 7219 jc Write_Exit ;an000;exit if fail 0 00002DB7 BE0080 mov si,8000h 0 00002DBA E81400 call seg_adj ;an000;adjust segment 0 00002DBD 89F3 mov bx,si ;an000;new offset 0 00002DBF 83C240 add dx,40h 0 00002DC2 83E940 sub cx,40h 2914 ; $else ;an000;< 64k 0 00002DC5 EB07 JMP SHORT DD_EN69 2916 DD_IF69: 0 00002DC7 50 push ax ;an000;save ax 0 00002DC8 E8[0000] call write_disk ;an000;write it 0 00002DCB 58 pop ax ;an000;restore ax 0 00002DCC 31C9 xor cx,cx ;an000;set cx to 0 - last read 2921 ; $endif 2922 DD_EN69: 2923 ; $enddo 0 00002DCE EBD1 JMP SHORT DD_DO67 2925 DD_EN67: 2926 2927 Write_Exit: 2928 0 00002DD0 C3 ret 2930 2931 write_fat endp 2932 2933 ;========================================================================= 2934 ; SEG_ADJ : This routine adjusts the segment:offset to prevent 2935 ; address wrap. 2936 ; 2937 ; Inputs : SI - Offset to adjust segment with 2938 ; DS - Segment to be adjusted 2939 ; 2940 ; Outputs : SI - New offset 2941 ; DS - Adjusted segment 2942 ;========================================================================= 2943 2944 procedure seg_adj 2945 0 00002DD1 50 push ax 0 00002DD2 51 push cx 0 00002DD3 52 push dx 0 00002DD4 89F0 mov ax,si ;an000;get offset 0 00002DD6 BB1000 mov bx,0010h ;an000;16 0 00002DD9 31D2 xor dx,dx ;an000;clear dx 0 00002DDB F7F3 div bx ;an000;get para count 2953 ; $if c ;an000;overflow? 0 00002DDD 7303 JNC DD_IF73 0 00002DDF 83D300 adc bx,0 ;an000;pick it up 2956 ; $endif ;an000; 2957 DD_IF73: 0 00002DE2 8CDB mov bx,ds ;an000;get seg 0 00002DE4 01C3 add bx,ax ;an000;adjust for paras 0 00002DE6 8EDB mov ds,bx ;an000;save new seg 0 00002DE8 89D6 mov si,dx ;an000;new offset 0 00002DEA 5A pop dx 0 00002DEB 59 pop cx 0 00002DEC 58 pop ax 0 00002DED C3 ret 2966 2967 seg_adj endp 2968 2969 ;------------------------------------------------------------------------------- 2970 ; format is done... so clean up the disk! 2971 ; 2972 Done proc near 2973 2974 0 00002DEE E8[0000] call OemDone 0 00002DF1 C3 return 2977 2978 Done endp 2979 2980 ;------------------------------------------------------------------------------- 2981 ; CurrentLogicalSector: 2982 ; Get the current logical sector number 2983 ; 2984 ; Input: 2985 ; current track = tracksPerDisk - tracksLeft 2986 ; SectorsPerTrack 2987 ; 2988 ; Output: 2989 ; BX = logical sector number of the first sector in the track we 2990 ; just tried to format 2991 ; 2992 CurrentLogicalSector proc near 2993 0 00002DF2 50 push ax ;an000; dms;save regs 0 00002DF3 53 push bx ;an000; dms; 0 00002DF4 52 push dx ;an000; dms; 2997 0 00002DF5 A1[6C04] mov ax, [tracksPerDisk] 0 00002DF8 2B06[6A04] sub ax, [tracksLeft] 0 00002DFC 31D2 xor dx,dx ;an000; dms;clear dx 0 00002DFE F726[3901] mul word [deviceParameters + DP_BPB + BPB_SectorsPerTrack] 0 00002E02 8916[D506] mov word ptr [Relative_Sector_High],dx ;an000; dms;save high word of sector # 0 00002E06 A3[D306] mov word ptr [Relative_Sector_Low],ax ;an000; dms;save low word of sector # 3004 0 00002E09 5A pop dx ;an000; dms;restore regs 0 00002E0A 5B pop bx ;an000; dms; 0 00002E0B 58 pop ax ;an000; dms; 3008 0 00002E0C C3 return 3010 3011 CurrentLogicalSector endp 3012 3013 ;------------------------------------------------------------------------------- 3014 ; PrintErrorAbort: 3015 ; Print an error message and abort 3016 ; 3017 ; Input: 3018 ; dx - Pointer to error message string 3019 ; 3020 PrintErrorAbort proc near 3021 0 00002E0D 52 push dx 0 00002E0E E89DF5 call crlf 0 00002E11 5A pop dx 0 00002E12 E89CF5 call PrintString 3026 0 00002E15 E983F4 jmp fexit 3028 3029 PrintErrorAbort endp 3030 3031 3032 3033 3034 ;***************************************************************************** 3035 ;Routine name: Multiply_32_Bits 3036 ;***************************************************************************** 3037 ; 3038 ;Description: A real sleazy 32 bit x 16 bit multiply routine. Works by adding 3039 ; the 32 bit number to itself for each power of 2 contained in the 3040 ; 16 bit number. Whenever a bit that is set in the multiplier (CX) 3041 ; gets shifted to the bit 0 spot, it means that that amount has 3042 ; been multiplied so far, and it should be added into the total 3043 ; value. Take the example CX = 12 (1100). Using the associative 3044 ; rule, this is the same as CX = 8+4 (1000 + 0100). The 3045 ; multiply is done on this principle - whenever a bit that is set 3046 ; is shifted down to the bit 0 location, the value in BX:AX is 3047 ; added to the running total in DI:SI. The multiply is continued 3048 ; until CX = 0. The routine will exit with CY set if overflow 3049 ; occurs. 3050 ; 3051 ; 3052 ;Called Procedures: None 3053 ; 3054 ;Change History: Created 7/23/87 MT 3055 ; 3056 ;Input: BX:AX = 32 bit number to be multiplied 3057 ; CX = 16 bit number to be multiplied. (Must be even number) 3058 ; 3059 ;Output: BX:AX = output. 3060 ; CY set if overflow 3061 ; 3062 ;Psuedocode 3063 ;---------- 3064 ; 3065 ; Point at ControlC_Handler routine 3066 ; Set interrupt handler (INT 21h, AX=2523h) 3067 ; ret 3068 ;***************************************************************************** 3069 3070 Public Multiply_32_Bits 3071 Multiply_32_Bits proc ; ;AN000; 3072 0 00002E18 57 push di ; ;AN000; 0 00002E19 56 push si ; ;AN000; 0 00002E1A 31FF xor di,di ;Init result to zero 0 00002E1C 31F6 xor si,si ; 0 00002E1E 83F900 cmp cx,0 ;Multiply by 0? ;AN000; 3078 ; $IF NE ;Keep going if not ;AN000; 0 00002E21 7425 JE DD_IF75 3080 ; $DO ;This works by adding the result;AN000; 3081 DD_DO76: 0 00002E23 F7C10100 test cx,1 ;Need to add in sum of this bit?;AN000; 3083 ; $IF NZ ;Yes ;AN000; 0 00002E27 7406 JZ DD_IF77 0 00002E29 01C6 add si,ax ;Add in the total so far for ;AN000; 0 00002E2B 11DF adc di,bx ; this bit multiplier (CY oflow);AN000; 3087 ; $ELSE ;Don't split multiplier ;AN000; 0 00002E2D EB01 JMP SHORT DD_EN77 3089 DD_IF77: 0 00002E2F F8 clc ;Force non exit ;AN000; 3091 ; $ENDIF ; ;AN000; 3092 DD_EN77: 3093 ; $LEAVE C ;Leave on overflow ;AN000; 0 00002E30 720D JC DD_EN76 0 00002E32 D1E9 shr cx,1 ;See if need to multiply value ;AN000; 0 00002E34 83F900 cmp cx,0 ;by 2 ;AN000; 3097 ; $LEAVE E ;Done if cx shifted down to zero;AN000; 0 00002E37 7406 JE DD_EN76 0 00002E39 01C0 add ax,ax ;Each time cx is shifted, add ;AN000; 0 00002E3B 11DB adc bx,bx ;value to itself (Multiply * 2) ;AN000; 3101 ; $ENDDO C ;CY set on overflow ;AN000; 0 00002E3D 73E4 JNC DD_DO76 3103 DD_EN76: 3104 ; $IF NC ;If no overflow, add in DI:SI ;AN000; 0 00002E3F 7205 JC DD_IF83 0 00002E41 89F0 mov ax,si ; which contains the original ;AN000; 0 00002E43 89FB mov bx,di ; value if odd, 0 if even. This ;AN000; 0 00002E45 F8 clc ;Set no overflow flag ;AN000; 3109 ; $ENDIF ; ;AN000; 3110 DD_IF83: 3111 ; $ELSE ; 0 00002E46 EB04 JMP SHORT DD_EN75 3113 DD_IF75: 0 00002E48 31C0 xor ax,ax ; 0 00002E4A 31DB xor bx,bx ; 3116 ; $ENDIF ;Multiply by 0 ;AN000; 3117 DD_EN75: 0 00002E4C 5E pop si ; ;AN000; 0 00002E4D 5F pop di ; ;AN000; 0 00002E4E C3 ret ; ;AN000; 3121 3122 Multiply_32_Bits endp 3123 3124 3125 ;========================================================================= 3126 ; Divide_32_Bits - This routine will perform 32bit division 3127 ; 3128 ; Inputs : SI:DI - value to be divided 3129 ; CX - divisor 3130 ; 3131 ; Outputs : SI:DI - result 3132 ; CX - remainder 3133 ;========================================================================= 3134 3135 Procedure Divide_32_Bits ;an000; dms; 3136 0 00002E4F 50 push ax ;an000; dms;save regs 0 00002E50 53 push bx ;an000; dms; 0 00002E51 52 push dx ;an000; dms; 3140 0 00002E52 31D2 xor dx,dx ;an000; dms;clear dx 0 00002E54 89F0 mov ax,si ;an000; dms;get high word 0 00002E56 F7F1 div cx ;an000; dms;get high word result 0 00002E58 89C6 mov si,ax ;an000; dms;save high word result 3145 0 00002E5A 89F8 mov ax,di ;an000; dms;get low word 0 00002E5C F7F1 div cx ;an000; dms;get low word result 0 00002E5E 89C7 mov di,ax ;an000; dms;save low word result 0 00002E60 89D1 mov cx,dx ;an000; dms;pick up remainder 3150 0 00002E62 5A pop dx ;an000; dms;restore regs 0 00002E63 5B pop bx ;an000; dms; 0 00002E64 58 pop ax ;an000; dms; 3154 0 00002E65 C3 ret ;an000; dms; 3156 3157 Divide_32_Bits endp ;an000; dms; 3158 3159 3160 3161 3162 ;========================================================================= 3163 ; FAT_INIT: This routine initializes the FAT based on the 3164 ; number of paragraphs. 3165 ; 3166 ; 3167 ; input - fatspace 3168 ; fatspace+2 3169 ; paras_per_fat 3170 ; fat_init_value 3171 ; output - fat space is initialized 3172 ; 3173 ;========================================================================= 3174 Public Fat_Init 3175 Fat_Init proc near 3176 0 00002E66 06 push es 0 00002E67 57 push di 0 00002E68 50 push ax 0 00002E69 53 push bx 0 00002E6A 51 push cx 0 00002E6B 8B3E[6304] mov di, word ptr [FatSpace+2] ;Get segment of Fat space ;AC000; 0 00002E6F 8EC7 mov es,di ; ;AN000; 0 00002E71 8B3E[6104] mov di, word ptr [FatSpace] ; ;AN000; 0 00002E75 8B1E[DA04] mov bx,[Paras_Per_Fat] ;an000;get number of paras 3186 fat_init_value equ Fat_Init_Value ; NASM port label 0 00002E79 A1[DC04] mov ax,[fat_init_value] ;an000; 0 00002E7C 52 push dx ;an000;save bx 0 00002E7D 8CC2 mov dx,es ;an000;grab es into dx 3190 ; $do 3191 DD_DO87: 0 00002E7F 83FB00 cmp bx,0 ;an000;do while bx not = 0 3193 ; $leave e ;an000;exit if 0 0 00002E82 740D JE DD_EN87 0 00002E84 B91000 mov cx,10h ;an000;word move of paragraph 0 00002E87 F3AA rep stosb ;an000;move the data to FAT 0 00002E89 31FF xor di,di ;an000;offset always init to 0 0 00002E8B 42 inc dx ;an000;next paragraph 0 00002E8C 8EC2 mov es,dx ;an000;put next para in es 0 00002E8E 4B dec bx ;an000;loop iteration counter 3201 ; $enddo ;an000; 0 00002E8F EBEE JMP SHORT DD_DO87 3203 DD_EN87: 0 00002E91 5A pop dx ;an000; 0 00002E92 59 pop cx ;an000; 0 00002E93 5B pop bx ;an000; 0 00002E94 58 pop ax ;an000; 0 00002E95 5F pop di ;an000; 0 00002E96 07 pop es ;an000; 3210 0 00002E97 C3 ret ;an000; 3212 3213 Fat_Init endp ;an000; 3214 3215 3216 ;========================================================================= 3217 ; Ctrl_Break_Write : This routine takes the control break request 3218 ; an returns. In essence, it disables the CTRL-BREAK. 3219 ; This routine is used during the writing of the 3220 ; FAT, DIR, and SYSTEM. 3221 ;========================================================================= 3222 3223 Ctrl_Break_Write: ;ac010; dms; 3224 0 00002E98 CF iret ;ac010; dms;return to caller 3226 3227 3228 ;========================================================================= 3229 ; Ctrl_Break_Save : This routine gets the current vector of 3230 ; INT 23h and saves it in CTRL_BREAK_VECTOR. 3231 ; 3232 ; Inputs : none 3233 ; 3234 ; Outputs : CTRL_BREAK_VECTOR - holds address of INT 23h routine 3235 ;========================================================================= 3236 3237 Ctrl_Break_Save proc near ;ac010; dms; 3238 0 00002E99 06 push es ;ac010; dms;save es 0 00002E9A 53 push bx ;ac010; dms;save bx 0 00002E9B 50 push ax ;ac010; dms;save ax 3242 0 00002E9C B82335 mov ax,3523h ;ac010; dms;get CTRL-BREAK 3244 ; interrupt vector 0 00002E9F CD21 int 21h ;ac010; dms; 3246 3247 Ctrl_Break_Vector equ CTRL_BREAK_VECTOR ; NASM port label 0 00002EA1 891E[8506] mov word ptr [Ctrl_Break_Vector],bx ;ac010; dms;get vector offset 0 00002EA5 8C06[8706] mov word ptr [Ctrl_Break_Vector+2],es ;ac010; dms;get vector segment 3250 0 00002EA9 58 pop ax ;ac010; dms;restore ax 0 00002EAA 5B pop bx ;ac010; dms;restore bx 0 00002EAB 07 pop es ;ac010; dms;restore es 3254 0 00002EAC C3 ret ;ac010; dms; 3256 3257 3258 Ctrl_Break_Save endp ;ac010; dms; 3259 3260 3261 ;========================================================================= 3262 ; Set_Ctrl_Break : This routine sets the CTRL-Break vector to one 3263 ; defined by the user. 3264 ; 3265 ; Inputs : none 3266 ; 3267 ; Outputs : CTRL_BREAK_VECTOR - holds address of INT 23h routine 3268 ;========================================================================= 3269 3270 Set_Ctrl_Break proc near ;ac010; dms; 3271 0 00002EAD 1E push ds ;ac010; dms;save ds 0 00002EAE 50 push ax ;ac010; dms;save ax 0 00002EAF 53 push bx ;ac010; dms;save bx 0 00002EB0 52 push dx ;ac010; dms;save dx 3276 0 00002EB1 0E push cs ;ac010; dms;swap cs with ds 0 00002EB2 1F pop ds ;an000; dms;point to code seg 3279 0 00002EB3 BA[280F] mov dx,offset Ctrl_Break_Write ;ac010; dms;get interrupt vec. 0 00002EB6 B82325 mov ax,2523h ;ac010; dms;set CTRL-BREAK 3282 ; interrupt vector 0 00002EB9 CD21 int 21h ;ac010; dms; 3284 0 00002EBB 5A pop dx ;ac010; dms;restore dx 0 00002EBC 5B pop bx ;ac010; dms;restore bx 0 00002EBD 58 pop ax ;ac010; dms;restore ax 0 00002EBE 1F pop ds ;ac010; dms;restore ds 3289 0 00002EBF C3 ret ;ac010; dms; 3291 3292 3293 Set_Ctrl_Break endp ;ac010; dms; 3294 3295 3296 ;========================================================================= 3297 ; Reset_Ctrl_Break : This routine resets the CTRL-Break vector to that 3298 ; originally defined. 3299 ; 3300 ; Inputs : CTRL_BREAK_VECTOR - holds address of INT 23h routine 3301 ; 3302 ; Outputs : none 3303 ;========================================================================= 3304 3305 Reset_Ctrl_Break proc near ;ac010; dms; 3306 0 00002EC0 1E push ds ;ac010; dms;save ds 0 00002EC1 50 push ax ;ac010; dms;save ax 0 00002EC2 53 push bx ;ac010; dms;save bx 0 00002EC3 52 push dx ;ac010; dms;save ds 3311 0 00002EC4 A1[8706] mov ax,word ptr [Ctrl_Break_Vector+2] ;ac010; dms;get seg. of vector 0 00002EC7 8B1E[8506] mov bx,word ptr [Ctrl_Break_Vector] ;ac010; dms;get off. of vector 0 00002ECB 8ED8 mov ds,ax ;ac010; dms;get seg. 0 00002ECD 89DA mov dx,bx ;ac010; dms;get off. 0 00002ECF B82325 mov ax,2523h ;ac010; dms;set CTRL-BREAK 3317 ; interrupt vector 0 00002ED2 CD21 int 21h ;ac010; dms; 3319 0 00002ED4 5A pop dx ;ac010; dms;restore dx 0 00002ED5 5B pop bx ;ac010; dms;restore bx 0 00002ED6 58 pop ax ;ac010; dms;restore ax 0 00002ED7 1F pop ds ;ac010; dms;restore ds 3324 0 00002ED8 C3 ret ;ac010; dms; 3326 3327 3328 Reset_Ctrl_Break endp ;ac010; dms; 3329 3330 ;========================================================================= 3331 ; Get_Command_Path : This routine finds the path where 3332 ; COMMAND.COM resides based on the 3333 ; environmental vector. Once the 3334 ; path is found it is copied to 3335 ; CommandFile. 3336 ; 3337 ; Inputs : Exec_Block.Segment_Env - Segment of environmental vector 3338 ; Comspec_ID - "COMSPEC=" 3339 ; 3340 ; Outputs : CommandFile - Holds path to COMMAND.COM 3341 ;========================================================================= 3342 3343 Procedure Get_Command_Path ;an011; dms; 3344 0 00002ED9 1E push ds ;an011; dms;save ds 0 00002EDA 06 push es ;an011; dms;save es 3347 0 00002EDB 50B8[0000]8ED81E07 Set_Data_Segment ;an011; dms; DS,ES = Data 0 00002EE3 58 0 00002EE4 E84F00 call Get_PSP_Parms ;an011; dms; gets PSP info. 0 00002EE7 FC cld ;an011; dms; clear direction 0 00002EE8 26A1[9606] mov ax,[es:Environ_Segment] ;an011; dms; get seg. of 3352 ; environ. vector 0 00002EEC 8ED8 mov ds,ax ;an011; dms; put it in DS 3354 assume ds:nothing ;an011; dms; 0 00002EEE 31F6 xor si,si ;an011; dms; clear si 0 00002EF0 89F3 mov bx,si ;an011; dms; save si 0 00002EF2 BF[8D06] mov di,offset Comspec_ID ;an011; dms; point to target 0 00002EF5 B97F00 mov cx,127 ;an011; dms; loop 127 times 3359 ; $do ;an011; dms; while cx not 0 3360 DD_DO90: 3361 ; and target not found 0 00002EF8 83F900 cmp cx,00h ;an011; dms; end of env.? 3363 ; $leave e ;an011; dms; yes 0 00002EFB 7436 JE DD_EN90 3365 0 00002EFD 51 push cx ;an011; dms; save cx 0 00002EFE B90800 mov cx,0008h ;an011; dms; loop 8 times 0 00002F01 F3A6 repe cmpsb ;an011; dms; "COMSPEC=" ? 0 00002F03 59 pop cx ;an011; dms; restore cx 3370 ; $if z ;an011; dms; yes 0 00002F04 751D JNZ DD_IF92 0 00002F06 57 push di ;an011; dms; save di 0 00002F07 BF[1405] mov di,offset CommandFile ;an011; dms 0 00002F0A AC lodsb ;an011; dms; priming read 0 00002F0B 88C2 mov dl,al ;an011; dms; prepare for capitalization 0 00002F0D E83802 call Cap_Char ;an011; dms; capitalize character in DL 0 00002F10 263A16[1405] cmp dl,[es:CommandFile] ;an011; dms;COMSPEC same as default drive? 3378 ; $if e ;an000; dms; yes 0 00002F15 7508 JNE DD_IF93 3380 ; $do ;an011; dms; while AL not = 0 3381 DD_DO94: 0 00002F17 3C00 cmp al,00h ;an011; dms; at end? 3383 ; $leave e ;an011; dms; yes 0 00002F19 7404 JE DD_EN94 0 00002F1B AA stosb ;an011; dms; save it 0 00002F1C AC lodsb ;an011; dms; get character 3387 ; $enddo 0 00002F1D EBF8 JMP SHORT DD_DO94 3389 DD_EN94: 3390 ; $endif ;an011; dms; 3391 DD_IF93: 0 00002F1F 5F pop di ;an011; dms; restore di 0 00002F20 B9FFFF mov cx,0ffffh ;an011; dms; flag target found 3394 ; $endif ;an011; dms; 3395 DD_IF92: 3396 0 00002F23 83F9FF cmp cx,0ffffh ;an011; dms; target found? 3398 ; $leave e ;an011; dms; yes 0 00002F26 740B JE DD_EN90 3400 0 00002F28 BF[8D06] mov di,offset Comspec_ID ;an011; dms; point to target 0 00002F2B 89DE mov si,bx ;an011; dms; restore si 0 00002F2D 46 inc si ;an011; dms; point to next byte 0 00002F2E 89F3 mov bx,si ;an011; dms; save si 3405 0 00002F30 49 dec cx ;an011; dms; decrease counter 3407 ; $enddo ;an011; dms; 0 00002F31 EBC5 JMP SHORT DD_DO90 3409 DD_EN90: 3410 0 00002F33 07 pop es ;an011; dms; restore es 0 00002F34 1F pop ds ;an011; dms; restore ds 3413 0 00002F35 C3 ret ;an011; dms; 3415 3416 Get_Command_Path endp ;an011; dms; 3417 3418 3419 ; 3420 ;**************************************************************************** 3421 ; Get_PSP_Parms 3422 ;**************************************************************************** 3423 ; 3424 ; 3425 ; 3426 ; 3427 3428 Procedure Get_PSP_Parms ; ;AC000; 3429 0 00002F36 50B8[0000]8ED81E07 Set_Data_Segment 0 00002F3E 58 0 00002F3F A1[0000] mov ax,[PSP_Segment] ;Get segment of PSP ;AN000; 0 00002F42 8ED8 mov ds,ax ; " " " " ;AN000; 3433 ; ; 3434 assume ds:nothing 3435 ;Setup segment of Environment string, get from PSP ; ; 3436 0 00002F44 A12C00 mov ax,[PSP_Environ] ; ; ; 0 00002F47 26A3[9606] mov [es:Environ_Segment],ax ; ; ; 0 00002F4B 50B8[0000]8ED81E07 Set_Data_Segment 0 00002F53 58 0 00002F54 C3 ret ; ; ; 3441 3442 3443 Get_PSP_Parms endp ; ;AN000; 3444 3445 3446 ;========================================================================= 3447 ; Command_Root : This routine sets up CommandFile so that the 3448 ; COMMAND.COM will be written to the root. 3449 ; It does this by copying at offset 3 of CommandFile 3450 ; the literal COMMAND.COM. This effectively 3451 ; overrides the original path, but maintains the 3452 ; drive letter that is to be written to. 3453 ; 3454 ; Inputs : CommandFile - Holds full path to default COMMAND.COM 3455 ; Outputs : CommandFile - Holds modified path to new COMMAND.COM 3456 ; on target drive. 3457 ;========================================================================= 3458 3459 Procedure Command_Root ;an011; dms; 3460 0 00002F55 1E push ds ;an011; dms; save ds 0 00002F56 06 push es ;an011; dms; save es 0 00002F57 57 push di ;an011; dms; save di 0 00002F58 56 push si ;an011; dms; save si 0 00002F59 51 push cx ;an011; dms; save cx 0 00002F5A 50B8[0000]8ED81E07 Set_Data_Segment ;an011; 0 00002F62 58 3467 0 00002F63 BF[1705] mov di,offset CommandFile+3 ;an011; dms; point to path 3469 ; past drive spec 0 00002F66 BE[A205] mov si,offset Command_Com ;an011; dms; holds the literal 3471 ; COMMAND.COM 0 00002F69 B90C00 mov cx,000ch ;an011; dms; len. of literal 0 00002F6C F3A4 rep movsb ;an011; dms; move it 3474 0 00002F6E 59 pop cx ;an011; dms; restore cx 0 00002F6F 5E pop si ;an011; dms; restore si 0 00002F70 5F pop di ;an011; dms; restore di 0 00002F71 07 pop es ;an011; dms; restore es 0 00002F72 1F pop ds ;an011; dms; restore ds 3480 0 00002F73 C3 ret ;an011; dms; 3482 3483 Command_Root endp ;an011; dms; 3484 3485 3486 ;========================================================================= 3487 ; Set_BPB_Info : When we have a FAT count of 0, we must calculate 3488 ; certain parts of the BPB. The following code 3489 ; will do just that. 3490 ; 3491 ; Inputs : DeviceParameters 3492 ; 3493 ; Outputs : BPB information 3494 ;========================================================================= 3495 3496 Procedure Set_BPB_Info ;an012; dms;calc new BPB 3497 0 00002F74 50B8[0000]8ED81E07 Set_Data_Segment ;an012; dms;set up addressibility 0 00002F7C 58 3499 BPB_NumberOfFats equ BPB_NUMBEROFFATS ; NASM port equate 0 00002F7D 803E[3101]00 cmp byte [DeviceParameters + DP_BPB + BPB_NumberOfFats],00h ;an012; dms;see if we have 0 FATS specified 3501 ; $if e ;an012; dms;yes, 0 FATS specified 0 00002F82 7532 JNE DD_IF101 0 00002F84 E83000 call Scan_Disk_Table ;an012; dms;access disk table 0 00002F87 8A5C08 mov bl,byte ptr [si+8] ;an012; dms;get FAT type 0 00002F8A 8B4C04 mov cx,word ptr [si+4] ;an012; dms;get sectors/cluster 0 00002F8D 8B5406 mov dx,word ptr [si+6] ;an012; dms;number of entries for the root DIR 3507 0 00002F90 8916[3201] mov [DeviceParameters + DP_BPB + BPB_RootEntries],dx ;an012; dms;save root entries 0 00002F94 882E[2E01] mov [DeviceParameters + DP_BPB + BPB_SectorsPerCluster],ch ;an012; dms;save sectors/cluster 0 00002F98 C706[2C01]0002 mov word [DeviceParameters + DP_BPB + BPB_BytesPerSector],0200h ;an012; dms;save bytes/sector 0 00002F9E C706[2F01]0100 mov word [DeviceParameters + DP_BPB + BPB_ReservedSectors],0001h ;an012; dms;save reserved sectors 0 00002FA4 C606[3101]02 mov byte [DeviceParameters + DP_BPB + BPB_NumberOfFats],02h ;an012; dms;FAT count 3513 3514 FBIG equ Fbig ; NASM port equate 0 00002FA9 80FBFF cmp bl,FBIG ;an012; dms;Big FAT? 3516 ; $if e ;an012; dms;yes 0 00002FAC 7505 JNE DD_IF102 0 00002FAE E83000 call Calc_Big_FAT ;an012; dms;calc big FAT info 3519 ; $else ;an012; dms; 0 00002FB1 EB03 JMP SHORT DD_EN102 3521 DD_IF102: 0 00002FB3 E86D00 call Calc_Small_FAT ;an012; dms;calc small FAT info 3523 ; $endif ;an012; dms; 3524 DD_EN102: 3525 ; $endif ;an012; dms; 3526 DD_IF101: 3527 0 00002FB6 C3 ret ;an012; dms; 3529 3530 Set_BPB_Info endp ;an012; dms; 3531 3532 3533 3534 ;========================================================================= 3535 ; Scan_Disk_Table : Scans the table containing information on 3536 ; the disk's attributes. When it finds the 3537 ; applicable data, it returns a pointer in 3538 ; DS:SI for reference by the calling proc. 3539 ; 3540 ; Inputs : DiskTable - Contains data about disk types 3541 ; 3542 ; Outputs : DS:SI - Points to applicable disk data 3543 ;========================================================================= 3544 3545 Procedure Scan_Disk_Table ;an012; dms; 3546 0 00002FB7 833E[3401]00 cmp word [DeviceParameters + DP_BPB + BPB_TotalSectors],00h ;an012; dms;small disk? 3548 ; $if ne ;an012; dms;yes 0 00002FBC 7408 JE DD_IF106 0 00002FBE BA0000 mov dx,00h ;an012; dms;set high to 0 0 00002FC1 A1[3401] mov ax,word ptr [DeviceParameters + DP_BPB + BPB_TotalSectors] ;an012; dms;get sector count 3552 ; $else ;an012; dms; 0 00002FC4 EB07 JMP SHORT DD_EN106 3554 DD_IF106: 0 00002FC6 8B16[4301] mov dx,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +2] ;an012; dms;get high count 0 00002FCA A1[4101] mov ax,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +0] ;an012; dms;get low count 3557 ; $endif ;an012; dms; 3558 DD_EN106: 3559 0 00002FCD BE[9806] mov si,offset DiskTable ;an012; dms;point to disk data 3561 Scan: 3562 0 00002FD0 3B14 cmp dx,word ptr [si] ;an012; dms;below? 0 00002FD2 720C jb Scan_Disk_Table_Exit ;an012; dms;yes, exit 0 00002FD4 7705 ja Scan_Next ;an012; dms;no, continue 0 00002FD6 3B4402 cmp ax,word ptr [si+2] ;an012; dms;below or equal? 0 00002FD9 7605 jbe Scan_Disk_Table_Exit ;an012; dms;yes, exit 3568 3569 Scan_Next: 3570 0 00002FDB 83C60A add si,5*2 ;an012; dms;adjust pointer 0 00002FDE EBF0 jmp Scan ;an012; dms;continue scan 3573 3574 Scan_Disk_Table_Exit: 3575 0 00002FE0 C3 ret ;an012; dms; 3577 3578 Scan_Disk_Table endp ;an012; dms; 3579 3580 3581 3582 ;========================================================================= 3583 ; Calc_Big_FAT : Calculates the sectors per FAT for a 16 bit FAT. 3584 ; 3585 ; Inputs : DeviceParameters.DP_BPB.BPB_BigTotalSectors or 3586 ; DeviceParameters.DP_BPB.BPB_TotalSectors 3587 ; 3588 ; Outputs : DeviceParameters.DP_BPB.BPB_SectorsPerFat 3589 ;========================================================================= 3590 3591 Procedure Calc_Big_FAT ;an012; dms; 3592 0 00002FE1 833E[3401]00 cmp word [DeviceParameters + DP_BPB + BPB_TotalSectors],00h ;an012; dms;small disk? 3594 ; $if ne ;an012; dms;yes 0 00002FE6 7408 JE DD_IF109 0 00002FE8 BA0000 mov dx,00h ;an012; dms;set high to 0 0 00002FEB A1[3401] mov ax,word ptr [DeviceParameters + DP_BPB + BPB_TotalSectors] ;an012; dms;get sector count 3598 ; $else ;an012; dms; 0 00002FEE EB07 JMP SHORT DD_EN109 3600 DD_IF109: 0 00002FF0 8B16[4301] mov dx,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +2] ;an012; dms;get high count 0 00002FF4 A1[4101] mov ax,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +0] ;an012; dms;get low count 3603 ; $endif ;an012; dms; 3604 DD_EN109: 3605 0 00002FF7 B104 mov cl,04h ;an012; dms;16 DIR entries per sector 0 00002FF9 52 push dx ;an012; dms;save total sectors (high) 0 00002FFA 8B16[3201] mov dx,[DeviceParameters + DP_BPB + BPB_RootEntries] ;an012; dms;get root entry count 0 00002FFE D3EA shr dx,cl ;an012; dms;divide by 16 0 00003000 29D0 sub ax,dx ;an012; dms; 0 00003002 5A pop dx ;an012; dms;restore dx 0 00003003 83DA00 sbb dx,0 ;an012; dms; 0 00003006 83E801 sub ax,1 ;an012; dms;AX = T - R - D 0 00003009 83DA00 sbb dx,0 ;an012; dms; 0 0000300C B302 mov bl,02h ;an012; dms; 0 0000300E 8A3E[2E01] mov bh,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an012; dms;get sectors per cluster 0 00003012 01D8 add ax,bx ;an012; dms;AX = T-R-D+256*SPC+2 0 00003014 83D200 adc dx,0 ;an012; dms; 0 00003017 83E801 sub ax,1 ;an012; dms;AX = T-R-D+256*SPC+1 0 0000301A 83DA00 sbb dx,0 ;an012; dms; 0 0000301D F7F3 div bx ;an012; dms; sec/FAT = CEIL((TOTAL-DIR-RES)/ 3622 ; (256*SECPERCLUS+2) 0 0000301F A3[3701] mov word ptr [DeviceParameters + DP_BPB + BPB_SectorsPerFAT],ax ;an012; dms;Sectors/cluster 0 00003022 C3 ret ;an012; dms; 3625 3626 Calc_Big_FAT endp ;an012; dms; 3627 3628 3629 ;========================================================================= 3630 ; Calc_Small_FAT: Calculates the sectors per FAT for a 12 bit FAT. 3631 ; 3632 ; Inputs : DeviceParameters.DP_BPB.BPB_BigTotalSectors or 3633 ; DeviceParameters.DP_BPB.BPB_TotalSectors 3634 ; 3635 ; Outputs : DeviceParameters.DP_BPB.BPB_SectorsPerFat 3636 ;========================================================================= 3637 3638 Procedure Calc_Small_FAT ;an012; dms; 3639 0 00003023 833E[3401]00 cmp word [DeviceParameters + DP_BPB + BPB_TotalSectors],00h ;an012; dms;small disk? 3641 ; $if ne ;an012; dms;yes 0 00003028 7408 JE DD_IF112 0 0000302A BA0000 mov dx,00h ;an012; dms;set high to 0 0 0000302D A1[3401] mov ax,word ptr [DeviceParameters + DP_BPB + BPB_TotalSectors] ;an012; dms;get sector count 3645 ; $else ;an012; dms; 0 00003030 EB07 JMP SHORT DD_EN112 3647 DD_IF112: 0 00003032 8B16[4301] mov dx,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +2] ;an012; dms;get high count 0 00003036 A1[4101] mov ax,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +0] ;an012; dms;get low count 3650 ; $endif ;an012; dms; 3651 DD_EN112: 3652 0 00003039 31DB xor bx,bx ;an012; dms;clear bx 0 0000303B 8A1E[2E01] mov bl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an012; dms;get sectors/cluster 0 0000303F F7F3 div bx ;an012; dms; 3656 ; now multiply by 3/2 0 00003041 BB0300 mov bx,3 ;an012; dms; 0 00003044 F7E3 mul bx ;an012; dms;div by log 2 of sectors/cluster 0 00003046 BB0200 mov bx,2 ;an012; dms; 0 00003049 F7F3 div bx ;an012; dms; 0 0000304B 31D2 xor dx,dx ;an012; dms; 3662 ; now divide by 512 0 0000304D BB0002 mov bx,512 ;an012; dms; 0 00003050 F7F3 div bx ;an012; dms; 0 00003052 40 inc ax ;an012; dms; 3666 ; dx:ax contains number of FAT sectors necessary 0 00003053 A3[3701] mov [DeviceParameters + DP_BPB + BPB_SectorsPerFAT],ax ;an012; dms;save sectors/FAT 0 00003056 C3 ret ;an012; dms; 3669 3670 Calc_Small_FAT endp ;an012; dms; 3671 3672 ;========================================================================= 3673 ; Get_Bad_Sector_Hard : Determine the bad sector. 3674 ; 3675 ; Inputs : Head of failing track 3676 ; Cylinder of failing track 3677 ; Relative_Sector_Low - 1st. sector in track 3678 ; Relative_Sector_High 3679 ; 3680 ; Cluster_Boundary_Adj_Factor - The number of sectors 3681 ; that are to be read 3682 ; at one time. 3683 ; Cluster_Boundary_SPT_Count - Used by Calc_Cluster_Boundary 3684 ; to track how many sectors 3685 ; have been read. 3686 ; Cluster_Boundary_Flag - True (Use cluster buffer) 3687 ; - False (Use internal buffer) 3688 ; Cluster_Boundary_Buffer_Seg - Segment of buffer 3689 ; 3690 ; Outputs : Marked cluster as bad 3691 ;========================================================================= 3692 3693 Procedure Get_Bad_Sector_Hard ;an000; dms; 3694 0 00003057 51 push cx ;an000; dms;save cx 0 00003058 B90100 mov cx,0001h ;an000; dms;set counter to start at 1 0 0000305B C706[CE06]0000 mov word [Cluster_Boundary_SPT_Count],00h ;an000; dms;clear sector counter 0 00003061 C706[CC06]0100 mov word [Cluster_Boundary_Adj_Factor],01h ;an000; dms;default value 3699 ; $do ;an000; dms;while sectors left 3700 DD_DO115: 0 00003067 3B0E[3901] cmp cx,[DeviceParameters + DP_BPB + BPB_SectorsPerTrack] ;an000; dms;at end? 3702 ; $leave a ;an000; dms;yes,exit 0 0000306B 775F JA DD_EN115 0 0000306D 51 push cx ;an000; dms;save cx 3705 0 0000306E 803E[D006]FF cmp byte [Cluster_Boundary_Flag],True ;an000; dms;full buffer there? 3706 ****************** warning: byte data exceeds bounds [-w+number-overflow] 3707 ; $if e ;an000; dms;yes 0 00003073 7511 JNE DD_IF117 0 00003075 E83401 call Calc_Cluster_Boundary ;an000; dms;see if on boundary 0 00003078 A1[D106] mov ax,[Cluster_Boundary_Buffer_Seg] 3711 TRWP_TransferAddress equ TRWP_TRANSFERADDRESS ; NASM port equate 0 0000307B C706[5B02]0000 mov word ptr [RWPacket + TRWP_TransferAddress + 0],0 ;an000; dms;point to transfer area 0 00003081 A3[5D02] mov word ptr [RWPacket + TRWP_TransferAddress + 2],ax ;an000; dms; 3714 ; $else ;an000; dms;default to internal buffer 0 00003084 EB0A JMP SHORT DD_EN117 3716 DD_IF117: 0 00003086 C706[5B02][5F02] mov word ptr [RWPacket + TRWP_TransferAddress + 0],offset RW_TRF_Area ;an000; dms;point to transfer area 0 0000308C 8C1E[5D02] mov word ptr [RWPacket + TRWP_TransferAddress + 2],DS ;an000; dms; 3719 ; $endif ;an000; dms; 3720 DD_EN117: 3721 0 00003090 E83B00 call Verify_Structure_Set_Up ;an019; dms; set up verify vars 3723 0 00003093 B80D44 mov ax,(IOCTL << 8) | GENERIC_IOCTL ;an000; dms; 0 00003096 31DB xor bx,bx ;an000; dms;clear bx 0 00003098 8A1E[8206] mov bl,[drive] ;an000; dms;get drive 0 0000309C FEC3 inc bl ;an000; dms;adjust it 0 0000309E B96108 mov cx,(IOC_DC << 8) | READ_TRACK ;an000; dms;read track 0 000030A1 8D16[5202] lea dx,[RWPacket] ;an000; dms;point to parms 0 000030A5 CD21 int 21h ;an000; dms; 3731 0 000030A7 59 pop cx ;an000; dms;restore cx 3733 0 000030A8 51 push cx ;an000; dms;save cx 3735 3736 ; $if c ;an000; dms;an error occurred 0 000030A9 7306 JNC DD_IF120 0 000030AB E86C00 call Calc_Cluster_Position ;an000; dms;determine which cluster 0 000030AE E83EF0 call BadClus ;an000; dms;mark the cluster as bad 3740 ; $endif ;an000; dms; 3741 DD_IF120: 3742 0 000030B1 59 pop cx ;an000; dms;restore cx 3744 0 000030B2 030E[CC06] add cx,[Cluster_Boundary_Adj_Factor] ;an000; dms;adjust loop counter 0 000030B6 A1[CC06] mov ax,[Cluster_Boundary_Adj_Factor] ;an000; dms;get adjustment factor 0 000030B9 31D2 xor dx,dx ;an000; dms;clear dx 0 000030BB 0306[D306] add ax,[Relative_Sector_Low] ;an000; dms;add in low word 0 000030BF 1316[D506] adc dx,[Relative_Sector_High] ;an000; dms;pick up carry in high word 0 000030C3 A3[D306] mov [Relative_Sector_Low],ax ;an000; dms;save low word 0 000030C6 8916[D506] mov [Relative_Sector_High],dx ;an000; dms;save high word 3752 3753 3754 ; $enddo ;an000; dms; 0 000030CA EB9B JMP SHORT DD_DO115 3756 DD_EN115: 3757 0 000030CC 59 pop cx ;an000; dms;restore cx 3759 0 000030CD C3 ret ;an000; dms; 3761 3762 Get_Bad_Sector_Hard endp ;an000; dms; 3763 3764 3765 ;========================================================================= 3766 ; Verify_Structure_Set_Up : Set up the fields for the Read IOCTL 3767 ; to verify the sectors in a failing 3768 ; track. Also, it displays the 3769 ; message notifying the user of the 3770 ; sectors it is verifying. 3771 ;========================================================================= 3772 3773 Procedure Verify_Structure_Set_Up ;an019; dms;set up verify structure 3774 3775 TRWP_SpecialFunctions equ TRWP_SPECIALFUNCTIONS ; NASM port equate 0 000030CE C606[5202]00 mov byte [RWPacket + TRWP_SpecialFunctions],00h ;an000; dms;reset special functions 3777 0 000030D3 A1[4C02] mov ax,[FormatPacket + FP_Head] ;an000; dms;get current head 3779 TRWP_Head equ TRWP_HEAD ; NASM port equate 0 000030D6 A3[5302] mov [RWPacket + TRWP_Head],ax ;an000; dms;get current head 3781 0 000030D9 A1[4E02] mov ax,[FormatPacket + FP_Cylinder] ;an000; dms;get current cylinder 3783 TRWP_Cylinder equ TRWP_CYLINDER ; NASM port equate 0 000030DC A3[5502] mov [RWPacket + TRWP_Cylinder],ax ;an000; dms;get current cylinder 3785 0 000030DF 49 dec cx ;an000; dms;make sector 0 based 3787 TRWP_FirstSector equ TRWP_FIRSTSECTOR ; NASM port equate 0 000030E0 890E[5702] mov [RWPacket + TRWP_FirstSector],cx ;an000; dms;get sector to read 3789 0 000030E4 A1[CC06] mov ax,[Cluster_Boundary_Adj_Factor] ;an000; dms;get # of sectors to read 3791 TRWP_SectorsToReadWrite equ TRWP_SECTORSTOREADWRITE ; NASM port equate 0 000030E7 A3[5902] mov [RWPacket + TRWP_SectorsToReadWrite],ax ;an000; dms;read only # sector(s) 3793 0 000030EA E82D00 call Calc_Cluster_Position ;an019; dms;determine cluster number 0 000030ED 8916[DF06] mov word ptr [Msg_Allocation_Unit_Val + +2],dx ;an019; dms;save high word of cluster 0 000030F1 A3[DD06] mov word ptr [Msg_Allocation_Unit_Val + +0],ax ;an019; dms;save low word of cluster 0 000030F4 BA[0000]E8[0000] message MsgVerify 3798 0 000030FA C3 ret 3800 3801 Verify_Structure_Set_Up endp ;an019; dms; 3802 3803 3804 ;========================================================================= 3805 ; Get_Bad_Sector_Floppy : This routine marks an entire track as bad 3806 ; since it is a floppy disk. 3807 ; 3808 ; Inputs : Relative_Sector_Low - first sector 3809 ; 3810 ; Outputs : FAT marked with bad sectors 3811 ;========================================================================= 3812 3813 Procedure Get_Bad_Sector_Floppy ;an000; dms; 3814 0 000030FB 53 push bx ;an000; dms;save regs 0 000030FC 51 push cx ;an000; dms; 3817 0 000030FD 8B0E[3901] mov cx,[DeviceParameters + DP_BPB + BPB_SectorsPerTrack] ;an000; dms;get sectors/track 3819 ; $do ;an000; dms;while sectors left 3820 DD_DO123: 0 00003101 83F900 cmp cx,00 ;an000; dms;at end 3822 ; $leave e ;an000; dms;yes 0 00003104 7411 JE DD_EN123 0 00003106 53 push bx ;an000; dms;save bx we destroy it 0 00003107 51 push cx ;an000; dms;save cx we destroy it 0 00003108 E80F00 call Calc_Cluster_Position ;an000; dms;get cluster position 0 0000310B E8E1EF call BadClus ;an000; dms;mark it as bad 0 0000310E 59 pop cx ;an000; dms;restore regs 0 0000310F 5B pop bx ;an000; dms; 0 00003110 49 dec cx ;an000; dms;decrease loop counter 0 00003111 FF06[D306] inc word [Relative_Sector_Low] ;an000; dms;next sector 3832 ; $enddo ;an000; dms; 0 00003115 EBEA JMP SHORT DD_DO123 3834 DD_EN123: 3835 0 00003117 59 pop cx ;an000; dms;restore regs 0 00003118 5B pop bx ;an000; dms; 3838 0 00003119 C3 ret ;an000; dms; 3840 3841 Get_Bad_Sector_Floppy endp ;an000; dms; 3842 3843 3844 ;========================================================================= 3845 ; Calc_Cluster_Position : This routine calculates which cluster the 3846 ; failing sector falls in. 3847 ; 3848 ; Inputs : Relative_Sector_High - high word of sector position 3849 ; Relative_Sector_Low - low word of sector position 3850 ; 3851 ; Outputs : DX:AX - Cluster position 3852 ;========================================================================= 3853 Procedure Calc_Cluster_Position ;an000; dms; 3854 0 0000311A 51 push cx ;an000; dms;save regs 0 0000311B 57 push di ;an000; dms; 0 0000311C 56 push si ;an000; dms; 3858 0 0000311D 31D2 xor dx,dx ;an000; dms;clear high word 0 0000311F 8B16[D506] mov dx,word ptr [Relative_Sector_High] ;an000; dms;get the high sector word 0 00003123 A1[D306] mov ax,word ptr [Relative_Sector_Low] ;an000; dms;get the low sector word 3862 StartSector equ startSector ; NASM port label 0 00003126 2B06[5F04] sub ax,[StartSector] ;an000; dms;get relative sector # 0 0000312A 83DA00 sbb dx,0 ;an000; dms;pick up borrow 3865 0 0000312D 89D6 mov si,dx ;an000; dms;get high word 0 0000312F 89C7 mov di,ax ;an000; dms;get low word 0 00003131 31C9 xor cx,cx ;an000; dms;clear cx 0 00003133 8A0E[2E01] mov cl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an000; dms;get sectors/cluster 0 00003137 E815FD call Divide_32_Bits ;an000; dms;32 bit division 3871 0 0000313A 89F2 mov dx,si ;an000; dms;get high word of result 0 0000313C 89F8 mov ax,di ;an000; dms;get low word of result 0 0000313E 83C002 add ax,2 ;an000; dms;adjust for cluster bias 0 00003141 83D200 adc dx,0 ;an000; dms;pick up carry 3876 0 00003144 5E pop si ;an000; dms;restore regs 0 00003145 5F pop di ;an000; dms; 0 00003146 59 pop cx ;an000; dms; 3880 0 00003147 C3 ret ;an000 ;dms; 3882 3883 Calc_Cluster_Position endp ;an000; dms; 3884 3885 3886 ;========================================================================= 3887 ; Cap_Char : This routine will capitalize the character passed in 3888 ; DL. 3889 ; 3890 ; Inputs : DL - Character to be capitalized 3891 ; 3892 ; Outputs : DL - Capitalized character 3893 ;========================================================================= 3894 3895 Procedure Cap_Char ;an011; dms; 3896 0 00003148 50 push ax ;an011; dms;save ax 0 00003149 B82065 mov ax,6520h ;an011; dms;capitalize character 0 0000314C CD21 int 21h ;an011; dms; 0 0000314E 58 pop ax ;an011; dms;restore ax 0 0000314F C3 ret ;an011; dms; 3902 3903 Cap_Char endp ;an011; dms; 3904 3905 ;========================================================================= 3906 ; Set_Disk_Access_On_Off: This routine will either turn access on or off 3907 ; to a disk depending on the contents of the 3908 ; buffer passed in DX. 3909 ; 3910 ; Inputs : DX - pointer to buffer 3911 ; 3912 ;========================================================================= 3913 3914 Procedure Set_Disk_Access_On_Off ;an014; dms; 3915 0 00003150 50 push ax ;an014; dms;save regs 0 00003151 53 push bx ;an014; dms; 0 00003152 51 push cx ;an014; dms; 0 00003153 52 push dx ;an014; dms; 3920 0 00003154 31DB xor bx,bx ;an014; dms;clear bx 3922 Drive equ drive ; NASM port label 0 00003156 8A1E[8206] mov bl,[Drive] ;an014; dms;get driver number 0 0000315A FEC3 inc bl ;an014; dms;make it 1 based 0 0000315C E8D0F1 call IsRemovable ;an014; dms;see if removable media 3926 ; $if c ;an014; dms;not removable 0 0000315F 7310 JNC DD_IF126 3928 Generic_IOCTL equ GENERIC_IOCTL ; NASM port equate 0 00003161 B80D44 mov ax,(IOCTL << 8) | Generic_IOCTL ;an014; dms;generic ioctl 0 00003164 31DB xor bx,bx ;an014; dms;clear bx 0 00003166 8A1E[8206] mov bl,[Drive] ;an014; dms;get drive letter 0 0000316A FEC3 inc bl ;an014; dms;make it 1 based 3933 Set_Access_Flag equ SET_ACCESS_FLAG ; NASM port equate 0 0000316C B94708 mov cx,(RAWIO << 8) | Set_Access_Flag ;an014; dms;allow access to disk 0 0000316F CD21 int 21h ;an014; dms; 3936 ; $endif ;an014; dms; 3937 DD_IF126: 3938 0 00003171 5A pop dx ;an014; dms;restore regs 0 00003172 59 pop cx ;an014; dms; 0 00003173 5B pop bx ;an014; dms; 0 00003174 58 pop ax ;an014; dms; 3943 0 00003175 C3 ret ;an014; dms; 3945 3946 Set_Disk_Access_On_Off endp ;an014; dms; 3947 3948 3949 ;========================================================================= 3950 ; Get_Disk_Access : This routine will determine the access state of 3951 ; the disk. 3952 ; 3953 ; Inputs : DX - pointer to buffer 3954 ; Outputs : Disk_Access.DAC_Access_Flag - 0ffh signals access allowed 3955 ; to the disk previously. 3956 ; 3957 ;========================================================================= 3958 3959 Procedure Get_Disk_Access ;an014; dms; 3960 0 00003176 50 push ax ;an014; dms;save regs 0 00003177 53 push bx ;an014; dms; 0 00003178 51 push cx ;an014; dms; 0 00003179 52 push dx ;an014; dms; 3965 0 0000317A 31DB xor bx,bx ;an014; dms;clear bx 0 0000317C 8A1E[8206] mov bl,[Drive] ;an014; dms;get driver number 0 00003180 FEC3 inc bl ;an014; dms;make it 1 based 0 00003182 E8AAF1 call IsRemovable ;an014; dms;see if removable media 3970 ; $if c ;an014; dms;not removable 0 00003185 7320 JNC DD_IF128 0 00003187 B80D44 mov ax,(IOCTL << 8) | Generic_IOCTL ;an014; dms;generic ioctl 0 0000318A 31DB xor bx,bx ;an014; dms;clear bx 0 0000318C 8A1E[8206] mov bl,[Drive] ;an014; dms;get drive letter 0 00003190 FEC3 inc bl ;an014; dms;make it 1 based 3976 Get_Access_Flag equ GET_ACCESS_FLAG ; NASM port equate 0 00003192 B96708 mov cx,(RAWIO << 8) | Get_Access_Flag ;an014; dms;determine disk access 0 00003195 8D16[4902] lea dx,[Disk_Access] ;an014; dms;point to parm list 0 00003199 CD21 int 21h ;an014; dms; 0 0000319B 803E[4A02]01 cmp byte [Disk_Access + DAC_Access_Flag],01h ;an014; dms;access is currently allowed? 3981 ; $if e ;an014; dms;yes 0 000031A0 7505 JNE DD_IF129 0 000031A2 C606[4A02]FF mov byte [Disk_Access + DAC_Access_Flag],0ffh ;an014; dms;signal access is currently allowed 3984 ; $endif ;an014; dms; 3985 DD_IF129: 3986 ; $endif ;an014; dms; 3987 DD_IF128: 3988 0 000031A7 5A pop dx ;an014; dms;restore regs 0 000031A8 59 pop cx ;an014; dms; 0 000031A9 5B pop bx ;an014; dms; 0 000031AA 58 pop ax ;an014; dms; 3993 0 000031AB C3 ret ;an014; dms; 3995 3996 Get_Disk_Access endp ;an014; dms; 3997 3998 ;========================================================================= 3999 ; Calc_Cluster_Boundary : This routine will determine where, within a 4000 ; cluster, a sector resides. 4001 ; 4002 ; Inputs : Relative_Sector_Low - Sector 4003 ; Relative_Sector_High 4004 ; 4005 ; Outputs : Cluster_Boundary_Adj_Factor - The number of sectors 4006 ; remaining in the cluster. 4007 ; Cluster_Boundary_SPT_Count - The count of sectors 4008 ; having been accessed for 4009 ; a track. 4010 ;========================================================================= 4011 4012 Procedure Calc_Cluster_Boundary ;an000; dms; 4013 0 000031AC 50 push ax ;an000; dms;save regs 0 000031AD 53 push bx ;an000; dms; 0 000031AE 51 push cx ;an000; dms; 0 000031AF 52 push dx ;an000; dms; 0 000031B0 56 push si ;an000; dms; 0 000031B1 57 push di ;an000; dms; 4020 0 000031B2 31D2 xor dx,dx ;an000; dms;clear high word 0 000031B4 8B16[D506] mov dx,word ptr [Relative_Sector_High] ;an000; dms;get the high sector word 0 000031B8 A1[D306] mov ax,word ptr [Relative_Sector_Low] ;an000; dms;get the low sector word 0 000031BB 2B06[5F04] sub ax,[StartSector] ;an000; dms;get relative sector # 0 000031BF 83DA00 sbb dx,0 ;an000; dms;pick up borrow 4026 0 000031C2 89D6 mov si,dx ;an000; dms;get high word 0 000031C4 89C7 mov di,ax ;an000; dms;get low word 0 000031C6 31C9 xor cx,cx ;an000; dms;clear cx 0 000031C8 8A0E[2E01] mov cl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an000; dms;get sectors/cluster 0 000031CC E880FC call Divide_32_Bits ;an000; dms;32 bit division 4032 0 000031CF 09C9 or cx,cx ;an000; dms;see if remainder exists 4034 ; $if nz ;an000; dms;remainder exists 0 000031D1 740E JZ DD_IF132 0 000031D3 31DB xor bx,bx ;an021; dms; 0 000031D5 8A1E[2E01] mov bl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an021; dms;get sectors/cluster 0 000031D9 29CB sub bx,cx ;an021; dms;get number of sectors to read 0 000031DB 891E[CC06] mov [Cluster_Boundary_Adj_Factor],bx ;ac021; dms;remainder = sector count 4040 ; $else ;an000; dms;no remainder 0 000031DF EB0A JMP SHORT DD_EN132 4042 DD_IF132: 0 000031E1 31DB xor bx,bx ;an000; dms;clear bx 0 000031E3 8A1E[2E01] mov bl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an000; dms;get sectors/cluster 0 000031E7 891E[CC06] mov [Cluster_Boundary_Adj_Factor],bx ;an000; dms;get sectors/cluster 4046 ; $endif ;an000; dms; 4047 DD_EN132: 4048 0 000031EB A1[CE06] mov ax,[Cluster_Boundary_SPT_Count] ;an000; dms;get current sector count 0 000031EE 31D2 xor dx,dx ;an000; dms;clear high word 0 000031F0 0306[CC06] add ax,[Cluster_Boundary_Adj_Factor] ;an000; dms;get next sector count 0 000031F4 3B06[3901] cmp ax,[DeviceParameters + DP_BPB + BPB_SectorsPerTrack] ;an000; dms;exceeded sectors/track? 4053 ; $if a ;an000; dms;yes 0 000031F8 760A JNA DD_IF135 0 000031FA A1[3901] mov ax,[DeviceParameters + DP_BPB + BPB_SectorsPerTrack] ;an000; dms;only use difference 0 000031FD 2B06[CE06] sub ax,[Cluster_Boundary_SPT_Count] ;an000; dms;get next sector count 0 00003201 A3[CC06] mov [Cluster_Boundary_Adj_Factor],ax ;an000; dms; 4058 ; $endif ;an000; dms; 4059 DD_IF135: 4060 0 00003204 A1[CE06] mov ax,[Cluster_Boundary_SPT_Count] ;an000; dms;get sector count 0 00003207 31D2 xor dx,dx ;an000; dms;clear high word 0 00003209 0306[CC06] add ax,[Cluster_Boundary_Adj_Factor] ;an000; dms;get new sector count 0 0000320D A3[CE06] mov [Cluster_Boundary_SPT_Count],ax ;an000; dms;save it 4065 0 00003210 5F pop di ;an000; dms;restore regs 0 00003211 5E pop si ;an000; dms; 0 00003212 5A pop dx ;an000; dms;restore regs 0 00003213 59 pop cx ;an000; dms; 0 00003214 5B pop bx ;an000; dms; 0 00003215 58 pop ax ;an000; dms; 4072 0 00003216 C3 ret ;an000; dms; 4074 4075 Calc_Cluster_Boundary endp ;an000; dms; 4076 4077 ;========================================================================= 4078 ; Cluster_Buffer_Allocate : This routine will allocate a buffer 4079 ; based on a cluster's size. If enough 4080 ; space does not exist, a cluster will 4081 ; be redefined to a smaller size for 4082 ; purposes of sector retries. 4083 ; 4084 ; Inputs : DeviceParameters.DP_BPB.BPB_BytesPerSector 4085 ; DeviceParameters.DP_BPB.BPB_SectorsPerCluster 4086 ; 4087 ; Outputs : Cluster_Boundary_Flag - True (space available) 4088 ; False(not enough space) 4089 ; Cluster_Boundary_Buffer_Seg - Pointer to buffer 4090 ;========================================================================= 4091 4092 Procedure Cluster_Buffer_Allocate ;an000; dms; 4093 0 00003217 50 push ax ;an000; dms;save regs 0 00003218 53 push bx ;an000; dms; 0 00003219 51 push cx ;an000; dms; 0 0000321A 52 push dx ;an000; dms; 4098 0 0000321B B80048 mov ax,(Alloc << 8) ;an000; dms;allocate memory 0 0000321E BBFFFF mov bx,0ffffh ;an000; dms;get available memory 0 00003221 CD21 int 21h ;an000; dms; 4102 0 00003223 A1[2C01] mov ax,[DeviceParameters + DP_BPB + BPB_BytesPerSector] ;an000; dms;get bytes/sector 0 00003226 31D2 xor dx,dx ;an000; dms;clear high word 0 00003228 31C9 xor cx,cx ;an000; dms;clear cx 0 0000322A 8A0E[2E01] mov cl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an000; dms;get sector count 0 0000322E F7E1 mul cx ;an000; dms;get total byte count 0 00003230 B104 mov cl,4 ;an000; dms;set up shift count 0 00003232 D3E8 shr ax,cl ;an000; dms;divide by 16 0 00003234 40 inc ax ;an000; dms;round up 4111 0 00003235 39C3 cmp bx,ax ;an000; dms;enough room 4113 ; $if a ;an000; dms;yes 0 00003237 7611 JNA DD_IF137 0 00003239 89C3 mov bx,ax ;an000; dms;allocate needed memory 0 0000323B B80048 mov ax,(Alloc << 8) ;an000; dms; 0 0000323E CD21 int 21h ;an000; dms; 0 00003240 A3[D106] mov [Cluster_Boundary_Buffer_Seg],ax ;an000; dms;save pointer to buffer 0 00003243 C606[D006]FF mov byte [Cluster_Boundary_Flag],True ;an000; dms;signal space available 4119 ****************** warning: byte data exceeds bounds [-w+number-overflow] 4120 ; $else ;an000; dms;not enough room 0 00003248 EB05 JMP SHORT DD_EN137 4122 DD_IF137: 0 0000324A C606[D006]00 mov byte [Cluster_Boundary_Flag],False ;an000; dms;signal not enough space 4124 ; $endif ;an000; dms; 4125 DD_EN137: 4126 0 0000324F 5A pop dx ;an000; dms;restore regs 0 00003250 59 pop cx ;an000; dms; 0 00003251 5B pop bx ;an000; dms; 0 00003252 58 pop ax ;an000; dms; 4131 0 00003253 C3 ret ;an000; dms; 4133 4134 Cluster_Buffer_Allocate endp ;an000; dms; 4135 4136 4137 ;========================================================================= 4138 ; Set_CDS_Off - This routine disallows access to a 4139 ; disk if a format fails on a non-FAT 4140 ; formatted disk. 4141 ; 4142 ;========================================================================= 4143 4144 Procedure Set_CDS_Off ;an000; dms; 4145 0 00003254 50 push ax ;an000; dms;save regs 0 00003255 52 push dx ;an000; dms; 4148 0 00003256 B8085F mov ax,5f08h ;an000; dms;reset CDS 0 00003259 8A16[8206] mov dl,[Drive] ;an000; dms;drive to reset 0 0000325D CD21 int 21h ;an000; dms; 4152 0 0000325F 5A pop dx ;an000; dms;restore regs 0 00003260 58 pop ax ;an000; dms; 4155 0 00003261 C3 ret ;an000; dms; 4157 4158 Set_CDS_Off endp ;an000; dms; 4159 4160 4161 ;========================================================================= 4162 ; Format_Access_Wrap_Up - This routine determines whether or 4163 ; not access should be allowed to the 4164 ; disk based on the exit status of 4165 ; format. 4166 ; 4167 ;========================================================================= 4168 4169 Procedure Format_Access_Wrap_Up ;an000; dms; 4170 0 00003262 803E[4A02]FF cmp byte [Disk_Access + DAC_Access_Flag],0ffh ;an015; dms;access prev. allowed? 4172 ; $if ne ;an015; dms;no 0 00003267 7421 JE DD_IF140 0 00003269 803E[8304]00 cmp byte [ExitStatus],ExitOK ;an015; dms;good exit? 4175 ; $if ne ;an015; dms;no 0 0000326E 740E JE DD_IF141 0 00003270 8D16[4902] lea dx,[Disk_Access] ;an015; dms;point to parm block 0 00003274 C606[4A02]00 mov byte [Disk_Access + DAC_Access_Flag],00h ;an015; dms;signal no disk access 0 00003279 E8D4FE call Set_Disk_Access_On_Off ;an015; dms;don't allow disk access 4180 ; $else ;an015; dms;bad exit 0 0000327C EB0C JMP SHORT DD_EN141 4182 DD_IF141: 0 0000327E 8D16[4902] lea dx,[Disk_Access] ;an015; dms;point to parm block 0 00003282 C606[4A02]01 mov byte [Disk_Access + DAC_Access_Flag],01h ;an015; dms;signal disk access 0 00003287 E8C6FE call Set_Disk_Access_On_Off ;an015; dms;allow disk access 4186 ; $endif ;an015; dms; 4187 DD_EN141: 4188 ; $endif ;an015; dms; 4189 DD_IF140: 4190 4191 No equ NO ; NASM port equate 0 0000328A 803E[D706]00 cmp byte [FAT_Flag],No ;an012; dms;non-FAT format? 4193 ; $if e ;an012; dms;yes 0 0000328F 750A JNE DD_IF145 0 00003291 803E[8304]00 cmp byte [ExitStatus],ExitOK ;an012; dms;good exit? 4196 ; $if ne ;an012; dms;no 0 00003296 7403 JE DD_IF146 0 00003298 E8B9FF call Set_CDS_Off ;an012; dms;disallow FAT access 4199 ; $endif ;an012; dms; 4200 DD_IF146: 4201 ; $endif ;an012; dms; 4202 DD_IF145: 4203 0 0000329B C3 ret ;an000; dms; 4205 4206 Format_Access_Wrap_Up endp ;an000; dms; 4207 4208 ;========================================================================= 4209 ; BadClus_Address_Adjust - This routine adjusts the segment and 4210 ; offset to provide addressibility into 4211 ; the FAT table. 4212 ; 4213 ; Inputs : bx - high word to adjust segment for 4214 ; ax - low word to adjust segment for 4215 ; cx - segment to be adjusted 4216 ; 4217 ; Outputs : cx - new segment value 4218 ; ax - new offset value 4219 ;========================================================================= 4220 4221 Procedure BadClus_Address_Adjust ;an000; dms; 4222 0 0000329C 53 push bx ;an000; save regs 0 0000329D 52 push dx ;an000; 0 0000329E 57 push di ;an000; 0 0000329F 56 push si ;an000; 4227 0 000032A0 89CA mov dx,cx ;an000; save segment value 0 000032A2 89DE mov si,bx ;an000; get high word for divide 0 000032A4 89C7 mov di,ax ;an000; get low word for divide 0 000032A6 31C9 xor cx,cx ;an000; clear cx 0 000032A8 B110 mov cl,Paragraph_Size ;an000; divide by 16 0 000032AA E8A2FB call Divide_32_Bits ;an000; perform division 4234 0 000032AD 01FA add dx,di ;an000; adjust segment for result 0 000032AF 89C8 mov ax,cx ;an000; pick up the remainder 0 000032B1 89D1 mov cx,dx ;an000; pass back new segment 4238 0 000032B3 5E pop si ;an000; restore regs 0 000032B4 5F pop di ;an000; 0 000032B5 5A pop dx ;an000; 0 000032B6 5B pop bx ;an000; 4243 0 000032B7 C3 ret ;an000; dms; 4245 4246 BadClus_Address_Adjust endp ;an000; dms; 4247 4248 4249 4250 ;========================================================================= 4251 ; NextTrack : This routine determines the next track to be 4252 ; formatted. 4253 ; 4254 ; Inputs : TracksLeft - # of tracks remaining 4255 ; Tracks_To_Format - # of tracks to format in 1 call 4256 ; FP_Head - disk head 4257 ; FP_Cylinder - disk cylinder 4258 ; 4259 ; Outputs : TracksLeft - # of tracks remaining 4260 ; FP_Head - disk head 4261 ; FP_Cylinder - disk cylinder 4262 ; CY - no tracks left to format 4263 ; NC - tracks left to format 4264 ;========================================================================= 4265 4266 Procedure NextTrack ;an015; dms; 4267 4268 4269 TracksLeft equ tracksLeft ; NASM port label 0 000032B8 833E[6A04]00 cmp word [TracksLeft],00 ;an015; dms;end of format? 4271 ; $if e ;an015; dms;yes 0 000032BD 7508 JNE DD_IF149 0 000032BF F9 stc ;an015; dms;signal end of format 0 000032C0 C606[DC06]FF mov byte [Format_End],True 4274 ****************** warning: byte data exceeds bounds [-w+number-overflow] 4275 ; $else 0 000032C5 EB2B JMP SHORT DD_EN149 4277 DD_IF149: 0 000032C7 8B0E[D806] mov cx,[Tracks_To_Format] ;an015; dms;get max track count for call 4279 ; $do ;an015; dms;while tracks remain 4280 DD_DO151: 0 000032CB 833E[6A04]00 cmp word [TracksLeft],00 ;an015; dms;end of format? 4282 ; $leave e ;an015; dms;yes 0 000032D0 741F JE DD_EN151 0 000032D2 83F900 cmp cx,00 ;an015; dms;end of head/cyl. adjustment? 4285 ; $leave e ;an015; dms;yes 0 000032D5 741A JE DD_EN151 0 000032D7 FF06[4C02] inc word [FormatPacket + FP_Head] ;an015; dms;next head 0 000032DB A1[4C02] mov ax,[FormatPacket + FP_Head] ;an015; dms;get head for comp 0 000032DE 3B06[3B01] cmp ax,[DeviceParameters + DP_BPB + BPB_Heads] ;an015; dms;exceeded head count? 4290 ; $if e ;an015; dms;yes 0 000032E2 750A JNE DD_IF154 0 000032E4 C706[4C02]0000 mov word [FormatPacket + FP_Head],00 ;an015; dms;reinit. head 0 000032EA FF06[4E02] inc word [FormatPacket + FP_Cylinder] ;an015; dms;next cylinder 4294 ; $endif ;an015; dms; 4295 DD_IF154: 4296 0 000032EE 49 dec cx ;an015; dms;decrease counter 4298 ; $enddo ;an015; dms; 0 000032EF EBDA JMP SHORT DD_DO151 4300 DD_EN151: 4301 0 000032F1 F8 clc ;an015; dms;clear CY 4303 ; $endif ;an015; dms; 4304 DD_EN149: 4305 0 000032F2 C3 ret ;an015; dms; 4307 4308 NextTrack endp ;an015; dms; 4309 4310 ;========================================================================= 4311 ; Determine_Format_Type : This routine determines the type of format 4312 ; that is to occur based on the media type. 4313 ; 4314 ; Inputs : Dev_HardDisk - Media type (harddisk) 4315 ; Multi_Track_Format - EQU 02h 4316 ; Single_Track_Format - EQU 00h 4317 ; 4318 ; Outputs : FP_SpecialFunctions - Set appropriately for single 4319 ; or multi track format 4320 ;========================================================================= 4321 4322 Procedure Determine_Format_Type ;an015; dms; 4323 4324 Dev_HardDisk equ DEV_HARDDISK ; NASM port equate 0 000032F3 803E[2601]05 cmp byte [DeviceParameters + DP_DeviceType],Dev_HardDisk ;an015; dms;harddisk? 4326 ; $if e ;an015; dms;yes 0 000032F8 7507 JNE DD_IF158 0 000032FA C606[4B02]02 mov byte [FormatPacket + FP_SpecialFunctions],Multi_Track_Format ;an015; dms;set for multi track format 4329 ; $else ;an015; dms; 0 000032FF EB05 JMP SHORT DD_EN158 4331 DD_IF158: 0 00003301 C606[4B02]00 mov byte [FormatPacket + FP_SpecialFunctions],Single_Track_Format ;an015; dms;set for single track format 4333 ; $endif ;an015; dms; 4334 DD_EN158: 0 00003306 C3 ret ;an015; dms; 4336 4337 Determine_Format_Type endp ;an015; dms; 4338 4339 4340 ;========================================================================= 4341 ; FormatTrack : This routine performs multi track or single 4342 ; track formatting based on the state of the 4343 ; SpecialFunctions byte. 4344 ; 4345 ; Inputs : Tracks_To_Format - # of tracks to format in 1 call 4346 ; FormatPacket - Parms for IOCTL call 4347 ; 4348 ; Outputs : NC - formatted track(s) 4349 ; CY - error in format 4350 ; AX - extended error on CY 4351 ;========================================================================= 4352 4353 Procedure FormatTrack ;an015; dms; 4354 0 00003307 B80D44 mov ax,(IOCTL << 8) | Generic_IOCTL ;an015; dms;Generic IOCTL 0 0000330A 8A1E[8206] mov bl,[drive] ;an015; dms;get drive number 0 0000330E FEC3 inc bl ;an015; dms;make it 1 based 4358 RawIO equ RAWIO ; NASM port equate 4359 Format_Track equ FORMAT_TRACK ; NASM port equate 0 00003310 B94208 mov cx,(RawIO << 8) | Format_Track ;an015; dms;Format track(s) 0 00003313 8B16[D806] mov dx,[Tracks_To_Format] ;an015; dms;get track count 4362 FP_TrackCount equ FP_TRACKCOUNT ; NASM port equate 0 00003317 8916[5002] mov [FormatPacket + FP_TrackCount],dx ;an015; dms;put count in parms list 0 0000331B 8D16[4B02] lea dx,[FormatPacket] ;an015; dms;ptr to parms 0 0000331F CD21 int 21h ;an015; dms; 4366 4367 ; $if c ;an015; dms;error? 0 00003321 7307 JNC DD_IF161 0 00003323 B459 mov ah,59h ;an015; dms;get extended error 0 00003325 31DB xor bx,bx ;an015; dms;clear bx 0 00003327 CD21 int 21h ;an015; dms; 0 00003329 F9 stc ;an015; dms;flag an error 4373 ; $endif ;an015; dms; 4374 DD_IF161: 4375 0 0000332A C3 ret ;an015; dms; 4377 4378 FormatTrack endp ;an015; dms; 4379 4380 4381 ;========================================================================= 4382 ; Determine_Track_Count : This routine determines the number of 4383 ; tracks to be formatted, based on whether 4384 ; or not we have a hard disk. If we have 4385 ; a hard disk we can use multi-track 4386 ; format/verify, otherwise we use the 4387 ; single track format/verify. 4388 ; 4389 ; Inputs : Device_Type - Media type 4390 ; 4391 ; Outputs : Tracks_To_Format - Max. number of tracks 4392 ; to be formatted in one 4393 ; call 4394 ;========================================================================= 4395 4396 Procedure Determine_Track_Count ;an015; dms; 4397 0 0000332B 803E[2601]05 cmp byte [DeviceParameters + DP_DeviceType],Dev_HardDisk ;an015; dms;harddisk? 4399 ; $if e ;an015; dms;yes 0 00003330 7505 JNE DD_IF163 0 00003332 E80900 call Calc_Track_Count ;an015; dms;calc Tracks_To_Format 4402 ; $else ;an015; dms;removable media 0 00003335 EB06 JMP SHORT DD_EN163 4404 DD_IF163: 0 00003337 C706[D806]0100 mov word [Tracks_To_Format],0001h ;an015; dms;default to 1 track 4406 ; $endif ;an015; dms; 4407 DD_EN163: 4408 0 0000333D C3 ret ;an015; dms; 4410 4411 Determine_Track_Count endp ;an015;dms; 4412 4413 4414 ;========================================================================= 4415 ; Calc_Track_Count : This routine determines if we have enough tracks 4416 ; remaining to use the max. number of tracks 4417 ; in the FormatTrack call. If the tracks remaining 4418 ; to be formatted is less that the max. number of 4419 ; allowable tracks for the call, the max. number 4420 ; of allowable tracks is set to the remaining track 4421 ; count. 4422 ; 4423 ; Inputs : Track_Count - Max. number of allowable tracks to be 4424 ; formatted in 1 FormatTrack call. 4425 ; TracksLeft - Track count of remaining tracks to be 4426 ; formatted. 4427 ; 4428 ; Outputs : Tracks_To_Format - Count of the tracks to be formatted 4429 ; in the next FormatTrack call. 4430 ; 4431 ; 4432 ;========================================================================= 4433 4434 Procedure Calc_Track_Count ;an015; dms; 4435 0 0000333E 50 push ax ;an015; dms;save regs 0 0000333F A1[DA06] mov ax,[Track_Count] ;an015; dms;max bytes to format 0 00003342 3B06[6A04] cmp ax,[TracksLeft] ;an015; dms;too many tracks? 4439 ; $if a ;an015; dms;yes 0 00003346 7603 JNA DD_IF166 0 00003348 A1[6A04] mov ax,[TracksLeft] ;an015; dms;format remaining tracks 4442 ; $endif ;an015; dms; 4443 DD_IF166: 0 0000334B A3[D806] mov [Tracks_To_Format],ax ;an015; dms;save track count 4445 0 0000334E 58 pop ax ;an015; dms; 4447 0 0000334F C3 ret ;an015; dms; 4449 4450 Calc_Track_Count endp ;an015; dms; 4451 4452 ;========================================================================= 4453 ; Calc_Max_Tracks_To_Format : This routine determines the maximum 4454 ; number of tracks to format at 1 time. 4455 ; 4456 ; Inputs : DeviceParameters - SectorsPerTrack 4457 ; BytesPerSector 4458 ; 4459 ; Outputs : Track_Count - Max. # of tracks to format in 1 call 4460 ; to FormatTrack 4461 ;========================================================================= 4462 4463 Procedure Calc_Max_Tracks_To_Format 4464 0 00003350 50 push ax ;an015; dms;save regs 0 00003351 53 push bx ;an015; dms; 0 00003352 52 push dx ;an015; dms; 4468 0 00003353 A1[3901] mov ax,[DeviceParameters + DP_BPB + BPB_SectorsPerTrack] ;an015; dms;get sectors per track 0 00003356 8B1E[2C01] mov bx,[DeviceParameters + DP_BPB + BPB_BytesPerSector] ;an015; dms;get byte count 0 0000335A 31D2 xor dx,dx ;an015; dms;clear dx 0 0000335C F7E3 mul bx ;an015; dms;get total byte count 0 0000335E 89C3 mov bx,ax ;an015; dms;put count in bx 0 00003360 B8FFFF mov ax,Max_Format_Size ;an015; dms;max bytes to format 0 00003363 F7F3 div bx ;an015; dms;get track count 0 00003365 A3[DA06] mov [Track_Count],ax 4477 0 00003368 5A pop dx ;an015; dms; 0 00003369 5B pop bx ;an015; dms; 0 0000336A 58 pop ax ;an015; dms; 4481 0 0000336B C3 ret 4483 4484 Calc_Max_Tracks_To_Format endp 4485 4486 4487 4488 4489 4490 ;========================================================================= 4491 ; Format_Track_Retry : This routine performs the retry logic for 4492 ; the format multi-track. It will retry each track 4493 ; until the failing track is encountered through 4494 ; a CY condition. 4495 ; 4496 ; Inputs : none 4497 ; 4498 ; Outputs : CY - indicates either a failing track or end of format 4499 ; 4500 ; 4501 ;========================================================================= 4502 4503 Procedure Format_Track_Retry 4504 0 0000336C F8 clc ;an022; dms; clear existing CY 0 0000336D C706[D806]0100 mov word [Tracks_To_Format],1 ;an015; dms; only format 1 track 4507 ; $do ;an015; dms; while we have good tracks 4508 DD_DO168: 4509 ; $leave c ;an015; dms; exit on bad track 0 00003373 7210 JC DD_EN168 0 00003375 E88FFF call FormatTrack ;an015; dms; format the track 4512 ; $if nc ;an015; dms;error? 0 00003378 7209 JC DD_IF170 0 0000337A E895F8 call DisplayCurrentTrack ;an022; dms;adjust percent counter 0 0000337D E84200 call Adj_Track_Count 0 00003380 E835FF call NextTrack ;an015; dms;calc next track 4517 ; $endif ;an015; dms; 4518 DD_IF170: 4519 ; $enddo ;an015; dms; 0 00003383 EBEE JMP SHORT DD_DO168 4521 DD_EN168: 4522 0 00003385 C3 ret ;an015; dms; 4524 4525 Format_Track_Retry endp ;an015; dms; 4526 4527 ;========================================================================= 4528 ; Format_Loop : This routine provides the main template 4529 ; for the formatting of a disk. A disk 4530 ; will be formatted as long as there are 4531 ; tracks remaining to be formatted. 4532 ; This routine can be exited on a carry 4533 ; condition; i.e., bad track, last track, etc. 4534 ; 4535 ; Inputs : none 4536 ; 4537 ; Outputs : CY - Set on exit from this routine 4538 ; AX - Possible error condition code 4539 ;========================================================================= 4540 4541 Procedure Format_Loop ;an015; dms; 4542 0 00003386 F8 clc ;an015; dms;initialize to NC 4544 ; $do ;an015; dms;while NC 4545 DD_DO173: 4546 ; $leave c ;an015; dms;exit on CY 0 00003387 7238 JC DD_EN173 0 00003389 E873F8 call Calc_Current_Head_Cyl ;an015; dms;head and cylinder calc. 0 0000338C E864FF call Determine_Format_Type ;an015; dms;floppy/hard media? 0 0000338F E899FF call Determine_Track_Count ;an015; dms;how many tracks? 0 00003392 E872FF call FormatTrack ;an015; dms;format track(s) 4552 ; $if c ;an015; dms;formattrack failed 0 00003395 730F JNC DD_IF175 0 00003397 9C pushf ;an015; dms;save flags 0 00003398 803E[2601]05 cmp byte [DeviceParameters + DP_DeviceType],Dev_HardDisk ;an015; dms;harddisk? 4556 ; $if e ;an015; dms;yes 0 0000339D 7506 JNE DD_IF176 0 0000339F 9D popf ;an015; dms;restore flags 0 000033A0 E8C9FF call Format_Track_Retry ;an015; dms;find failing track 4560 ; $else ;an015; dms; 0 000033A3 EB01 JMP SHORT DD_EN176 4562 DD_IF176: 0 000033A5 9D popf ;an015; dms;restore flags 4564 ; $endif ;an015; dms; 4565 DD_EN176: 4566 ; $endif ;an015; dms; 4567 DD_IF175: 4568 4569 ; $if c ;an015; dms;format error? 0 000033A6 730C JNC DD_IF180 0 000033A8 9C pushf ;an015; dms;yes - save flags 0 000033A9 50 push ax ;an015; dms;save return code 0 000033AA E8B2F8 call CheckRealErrors ;an015; dms;check error type 4574 ; $if nc ;an015; dms;if non-fatal 0 000033AD 7203 JC DD_IF181 0 000033AF E860F8 call DisplayCurrentTrack ;an015; dms;display % formatted 4577 ; $endif ;an015; dms; 4578 DD_IF181: 0 000033B2 58 pop ax ;an015; dms;restore regs 0 000033B3 9D popf ;an015; dms; 4581 ; $endif ;an015; dms; 4582 DD_IF180: 4583 4584 ; $leave c ;an015; dms;exit on CY 0 000033B4 720B JC DD_EN173 4586 0 000033B6 E859F8 call DisplayCurrentTrack ;an015; dms;tell how much formatted 0 000033B9 E80600 call Adj_Track_Count ;an015; dms;decrease track counter 0 000033BC E8F9FE call NextTrack ;an015; dms;adjust head and cylinder 4590 ; $enddo ;an015; dms; 0 000033BF EBC6 JMP SHORT DD_DO173 4592 DD_EN173: 0 000033C1 C3 ret ;an015; dms; 4594 4595 Format_Loop endp ;an015; dms; 4596 4597 ;========================================================================= 4598 ; Adj_Track_Count : This routine adjusts the track count by the 4599 ; number of tracks that have been formatted 4600 ; in one FormatTrack call. 4601 ; 4602 ; Inputs : TracksLeft - # of tracks remaining to be formatted 4603 ; Tracks_To_Format - Tracks formatted in 1 call 4604 ; 4605 ; Outputs : TracksLeft - # of tracks remaining to be formatted 4606 ;========================================================================= 4607 4608 Procedure Adj_Track_Count ;an015; dms; 4609 0 000033C2 50 push ax ;an015; dms; save regs 0 000033C3 A1[6A04] mov ax,[TracksLeft] ;an015; dms; get tracks remaining 0 000033C6 2B06[D806] sub ax,[Tracks_To_Format] ;an015; dms; subtract amount formatted 0 000033CA A3[6A04] mov [TracksLeft],ax ;an015; dms; save new tracks remaining value 0 000033CD 58 pop ax ;an015; dms; restore regs 0 000033CE C3 ret ;an015; dms; 4616 4617 Adj_Track_Count endp ;an015; dms; 4618 4619 ;========================================================================= 4620 ; Prompt_User_For_Disk : This routine prompts the user for the 4621 ; disk to be formatted. An appropriate 4622 ; message is chosen based on the type 4623 ; of switch entered. If the /SELECT 4624 ; switch is entered, the disk prompt is 4625 ; issued through the INT 2fh services 4626 ; provided by SELECT. 4627 ; 4628 ; Inputs : Switchmap - Switches chosen for format 4629 ; 4630 ; Outputs : Message printed as appropriate. 4631 ;========================================================================= 4632 4633 Procedure Prompt_User_For_Disk ;an016;dms; 4634 0 000033CF 50 push ax ;an016;dms;save ax 4636 SWITCH_Backup equ SWITCH_BACKUP ; NASM port equate 0 000033D0 F706[2006]040C test word [switchmap], (SWITCH_Backup | SWITCH_Select | SWITCH_AUTOTEST) ;Suppress prompt? ;AC000; 4638 ; $IF Z ; ;AC000; 0 000033D6 7503 JNZ DD_IF186 0 000033D8 E877EF call DSKPRM ; prompt user for disk 4641 ; $ENDIF ; ;AC000; 4642 DD_IF186: 4643 0 000033DB F706[2006]0004 test word [switchmap], (Switch_Select) ;an016;dms;/SELECT requested? 4645 ; $if nz ;an016;dms;yes 0 000033E1 740B JZ DD_IF188 0 000033E3 A0[8206] mov al, [drive] ;an016;dms;get drive to access for format 0 000033E6 E8[0000] call AccessDisk ;an016;dms;access the disk 0 000033E9 B8C1AD mov ax,Select_Disk_Message ;an016;dms;display disk prompt 0 000033EC CD2F int 2fh ;an016;dms; through INT 2fh services 4651 ; $endif ;an016;dms; 4652 DD_IF188: 0 000033EE 58 pop ax ;an016;dms;restore ax 4654 0 000033EF C3 ret ;an016;dms; 4656 4657 Prompt_User_For_Disk endp ;an016;dms; 4658 4659 4660 ; (no prior section) ; code ends 4661 END START 4662 === Trace listing source: forproc.lst 1 ; SCCSID = @(#)forproc.asm 1.2 85/07/25 2 [list -] 134 <1> 10 %include "syscall.mac" 1 <1> ; SCCSID = @(#)syscall.asm 1.1 85/04/10 2 <1> ;BREAK 3 <1> ;SUBTTL system call definitions 4 <1> ;PAGE 5 <1> 6 <1> Abort EQU 0 ; 0 0 7 <1> Std_Con_Input EQU 1 ; 1 1 8 <1> Std_Con_Output EQU 2 ; 2 2 9 <1> Std_Aux_Input EQU 3 ; 3 3 10 <1> Std_Aux_Output EQU 4 ; 4 4 11 <1> Std_Printer_Output EQU 5 ; 5 5 12 <1> Raw_Con_IO EQU 6 ; 6 6 13 <1> Raw_Con_Input EQU 7 ; 7 7 14 <1> Std_Con_Input_No_Echo EQU 8 ; 8 8 15 <1> Std_Con_String_Output EQU 9 ; 9 9 16 <1> Std_Con_String_Input EQU 10 ; 10 A 17 <1> Std_Con_Input_Status EQU 11 ; 11 B 18 <1> Std_Con_Input_Flush EQU 12 ; 12 C 19 <1> Disk_Reset EQU 13 ; 13 D 20 <1> Set_Default_Drive EQU 14 ; 14 E 21 <1> FCB_Open EQU 15 ; 15 F 22 <1> FCB_Close EQU 16 ; 16 10 23 <1> Dir_Search_First EQU 17 ; 17 11 24 <1> Dir_Search_Next EQU 18 ; 18 12 25 <1> FCB_Delete EQU 19 ; 19 13 26 <1> FCB_Seq_Read EQU 20 ; 20 14 27 <1> FCB_Seq_Write EQU 21 ; 21 15 28 <1> FCB_Create EQU 22 ; 22 16 29 <1> FCB_Rename EQU 23 ; 23 17 30 <1> Get_Default_Drive EQU 25 ; 25 19 31 <1> Set_DMA EQU 26 ; 26 1A 32 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 33 <1> ; C A V E A T P R O G R A M M E R ; 34 <1> ; ; 35 <1> Get_Default_DPB EQU 31 ; 31 1F 36 <1> ; ; 37 <1> ; C A V E A T P R O G R A M M E R ; 38 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 39 <1> FCB_Random_Read EQU 33 ; 33 21 40 <1> FCB_Random_Write EQU 34 ; 34 22 41 <1> Get_FCB_File_Length EQU 35 ; 35 23 42 <1> Get_FCB_Position EQU 36 ; 36 24 43 <1> Set_Interrupt_Vector EQU 37 ; 37 25 44 <1> Create_Process_Data_Block EQU 38 ; 38 26 45 <1> FCB_Random_Read_Block EQU 39 ; 39 27 46 <1> FCB_Random_Write_Block EQU 40 ; 40 28 47 <1> Parse_File_Descriptor EQU 41 ; 41 29 48 <1> Get_Date EQU 42 ; 42 2A 49 <1> Set_Date EQU 43 ; 43 2B 50 <1> Get_Time EQU 44 ; 44 2C 51 <1> Set_Time EQU 45 ; 45 2D 52 <1> Set_Verify_On_Write EQU 46 ; 46 2E 53 <1> ; Extended functionality group 54 <1> Get_DMA EQU 47 ; 47 2F 55 <1> Get_Version EQU 48 ; 48 30 56 <1> Keep_Process EQU 49 ; 49 31 57 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 58 <1> ; C A V E A T P R O G R A M M E R ; 59 <1> ; ; 60 <1> Get_DPB EQU 50 ; 50 32 61 <1> ; ; 62 <1> ; C A V E A T P R O G R A M M E R ; 63 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 64 <1> Set_CTRL_C_Trapping EQU 51 ; 51 33 65 <1> Get_InDOS_Flag EQU 52 ; 52 34 66 <1> Get_Interrupt_Vector EQU 53 ; 53 35 67 <1> Get_Drive_Freespace EQU 54 ; 54 36 68 <1> Char_Oper EQU 55 ; 55 37 69 <1> International EQU 56 ; 56 38 70 <1> ; Directory Group 71 <1> MKDir EQU 57 ; 57 39 72 <1> RMDir EQU 58 ; 58 3A 73 <1> CHDir EQU 59 ; 59 3B 74 <1> ; File Group 75 <1> Creat EQU 60 ; 60 3C 76 <1> Open EQU 61 ; 61 3D 77 <1> Close EQU 62 ; 62 3E 78 <1> Read EQU 63 ; 63 3F 79 <1> Write EQU 64 ; 64 40 80 <1> Unlink EQU 65 ; 65 41 81 <1> LSeek EQU 66 ; 66 42 82 <1> CHMod EQU 67 ; 67 43 83 <1> IOCtl EQU 68 ; 68 44 84 <1> XDup EQU 69 ; 69 45 85 <1> XDup2 EQU 70 ; 70 46 86 <1> Current_Dir EQU 71 ; 71 47 87 <1> ; Memory Group 88 <1> Alloc EQU 72 ; 72 48 89 <1> Dealloc EQU 73 ; 73 49 90 <1> Setblock EQU 74 ; 74 4A 91 <1> ; Process Group 92 <1> Exec EQU 75 ; 75 4B 93 <1> Exit EQU 76 ; 76 4C 94 <1> WaitProcess EQU 77 ; 77 4D 95 <1> Find_First EQU 78 ; 78 4E 96 <1> ; Special Group 97 <1> Find_Next EQU 79 ; 79 4F 98 <1> ; SPECIAL SYSTEM GROUP 99 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 100 <1> ; C A V E A T P R O G R A M M E R ; 101 <1> ; ; 102 <1> Set_Current_PDB EQU 80 ; 80 50 103 <1> Get_Current_PDB EQU 81 ; 81 51 104 <1> Get_In_Vars EQU 82 ; 82 52 105 <1> SetDPB EQU 83 ; 83 53 106 <1> ; ; 107 <1> ; C A V E A T P R O G R A M M E R ; 108 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 109 <1> Get_Verify_On_Write EQU 84 ; 84 54 110 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 111 <1> ; C A V E A T P R O G R A M M E R ; 112 <1> ; ; 113 <1> Dup_PDB EQU 85 ; 85 55 114 <1> ; ; 115 <1> ; C A V E A T P R O G R A M M E R ; 116 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 117 <1> Rename EQU 86 ; 86 56 118 <1> File_Times EQU 87 ; 87 57 119 <1> AllocOper EQU 88 ; 88 58 120 <1> ; Network extention system calls 121 <1> GetExtendedError EQU 89 ; 89 59 122 <1> CreateTempFile EQU 90 ; 90 5A 123 <1> CreateNewFile EQU 91 ; 91 5B 124 <1> LockOper EQU 92 ; 92 5C Lock and Unlock 125 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 126 <1> ; C A V E A T P R O G R A M M E R ; 127 <1> ; ; 128 <1> ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall, 129 <1> ; CloseByName, CloseUser, 130 <1> ; CloseUserProcess, 131 <1> ; GetOpenFileList 132 <1> ; ; 133 <1> ; C A V E A T P R O G R A M M E R ; 134 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 135 <1> UserOper EQU 94 ; 94 5E Get and Set 136 <1> AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel 137 <1> xNameTrans EQU 96 ; 96 60 138 <1> PathParse EQU 97 ; 97 61 139 <1> GetCurrentPSP EQU 98 ; 98 62 140 <1> Hongeul EQU 99 ; 99 63 141 <1> ECS_CALL EQU 99 ; 99 63 ;; DBCS support 142 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 143 <1> ; C A V E A T P R O G R A M M E R ; 144 <1> ; ; 145 <1> Set_Printer_Flag EQU 100 ; 100 64 146 <1> ; ; 147 <1> ; C A V E A T P R O G R A M M E R ; 148 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 149 <1> GetExtCntry EQU 101 ; 101 65 150 <1> GetSetCdPg EQU 102 ; 102 66 151 <1> ExtHandle EQU 103 ; 103 67 152 <1> Commit EQU 104 ; 104 68 153 <1> GetSetMediaID EQU 105 ; 105 69 154 <1> IFS_IOCTL EQU 107 ; 107 6B 155 <1> ExtOpen EQU 108 ; 108 6C 156 <1> ; 157 <1> ; 158 <1> Set_Oem_Handler EQU 248 ; 248 F8 159 <1> OEM_C1 EQU 249 ; 249 F9 160 <1> OEM_C2 EQU 250 ; 250 FA 161 <1> OEM_C3 EQU 251 ; 251 FB 162 <1> OEM_C4 EQU 252 ; 252 FC 163 <1> OEM_C5 EQU 253 ; 253 FD 164 <1> OEM_C6 EQU 254 ; 254 FE 165 <1> OEM_C7 EQU 255 ; 255 FF 11 %include "forequ.mac" 1 <1> ; ; ; 2 <1> 3 <1> NO equ 0 4 <1> YES equ ~ NO 5 <1> FSExec equ NO ;an018; dms;conditional assembly 6 <1> ShipDisk equ NO ;an000; dms;ship disk flag 7 <1> 8 <1> Boot_ID equ 0AA55h 9 <1> DOS_Found equ 0 10 <1> 11 <1> Not_Include equ 0 12 <1> Do_Include equ 1 13 <1> 14 <1> INIT equ 0 15 <1> 16 <1> FAT12_File_System equ 01h 17 <1> FAT16_File_System equ 04h 18 <1> New_File_System equ 06h 19 <1> 20 <1> FS_String_Max_Length equ 5 21 <1> 22 <1> Paragraph_Size equ 16 ; ;AN005; 23 <1> Len_FS_String_Buffer equ 13 24 <1> 25 <1> Net_Check equ 1200h 26 <1> Assign_Check equ 8000h 27 <1> 28 <1> Found_Yes equ 1 29 <1> Found_No equ 0 30 <1> 31 <1> Asciiz_End equ 0 32 <1> DBCS equ 81h 33 <1> DBCS_Blank equ 40h 34 <1> DBCS_Vector_Size equ 2 35 <1> End_Of_Vector equ 0 36 <1> 37 <1> 38 <1> Blank equ " " 39 <1> 40 <1> Label_Length equ 11 41 <1> CR equ 13 42 <1> 43 <1> DBCS_VECTOR equ NO 44 <1> 45 <1> ;Limits 46 <1> BIG_FAT_THRESHOLD equ 4086 47 <1> 48 <1> ;------------------------------------------------------------------------------- 49 <1> 50 <1> 51 <1> 52 <1> 53 <1> 54 <1> DRNUM EQU 5CH 55 <1> 56 <1> 57 <1> 58 <1> ; Exit status defines 59 <1> ExitOK equ 0 60 <1> ExitCtrlC equ 3 61 <1> ExitFatal equ 4 62 <1> ExitNo equ 5 63 <1> 64 <1> 65 <1> ;------------------------------------------------------------------------------- 66 <1> ; These are the data structures which we will need 67 <1> 68 <1> 69 <1> Media_ID struc 0 00000000 ???? Media_ID_Info_Level dw ? 0 00000002 ???????? Media_ID_Serial_Number dd ? 72 00000006 <1> Media_ID_Volume_Label db 11 dup(?) 0 00000011 ???????????????? Media_ID_File_System db 8 dup(?) 74 <1> Media_ID ends 75 <1> 76 <1> 77 <1> Relative_Sector_Buffer struc ; ;AN000; 78 <1> 0 00000000 ???? Start_Sector_Low dw ? ;Low word of RBA sector ;AN000; 0 00000002 ???? Start_Sector_High dw ? ;High word of RBA sector ;AN000; 0 00000004 ???? Number_Sectors dw ? ;Number of sectors ;AN000; 0 00000006 ???? Buffer_Offset dw ? ;Address of data buffer ;AN000; 0 00000008 ???? Buffer_Segment dw ? ; ;AN000; 84 <1> 85 <1> Relative_Sector_Buffer ends ; ;AN000; 86 <1> 87 <1> 88 <1> ;Per system file data structure 89 <1> 90 <1> a_FileStructure struc 0 00000000 ???? fileHandle DW ? 0 00000002 ???? fileSizeInParagraphs DW ? 0 00000004 ???????? fileSizeInBytes DD ? 0 00000008 ???????? fileOffset DD ? 0 0000000C ???? fileStartSegment DW ? 0 0000000E ???? fileDate DW ? 0 00000010 ???? fileTime DW ? 98 <1> a_FileStructure ends 99 <1> 100 <1> ;------------------------------------------------------------------------------- 101 <1> 102 <1> LOGBOOTSECT equ 1 103 <1> Set_Drv_Owner equ 0Fh ; IOCTL subfunction 104 <1> Custom_Media equ 0F0H ; Media byte for custom format 105 <1> Dual_8_Media equ 0FFh ; Dual sided 8 sectored 106 <1> Single_8_Media equ 0FEh ; Single sided 8 sectored 107 <1> Dual_9_Media equ 0FDh ; Dual sided 9 sectored 108 <1> Single_9_Media equ 0FCh ; Single sided 9 sectored 109 <1> Dual_15_Media equ 0F9h ; Dual sided 15 sectored 110 <1> Fixed_Disk equ 0F8h ; Fixed Disk 111 <1> Invalid_Drive equ 000Fh ; Extended error 15 112 <1> Max_Format_Size equ 0FFFFh ; Max bytes to Format ;an015; dms; 113 <1> Multi_Track_Format equ 02h ; Multi-track format ;an015; dms; 114 <1> Single_Track_Format equ 00h ; Single track format ;an015; dms; 115 <1> Select_Disk_Message equ 0ADC1h ; an016; dms; 12 %include "formacro.mac" 1 <1> ; 2 <1> ;****************************************************************************** 3 <1> ; Message Macro Definitions 4 <1> ;****************************************************************************** 5 <1> ; 6 <1> 7 <1> EXTRN Display_Interface:near 8 <1> 9 <1> 10 <1> ; NASM original macros 11 <1> 12 <1> ;----------------------------------------------------------------------------- 13 <1> 14 <1> %imacro Message 1.nolist 15 <1> mov dx,offset %1 wrt data 16 <1> call Display_Interface 17 <1> %endmacro 18 <1> 19 <1> ;----------------------------------------------------------------------------- 20 <1> 21 <1> %imacro Parse_Message 0.nolist 22 <1> push ds 23 <1> mov dx,data 24 <1> mov ds,dx 25 <1> mov word ptr [Parse_Error_Msg],ax 26 <1> mov dx,offset Parse_Error_Msg ; ;AN000; 27 <1> call Display_Interface ; ;AN000; 28 <1> pop ds ; 29 <1> %endmacro 30 <1> 31 <1> ;----------------------------------------------------------------------------- 32 <1> 33 <1> %imacro Extended_Message 0.nolist 34 <1> push ds 35 <1> mov dx,data 36 <1> mov ds,dx 37 <1> mov word ptr [Extended_Error_Msg],ax 38 <1> mov dx,offset Extended_Error_Msg wrt data 39 <1> call Display_Interface ; ;AN000; 40 <1> pop ds 41 <1> %endmacro 42 <1> 43 <1> ; 44 <1> ;***************************************************************************** 45 <1> ; General Macro's 46 <1> ;***************************************************************************** 47 <1> ; 48 <1> 49 <1> %imacro Procedure 1.nolist 50 <1> %1 proc 51 <1> Public %1 52 <1> %endmacro 53 <1> 54 <1> ;----------------------------------------------------------------------------- 55 <1> 56 <1> %imacro DOS_Call 1.nolist 57 <1> mov ah, %1 58 <1> int 21h 59 <1> %endmacro 60 <1> ;----------------------------------------------------------------------------- 61 <1> 62 <1> %imacro Popff 0.nolist 63 <1> jmp strict short $+3 64 <1> iret 65 <1> push cs 66 <1> call near $-2 67 <1> %endmacro 68 <1> 69 <1> ;----------------------------------------------------------------------------- 70 <1> 71 <1> %imacro Set_Data_Segment 0.nolist 72 <1> push ax 73 <1> mov ax,data ;Point to data segment 74 <1> mov ds,ax ; 75 <1> push ds 76 <1> pop es 77 <1> pop ax 78 <1> assume ds:data,es:data 79 <1> %endmacro 80 <1> 81 <1> ; end of NASM original macros 13 %include "forswtch.mac" 1 <1> ;FORMAT Pre-defined switches 2 <1> SWITCH_S EQU 0001h ; System transfer 3 <1> SWITCH_V EQU 0002h ; Volume ID prompt 4 <1> SWITCH_BACKUP EQU 0004h 5 <1> SWITCH_C EQU 0008h 6 <1> SWITCH_T EQU 0010h 7 <1> SWITCH_N EQU 0020h 8 <1> SWITCH_1 EQU 0040h 9 <1> SWITCH_4 EQU 0080h 10 <1> SWITCH_8 EQU 0100h 11 <1> SWITCH_B EQU 0200h 12 <1> SWITCH_SELECT EQU 0400h 13 <1> SWITCH_AUTOTEST EQU 0800h 14 <1> SWITCH_F EQU 1000h 15 <1> SWITCH_FS EQU 2000h 16 <1> 17 <1> %IF ShipDisk 18 <1> 19 <1> SWITCH_Z EQU 4000h ;an000; dms;1 sector/cluster switch 20 <1> 21 <1> %ENDIF 22 <1> 23 <1> ; 24 <1> ; The following is a list of equates to define each IBM defined diskette size 25 <1> ; for use with the /F switch 26 <1> 27 <1> 28 <1> Size_160 equ 0001h ;Flag settings for size switch ;AN000; 29 <1> Size_180 equ 0002h ; ;AN000; 30 <1> Size_320 equ 0004h ; ;AN000; 31 <1> Size_360 equ 0008h ; ;AN000; 32 <1> Size_720 equ 0010h ; ;AN000; 33 <1> Size_1200 equ 0020h ; ;AN000; 34 <1> Size_1440 equ 0040h ; ;AN000; 35 <1> 36 <1> 37 <1> 14 %include "ioctl.mac" 1 <1> 2 <1> %warning out: IOCTL.INC... 2 ****************** <1> warning: out: IOCTL.INC... [-w+user] 3 <1> ; THESE ARE ALL THE IMPORTANT STRUCTURES AND EQUATES FOR IOCTL 4 <1> ;============================================================================== 5 <1> ;REVISION HISTORY: 6 <1> ;AN000 - New for DOS Version 4.00 - J.K. 7 <1> ;AC000 - Changed for DOS Version 4.00 - J.K. 8 <1> ;AN00x - PTM number for DOS Version 4.00 - J.K. 9 <1> ;============================================================================== 10 <1> ;AN001; D241 Provide support of Multi-track Format/Verify 9/23/87 J.K. 11 <1> ;AN002; P1535 Unformatted hard file problem 10/15/87 J.K. 12 <1> ;AN003; D490 IOCTL subfunction 63h,43h,64h,44h conflicts with OS2 2/26/88 J.K. 13 <1> ;============================================================================== 14 <1> 15 <1> ;*** J.K. 16 <1> ;General Guide - 17 <1> ;Category Code: 18 <1> ; 0... .... DOS Defined 19 <1> ; 1... .... User defined 20 <1> ; .xxx xxxx Code 21 <1> 22 <1> ;Function Code: 23 <1> ; 0... .... Return error if unsupported 24 <1> ; 1... .... Ignore if unsupported 25 <1> ; .0.. .... Intercepted by DOS 26 <1> ; .1.. .... Passed to driver 27 <1> ; ..0. .... Sends data/commands to device 28 <1> ; ..1. .... Quries data/info from device 29 <1> ; ...x .... Subfunction 30 <1> ; 31 <1> ; Note that "Sends/queries" data bit is intended only to regularize the 32 <1> ; function set. It plays no critical role; some functions may contain both 33 <1> ; command and query elements. The convention is that such commands are 34 <1> ; defined as "sends data". 35 <1> 36 <1> ;*****************************;* 37 <1> ; BLOCK DRIVERS ;* 38 <1> ;*****************************;* 39 <1> 40 <1> ; IOCTL SUB-FUNCTIONS 41 <1> IOCTL_GET_DEVICE_INFO EQU 0 42 <1> IOCTL_SET_DEVICE_INFO EQU 1 43 <1> IOCTL_READ_HANDLE EQU 2 44 <1> IOCTL_WRITE_HANDLE EQU 3 45 <1> IOCTL_READ_DRIVE EQU 4 46 <1> IOCTL_WRITE_DRIVE EQU 5 47 <1> IOCTL_GET_INPUT_STATUS EQU 6 48 <1> IOCTL_GET_OUTPUT_STATUS EQU 7 49 <1> IOCTL_CHANGEABLE? EQU 8 50 <1> IOCTL_DeviceLocOrRem? EQU 9 51 <1> IOCTL_HandleLocOrRem? EQU 0Ah ;10 52 <1> IOCTL_SHARING_RETRY EQU 0Bh ;11 53 <1> GENERIC_IOCTL_HANDLE EQU 0Ch ;12 54 <1> GENERIC_IOCTL EQU 0Dh ;13 55 <1> 56 <1> ; GENERIC IOCTL CATEGORY CODES 57 <1> IOC_OTHER EQU 0 ; Other device control J.K. 4/29/86 58 <1> IOC_SE EQU 1 ; SERIAL DEVICE CONTROL 59 <1> IOC_TC EQU 2 ; TERMINAL CONTROL 60 <1> IOC_SC EQU 3 ; SCREEN CONTROL 61 <1> IOC_KC EQU 4 ; KEYBOARD CONTROL 62 <1> IOC_PC EQU 5 ; PRINTER CONTROL 63 <1> IOC_DC EQU 8 ; DISK CONTROL (SAME AS RAWIO) 64 <1> 65 <1> ; GENERIC IOCTL SUB-FUNCTIONS 66 <1> RAWIO EQU 8 67 <1> 68 <1> ; RAWIO SUB-FUNCTIONS 69 <1> GET_DEVICE_PARAMETERS EQU 60H 70 <1> SET_DEVICE_PARAMETERS EQU 40H 71 <1> READ_TRACK EQU 61H 72 <1> WRITE_TRACK EQU 41H 73 <1> VERIFY_TRACK EQU 62H 74 <1> FORMAT_TRACK EQU 42H 75 <1> GET_MEDIA_ID EQU 66h ;AN000;AN003;changed from 63h 76 <1> SET_MEDIA_ID EQU 46h ;AN000;AN003;changed from 43h 77 <1> GET_ACCESS_FLAG EQU 67h ;AN002;AN003;Unpublished function.Changed from 64h 78 <1> SET_ACCESS_FLAG EQU 47h ;AN002;AN003;Unpublished function.Changed from 44h 79 <1> 80 <1> ; SPECIAL FUNCTION FOR GET DEVICE PARAMETERS 81 <1> BUILD_DEVICE_BPB EQU 000000001B 82 <1> 83 <1> ; SPECIAL FUNCTIONS FOR SET DEVICE PARAMETERS 84 <1> INSTALL_FAKE_BPB EQU 000000001B 85 <1> ONLY_SET_TRACKLAYOUT EQU 000000010B 86 <1> TRACKLAYOUT_IS_GOOD EQU 000000100B 87 <1> 88 <1> ; SPECIAL FUNCTION FOR FORMAT TRACK 89 <1> STATUS_FOR_FORMAT EQU 000000001B 90 <1> DO_FAST_FORMAT equ 000000010B ;AN001; 91 <1> ; CODES RETURNED FROM FORMAT STATUS CALL 92 <1> FORMAT_NO_ROM_SUPPORT EQU 000000001B 93 <1> FORMAT_COMB_NOT_SUPPORTED EQU 000000010B 94 <1> 95 <1> ; DEVICETYPE VALUES 96 <1> MAX_SECTORS_IN_TRACK EQU 63 ; MAXIMUM SECTORS ON A DISK.(Was 40 in DOS 3.2) 97 <1> DEV_5INCH EQU 0 98 <1> DEV_5INCH96TPI EQU 1 99 <1> DEV_3INCH720KB EQU 2 100 <1> DEV_8INCHSS EQU 3 101 <1> DEV_8INCHDS EQU 4 102 <1> DEV_HARDDISK EQU 5 103 <1> DEV_OTHER EQU 7 104 <1> 105 <1> MAX_DEV_TYPE EQU 7 ; MAXIMUM DEVICE TYPE THAT WE 106 <1> ; CURRENTLY SUPPORT. 107 <1> 108 <1> %include "bpb.mac" 1 <2> %warning out: BPB.INC... 1 ****************** <2> warning: out: BPB.INC... [-w+user] 2 <2> ; SCCSID = @(#)BPB.ASM 1.1 85/04/29 3 <2> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 4 <2> ; C A V E A T P R O G R A M M E R ; 5 <2> ; ; 6 <2> 7 <2> ; BIOS PARAMETER BLOCK DEFINITION 8 <2> ; THIS STRUCTURE IS USED TO BUILD A FULL DPB 9 <2> 10 <2> BPBLOCK STRUC 0 00000000 ???? BPSECSZ DW ? ; SIZE IN BYTES OF PHYSICAL SECTOR 0 00000002 ?? BPCLUS DB ? ; SECTORS/ALLOC UNIT 0 00000003 ???? BPRES DW ? ; NUMBER OF RESERVED SECTORS 0 00000005 ?? BPFTCNT DB ? ; NUMBER OF FATS 0 00000006 ???? BPDRCNT DW ? ; NUMBER OF DIRECTORY ENTRIES 0 00000008 ???? BPSCCNT DW ? ; TOTAL NUMBER OF SECTORS 0 0000000A ?? BPMEDIA DB ? ; MEDIA DESCRIPTOR BYTE 0 0000000B ???? BPFTSEC DW ? ; NUMBER OF SECTORS TAKEN UP BY ONE FAT 19 <2> BPBLOCK ENDS 20 <2> 21 <2> A_BPB STRUC 0 00000000 ???? BPB_BYTESPERSECTOR DW ? 0 00000002 ?? BPB_SECTORSPERCLUSTER DB ? 0 00000003 ???? BPB_RESERVEDSECTORS DW ? 0 00000005 ?? BPB_NUMBEROFFATS DB ? 0 00000006 ???? BPB_ROOTENTRIES DW ? 0 00000008 ???? BPB_TOTALSECTORS DW ? 0 0000000A ?? BPB_MEDIADESCRIPTOR DB ? 0 0000000B ???? BPB_SECTORSPERFAT DW ? 0 0000000D ???? BPB_SECTORSPERTRACK DW ? 0 0000000F ???? BPB_HEADS DW ? 0 00000011 ???? BPB_HIDDENSECTORS DW ? 0 00000013 ???? DW ? 0 00000015 ???? BPB_BIGTOTALSECTORS DW ? 0 00000017 ???? DW ? 0 00000019 ???????????? DB 6 DUP(?) 37 <2> A_BPB ENDS 38 <2> ; ; 39 <2> ; C A V E A T P R O G R A M M E R ; 40 <2> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 109 <1> 110 <1> A_SECTORTABLE STRUC 0 00000000 ???? ST_SECTORNUMBER DW ? 0 00000002 ???? ST_SECTORSIZE DW ? 113 <1> A_SECTORTABLE ENDS 114 <1> 115 <1> A_DEVICEPARAMETERS STRUC 0 00000000 ?? DP_SPECIALFUNCTIONS DB ? 0 00000001 ?? DP_DEVICETYPE DB ? 0 00000002 ???? DP_DEVICEATTRIBUTES DW ? 0 00000004 ???? DP_CYLINDERS DW ? 0 00000006 ?? DP_MEDIATYPE DB ? 121 00000007 <1> DP_BPB DB A_BPB_struc_size DUP (?) 0 00000026 ???? DP_TRACKTABLEENTRIES DW ? 123 00000028 <1> DP_SECTORTABLE DB MAX_SECTORS_IN_TRACK * A_SECTORTABLE_struc_size DUP (?) 124 <1> A_DEVICEPARAMETERS ENDS 125 <1> 126 <1> A_TRACKREADWRITEPACKET STRUC 0 00000000 ?? TRWP_SPECIALFUNCTIONS DB ? 0 00000001 ???? TRWP_HEAD DW ? 0 00000003 ???? TRWP_CYLINDER DW ? 0 00000005 ???? TRWP_FIRSTSECTOR DW ? 0 00000007 ???? TRWP_SECTORSTOREADWRITE DW ? 0 00000009 ???????? TRWP_TRANSFERADDRESS DD ? 133 <1> A_TRACKREADWRITEPACKET ENDS 134 <1> 135 <1> ;AN001; - FP_TRACKCOUNT is only meaningful when FP_SPECIALFUNCTIONS bit 1 = 1. 136 <1> A_FORMATPACKET STRUC 0 00000000 ?? FP_SPECIALFUNCTIONS DB ? 0 00000001 ???? FP_HEAD DW ? 0 00000003 ???? FP_CYLINDER DW ? 0 00000005 ???? FP_TRACKCOUNT DW ? ;1 141 <1> A_FORMATPACKET ENDS 142 <1> 143 <1> A_VERIFYPACKET STRUC 0 00000000 ?? VP_SPECIALFUNCTIONS DB ? 0 00000001 ???? VP_HEAD DW ? 0 00000003 ???? VP_CYLINDER DW ? 147 <1> A_VERIFYPACKET ENDS 148 <1> 149 <1> A_MEDIA_ID_INFO STRUC 0 00000000 ???? MI_LEVEL DW ? ;0 ;J.K. 87 Info. level 0 00000002 ???????? MI_SERIAL DD ? ;J.K. 87 Serial # 152 00000006 <1> MI_LABEL DB 11 DUP (?) ;(' ') ;J.K. 87 volume label 0 00000011 ???????????????? MI_SYSTEM DB 8 DUP (?) ;(' ') ;J.K. 87 File system type 154 <1> A_MEDIA_ID_INFO ENDS 155 <1> 156 <1> A_DISKACCESS_CONTROL STRUC ;AN002; Unpublished function. Only for Hard file. 0 00000000 ?? DAC_SPECIALFUNCTIONS DB ? ;0 ;AN002; Always 0 0 00000001 ?? DAC_ACCESS_FLAG DB ? ;0 ;AN002; Non Zero - allow disk I/O to unformatted hard file 159 <1> A_DISKACCESS_CONTROL ENDS ;AN002; 0 - Disallow disk I/O to unformatted hard file 160 <1> 161 <1> ;********************************;* 162 <1> ; CHARACTER DEVICES (PRINTERS) ;* 163 <1> ;********************************;* 164 <1> 165 <1> ;RAWIO SUB-FUNCTIONS 166 <1> GET_RETRY_COUNT EQU 65H 167 <1> SET_RETRY_COUNT EQU 45H 168 <1> 169 <1> A_RETRYCOUNT STRUC 0 00000000 ???? RC_COUNT DW ? 171 <1> A_RETRYCOUNT ENDS 172 <1> 173 <1> ;********************************;* ;J.K. 4/29/86 174 <1> ; CHARACTER DEVICES (SCREEN) ;* 175 <1> ;********************************;* ;J.K. 4/29/86 176 <1> ; 177 <1> ;SC_MODE_INFO struc 178 <1> ;SC_INFO_LENGTH DW 9 179 <1> ;SC_MODE DB 0 180 <1> ;SC_COLORS DW 0 181 <1> ;SC_WIDTH DW 0 182 <1> ;SC_LENGTH DW 0 183 <1> ;SC_MODE_INFO ends 184 <1> ; 185 <1> ;SC_INFO_PACKET_LENGTH EQU 9 ;LENGTH OF THE INFO PACKET. 186 <1> 187 <1> ;SUBFUNCTIONS FOR CON$GENIOCTL 188 <1> ;GET_SC_MODE EQU 60h 189 <1> ;SET_SC_MODE EQU 40h 190 <1> ;The following subfunctions are reserved for installable CODE PAGE switch 191 <1> ;console devices. - J.K. 4/29/86 192 <1> ;Get_active_codepage equ 6Ah 193 <1> ;Invoke_active_codepage equ 4Ah 194 <1> ;Start_designate_codepage equ 4Ch 195 <1> ;End_designate_codepage equ 4Dh 196 <1> ;Get_list_of_designated_codepage equ 6Bh 197 <1> ;J.K. 4/29/86 *** End of Con$genioctl equates & structures 15 ;.cref 16 [list +] === Switch to base=000080h -> "DATA" 17 section data public align=16 class=DATA 18 ; (no prior section) ; data ends 19 === Switch to base=001900h -> "CODE" 20 section code public align=16 class=CODE 21 assume cs:code,ds:data 22 23 Yes? equ YES? ; NASM port label 24 PUBLIC FormatAnother?,REPORT,USER_STRING 25 public fdsksiz,badsiz,syssiz,datasiz,biosiz 26 public AllocSize,AllocNum 27 28 extrn std_printf:near,crlf:near,PrintString:near 29 extrn Multiply_32_Bits:near 30 extrn AddToSystemSize:near 31 === Switch to base=000080h -> "DATA" 32 section data 33 extrn driveLetter:byte 34 extrn msgInsertDisk:byte 35 extrn msgFormatAnother?:byte 36 extrn msgTotalDiskSpace:byte 37 extrn msgSystemSpace:byte 38 extrn msgBadSpace:byte 39 extrn msgDataSpace:byte 40 extrn Read_Write_Relative:byte 41 extrn msgAllocSize:byte 42 extrn MsgAllocNum:Byte 43 extrn deviceParameters:byte 44 extrn bios:byte 45 extrn dos:byte 46 extrn command:byte 47 extrn Serial_Num_Low:Word 48 extrn Serial_Num_High:Word 49 extrn msgSerialNumber:Byte 50 extrn SwitchMap:Word 51 52 53 extrn inbuff:byte 54 0 00000E90 00000000 fdsksiz dd 0 56 0 00000E94 00000000 syssiz dd 0 0 00000E98 00000000 biosiz dd 0 59 0 00000E9C 00000000 badsiz dd 0 61 0 00000EA0 00000000 datasiz dd 0 63 0 00000EA4 00000000 AllocSize dd 0 ; ;AN000; 0 00000EA8 0000 AllocNum dw 0 ; ;AN000; 0 00000EAA [0000] dw offset driveLetter === Switch to base=001900h -> "CODE" 67 section code ; data ends 68 69 FormatAnother? proc near 70 ; Wait for key. If yes return carry clear, else no. Insures 71 ; explicit Y or N answer. 0 000033F0 BA[0000]E8[0000] Message msgFormatAnother? ; ;AC000; 0 000033F6 E80A00 CALL Yes? 0 000033F9 7307 JNC WAIT20 0 000033FB 7405 JZ WAIT20 76 CRLF equ crlf ; NASM port label 0 000033FD E8[0000] CALL CRLF 0 00003400 EBEE JMP SHORT FormatAnother? 79 WAIT20: ; ;AC000; 0 00003402 C3 RET ; ;AC000; 81 FormatAnother? endp 82 83 ;***************************************************************************** 84 ;Routine name:Yes? 85 ;***************************************************************************** 86 ; 87 ;Description: Validate that input is valid Y/N for the country dependent info 88 ; Wait for key. If YES return carry clear,else carry set. 89 ; If carry is set, Z is set if explicit NO, else key was not Yes or No. 90 ; 91 ;Called Procedures: Message (macro) 92 ; User_String 93 ; 94 ;Change History: Created 4/32/87 MT 95 ; 96 ;Input: None 97 ; 98 ;Output: CY = 0 Yes is entered 99 ; CY = 1, Z = No 100 ; CY = 1, NZ = other 101 ; 102 ;Psuedocode 103 ;---------- 104 ; 105 ; Get input (CALL USER STRING) 106 ; IF got character 107 ; Check for country dependent Y/N (INT 21h, AX=6523h Get Ext Country) 108 ; IF Yes 109 ; clc 110 ; ELSE (No) 111 ; IF No 112 ; stc 113 ; Set Zero flag 114 ; ELSE (Other) 115 ; stc 116 ; Set NZ 117 ; ENDIF 118 ; ENDIF 119 ; ELSE (nothing entered) 120 ; stc 121 ; Set NZ flag 122 ; ENDIF 123 ; ret 124 ;***************************************************************************** 125 126 Procedure YES? ; ;AN000; 127 128 User_String equ USER_STRING ; NASM port label 0 00003403 E82900 call User_String ;Get character ; ; 130 ; $IF NZ ;Got one if returned NZ ;AC000; 0 00003406 7421 JZ DD_IF1 0 00003408 B023 mov al,23h ;See if it is Y/N ;AN000; 133 InBuff equ inbuff ; NASM port label 0 0000340A 8A16[0200] mov dl,[InBuff+2] ;Get character ;AN000; 0 0000340E B465CD21 DOS_Call GetExtCntry ;Get country info call ;AN000; 0 00003412 83F801 cmp ax,Found_Yes ;Which one? ;AC000; 137 ; $IF E ;Got a Yes ;AC000; 0 00003415 7503 JNE DD_IF2 0 00003417 F8 clc ;Clear CY for return ;AN000; 140 ; $ELSE ;Not a Yes ;AN000; 0 00003418 EB0D JMP SHORT DD_EN2 142 DD_IF2: 0 0000341A 83F800 cmp ax,Found_No ;Is it No? ;AC000; 144 ; $IF E ;Yep ;AN000; 0 0000341D 7503 JNE DD_IF4 0 0000341F F9 stc ;Set CY for return ;AC000; 147 ; $ELSE ;Something else we don't want ;AN000; 0 00003420 EB05 JMP SHORT DD_EN4 149 DD_IF4: 0 00003422 30C0 xor al,al ;Set NZ flag for ret ;AC000; 0 00003424 3C01 cmp al,1 ; " " " " ;AC000; 0 00003426 F9 stc ;And CY flag for good measure ;AN000; 153 ; $ENDIF ; ;AN000; 154 DD_EN4: 155 ; $ENDIF ; ;AN000; 156 DD_EN2: 157 ; $ELSE ;No char found at all ;AN000; 0 00003427 EB05 JMP SHORT DD_EN1 159 DD_IF1: 0 00003429 30C0 xor al,al ;Set NZ flag for ret ;AN000; 0 0000342B 3C01 cmp al,1 ; " " " " ;AN000; 0 0000342D F9 stc ;And CY flag for good measure ;AN000; 163 ; $ENDIF ; ;AN000; 164 DD_EN1: 0 0000342E C3 ret ; ; ; 166 167 Yes? endp ; ;AN000; 168 169 170 USER_STRING: 171 ; Get a string from user. Z is set if user typed no chars (imm CR) 172 ; We need to flush a second time to get rid of incoming Kanji characters also. 173 STD_CON_INPUT_FLUSH equ Std_Con_Input_Flush ; NASM port equate 0 0000342F B8000C MOV AX,(STD_CON_INPUT_FLUSH << 8) + 0 ; Clean out input 0 00003432 CD21 INT 21H 176 INBUFF equ inbuff ; NASM port label 0 00003434 BA[0000] MOV DX,OFFSET INBUFF 178 STD_CON_STRING_INPUT equ Std_Con_String_Input ; NASM port equate 0 00003437 B40A MOV AH,STD_CON_STRING_INPUT 0 00003439 CD21 INT 21H 0 0000343B B8000C MOV AX,(STD_CON_INPUT_FLUSH << 8) + 0 ; Clean out input 0 0000343E CD21 INT 21H 0 00003440 803E[0100]00 CMP BYTE PTR [INBUFF+1],0 0 00003445 C3 RET 185 186 ;********************************************* 187 ; Make a status report including the following information: 188 ; Total disk capacity 189 ; Total system area used 190 ; Total bad space allocated 191 ; Total data space available 192 ; Number of allocation units 193 ; Size of allocation units 194 195 REPORT: 0 00003446 E8[0000] call crlf 197 0 00003449 E86601 call Calc_System_Space ;an013; dms;calc system space 0 0000344C E80101 call Calc_Total_Addressible_Space ;an013; dms;calc total space 200 0 0000344F BA[0000]E8[0000] Message msgTotalDiskSpace ; ;AC000; 202 ;call std_printf 203 SYSSIZ equ syssiz ; NASM port label 0 00003455 833E[0400]00 cmp WORD [SYSSIZ],0 0 0000345A 7507 JNZ SHOWSYS 0 0000345C 833E[0600]00 cmp WORD [SYSSIZ+2],0 0 00003461 7406 JZ CHKBAD 208 SHOWSYS: 0 00003463 BA[0000]E8[0000] Message msgSystemSpace ; ;AC000; 210 ;CALL std_printf ;Report space used by system 211 CHKBAD: 212 BADSIZ equ badsiz ; NASM port label 0 00003469 833E[0C00]00 cmp WORD [BADSIZ],0 0 0000346E 7507 JNZ SHOWBAD 0 00003470 833E[0E00]00 cmp WORD [BADSIZ+2],0 0 00003475 7406 JZ SHOWDATA 217 SHOWBAD: 0 00003477 BA[0000]E8[0000] Message msgBadSpace ; ;AC000; 219 ;call std_printf 220 SHOWDATA: 221 222 223 Fdsksiz equ fdsksiz ; NASM port label 0 0000347D 8B0E[0000] MOV CX,WORD PTR [Fdsksiz] 0 00003481 8B1E[0200] MOV BX,WORD PTR [Fdsksiz+2] 0 00003485 2B0E[0C00] SUB CX,WORD PTR [BADSIZ] 0 00003489 1B1E[0E00] SBB BX,WORD PTR [BADSIZ+2] 0 0000348D 2B0E[0400] SUB CX,WORD PTR [SYSSIZ] 0 00003491 1B1E[0600] SBB BX,WORD PTR [SYSSIZ+2] 0 00003495 890E[1000] MOV word ptr [datasiz],CX 0 00003499 891E[1200] MOV word ptr [datasiz+2],BX 0 0000349D BA[0000]E8[0000] Message msgDataSpace ; ;AC000; 233 ;call std_printf 234 0 000034A3 E8[0000] call crlf ; ;AN000; 236 BPB_BytesPerSector equ BPB_BYTESPERSECTOR ; NASM port equate 0 000034A6 A1[0700] mov ax,[deviceParameters + DP_BPB + BPB_BytesPerSector] ; ;AN000; 238 BPB_SectorsPerCluster equ BPB_SECTORSPERCLUSTER ; NASM port equate 0 000034A9 8A0E[0900] mov cl,[deviceParameters + DP_BPB + BPB_SectorsPerCluster] ; ;AN000; 0 000034AD 30ED xor ch,ch ; ;AN000; 0 000034AF F7E1 mul cx ;Get bytes per alloc ;AN000; 242 0 000034B1 A3[1400] mov word ptr [AllocSize],ax ;Save allocation size ;AN000; 0 000034B4 8916[1600] mov word ptr [AllocSize+2],dx ; for message ;AN000; 0 000034B8 BA[0000]E8[0000] Message msgAllocSize ;Print size of cluster ;AN000; 0 000034BE E8E100 call Get_Free_Space ;an013; dms;get disk space 247 0 000034C1 891E[1800] mov word ptr [AllocNum],bx ;Put result in msg ;AN000; 249 msgAllocNum equ MsgAllocNum ; NASM port label 0 000034C5 BA[0000]E8[0000] Message msgAllocNum ; = cluster/disk ;AN000; 0 000034CB E8[0000] call crlf ; ;AN000; 252 switchmap equ SwitchMap ; NASM port label 0 000034CE F706[0000]0001 test word [switchmap], SWITCH_8 ;If 8 tracks, don't display ;AN027; 0 000034D4 7509 jnz NOSERIALNUMBER ;serial number ;AN027; 0 000034D6 BA[0000]E8[0000] Message msgSerialNumber ;Spit out serial number ;AN000; 0 000034DC E8[0000] call crlf ; 257 NOSERIALNUMBER: ;AN027; 0 000034DF C3 RET ; 259 260 ;***************************************************************************** 261 ;Routine name: Read_Disk 262 ;***************************************************************************** 263 ; 264 ;description: Read in data using Generic IOCtl 265 ; 266 ;Called Procedures: None 267 ; 268 ; 269 ;Change History: Created 5/13/87 MT 270 ; 271 ;Input: AL = Drive number (0=A) 272 ; DS:BX = Transfer address 273 ; CX = Number of sectors 274 ; Read_Write_Relative.Start_Sector_High = Number of sectors high 275 ; DX = logical sector number low 276 ; 277 ;Output: CY if error 278 ; AH = INT 25h error code 279 ; 280 ;Psuedocode 281 ;---------- 282 ; Save registers 283 ; Setup structure for function call 284 ; Read the disk (AX=440Dh, CL = 6Fh) 285 ; Restore registers 286 ; ret 287 ;***************************************************************************** 288 289 Procedure Read_Disk ; ;AN000; 290 291 ;This is setup for INT 25h right;AN000; 292 ;Change it to Read relative sect;AN000; 0 000034E0 53 push bx ;Save registers ;AN000; 0 000034E1 51 push cx ; ;AN000; 0 000034E2 52 push dx ; ;AN000; 0 000034E3 56 push si ; ;AN000; 0 000034E4 57 push di ; ;AN000; 0 000034E5 55 push bp ; ;AN000; 0 000034E6 06 push es ; ;AN000; 0 000034E7 1E push ds ; 0 000034E8 BE[0000] mov si,data ; ;AN000; 0 000034EB 8EC6 mov es,si ; ;AN000; 303 304 assume es:data,ds:nothing ; ;AN000; 305 0 000034ED 26891E[0600] mov [es:Read_Write_Relative + Buffer_Offset],bx ;Get transfer buffer add;AN000; 0 000034F2 8CDB mov bx,ds ; ;AN000; 0 000034F4 26891E[0800] mov [es:Read_Write_Relative + Buffer_Segment],bx ;Get segment ;AN000; 0 000034F9 BB[0000] mov bx,data ;Point DS at parameter list ;AN000; 0 000034FC 8EDB mov ds,bx ; ;AN000; 311 312 assume ds:data,es:data 313 0 000034FE 890E[0400] mov [Read_Write_Relative + Number_Sectors],cx ;Number of sec to read ;AN000; 0 00003502 8916[0000] mov [Read_Write_Relative + Start_Sector_Low],dx ;Start sector ;AN000; 0 00003506 BB[0000] mov bx,offset Read_Write_Relative ; ;AN000; 0 00003509 B9FFFF mov cx,0FFFFh ;Read relative sector ;AN000; 0 0000350C CD25 INT 25h ;Do the read ;AN000; 0 0000350E 5A pop dx ;Throw away flags on stack ;AN000; 0 0000350F 1F pop ds ; 0 00003510 07 pop es ; ;AN000; 0 00003511 5D pop bp ; ;AN000; 0 00003512 5F pop di ; ;AN000; 0 00003513 5E pop si ; ;AN000; 0 00003514 5A pop dx ;Restore registers ;AN000; 0 00003515 59 pop cx ; ;AN000; 0 00003516 5B pop bx ; ;AN000; 0 00003517 C3 ret ; ;AN000; 329 330 331 Read_Disk endp ; ;AN000; 332 333 ;***************************************************************************** 334 ;Routine name: Write_Disk 335 ;***************************************************************************** 336 ; 337 ;description: Write Data using Generic IOCtl 338 ; 339 ;Called Procedures: None 340 ; 341 ; 342 ;Change History: Created 5/13/87 MT 343 ; 344 ;Input: AL = Drive number (0=A) 345 ; DS:BX = Transfer address 346 ; CX = Number of sectors 347 ; Read_Write_Relative.Start_Sector_High = Number of sectors high 348 ; DX = logical sector number low 349 ; 350 ;Output: CY if error 351 ; AH = INT 26h error code 352 ; 353 ;Psuedocode 354 ;---------- 355 ; Save registers 356 ; Setup structure for function call 357 ; Write to disk (AX=440Dh, CL = 4Fh) 358 ; Restore registers 359 ; ret 360 ;***************************************************************************** 361 362 Procedure Write_Disk ; ;AN000; 363 364 365 ;This is setup for INT 26h right 366 ;Change it to Read relative sect 367 0 00003518 53 push bx ;Save registers ;AN000; 0 00003519 51 push cx ; ;AN000; 0 0000351A 52 push dx ; ;AN000; 0 0000351B 56 push si ; ;AN000; 0 0000351C 57 push di ; ;AN000; 0 0000351D 55 push bp ; ;AN000; 0 0000351E 06 push es ; ;AN000; 0 0000351F 1E push ds ; 0 00003520 BE[0000] mov si,data ; ;AN000; 0 00003523 8EC6 mov es,si ; ;AN000; 378 379 assume es:data,ds:nothing ; ;AN000; 380 0 00003525 26891E[0600] mov [es:Read_Write_Relative + Buffer_Offset],bx ;Get transfer buffer add;AN000; 0 0000352A 8CDB mov bx,ds ; ;AN000; 0 0000352C 26891E[0800] mov [es:Read_Write_Relative + Buffer_Segment],bx ;Get segment ;AN000; 0 00003531 BB[0000] mov bx,data ;Point DS at parameter list ;AN000; 0 00003534 8EDB mov ds,bx ; ;AN000; 386 387 assume ds:data,es:data 388 0 00003536 890E[0400] mov [Read_Write_Relative + Number_Sectors],cx ;Number of sec to write ;AN000; 0 0000353A 8916[0000] mov [Read_Write_Relative + Start_Sector_Low],dx ;Start sector ;AN000; 0 0000353E BB[0000] mov bx,offset Read_Write_Relative ; ;AN000; 0 00003541 B9FFFF mov cx,0FFFFh ;Write relative sector ;AN000; 0 00003544 CD26 INT 26h ;Do the write ;AN000; 0 00003546 5A pop dx ;Throw away flags on stack ;AN000; 0 00003547 1F pop ds ; ;AN000; 0 00003548 07 pop es ; ;AN000; 0 00003549 5D pop bp ; ;AN000; 0 0000354A 5F pop di ; ;AN000; 0 0000354B 5E pop si ; ;AN000; 0 0000354C 5A pop dx ;Restore registers ;AN000; 0 0000354D 59 pop cx ; ;AN000; 0 0000354E 5B pop bx ; ;AN000; 0 0000354F C3 ret ; ;AN000; 404 405 Write_Disk endp ; ;AN000; 406 407 ;========================================================================= 408 ; Calc_Total_Addressible_Space : Calculate the total space that is 409 ; addressible on the the disk by DOS. 410 ; 411 ; Inputs : none 412 ; 413 ; Outputs : Fdsksiz - Size in bytes of the disk 414 ;========================================================================= 415 416 Procedure Calc_Total_Addressible_Space ;an013; dms; 417 0 00003550 50 push ax ;an013; dms;save affected regs 0 00003551 52 push dx ;an013; dms; 0 00003552 53 push bx ;an013; dms; 421 0 00003553 E84C00 call Get_Free_Space ;an013; dms;get free disk space 423 0 00003556 53 push bx ;an013; dms;save avail. cluster 0 00003557 52 push dx ;an013; dms;save total. cluster 426 0 00003558 89D0 mov ax,dx ;an013; dms;get total clusters 428 0 0000355A 31DB xor bx,bx ;an013; dms;clear bx 0 0000355C 31C9 xor cx,cx ;an013; dms;clear cx 431 DeviceParameters equ deviceParameters ; NASM port label 0 0000355E 8A0E[0900] mov cl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an013; dms;get total sectors 0 00003562 E8[0000] call Multiply_32_Bits ;an013; dms;multiply 434 0 00003565 31C9 xor cx,cx ;an013; dms;clear cx 0 00003567 8B0E[0700] mov cx,[DeviceParameters + DP_BPB + BPB_BytesPerSector] ;an013; dms;get total bytes 0 0000356B E8[0000] call Multiply_32_Bits ;an013; dms; multiply 438 0 0000356E A3[0000] mov word ptr [Fdsksiz],ax ;an013; dms;save high word 0 00003571 891E[0200] mov word ptr [Fdsksiz+2],bx ;an013; dms;save low word 441 0 00003575 5A pop dx ;an000; dms;get total clusters 0 00003576 5B pop bx ;an000; dms;get avail clusters 444 0 00003577 89D0 mov ax,dx ;an013; dms;get total clusters 0 00003579 29D8 sub ax,bx ;an013; dms;get bad clusters 447 0 0000357B 31DB xor bx,bx ;an013; dms;clear bx 0 0000357D 31C9 xor cx,cx ;an013; dms;clear cx 0 0000357F 8A0E[0900] mov cl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] ;an013; dms;get total sectors 0 00003583 E8[0000] call Multiply_32_Bits ;an013; dms;multiply 452 0 00003586 31C9 xor cx,cx ;an013; dms;clear cx 0 00003588 8B0E[0700] mov cx,[DeviceParameters + DP_BPB + BPB_BytesPerSector] ;an013; dms;get total bytes 0 0000358C E8[0000] call Multiply_32_Bits ;an013; dms; multiply 456 0 0000358F 2B06[0400] sub ax,word ptr [syssiz] ;an013; dms;account for system 0 00003593 1B1E[0600] sbb bx,word ptr [syssiz+2] ;an013; dms;size 459 460 Badsiz equ badsiz ; NASM port label 0 00003597 A3[0C00] mov word ptr [Badsiz],ax ;an013; dms;save high word 0 0000359A 891E[0E00] mov word ptr [Badsiz+2],bx ;an013; dms;save low word 463 0 0000359E 5B pop bx ;an013; dms; 0 0000359F 5A pop dx ;an013; dms;restore regs 0 000035A0 58 pop ax ;an013; dms; 467 0 000035A1 C3 ret ;an013; dms; 469 470 Calc_Total_Addressible_Space endp ;an013; dms; 471 472 473 ;========================================================================= 474 ; Get_Free_Space : Get the free space on the disk. 475 ; 476 ; Inputs : none 477 ; 478 ; Outputs : BX - Available space in clusters 479 ; DX - Total space in clusters 480 ;========================================================================= 481 482 Procedure Get_Free_Space ;an013; dms; 483 0 000035A2 31C0 xor ax,ax ;an013; dms;clear ax 0 000035A4 B436 mov ah,36h ;an013; dms;Get disk free space 486 driveletter equ driveLetter ; NASM port label 0 000035A6 8A16[0000] mov dl,[driveletter] ;an013; dms;get drive letter 0 000035AA 80EA41 sub dl,"A" ;an013; dms;get 0 based number 0 000035AD FEC2 inc dl ;an013; dms;make it 1 based 0 000035AF CD21 int 21h ;an013; dms; 0 000035B1 C3 ret ;an013; dms; 492 493 Get_Free_Space endp ;an013; dms; 494 495 ;========================================================================= 496 ; Calc_System_Space : This routine calculates the space occupied by 497 ; the system on the disk. 498 ; 499 ; Inputs : DOS.FileSizeInBytes 500 ; BIOS.FileSizeInBytes 501 ; Command.FileSizeInBytes 502 ; 503 ; Outputs : SysSiz - Size of the system 504 ;========================================================================= 505 506 Procedure Calc_System_Space ;an013; dms; 507 0 000035B2 50 push ax ;an013; dms;save regs 0 000035B3 52 push dx ;an013; dms; 510 511 SysSiz equ syssiz ; NASM port label 0 000035B4 C706[0400]0000 mov word [SysSiz+0],00h ;an013; dms;clear variable 0 000035BA C706[0600]0000 mov word [SysSiz+2],00h ;an013; dms; 514 515 DOS equ dos ; NASM port label 516 FileSizeInBytes equ fileSizeInBytes ; NASM port equate 0 000035C0 A1[0400] mov ax,word ptr [DOS + FileSizeInBytes+0] ;an013; dms;get low word 0 000035C3 8B16[0600] mov dx,word ptr [DOS + FileSizeInBytes+2] ;an013; dms;get high word 0 000035C7 E8[0000] call AddToSystemSize ;an013; dms;add in values 520 521 BIOS equ bios ; NASM port label 0 000035CA A1[0400] mov ax,word ptr [BIOS + FileSizeInBytes+0] ;an013; dms;get bios size 0 000035CD 8B16[0600] mov dx,word ptr [BIOS + FileSizeInBytes+2] ;an013; dms; 0 000035D1 E8[0000] call AddToSystemSize ;an013; dms;add in values 525 526 COMMAND equ command ; NASM port label 0 000035D4 A1[0400] mov ax,word ptr [COMMAND + FileSizeInBytes+0] ;an013; dms;get command size 0 000035D7 8B16[0600] mov dx,word ptr [COMMAND + FileSizeInBytes+2] ;an013; dms; 0 000035DB E8[0000] call AddToSystemSize ;an013; dms;add in values 530 0 000035DE 5A pop dx ;an013; dms;restore regs 0 000035DF 58 pop ax ;an013; dms; 533 0 000035E0 C3 ret ;an013; dms; 535 536 Calc_System_Space endp ;an013; dms; 537 538 539 540 ; (no prior section) ; code ends 541 end 542 === Trace listing source: msfor.lst 1 ; e forproc.sal= @(#)ibmfor.asm 1.28 85/10/15 2 ; name OemFormatRoutines 3 ;****************************************************************************** 4 ;AN001 - ??? 5 ;AN002 - D304 Modify Boot record structure for OS2 11/09/87 J.K. 6 ;****************************************************************************** 7 8 %include "forchng.mac" 1 <1> [list -] 134 <1> 9 debug equ 0 10 DEBUG equ 0 11 ;------------------------------------------------------------------------------- 12 ; Public for debugging only 13 14 public LastChanceToSaveIt 15 public WriteBootSector 16 public OemDone 17 public WriteBogusDos 18 public ConvertToOldDirectoryFormat 19 public SetPartitionTable 20 public ReadSector 21 public WriteSector 22 public SectorIO 23 public GetVolumeId 24 25 public customBPBs 26 public NotSlashB 27 public NotSingleSided 28 public EndSwitchCheck 29 public WeCanNotIgnoreThisError 30 public HardDisk? 31 public BogusDos 32 public sys_mess_loop 33 public end_sys_loop 34 public DirectoryRead 35 public wrtdir 36 public DirectoryWritten 37 public FCBforVolumeIdSearch 38 public CopyVolumeId 39 public CompareVolumeIds 40 public BadVolumeId 41 42 public boot2 43 boot equ BOOT ; NASM port label 44 public boot 45 public scratchBuffer 46 public biosFilename 47 public dosFilename 48 public oldDrive 49 public oldVolumeId 50 public Read_Write_Relative 51 public Serial_Num_Low 52 public Serial_Num_High 53 public SizeMap 54 55 public ptr_msgWhatIsVolumeId? 56 57 public trackReadWritePacket 58 59 public BPB81 60 public BPB82 61 public BPB91 62 public BPB92 63 64 ;------------------------------------------------------------------------------- 65 === Switch to base=000080h -> "DATA" 66 section data public align=16 class=DATA 67 ; (no prior section) ; data ends 68 === Switch to base=001900h -> "CODE" 69 section code public align=16 class=CODE 70 assume cs:code,ds:data 71 72 Public AccessDisk 73 public LastChanceToSaveIt 74 public OemDone 75 public BiosFile 76 public DosFile 77 === Switch to base=000080h -> "DATA" 78 section data 79 extrn AddToSystemSize:near 80 extrn currentCylinder:word 81 extrn currentHead:word 82 extrn deviceParameters:byte 83 extrn drive:byte 84 extrn driveLetter:byte 85 extrn fBigFAT:byte 86 extrn inbuff:byte 87 extrn switchmap:word 88 extrn Old_Dir:byte 89 extrn fLastChance:byte 90 extrn Fatal_Error:Byte 91 extrn Bios:Byte 92 extrn Dos:Byte 93 extrn Command:Byte 94 95 extrn msgBad_T_N:byte 96 extrn msgBadVolumeId:byte 97 extrn msgBadPartitionTable:byte 98 extrn msgBootWriteError:byte 99 extrn msgDirectoryReadError:byte 100 extrn msgDirectoryWriteError:byte 101 extrn msgInvalidParameter:byte 102 extrn msgIncompatibleParameters:byte 103 extrn msgIncompatibleParametersForHardDisk:byte 104 extrn msgParametersNotSupportedByDrive:byte 105 extrn msgPartitionTableReadError:byte 106 extrn msgPartitionTableWriteError:byte 107 extrn msgWhatIsVolumeId?:byte 108 extrn NumSectors:word, TrackCnt:word 109 110 %IF DEBUG 111 extrn msgFormatBroken:byte 112 %ENDIF 113 === Switch to base=001900h -> "CODE" 114 section code ; data ends 115 116 extrn PrintString:near 117 extrn std_printf:near 118 extrn crlf:near 119 extrn user_string:near 120 extrn Read_Disk:near 121 extrn Write_Disk:near 122 123 124 ;------------------------------------------------------------------------------- 125 ; Constants 126 127 [list -] 127 ****************** warning: out: ..filesize.inc [-w+user] 127 ****************** warning: out: IOCTL.INC... [-w+user] 127 ****************** warning: out: BPB.INC... [-w+user] 127 ****************** warning: out: ... CLONE version build switch on ... [-w+user] 148 149 ;------------------------------------------------------------------------------- 150 ; And this is the actual data === Switch to base=000080h -> "DATA" 151 section data 152 153 Read_Write_Relative: ; NASM structure instance 154 Relative_Sector_Buffer_size equ Relative_Sector_Buffer_struc_size ; NASM port equate 155 istruc Relative_Sector_Buffer 0 00000EB0 ?? iend 157 158 159 %IF IBMCOPYRIGHT 160 BiosFile db "x:\IBMBIO.COM", 0 161 DosFile db "x:\IBMDOS.COM", 0 162 %ELSE 0 00000EBA 783A5C494F2E535953 BiosFile db "x:\IO.SYS", 0 0 00000EC3 00 0 00000EC4 783A5C4D53444F532E DosFile db "x:\MSDOS.SYS", 0 0 00000ECD 53595300 165 %ENDIF 166 0 00000ED1 4E4F204E414D452020 Dummy_Label db "NO NAME " 0 00000EDA 2020 0 00000EDC 0B00 Dummy_Label_Size dw 11 ;AN028 169 0 00000EDE 0000 Serial_Num_Low dw 0 ; ;AN000; 0 00000EE0 0000 Serial_Num_High dw 0 ; ;AN000; 172 0 00000EE2 00 SizeMap db 0 ; ;AN000; 174 175 trackReadWritePacket: ; NASM structure instance 176 A_TRACKREADWRITEPACKET_size equ A_TRACKREADWRITEPACKET_struc_size ; NASM port equate 177 istruc A_TRACKREADWRITEPACKET 0 00000EE3 ?? iend 179 180 181 ; BIOS parameter blocks for various media 182 customBPBs label byte 183 BPB92: ; NASM structure instance 184 A_BPB_size equ A_BPB_struc_size ; NASM port equate 185 istruc A_BPB 186 at BPB_BYTESPERSECTOR 0 00000EF0 0002 dw 512 188 at BPB_SECTORSPERCLUSTER 0 00000EF2 02 db 2 190 at BPB_RESERVEDSECTORS 0 00000EF3 0100 dw 1 192 at BPB_NUMBEROFFATS 0 00000EF5 02 db 2 194 at BPB_ROOTENTRIES 0 00000EF6 7000 dw 112 196 at BPB_TOTALSECTORS 0 00000EF8 D002 dw 2*9*40 198 at BPB_MEDIADESCRIPTOR 0 00000EFA FD db 0fdH 200 at BPB_SECTORSPERFAT 0 00000EFB 0200 dw 2 202 at BPB_SECTORSPERTRACK 0 00000EFD 0900 dw 9 204 at BPB_HEADS 0 00000EFF 0200 dw 2 206 at BPB_HIDDENSECTORS 0 00000F01 0000 dw 0 0 00000F03 0000 dw 0 209 at BPB_BIGTOTALSECTORS 0 00000F05 0000 dw 0 0 00000F07 0000 dw 0 0 00000F09 ?? iend 213 BPB91: ; NASM structure instance 214 istruc A_BPB 215 at BPB_BYTESPERSECTOR 0 00000F0F 0002 dw 512 217 at BPB_SECTORSPERCLUSTER 0 00000F11 01 db 1 219 at BPB_RESERVEDSECTORS 0 00000F12 0100 dw 1 221 at BPB_NUMBEROFFATS 0 00000F14 02 db 2 223 at BPB_ROOTENTRIES 0 00000F15 4000 dw 64 225 at BPB_TOTALSECTORS 0 00000F17 6801 dw 1*9*40 227 at BPB_MEDIADESCRIPTOR 0 00000F19 FC db 0fcH 229 at BPB_SECTORSPERFAT 0 00000F1A 0200 dw 2 231 at BPB_SECTORSPERTRACK 0 00000F1C 0900 dw 9 233 at BPB_HEADS 0 00000F1E 0100 dw 1 235 at BPB_HIDDENSECTORS 0 00000F20 0000 dw 0 0 00000F22 0000 dw 0 238 at BPB_BIGTOTALSECTORS 0 00000F24 0000 dw 0 0 00000F26 0000 dw 0 0 00000F28 ?? iend 242 BPB82: ; NASM structure instance 243 istruc A_BPB 244 at BPB_BYTESPERSECTOR 0 00000F2E 0002 dw 512 246 at BPB_SECTORSPERCLUSTER 0 00000F30 02 db 2 248 at BPB_RESERVEDSECTORS 0 00000F31 0100 dw 1 250 at BPB_NUMBEROFFATS 0 00000F33 02 db 2 252 at BPB_ROOTENTRIES 0 00000F34 7000 dw 112 254 at BPB_TOTALSECTORS 0 00000F36 8002 dw 2*8*40 256 at BPB_MEDIADESCRIPTOR 0 00000F38 FF db 0ffH 258 at BPB_SECTORSPERFAT 0 00000F39 0100 dw 1 260 at BPB_SECTORSPERTRACK 0 00000F3B 0800 dw 8 262 at BPB_HEADS 0 00000F3D 0200 dw 2 264 at BPB_HIDDENSECTORS 0 00000F3F 0000 dw 0 0 00000F41 0000 dw 0 267 at BPB_BIGTOTALSECTORS 0 00000F43 0000 dw 0 0 00000F45 0000 dw 0 0 00000F47 ?? iend 271 BPB81: ; NASM structure instance 272 istruc A_BPB 273 at BPB_BYTESPERSECTOR 0 00000F4D 0002 dw 512 275 at BPB_SECTORSPERCLUSTER 0 00000F4F 01 db 1 277 at BPB_RESERVEDSECTORS 0 00000F50 0100 dw 1 279 at BPB_NUMBEROFFATS 0 00000F52 02 db 2 281 at BPB_ROOTENTRIES 0 00000F53 4000 dw 64 283 at BPB_TOTALSECTORS 0 00000F55 4001 dw 1*8*40 285 at BPB_MEDIADESCRIPTOR 0 00000F57 FE db 0feH 287 at BPB_SECTORSPERFAT 0 00000F58 0100 dw 1 289 at BPB_SECTORSPERTRACK 0 00000F5A 0800 dw 8 291 at BPB_HEADS 0 00000F5C 0100 dw 1 293 at BPB_HIDDENSECTORS 0 00000F5E 0000 dw 0 0 00000F60 0000 dw 0 296 at BPB_BIGTOTALSECTORS 0 00000F62 0000 dw 0 0 00000F64 0000 dw 0 0 00000F66 ?? iend 300 BPB720: ; NASM structure instance 301 istruc A_BPB 302 at BPB_BYTESPERSECTOR 0 00000F6C 0002 dw 512 304 at BPB_SECTORSPERCLUSTER 0 00000F6E 02 db 2 306 at BPB_RESERVEDSECTORS 0 00000F6F 0100 dw 1 308 at BPB_NUMBEROFFATS 0 00000F71 02 db 2 310 at BPB_ROOTENTRIES 0 00000F72 7000 dw 112 312 at BPB_TOTALSECTORS 0 00000F74 A005 dw 2*9*80 314 at BPB_MEDIADESCRIPTOR 0 00000F76 F9 db 0F9h 316 at BPB_SECTORSPERFAT 0 00000F77 0300 dw 3 318 at BPB_SECTORSPERTRACK 0 00000F79 0900 dw 9 320 at BPB_HEADS 0 00000F7B 0200 dw 2 322 at BPB_HIDDENSECTORS 0 00000F7D 0000 dw 0 0 00000F7F 0000 dw 0 325 at BPB_BIGTOTALSECTORS 0 00000F81 0000 dw 0 0 00000F83 0000 dw 0 0 00000F85 ?? iend 329 330 331 332 boot2: 333 %include "boot11.mac" 0 00000F8B EB27900800140000 db 0EBH,027H,090H,008H,000H,014H,000H,000H 0 00000F93 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 00000F9B 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 00000FA3 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 00000FAB 00000000000000CD db 000H,000H,000H,000H,000H,000H,000H,0CDH 0 00000FB3 19FA8CC88ED833D2 db 019H,0FAH,08CH,0C8H,08EH,0D8H,033H,0D2H 0 00000FBB 8ED2BC007CFBB860 db 08EH,0D2H,0BCH,000H,07CH,0FBH,0B8H,060H 0 00000FC3 008ED88EC033D28B db 000H,08EH,0D8H,08EH,0C0H,033H,0D2H,08BH 0 00000FCB C2CD137269E88500 db 0C2H,0CDH,013H,072H,069H,0E8H,085H,000H 0 00000FD3 72DD2E833E037C08 db 072H,0DDH,02EH,083H,03EH,003H,07CH,008H 0 00000FDB 74062EC606647D02 db 074H,006H,02EH,0C6H,006H,064H,07DH,002H 0 00000FE3 BB00002E8B0E037C db 0BBH,000H,000H,02EH,08BH,00EH,003H,07CH 0 00000FEB 51B0092AC1B4008B db 051H,0B0H,009H,02AH,0C1H,0B4H,000H,08BH 0 00000FF3 F05633D233C08AC5 db 0F0H,056H,033H,0D2H,033H,0C0H,08AH,0C5H 0 00000FFB 2EF636647D8AE88A db 02EH,0F6H,036H,064H,07DH,08AH,0E8H,08AH 0 00001003 F48BC6B402CD1372 db 0F4H,08BH,0C6H,0B4H,002H,0CDH,013H,072H 0 0000100B 2D5E592E2936057C db 02DH,05EH,059H,02EH,029H,036H,005H,07CH 0 00001013 741F8BC62EF72665 db 074H,01FH,08BH,0C6H,02EH,0F7H,026H,065H 0 0000101B 7D03D8FEC5B10151 db 07DH,003H,0D8H,0FEH,0C5H,0B1H,001H,051H 0 00001023 BE08002E3B36057C db 0BEH,008H,000H,02EH,03BH,036H,005H,07CH 0 0000102B 7C052E8B36057CEB db 07CH,005H,02EH,08BH,036H,005H,07CH,0EBH 0 00001033 C0EA00006000BE67 db 0C0H,0EAH,000H,000H,060H,000H,0BEH,067H 0 0000103B 7DE80200EBFE32FF db 07DH,0E8H,002H,000H,0EBH,0FEH,032H,0FFH 0 00001043 2EAC247F740B56B4 db 02EH,0ACH,024H,07FH,074H,00BH,056H,0B4H 0 0000104B 0EBB0700CD105EEB db 00EH,0BBH,007H,000H,0CDH,010H,05EH,0EBH 0 00001053 EFC3E933FFBB0000 db 0EFH,0C3H,0E9H,033H,0FFH,0BBH,000H,000H 0 0000105B B90400B80102CD13 db 0B9H,004H,000H,0B8H,001H,002H,0CDH,013H 0 00001063 1E72338CC88ED8BF db 01EH,072H,033H,08CH,0C8H,08EH,0D8H,0BFH 0 0000106B 0000B90B0026800D db 000H,000H,0B9H,00BH,000H,026H,080H,00DH 0 00001073 2026804D202047E2 db 020H,026H,080H,04DH,020H,020H,047H,0E2H 0 0000107B F4BF0000BE8B7DB9 db 0F4H,0BFH,000H,000H,0BEH,08BH,07DH,0B9H 0 00001083 0B00FCF3A6750FBF db 00BH,000H,0FCH,0F3H,0A6H,075H,00FH,0BFH 0 0000108B 2000BE977DB90B00 db 020H,000H,0BEH,097H,07DH,0B9H,00BH,000H 0 00001093 F3A675021FC3BE1B db 0F3H,0A6H,075H,002H,01FH,0C3H,0BEH,01BH 0 0000109B 7DE8A2FFB400CD16 db 07DH,0E8H,0A2H,0FFH,0B4H,000H,0CDH,016H 0 000010A3 1FF9C30D0A4E6F6E db 01FH,0F9H,0C3H,00DH,00AH,04EH,06FH,06EH 0 000010AB 2D53797374656D20 db 02DH,053H,079H,073H,074H,065H,06DH,020H 0 000010B3 6469736B206F7220 db 064H,069H,073H,06BH,020H,06FH,072H,020H 0 000010BB 6469736B20657272 db 064H,069H,073H,06BH,020H,065H,072H,072H 0 000010C3 6F720D0A5265706C db 06FH,072H,00DH,00AH,052H,065H,070H,06CH 0 000010CB 61636520616E6420 db 061H,063H,065H,020H,061H,06EH,064H,020H 0 000010D3 737472696B652061 db 073H,074H,072H,069H,06BH,065H,020H,061H 0 000010DB 6E79206B65792077 db 06EH,079H,020H,06BH,065H,079H,020H,077H 0 000010E3 68656E2072656164 db 068H,065H,06EH,020H,072H,065H,061H,064H 0 000010EB 790D0A000100020D db 079H,00DH,00AH,000H,001H,000H,002H,00DH 0 000010F3 0A4469736B20426F db 00AH,044H,069H,073H,06BH,020H,042H,06FH 0 000010FB 6F74206661696C75 db 06FH,074H,020H,066H,061H,069H,06CH,075H 0 00001103 72650D0A004D6963 db 072H,065H,00DH,00AH,000H,04DH,069H,063H 0 0000110B 726F736F66742C49 db 072H,06FH,073H,06FH,066H,074H,02CH,049H 0 00001113 6E632069626D6269 db 06EH,063H,020H,069H,062H,06DH,062H,069H 0 0000111B 6F2020636F6D3069 db 06FH,020H,020H,063H,06FH,06DH,030H,069H 0 00001123 626D646F73202063 db 062H,06DH,064H,06FH,073H,020H,020H,063H 0 0000112B 6F6D3005C606772F db 06FH,06DH,030H,005H,0C6H,006H,077H,02FH 0 00001133 FF837EFC00750B80 db 0FFH,083H,07EH,0FCH,000H,075H,00BH,080H 0 0000113B 7EF73B7505C60676 db 07EH,0F7H,03BH,075H,005H,0C6H,006H,076H 0 00001143 2FFF89EC5DCA0400 db 02FH,0FFH,089H,0ECH,05DH,0CAH,004H,000H 0 0000114B 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 00001153 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 0000115B 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 00001163 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 0000116B 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 00001173 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 0000117B 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 0 00001183 0000000000000000 db 000H,000H,000H,000H,000H,000H,000H,000H 334 db 512 - ($ - boot2) dup(?) 335 REORG2 LABEL BYTE 336 337 338 %include "bootform.mac" 1 <1> %warning out: BOOTFORM.INC... 1 ****************** <1> warning: out: BOOTFORM.INC... [-w+user] 2 <1> ;**************************************************************************** 3 <1> ;AN000; - Structure of the Extended IBMBOOT record for DOS -. J.K. 4 <1> ;AN001; - D304 Include PHYDRV, CURHD to the header structure 11/09/87 J.K. 5 <1> ;**************************************************************************** 6 <1> 7 <1> BOOT_SIZE EQU 512 8 <1> EXT_BOOT_SIGNATURE EQU 41 ;Extended boot signature 9 <1> ; 10 <1> EXT_BPB_INFO STRUC 0 00000EB0 ???? EBPB_BYTESPERSECTOR DW ? 0 00000EB2 ?? EBPB_SECTORSPERCLUSTER DB ? 0 00000EB3 ???? EBPB_RESERVEDSECTORS DW ? 0 00000EB5 ?? EBPB_NUMBEROFFATS DB ? 0 00000EB6 ???? EBPB_ROOTENTRIES DW ? 0 00000EB8 ???? EBPB_TOTALSECTORS DW ? 0 00000EBA ?? EBPB_MEDIADESCRIPTOR DB ? 0 00000EBB ???? EBPB_SECTORSPERFAT DW ? 0 00000EBD ???? EBPB_SECTORSPERTRACK DW ? 0 00000EBF ???? EBPB_HEADS DW ? 0 00000EC1 ???????? EBPB_HIDDENSECTOR DD ? 0 00000EC5 ???????? EBPB_BIGTOTALSECTORS DD ? 23 <1> EXT_BPB_INFO ENDS 24 <1> ; 25 <1> ;AN001; EXT_PHYDRV, EXT_CURHD included in the header for OS2. 26 <1> EXT_IBMBOOT_HEADER STRUC 0 00000EB0 ?????? EXT_BOOT_JUMP DB 3 DUP (?) 0 00000EB3 ???????????????? EXT_BOOT_OEM DB 8 DUP (?) 29 0000000B <1> EXT_BOOT_BPB DB EXT_BPB_INFO_struc_size dup (?) 0 00000ED4 ?? EXT_PHYDRV DB ? ; 80h 0 00000ED5 ?? EXT_CURHD DB ? ; 0 0 00000ED6 ?? EXT_BOOT_SIG DB ? ; EXT_BOOT_SIGNATURE 0 00000ED7 ???????? EXT_BOOT_SERIAL DD ? 34 0000002B <1> EXT_BOOT_VOL_LABEL DB 11 DUP (?) 0 00000EE6 ???????????????? EXT_SYSTEM_ID DB 8 DUP (?) 36 <1> EXT_IBMBOOT_HEADER ENDS 37 <1> ; 38 <1> labelsize BOOT_SIGNATURE, word, (BOOT_SIZE-2) 39 <1> 40 <1> ; 41 <1> ;J.K. This is the number of sectors (of size 512 bytes) that will cover 42 <1> ;the size of IBMLOAD program. IBMBOOT program has to at least read this 43 <1> ;many sectors, and these sectors should be the first cluster and consecutive. 44 <1> ;Make sure IBMBOOT program uses the same value as this. 45 <1> IBMLOADSIZE equ 3 ;Number of sectors IBMBOOT program should read in. 46 <1> 47 <1> 339 340 341 BOOT LABEL BYTE 342 %include "boot.mac" 0 0000118B EB3C904D53444F53 db 0EBH,03CH,090H,04DH,053H,044H,04FH,053H 0 00001193 342E300002080100 db 034H,02EH,030H,000H,002H,008H,001H,000H 0 0000119B 0200020351F80800 db 002H,000H,002H,003H,051H,0F8H,008H,000H 0 000011A3 1100040001000000 db 011H,000H,004H,000H,001H,000H,000H,000H 0 000011AB 0000000080002900 db 000H,000H,000H,000H,080H,000H,029H,000H 0 000011B3 0000004E4F204E41 db 000H,000H,000H,04EH,04FH,020H,04EH,041H 0 000011BB 4D45202020204641 db 04DH,045H,020H,020H,020H,020H,046H,041H 0 000011C3 543132202020FA33 db 054H,031H,032H,020H,020H,020H,0FAH,033H 0 000011CB C08ED0BC007C1607 db 0C0H,08EH,0D0H,0BCH,000H,07CH,016H,007H 0 000011D3 BB780036C5371E56 db 0BBH,078H,000H,036H,0C5H,037H,01EH,056H 0 000011DB 1653BF3E7CB90B00 db 016H,053H,0BFH,03EH,07CH,0B9H,00BH,000H 0 000011E3 FCF3A4061FC645FE db 0FCH,0F3H,0A4H,006H,01FH,0C6H,045H,0FEH 0 000011EB 0F8B0E187C884DF9 db 00FH,08BH,00EH,018H,07CH,088H,04DH,0F9H 0 000011F3 894702C7073E7CFB db 089H,047H,002H,0C7H,007H,03EH,07CH,0FBH 0 000011FB CD13727C33C03906 db 0CDH,013H,072H,07CH,033H,0C0H,039H,006H 0 00001203 137C74088B0E137C db 013H,07CH,074H,008H,08BH,00EH,013H,07CH 0 0000120B 890E207CA0107CF7 db 089H,00EH,020H,07CH,0A0H,010H,07CH,0F7H 0 00001213 26167C03061C7C13 db 026H,016H,07CH,003H,006H,01CH,07CH,013H 0 0000121B 161E7C03060E7C83 db 016H,01EH,07CH,003H,006H,00EH,07CH,083H 0 00001223 D200A3507C891652 db 0D2H,000H,0A3H,050H,07CH,089H,016H,052H 0 0000122B 7CA3497C89164B7C db 07CH,0A3H,049H,07CH,089H,016H,04BH,07CH 0 00001233 B82000F726117C8B db 0B8H,020H,000H,0F7H,026H,011H,07CH,08BH 0 0000123B 1E0B7C03C348F7F3 db 01EH,00BH,07CH,003H,0C3H,048H,0F7H,0F3H 0 00001243 0106497C83164B7C db 001H,006H,049H,07CH,083H,016H,04BH,07CH 0 0000124B 00BB00058B16527C db 000H,0BBH,000H,005H,08BH,016H,052H,07CH 0 00001253 A1507CE887007220 db 0A1H,050H,07CH,0E8H,087H,000H,072H,020H 0 0000125B B001E8A10072198B db 0B0H,001H,0E8H,0A1H,000H,072H,019H,08BH 0 00001263 FBB90B00BEDB7DF3 db 0FBH,0B9H,00BH,000H,0BEH,0DBH,07DH,0F3H 0 0000126B A6750D8D7F20BEE6 db 0A6H,075H,00DH,08DH,07FH,020H,0BEH,0E6H 0 00001273 7DB90B00F3A67418 db 07DH,0B9H,00BH,000H,0F3H,0A6H,074H,018H 0 0000127B BE937DE8510032E4 db 0BEH,093H,07DH,0E8H,051H,000H,032H,0E4H 0 00001283 CD165E1F8F048F44 db 0CDH,016H,05EH,01FH,08FH,004H,08FH,044H 0 0000128B 02CD19585858EBE8 db 002H,0CDH,019H,058H,058H,058H,0EBH,0E8H 0 00001293 BB0007B90300A149 db 0BBH,000H,007H,0B9H,003H,000H,0A1H,049H 0 0000129B 7C8B164B7C505251 db 07CH,08BH,016H,04BH,07CH,050H,052H,051H 0 000012A3 E83A0072E6B001E8 db 0E8H,03AH,000H,072H,0E6H,0B0H,001H,0E8H 0 000012AB 5400595A5872C905 db 054H,000H,059H,05AH,058H,072H,0C9H,005H 0 000012B3 010083D200031E0B db 001H,000H,083H,0D2H,000H,003H,01EH,00BH 0 000012BB 7CE2E28A2E157C8A db 07CH,0E2H,0E2H,08AH,02EH,015H,07CH,08AH 0 000012C3 16247C8B1E497CA1 db 016H,024H,07CH,08BH,01EH,049H,07CH,0A1H 0 000012CB 4B7CEA00007000AC db 04BH,07CH,0EAH,000H,000H,070H,000H,0ACH 0 000012D3 0AC07429B40EBB07 db 00AH,0C0H,074H,029H,0B4H,00EH,0BBH,007H 0 000012DB 00CD10EBF23B1618 db 000H,0CDH,010H,0EBH,0F2H,03BH,016H,018H 0 000012E3 7C7319F736187CFE db 07CH,073H,019H,0F7H,036H,018H,07CH,0FEH 0 000012EB C288164F7C33D2F7 db 0C2H,088H,016H,04FH,07CH,033H,0D2H,0F7H 0 000012F3 361A7C8816257CA3 db 036H,01AH,07CH,088H,016H,025H,07CH,0A3H 0 000012FB 4D7CF8C3F9C3B402 db 04DH,07CH,0F8H,0C3H,0F9H,0C3H,0B4H,002H 0 00001303 8B164D7CB106D2E6 db 08BH,016H,04DH,07CH,0B1H,006H,0D2H,0E6H 0 0000130B 0A364F7C8BCA86E9 db 00AH,036H,04FH,07CH,08BH,0CAH,086H,0E9H 0 00001313 8A16247C8A36257C db 08AH,016H,024H,07CH,08AH,036H,025H,07CH 0 0000131B CD13C30D0A4E6F6E db 0CDH,013H,0C3H,00DH,00AH,04EH,06FH,06EH 0 00001323 2D53797374656D20 db 02DH,053H,079H,073H,074H,065H,06DH,020H 0 0000132B 6469736B206F7220 db 064H,069H,073H,06BH,020H,06FH,072H,020H 0 00001333 6469736B20657272 db 064H,069H,073H,06BH,020H,065H,072H,072H 0 0000133B 6F720D0A5265706C db 06FH,072H,00DH,00AH,052H,065H,070H,06CH 0 00001343 61636520616E6420 db 061H,063H,065H,020H,061H,06EH,064H,020H 0 0000134B 707265737320616E db 070H,072H,065H,073H,073H,020H,061H,06EH 0 00001353 79206B6579207768 db 079H,020H,06BH,065H,079H,020H,077H,068H 0 0000135B 656E207265616479 db 065H,06EH,020H,072H,065H,061H,064H,079H 0 00001363 0D0A00494F202020 db 00DH,00AH,000H,049H,04FH,020H,020H,020H 0 0000136B 2020205359534D53 db 020H,020H,020H,053H,059H,053H,04DH,053H 0 00001373 444F532020205359 db 044H,04FH,053H,020H,020H,020H,053H,059H 0 0000137B 5300000000000000 db 053H,000H,000H,000H,000H,000H,000H,000H 0 00001383 00000000000055AA db 000H,000H,000H,000H,000H,000H,055H,0AAH 343 344 000004DB scratchBuffer db 512 dup(?) 345 0 0000158B [0000] ptr_msgWhatIsVolumeId? dw offset msgWhatIsVolumeId? 0 0000158D [0000] dw offset driveLetter 348 349 0 0000158F 4641543132202020 FAT12_String db "FAT12 " 0 00001597 4641543136202020 FAT16_String db "FAT16 " 352 353 Media_ID_Buffer: ; NASM structure instance 354 Media_ID_size equ Media_ID_struc_size ; NASM port equate 355 istruc Media_ID 0 0000159F ??20 at Media_ID_Volume_Label, times 11 db 32 0 0000159F 0 000015B0 20 at Media_ID_File_System, times 8 db 32 358 iend 359 360 === Switch to base=001900h -> "CODE" 361 section code ; data ends 362 ;------------------------------------------------------------------------------- 363 ; AccessDisk: 364 ; Called whenever a different disk is about to be accessed 365 ; 366 ; Input: 367 ; al - drive letter (0=A, 1=B, ...) 368 ; 369 ; Output: 370 ; none 371 AccessDisk proc near 372 0 000035F0 50 push ax ; save drive letter 0 000035F1 88C3 mov bl,al ; Set up GENERIC IOCTL REQUEST preamble 0 000035F3 FEC3 inc bl 376 IOCTL equ IOCtl ; NASM port equate 0 000035F5 B80F44 mov ax,(IOCTL << 8) + Set_Drv_Owner ; IOCTL function 0 000035F8 CD21 int 21h 0 000035FA 58 pop ax 0 000035FB C3 return 381 382 AccessDisk endp 383 384 ;------------------------------------------------------------------------------- 385 ; CheckSwitches: 386 ; Check switches against device parameters 387 ; Use switches to modify device parameters 388 ; 389 ; Input: 390 ; deviceParameters 391 ; 392 ; Output: 393 ; deviceParameters may be modified 394 ; Carry set if error 395 ; 396 ; 397 ; /B <> /S 398 ; /B/8 <> /V 399 ; /1 or /8 <> /T/N 400 ; 401 402 403 CHeckSwitches equ CheckSwitches ; NASM port label 404 Public CHeckSwitches 405 CheckSwitches proc near 406 407 408 ; Disallow /C 409 ;lea dx, msgInvalidParameter ;AC000; 0 000035FC F706[0000]0800 test word [switchmap], SWITCH_C 0 00003602 7408 jz CheckExcl 0 00003604 BA[0000]E8[0000] Message msgInvalidParameter ;AC000; 413 SwitchError: 414 ;call PrintString ;AC000; 0 0000360A F9 stc 0 0000360B C3 ret 417 418 CheckExcl: 419 420 SwitchMap equ switchmap ; NASM port label 421 Switch_F equ SWITCH_F ; NASM port equate 0 0000360C F706[0000]0010 test word [SwitchMap],Switch_F ;Specify size? ;AN001; 423 ; $IF NZ ;Yes ;AN001; 0 00003612 7418 JZ DD_IF1 425 Switch_1 equ SWITCH_1 ; NASM port equate 426 Switch_8 equ SWITCH_8 ; NASM port equate 427 Switch_4 equ SWITCH_4 ; NASM port equate 428 Switch_N equ SWITCH_N ; NASM port equate 429 Switch_T equ SWITCH_T ; NASM port equate 0 00003614 F706[0000]F001 test word [SwitchMap],(Switch_1+Switch_8+Switch_4+Switch_N+Switch_T) ;AN001; 431 ; $IF NZ ;/F replaces above switches ;AN001; 0 0000361A 740D JZ DD_IF2 0 0000361C BA[0000]E8[0000] Message msgIncompatibleParameters ;Print error ;AN001; 434 Yes equ YES ; NASM port equate 0 00003622 C606[0000]FF mov byte [Fatal_Error],Yes ;Force exit ;AN001; 436 ; $ELSE ; ;AN001; 0 00003627 EB03 JMP SHORT DD_EN2 438 DD_IF2: 0 00003629 E84E02 call Size_To_Switch ;Go set switches based ;AN001; 440 ; $ENDIF ; on the size ;AN001; 441 DD_EN2: 442 ; $ENDIF ; ;AN001; 443 DD_IF1: 0 0000362C 803E[0000]00 cmp byte [Fatal_Error],NO ; ;AN007; 445 ; $IF E ; ;AN007; 0 00003631 7506 JNE DD_IF6 0 00003633 E87707 call Check_Switch_8_B ; ;ac007 0 00003636 E84D03 call Check_T_N 449 ; $ENDIF ; ;AN009; 450 DD_IF6: 0 00003639 803E[0000]FF cmp byte [Fatal_Error],Yes ; ;AN007; 0 0000363E 7502 jne ExclChkDone ; ;AN007; 0 00003640 F9 stc ; ;AN007; 0 00003641 C3 ret ; ;AN007; 455 456 ExclChkDone: 457 ; Patch the boot sector so that the boot strap loader knows what disk to 458 ; boot from 459 ; mov Boot.Boot_PhyDrv, 00H ;AC000; 460 Boot equ BOOT ; NASM port label 0 00003642 C606[FF02]00 mov byte [Boot + EXT_PHYDRV], 00H ;AN00?; 462 463 DP_DeviceType equ DP_DEVICETYPE ; NASM port equate 0 00003647 803E[0100]05 cmp byte [deviceParameters + DP_DeviceType], DEV_HARDDISK 0 0000364C 755F jne CheckFor5InchDrives 466 467 ; Formatting a hard disk so we must repatch the boot sector 468 ; mov Boot.Boot_PhyDrv, 80H ;AC000; 0 0000364E C606[FF02]80 mov byte [Boot + EXT_PHYDRV], 80H ;AN00?; 470 SWITCH_Select equ SWITCH_SELECT ; NASM port equate 471 Switch_B equ SWITCH_B ; NASM port equate 0 00003653 F706[0000]FCF1 test word [switchmap], ~ (SWITCH_S | SWITCH_V | SWITCH_Select | SWITCH_AUTOTEST | Switch_B) ;AN007; 0 00003659 7408 jz SwitchesOkForHardDisk 474 0 0000365B BA[0000]E8[0000] Message msgIncompatibleParametersForHardDisk ; ;AC000; 0 00003661 F9 stc 0 00003662 C3 ret 478 479 ; Before checking the Volume Id we need to verify that a valid one exists 480 ; We assume that unless a valid boot sector exists on the target disk, no 481 ; valid Volume Id can exist. 482 483 SwitchesOkForHardDisk: 0 00003663 505351521E SaveReg 0 00003668 A0[0000] mov al,[drive] 486 LogBootSect equ LOGBOOTSECT ; NASM port equate 0 0000366B B90100 mov cx,LogBootSect 0 0000366E 31D2 xor dx,dx 0 00003670 8D1E[DB04] lea bx,[scratchBuffer] ; ScratchBuffer := Absolute_Read_Disk( 490 ;INT 25h ; Logical_sec_1 ) 491 492 ;Assume Dir for vol ID exists in 1st 32mb of partition 493 0 00003674 C706[0200]0000 mov word [Read_Write_Relative + Start_Sector_High],0 0 0000367A E8[0000] call Read_Disk ; ;AC000; 496 ; on the stack. We throw them away 497 0 0000367D 7307 jnc CheckSignature 0 0000367F F9 stc 0 00003680 1F5A595B58 RestoreReg 0 00003685 C3 ret 502 503 CheckSignature: ; IF (Boot.Boot_Signature != aa55) 504 505 ScratchBuffer equ scratchBuffer ; NASM port label 0 00003686 A1[D906] mov ax, word ptr [ScratchBuffer + Boot_Signature] ;AC000; 0 00003689 3D55AA cmp ax, 0aa55h ;Find a valid boot record? 0 0000368C 1F5A595B58 RestoreReg 0 00003691 F8 clc ;No, so no need to check label 510 ; $IF Z ;No further checking needed ;AC000; 0 00003692 750E JNZ DD_IF8 0 00003694 F706[0000]000C test word [SwitchMap],(SWITCH_Select | SWITCH_AUTOTEST) ;Should we prompt for vol label?;AN000; 513 ; $IF Z ;Yes, if /Select not entered ;AN000; 0 0000369A 7505 JNZ DD_IF9 0 0000369C E8A906 call CheckVolumeId ;Go ask user for vol label ; ; 516 ; $ELSE ;/Select entered ;AN000; 0 0000369F EB01 JMP SHORT DD_EN9 518 DD_IF9: 0 000036A1 F8 clc ;CLC indicates passed label test;AN000; 520 ; $ENDIF ; for the return ;AN000; 521 DD_EN9: 522 ; $ENDIF 523 DD_IF8: 0 000036A2 C3 return 525 526 Incomp_Message: ;an000; fix PTM 809 527 0 000036A3 BA[0000]E8[0000] Message msgIncompatibleParameters ;an000; print incompatible parms 0 000036A9 F9 stc ;an000; signal error 0 000036AA C3 return ;an000; return to caller 531 532 Print_And_Return: 533 ;call PrintString ; ;AC000; 0 000036AB F9 stc 0 000036AC C3 return 536 537 538 CheckFor5InchDrives: 539 540 ;If drive type is anything other than 48 or 96, then only /V/S/H/N/T allowed 0 000036AD 803E[0100]01 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH96TPI 0 000036B2 7422 je Got96 543 0 000036B4 803E[0100]00 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH 0 000036B9 7435 je Got48 546 0 000036BB 31C0 xor ax,ax ;an000; dms;clear reg 548 Switch_V equ SWITCH_V ; NASM port equate 549 Switch_S equ SWITCH_S ; NASM port equate 0 000036BD 0D3302 or ax,(Switch_V | Switch_S | Switch_N | Switch_T | Switch_B) ;an000; dms;set up switch mask 551 Switch_Backup equ SWITCH_BACKUP ; NASM port equate 552 Switch_Select equ SWITCH_SELECT ; NASM port equate 553 Switch_Autotest equ SWITCH_AUTOTEST ; NASM port equate 0 000036C0 0D040C or ax,(Switch_Backup | Switch_Select | Switch_Autotest) ;an000; dms; 555 %IF ShipDisk 556 Switch_Z equ SWITCH_Z ; NASM port equate 557 or ax,Switch_Z ;an000; dms; 558 %ENDIF 0 000036C3 F7D0 not ax ;an000; dms; 0 000036C5 8506[0000] test [switchmap],ax ;an000; dms;invalid switch? 0 000036C9 7408 jz Goto_Got_BPB1 ;an000;dms;continue format 0 000036CB BA[0000]E8[0000] Message msgParametersNotSupportedByDrive ; ;AC000; 0 000036D1 EBD8 jmp short Print_And_Return 564 565 Goto_Got_BPB1: 0 000036D3 EB6D jmp Goto_Got_BPB 0 000036D5 90 nop ; identicalise 568 ; We have a 96tpi floppy drive 569 ; /4 allows just about all switches however, /1 requires /4 570 Got96: 571 ;;;DMS;;test switchmap, SWITCH_8 ;an000; If /8 we have an error 572 ;;;DMS;;jnz Incomp_message ;an000; tell user error 573 0 000036D6 F706[0000]8000 test word [switchmap], SWITCH_4 0 000036DC 752C jnz CheckForInterestingSwitches ;If /4 check /N/T/V/S 576 0 000036DE F706[0000]4000 test word [switchmap], SWITCH_1 ;If /1 and /4 check others 0 000036E4 740A jz Got48 579 580 ;If only /1 with no /4, see if /N/T 0 000036E6 F706[0000]3000 test word [SwitchMap],(Switch_N | Switch_T) 0 000036EC 751C jnz CheckForInterestingSwitches 583 584 Incomp_message equ Incomp_Message ; NASM port label 0 000036EE EBB3 jmp Incomp_message ;an000; tell user error occurred 586 587 Got48: 588 ;Ignore /4 for non-96tpi 5 1/4" drives 0 000036F0 8126[0000]7FFF and word [switchmap], ~ SWITCH_4 590 591 ;Ignore /1 if drive has only one head and not /8 592 BPB_Heads equ BPB_HEADS ; NASM port equate 0 000036F6 833E[1600]01 cmp word [deviceParameters + DP_BPB + BPB_Heads], 1 0 000036FB 770D ja CheckForInterestingSwitches 0 000036FD F706[0000]0001 test word [switchmap], SWITCH_8 0 00003703 7405 jz CheckForInterestingSwitches 0 00003705 8326[0000]BF and word [switchmap], ~ SWITCH_1 598 599 ;Are any interesting switches set? 600 CheckForInterestingSwitches: 0 0000370A F706[0000]F8F1 test word [switchmap], ~ (SWITCH_V | SWITCH_S | Switch_Backup | SWITCH_SELECT | SWITCH_AUTOTEST | Switch_B) 0 00003710 7433 jz Goto_EndSwitchCheck ;No, everything ok 603 604 ;At this point there are switches other than /v/s/h 0 00003712 F706[0000]3000 test word [SwitchMap],(SWITCH_N | SWITCH_T) 0 00003718 7455 jz Use_48tpi ;Not /n/t, so must be /b/1/8/4 607 608 ;We've got /N/T, see if there are others 0 0000371A F706[0000]C8F3 test word [SwitchMap], ~ (SWITCH_N | SWITCH_T | SWITCH_V | SWITCH_S | Switch_Backup | SWITCH_SELECT | SWITCH_AUTOTEST) 0 00003720 7426 jz NT_Compatible ;Nope, all is well 611 612 ;If 96tpi drive and /1 exists with /N/T, then okay, otherwise error 0 00003722 803E[0100]01 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH96TPI 0 00003727 7510 jne Bad_NT_Combo 615 0 00003729 F706[0000]8DFF test word [SwitchMap], ~ (SWITCH_1 | SWITCH_N | SWITCH_T | SWITCH_V) 0 0000372F 7508 jnz Bad_NT_Combo 0 00003731 F706[0000]FAF3 test word [SwitchMap], ~ (SWITCH_S | Switch_Backup | SWITCH_SELECT | Switch_Autotest) 0 00003737 7409 jz Goto_Got_BPB 620 621 Bad_NT_Combo: 0 00003739 BA[0000]E8[0000] Message msgIncompatibleParameters ; ;AC000; 0 0000373F E969FF jmp Print_And_Return 624 625 Goto_Got_BPB: 626 Got_BPB_Ok equ Got_BPB_OK ; NASM port label 0 00003742 EB76 jmp Got_BPB_Ok ;Sleazy, but je won't reach it 0 00003744 90 nop ; identicalise 629 630 Goto_EndSwitchCheck: 0 00003745 E93001 jmp EndSwitchCheck 632 ;There is a problem with /N/T in that IBMBIO will default to a BPB with the 633 ;media byte set to F0 (other) if the /N/T combo is used for the format. This 634 ;will cause problems if we are creating a media that has an assigned media 635 ;byte, i.e. 160,180,320,360, or 720k media using /N/T. To avoid this problem, 636 ;if we detect a /N/T combo that would correspond to one of these medias, then 637 ; we will set things up using the /4/1/8 switches instead of the /N/T 638 ; MT - 7/17/86 PTR 33D0110 639 640 ; Combo's that we look for - 96tpi drive @ /T:40, /N:9 641 ; 96tpi drive @ /T:40, /N:8 642 ; 643 ; Look for this combo after we set everything up with the /T/N routine 644 ; 1.44 drive @ /T:80, /N:9 645 646 NT_Compatible: 0 00003748 803E[0100]01 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH96TPI 0 0000374D 75F3 jne Goto_Got_BPB 649 0 0000374F 833E[0000]28 cmp word [TrackCnt],40 ;Look for 40 tracks 0 00003754 7564 jne Got_BPB_Ok 652 0 00003756 833E[0000]09 cmp word [NumSectors],9 ;9 sectors? 0 0000375B 740D je Found_48tpi_Type 655 0 0000375D 833E[0000]08 cmp word [NumSectors],8 ;8 sectors? 0 00003762 75DE jne Goto_Got_BPB ;Nope, different type, let it go thru 658 0 00003764 810E[0000]0001 or word [SwitchMap],SWITCH_8 ;Yes, turn on /8 switch 660 661 Found_48tpi_Type: 0 0000376A 8326[0000]CF and word [SwitchMap],~ (SWITCH_N | SWITCH_T) ;Turn off /T/N 663 664 ;******End PTR fix 665 666 ; if we have a 96 tpi drive then we will be using it in 48 tpi mode 667 Use_48tpi: 0 0000376F 803E[0100]01 cmp byte [deviceParameters + DP_DeviceType], DEV_5INCH96TPI 0 00003774 750B jne Not96tpi 670 671 DP_MediaType equ DP_MEDIATYPE ; NASM port equate 0 00003776 C606[0600]01 mov byte [deviceParameters + DP_MediaType], 1 673 DP_Cylinders equ DP_CYLINDERS ; NASM port equate 0 0000377B C706[0400]2800 mov word [deviceParameters + DP_Cylinders], 40 675 Not96tpi: 676 677 ; Since we know we are formatting in 48 tpi mode turn on /4 switch 678 ; (We use this info in LastChanceToSaveIt) 0 00003781 810E[0000]8000 or word [switchmap], SWITCH_4 680 681 ; At this point we know that we will require a special BPB 682 ; It will be one of: 683 ; 0) 9 track 2 sides - if no switches 684 ; 1) 9 track 1 side - if only /1 specified 685 ; 2) 8 track 2 sides - if only /8 specified 686 ; 3) 8 track 1 side - if /8 and /1 specified 687 ; 688 Get_BPBs: 689 ; ax is used to keep track of which of the above BPB's we want 0 00003787 31C0 xor ax, ax 691 692 NotSlashB: 693 0 00003789 F706[0000]4000 test word [switchmap], SWITCH_1 0 0000378F 7403 jz NotSingleSided 0 00003791 83C001 add ax, 1 697 NotSingleSided: 698 0 00003794 F706[0000]0001 test word [switchmap], SWITCH_8 0 0000379A 7408 jz Not8SectorsPerTrack 0 0000379C 83C002 add ax, 2 702 ; /8 implies Old_Dir = TRUE 0 0000379F C606[0000]FF mov byte [Old_Dir],TRUE 703 ****************** warning: byte data exceeds bounds [-w+number-overflow] 704 Not8SectorsPerTrack: 705 706 ; Ok now we know which BPB to use so lets move it to the device parameters 707 708 a_BPB_struc_size equ A_BPB_struc_size ; NASM port equate 0 000037A4 BB1F00 mov bx, a_BPB_struc_size 0 000037A7 F7E3 mul bx 711 CustomBPBs equ customBPBs ; NASM port label 0 000037A9 8D36[4000] lea si, [CustomBPBs] 0 000037AD 01C6 add si, ax 0 000037AF 8D3E[0700] lea di, [deviceParameters + DP_BPB] 0 000037B3 B91F00 mov cx, a_BPB_struc_size 0 000037B6 1E push ds 0 000037B7 07 pop es 0 000037B8 F2A4 repnz movsb 719 720 ;***************************************************************** 721 ;* /N/T DCR stuff. Possible flaw exists if we are dealing with a 722 ;* HardDisk. If they support the "custom format" features for 723 ;* Harddisks too, then CheckForInterestingSwitches should 724 ;* consider /n/t UNinteresting, and instead of returning 725 ;* after setting up the custom BPB we fall through and do our 726 ;* Harddisk Check. 727 Got_BPB_OK: 0 000037BA F706[0000]3000 test word [switchmap],SWITCH_N+SWITCH_T 0 000037C0 7503 jnz Setup_Stuff 0 000037C2 E9B300 jmp EndSwitchCheck 731 Setup_Stuff: 732 ; Set up NumSectors and SectorsPerTrack entries correctly 0 000037C5 F706[0000]2000 test word [switchmap],SWITCH_N 0 000037CB 7408 jz No_Custom_Seclim 0 000037CD A1[0000] mov ax,word ptr [NumSectors] 736 DeviceParameters equ deviceParameters ; NASM port label 737 BPB_SectorsPerTrack equ BPB_SECTORSPERTRACK ; NASM port equate 0 000037D0 A3[1400] mov [DeviceParameters + DP_BPB + BPB_SectorsPerTrack],ax 0 000037D3 EB06 jmp short Handle_Cyln 740 No_Custom_Seclim: 0 000037D5 A1[1400] mov ax,[deviceParameters + DP_BPB + BPB_SectorsPerTrack] 0 000037D8 A3[0000] mov [NumSectors],ax 743 744 Handle_Cyln: 0 000037DB F706[0000]1000 test word [switchmap],SWITCH_T 0 000037E1 7408 jz No_Custom_Cyln 747 ; Set up TrackCnt and Cylinders entries correctly 0 000037E3 A1[0000] mov ax,[TrackCnt] 0 000037E6 A3[0400] mov [DeviceParameters + DP_Cylinders],ax 0 000037E9 EB06 jmp short Check_720 751 No_Custom_Cyln: 0 000037EB A1[0400] mov ax,[DeviceParameters + DP_Cylinders] 0 000037EE A3[0000] mov [TrackCnt],ax 754 755 ;****PTM P868 - Always making 3 1/2 media byte 0F0h. If 720, then set to 756 ; 0F9h and use the DOS 3.20 BPB. Should check all drives 757 ; at this point (Make sure not 5 inch just for future 758 ; protection) 759 ; We will use the known BPB info for 720 3 1/2 diskettes for 760 ; this special case. All other new diskette media will use the 761 ; calculations that follow Calc_Total for BPB info. 762 ; Fix MT 11/12/86 763 764 Check_720: 765 0 000037F1 803E[0100]01 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH96TPI 0 000037F6 7434 je Calc_Total 768 0 000037F8 803E[0100]00 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH 0 000037FD 742D je Calc_Total 771 0 000037FF 833E[0000]50 cmp word [TrackCnt],80 0 00003804 7526 jne Calc_Total 774 0 00003806 833E[0000]09 cmp word [NumSectors],9 0 0000380B 751F jne Calc_Total 777 778 ; At this point we know we have a 3 1/2 720kb diskette to format. Use the 779 ; built in BPB rather than the one handed to us by DOS, because the DOS one 780 ; will be based on the default for that drive, and it can be different from 781 ; what we used in DOS 3.20 for the 720's. Short sighted on our part to use 782 ; 0F9h as the media byte, should have use 0F0h (OTHER) and then we wouldn't 783 ; have this problem. 784 0 0000380D 1E06565751 SaveReg 786 787 0 00003812 B9[0000] mov cx,data ;Setup seg regs, just in case they ain't! 0 00003815 8ED9 mov ds,cx 0 00003817 8EC1 mov es,cx 791 0 00003819 BE[BC00] mov si,offset BPB720 ;Copy the BPB! 0 0000381C BF[0700] mov di,offset deviceParameters + DP_BPB 0 0000381F B91F00 mov cx,a_BPB_struc_size 0 00003822 F3A4 rep movsb 0 00003824 595F5E071F RestoreReg 0 00003829 EB4D jmp EndSwitchCheck 0 0000382B 90 nop ; identicalise 799 800 ;End PTM P868 fix **************************************** 801 802 Calc_Total: 0 0000382C A1[0000] mov ax,[NumSectors] 0 0000382F 8B1E[1600] mov bx,[DeviceParameters + DP_BPB + BPB_Heads] 0 00003833 F6E3 mul bl ; AX = # of sectors * # of heads 0 00003835 F726[0000] mul word [TrackCnt] ; DX:AX = Total Sectors 0 00003839 09D2 or dx,dx 0 0000383B 7505 jnz Got_BigTotalSectors 809 BPB_TotalSectors equ BPB_TOTALSECTORS ; NASM port equate 0 0000383D A3[0F00] mov [DeviceParameters + DP_BPB + BPB_TotalSectors],ax 0 00003840 EB0F jmp short Set_BPB 812 Got_BigTotalSectors: 813 BPB_BigTotalSectors equ BPB_BIGTOTALSECTORS ; NASM port equate 0 00003842 A3[1C00] mov [DeviceParameters + DP_BPB + BPB_BigTotalSectors],ax 0 00003845 8916[1E00] mov [DeviceParameters + DP_BPB + BPB_BigTotalSectors+2],dx 0 00003849 52 push dx ; preserve dx for further use 0 0000384A 31D2 xor dx,dx 0 0000384C 8916[0F00] mov [DeviceParameters + DP_BPB + BPB_TotalSectors],dx 0 00003850 5A pop dx 820 821 Set_BPB: 822 ; We calculate the number of sectors required in a FAT. This is done as: 823 ; # of FAT Sectors = TotalSectors / SectorsPerCluster * # of bytes in FAT to 824 ; represent one cluster (i.e. 3/2) / BytesPerSector (i.e. 512) 0 00003851 31DB xor bx,bx 826 BPB_SectorsPerCluster equ BPB_SECTORSPERCLUSTER ; NASM port equate 0 00003853 8A1E[0900] mov bl,[DeviceParameters + DP_BPB + BPB_SectorsPerCluster] 0 00003857 F7F3 div bx ; DX:AX contains # of clusters 829 ; now multiply by 3/2 0 00003859 BB0300 mov bx,3 0 0000385C F7E3 mul bx 0 0000385E BB0200 mov bx,2 0 00003861 F7F3 div bx 0 00003863 31D2 xor dx,dx ; throw away modulo 835 ; now divide by 512 0 00003865 BB0002 mov bx,512 0 00003868 F7F3 div bx 838 ; dx:ax contains number of FAT sectors necessary 0 0000386A 40 inc ax ; Go one higher 840 BPB_SectorsPerFAT equ BPB_SECTORSPERFAT ; NASM port equate 0 0000386B A3[1200] mov [DeviceParameters + DP_BPB + BPB_SectorsPerFAT],ax 0 0000386E C606[0600]00 mov byte [DeviceParameters + DP_MediaType],0 843 BPB_MediaDescriptor equ BPB_MEDIADESCRIPTOR ; NASM port equate 0 00003873 C606[1100]F0 mov byte [DeviceParameters + DP_BPB + BPB_MediaDescriptor],Custom_Media 845 846 847 EndSwitchCheck: 0 00003878 F8 clc 0 00003879 C3 return 850 851 CheckSwitches endp 852 853 ;***************************************************************************** 854 ;Routine name: Size_To_Switch 855 ;***************************************************************************** 856 ; 857 ;Description: Given the SizeMap field as input indicating the SIZE= value 858 ; entered, validate that the specified size is valid for the 859 ; drive, and if so, turn on the appropriate data fields and 860 ; switches that would be turned on by the equivilent command line 861 ; using only switchs. All defined DOS 4.00 sizes are hardcoded, 862 ; in case a drive type of other is encountered that doesn't 863 ; qualify as a DOS 4.00 defined drive. Exit with error message if 864 ; unsupported drive. The switches will be setup for the CheckSwitches 865 ; routine to sort out, using existing switch matrix logic. 866 ; 867 ;Called Procedures: Low_Density_Drive 868 ; High_Capacity_Drive 869 ; 720k_Drives 870 ; Other_Drives 871 ; 872 ;Change History: Created 8/1/87 MT 873 ; 874 ;Input: SizeMap 875 ; Fatal_Error = NO 876 ; 877 ;Output: Fatal_Error = YES/NO 878 ; SwitchMap = appropriate Switch_?? values turned on 879 ; TrackCnt, NumSectors set if Switch_T,Switch_N turned on 880 ;***************************************************************************** 881 882 883 Procedure Size_To_Switch 884 0 0000387A 803E[3200]00 cmp byte [SizeMap],0 ;Are there sizes entered? ;AN001; 886 ; $IF NE ;Yes ;AN001; 0 0000387F 744A JE DD_IF13 0 00003881 803E[0100]05 cmp byte [deviceParameters + DP_DeviceType],DEV_HARDDISK ;AN000; ;AN001; 889 ; $IF E ;No size for fixed disk ;AN001; 0 00003886 7508 JNE DD_IF14 0 00003888 BA[0000]E8[0000] Message msgIncompatibleParametersForHardDisk ; ;AN001; 892 ; $ELSE ;Diskette, see what type ;AN001; 0 0000388E EB3B JMP SHORT DD_EN14 894 DD_IF14: 0 00003890 803E[0100]00 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH ; ;AN001; 896 ; $IF E ;Found 180/360k drive ;AN001; 0 00003895 7505 JNE DD_IF16 0 00003897 E87000 call Low_Density_Drive ;Go set switches ;AN001; 899 ; $ELSE ;Check for 96TPI ;AN001; 0 0000389A EB2F JMP SHORT DD_EN16 901 DD_IF16: 0 0000389C 803E[0100]01 cmp byte [deviceParameters + DP_DeviceType],DEV_5INCH96TPI ;AN001; ; 903 ; $IF E ;Found it ;AN001; 0 000038A1 7505 JNE DD_IF18 0 000038A3 E84500 call High_Capacity_Drive ; ;AN001; 906 ; $ELSE ; ;AN001; 0 000038A6 EB23 JMP SHORT DD_EN18 908 DD_IF18: 0 000038A8 803E[0100]02 cmp byte [deviceParameters + DP_DeviceType],DEV_3INCH720KB ;AN0001; 910 ; $IF E ;Found 720k drive ;AN001; 0 000038AD 7505 JNE DD_IF20 0 000038AF E89100 call Small_Drives ; ;AN001; 913 ; $ELSE ; ;AN001; 0 000038B2 EB17 JMP SHORT DD_EN20 915 DD_IF20: 0 000038B4 803E[0100]07 cmp byte [deviceParameters + DP_DeviceType],DEV_OTHER ;AN001; 917 ; $IF E ;Must be 1.44mb ;AN001; 0 000038B9 7505 JNE DD_IF22 0 000038BB E89200 call Other_Drives ; ;AN001; 920 ; $ELSE ; ;AN001; 0 000038BE EB0B JMP SHORT DD_EN22 922 DD_IF22: 0 000038C0 BA[0000]E8[0000] Message msgParametersNotSupportedByDrive ; ;AN001; 0 000038C6 C606[0000]FF mov byte [Fatal_Error],Yes ; ;AN001; 925 ; $ENDIF ; ;AN001; 926 DD_EN22: 927 ; $ENDIF ; ;AN001; 928 DD_EN20: 929 ; $ENDIF ; ;AN001; 930 DD_EN18: 931 ; $ENDIF ; ;AN001; 932 DD_EN16: 933 ; $ENDIF ; ;AN001; 934 DD_EN14: 935 ; $ENDIF ; ;AN001; 936 DD_IF13: 0 000038CB 803E[0000]FF cmp byte [Fatal_Error],Yes ; ;AN001; 938 ; $IF E ; ;AN001; 0 000038D0 7506 JNE DD_IF30 0 000038D2 BA[0000]E8[0000] Message msgIncompatibleParameters ; ;AN001; 941 ; $ENDIF ; ;AN001; 942 DD_IF30: 943 0 000038D8 803E[0100]05 cmp byte [deviceParameters + DP_DeviceType],DEV_HARDDISK ;an001; 945 ; $if e ;an001; 0 000038DD 7505 JNE DD_IF32 0 000038DF C606[0000]FF mov byte [Fatal_Error],Yes ;an001; 948 ; $endif ;an001; 949 DD_IF32: 950 0 000038E4 8126[0000]FFEF and word [SwitchMap],~ Switch_F ;Turn off /F so doesn't effect ;AN001; 0 000038EA C3 ret ; following logic ;AN001; 953 954 Size_To_Switch endp 955 956 ;***************************************************************************** 957 ;Routine name: High_Capacity_Drive 958 ;***************************************************************************** 959 ; 960 ;Description: See if 1.2mb diskette, or one of the other 5 1/4 sizes. Turn 961 ; on /4 if 360k or lower 962 ; 963 ;Called Procedures: Low_Density_Drive 964 ; 965 ;Change History: Created 8/1/87 MT 966 ; 967 ;Input: SizeMap 968 ; Fatal_Error = NO 969 ; 970 ;Output: Fatal_Error = YES/NO 971 ; SwitchMap = Switch_4 if 360k or lowere 972 ;***************************************************************************** 973 974 Procedure High_Capacity_Drive ; 975 0 000038EB F606[3200]20 test byte [SizeMap],Size_1200 ;1.2mb diskette? ;AN001; 977 ; $IF Z ;Nope ;AN001; 0 000038F0 7517 JNZ DD_IF34 0 000038F2 E81500 call Low_Density_Drive ;Check for /4 valid types ;AN001; 980 No equ NO ; NASM port equate 0 000038F5 803E[0000]00 cmp byte [Fatal_Error], No ;Find 160/180/320/360k? ;AN001; 982 ; $IF E ;Yes ;AN001; 0 000038FA 7508 JNE DD_IF35 0 000038FC 810E[0000]8000 or word [SwitchMap],Switch_4 ;Turn on /4 switch ;AN001; 985 ; $ELSE ;Did not find valid size ;AN001; 0 00003902 EB05 JMP SHORT DD_EN35 987 DD_IF35: 0 00003904 C606[0000]FF mov byte [Fatal_Error],Yes ;Indicate invalid device ;AN001; 989 ; $ENDIF ; ;AN001; 990 DD_EN35: 991 ; $ENDIF ; ;AN001; 992 DD_IF34: 0 00003909 C3 ret ; ;AN001; 994 995 High_Capacity_Drive endp 996 997 ;***************************************************************************** 998 ;Routine name: Low_Density_Drive 999 ;***************************************************************************** 1000 ; 1001 ;Description: See if 360k diskete or one of the other 5 1/4 sizes. Turn 1002 ; on the /1/8 switch to match sizes 1003 ; 1004 ;Called Procedures: Low_Density_Drive 1005 ; 1006 ;Change History: Created 8/1/87 MT 1007 ; 1008 ;Input: SizeMap 1009 ; Fatal_Error = NO 1010 ; 1011 ;Output: Fatal_Error = YES/NO 1012 ; SwitchMap = Switch_1, Switch_8 to define size 1013 ; 1014 ; 360k = No switch 1015 ; 320k = Switch_8 1016 ; 180k = Switch_1 1017 ; 160k = Switch_1 + Switch_8 1018 ;***************************************************************************** 1019 1020 1021 Procedure Low_Density_Drive ; ;AN000; 1022 ; 0 0000390A F606[3200]01 test byte [SizeMap],Size_160 ; ;AN001; 1024 ; $IF NZ ; ;AN001; 0 0000390F 7408 JZ DD_IF39 0 00003911 810E[0000]4001 or word [SwitchMap],Switch_1+Switch_8 ; ;AN001; 1027 ; $ELSE ; ;AN001; 0 00003917 EB29 JMP SHORT DD_EN39 1029 DD_IF39: 0 00003919 F606[3200]02 test byte [SizeMap],Size_180 ; ;AN001; 1031 ; $IF NZ ; ;AN001; 0 0000391E 7407 JZ DD_IF41 0 00003920 830E[0000]40 or word [SwitchMap],Switch_1 ; ;AN001; 1034 ; $ELSE ; ;AN001; 0 00003925 EB1B JMP SHORT DD_EN41 1036 DD_IF41: 0 00003927 F606[3200]04 test byte [SizeMap],Size_320 ; ;AN001; 1038 ; $IF NZ ; ;AN001; 0 0000392C 7408 JZ DD_IF43 0 0000392E 810E[0000]0001 or word [SwitchMap],Switch_8 ; ;AN001; 1041 ; $ELSE ; ;AN001; 0 00003934 EB0C JMP SHORT DD_EN43 1043 DD_IF43: 0 00003936 F606[3200]08 test byte [SizeMap],Size_360 ; ;AN001; 1045 ; $IF Z ;None of the above, not valid ;AN001; 0 0000393B 7505 JNZ DD_IF45 0 0000393D C606[0000]FF mov byte [Fatal_Error],Yes ; ;AN001; 1048 ; $ENDIF ; ;AN001; 1049 DD_IF45: 1050 ; $ENDIF ; ;AN001; 1051 DD_EN43: 1052 ; $ENDIF ; ;AN001; 1053 DD_EN41: 1054 ; $ENDIF ; ;AN001; 1055 DD_EN39: 0 00003942 C3 ret ; ;AN001; 1057 1058 Low_Density_Drive endp 1059 1060 ;***************************************************************************** 1061 ;Routine name: Small_Drives 1062 ;***************************************************************************** 1063 ; 1064 ;Description: See if 720k media in 720 drive, set up /T/N if so, otherwise 1065 ; error 1066 ; 1067 ;Called Procedures: None 1068 ; 1069 ;Change History: Created 8/1/87 MT 1070 ; 1071 ;Input: SizeMap 1072 ; Fatal_Error = NO 1073 ; 1074 ;Output: Fatal_Error = YES/NO 1075 ; SwitchMap 1076 ; TrackCnt 1077 ; NumSectors 1078 ; 720k = /T:80 /N:9 1079 ;***************************************************************************** 1080 1081 Procedure Small_Drives ; ;AN000; 1082 0 00003943 F606[3200]10 test byte [SizeMap],Size_720 ;Ask for 720k? ;AN001; 1084 ; $IF Z ;Nope, thats all drive can do ;AN001; 0 00003948 7505 JNZ DD_IF50 0 0000394A C606[0000]FF mov byte [Fatal_Error],Yes ;Indicate error ;AN001; 1087 ; $ENDIF ; ;AN001; 1088 DD_IF50: 0 0000394F C3 ret ; ;AN001; 1090 1091 Small_Drives endp 1092 1093 1094 ;***************************************************************************** 1095 ;Routine name: Other_Drives 1096 ;***************************************************************************** 1097 ; 1098 ;Description: See if 1.44 media or 720k media, setup /t/n, otherwise error 1099 ; 1100 ;Called Procedures: Small_Drives 1101 ; 1102 ;Change History: Created 8/1/87 MT 1103 ; 1104 ;Input: SizeMap 1105 ; Fatal_Error = NO 1106 ; 1107 ;Output: Fatal_Error = YES/NO 1108 ; SwitchMap 1109 ; TrackCnt 1110 ; NumSectors 1111 ; 720k = /T:80 /N:9 1112 ;***************************************************************************** 1113 1114 Procedure Other_Drives ; ;AN001; 1115 0 00003950 F606[3200]40 test byte [SizeMap],Size_1440 ;Ask for 1.44mb diskette? ;AN001; 1117 ; $IF Z ;Nope ;AN001; 0 00003955 751D JNZ DD_IF52 0 00003957 E8E9FF call Small_Drives ;See if 720k ;AN001; 0 0000395A 803E[0000]00 cmp byte [Fatal_Error],No ;Fatal_error=Yes if not ;AN001; 1121 ; $IF E ;Got 720k ;AN001; 0 0000395F 7511 JNE DD_IF53 0 00003961 830E[0000]30 or word [SwitchMap],Switch_T+Switch_N ;Turn on /T:80 /N:9 ;AN001; 0 00003966 C706[0000]5000 mov word [TrackCnt],80 ; ;AN001; 0 0000396C C706[0000]0900 mov word [NumSectors],9 ; ;AN001; 1126 ; $ENDIF ; ;AN001; 1127 DD_IF53: 1128 ; $ELSE ;Asked for 1.44mb ;AN001; 0 00003972 EB11 JMP SHORT DD_EN52 1130 DD_IF52: 0 00003974 830E[0000]30 or word [SwitchMap],Switch_T+Switch_N ;Turn on /T:80 /N:18; ;AN001; 0 00003979 C706[0000]5000 mov word [TrackCnt],80 ;This will protect SIZE=1440 ;AN001; 0 0000397F C706[0000]1200 mov word [NumSectors],18 ; from non-standard drives with ;AN001; 1134 ; $ENDIF ; type of 'other' ;AN001; 1135 DD_EN52: 0 00003985 C3 ret ; ;AN001; 1137 1138 Other_Drives endp 1139 1140 1141 ;***************************************************************************** 1142 ;Routine name:Check_T_N 1143 ;***************************************************************************** 1144 ; 1145 ;Description: Make sure than if /T is entered, /N is also entered 1146 ; 1147 ;Called Procedures: None 1148 ; 1149 ;Change History: Created 8/23/87 MT 1150 ; 1151 ;Input: SizeMap 1152 ; Fatal_Error = NO 1153 ; 1154 ;Output: Fatal_Error = YES/NO 1155 ;***************************************************************************** 1156 1157 Procedure Check_T_N 1158 0 00003986 F706[0000]2000 test word [SwitchMap],Switch_N ;Make sure /T entered if /N ;AN009; 1160 ; $IF NZ,AND ; ;AN009; 0 0000398C 7415 JZ DD_IF57 0 0000398E F706[0000]1000 test word [SwitchMap],Switch_T ; ;AN009; 1163 ; $IF Z ; ;AN009; 0 00003994 750D JNZ DD_IF57 0 00003996 BA[0000]E8[0000] Message msgBad_T_N ;It wasn't, so barf ;AN009; 0 0000399C C606[0000]FF mov byte [Fatal_Error],Yes ;Indicate error ;AN009; 1167 ; $ELSE ; ;AN009; 0 000039A1 EB1B JMP SHORT DD_EN57 1169 DD_IF57: 0 000039A3 F706[0000]1000 test word [SwitchMap],Switch_T ;Make sure /N entered if /T ;AN009; 1171 ; $IF NZ,AND ; ;AN009; 0 000039A9 7413 JZ DD_IF59 0 000039AB F706[0000]2000 test word [SwitchMap],Switch_N ; ;AN009; 1174 ; $IF Z ;It wasn't, so also barf ;AN009; 0 000039B1 750B JNZ DD_IF59 0 000039B3 BA[0000]E8[0000] Message msgBad_T_N ; ;AN009; 0 000039B9 C606[0000]FF mov byte [Fatal_Error],Yes ;Indicate error ;AN009; 1178 ; $ENDIF ; ;AN009; 1179 DD_IF59: 1180 ; $ENDIF ; ;AN009; 1181 DD_EN57: 0 000039BE C3 ret 1183 1184 Check_T_N endp 1185 1186 1187 1188 ;------------------------------------------------------------------------------- 1189 ; LastChanceToSaveIt: 1190 ; This routine is called when an error is detected in DiskFormat. 1191 ; If it returns with carry not set then DiskFormat is restarted. 1192 ; It gives the oem one last chance to try formatting differently. 1193 ; fLastChance gets set Then to prevent multiple prompts from being 1194 ; issued for the same diskette. 1195 ; 1196 ; Algorithm: 1197 ; IF (error_loc == Track_0_Head_1) & 1198 ; ( Device_type < 96TPI ) 1199 ; THEN 1200 ; fLastChance := TRUE 1201 ; try formatting 48TPI_Single_Sided 1202 ; ELSE return ERROR 1203 ; 1204 LastChanceToSaveIt proc near 1205 0 000039BF 833E[0000]00 cmp word [currentCylinder], 0 0 000039C4 751D jne WeCanNotIgnoreThisError 0 000039C6 833E[0000]01 cmp word [currentHead], 1 0 000039CB 7516 jne WeCanNotIgnoreThisError 1210 0 000039CD 803E[0100]00 cmp byte [deviceParameters + DP_DeviceType], DEV_5INCH 0 000039D2 770F ja WeCanNotIgnoreThisError 1213 0 000039D4 C606[0000]FF mov byte [fLastChance], TRUE 1214 ****************** warning: byte data exceeds bounds [-w+number-overflow] 1215 0 000039D9 830E[0000]40 or word [switchmap], SWITCH_1 0 000039DE E81BFC call CheckSwitches 0 000039E1 F8 clc 0 000039E2 C3 ret 1220 1221 WeCanNotIgnoreThisError: 0 000039E3 F9 stc 0 000039E4 C3 ret 1224 1225 LastChanceToSaveIt endp 1226 1227 ;------------------------------------------------------------------------------- 1228 1229 1230 ;***************************************************************************** 1231 ;Routine name WriteBootSector 1232 ;***************************************************************************** 1233 ; 1234 ;DescriptioN: Copy EBPB information to boot record provided by Get recommended 1235 ; BPB, write out boot record, error 1236 ; if can write it, then fill in new fields (id, etc..). The volume 1237 ; label will not be added at this time, but will be set by the 1238 ; create volume label call later. 1239 ; 1240 ;Called Procedures: Message (macro) 1241 ; 1242 ;Change History: Created 4/20/87 MT 1243 ; 1244 ;Input: DeviceParameters.DP_BPB 1245 ; 1246 ;Output: CY clear if ok 1247 ; CY set if error writing boot or media_id info 1248 ; 1249 ;Psuedocode 1250 ;---------- 1251 ; 1252 ; Copy recommended EBPB information to canned boot record 1253 ; Write boot record out (INT 26h) 1254 ; IF error 1255 ; Display boot error message 1256 ; stc 1257 ; ELSE 1258 ; Compute serial id and put into field (CALL Create_Serial_ID) 1259 ; Point at 'FAT_12' string for file system type 1260 ; IF fBIGFat ;16 bit FAT 1261 ; Point at 'FAT_16' for file system type 1262 ; ENDIF 1263 ; Copy file system string into media_id field 1264 ; Write info to boot (INT 21h AX=440Dh, CX=0843h SET MEDIA_ID) 1265 ; IF error (CY set) 1266 ; Display boot error message 1267 ; stc 1268 ; ELSE 1269 ; clc 1270 ; ENDIF 1271 ; ENDIF 1272 ; ret 1273 ;***************************************************************************** 1274 1275 Procedure WriteBootSector ; ;AN000; 1276 0 000039E5 8D36[0700] lea si, [deviceParameters + DP_BPB] ;Copy EBPB to the boot record ; 0 000039E9 8D3E[E602] lea di, [Boot + EXT_BOOT_BPB] ; " " " " ;AC000: 0 000039ED B91900 mov cx, EXT_BPB_INFO_struc_size ; " " " " ;AC000: 0 000039F0 1E push ds ;Set ES=DS (data segment) ; ; 0 000039F1 07 pop es ; " " " " ; ; 0 000039F2 F2A4 repnz movsb ;Do the copy ; ; 1283 ;Write out the boot record ; ; 0 000039F4 A0[0000] mov al, [drive] ;Get drive letter ; ; 0 000039F7 B90100 mov cx, 1 ;Specify 1 sector ; ; 0 000039FA 31D2 xor dx, dx ;Logical sector 0 ; ; 0 000039FC 8D1E[DB02] lea bx, [boot] ;Point at boot record ; ; 1288 ;Boot record in 1st 32mb of partition 0 00003A00 C706[0200]0000 mov word [Read_Write_Relative + Start_Sector_High],0 ; ;AN000; 0 00003A06 E8[0000] call Write_Disk ; ;AC000; 1291 ; $IF C ;Error on write ;AC000; 0 00003A09 7309 JNC DD_IF62 0 00003A0B BA[0000]E8[0000] Message msgBootWriteError ;Print error ; ; 0 00003A11 F9 stc ;CY=1 means error ; ; 1295 ; $ELSE ;Good write of boot record! ;AN000; 0 00003A12 EB4A JMP SHORT DD_EN62 1297 DD_IF62: 0 00003A14 8B0E[2C00] mov cx,[Dummy_Label_Size] ;Put in dummy volume label size ;ac026;ac028; 0 00003A18 8D36[2100] lea si,[Dummy_Label] ; " " " " ;AN000; 0 00003A1C 8D3E[F506] lea di,[Media_ID_Buffer + Media_ID_Volume_Label] ; " " " " ;AN000; 0 00003A20 F3A4 rep movsb ; " " " " ;AN000; 0 00003A22 E83A00 call Create_Serial_ID ;Go create unique ID number ;AN000; 0 00003A25 8D36[DF06] lea si,[FAT12_String] ;Assume 12 bit FAT ;AN000; 0 00003A29 803E[0000]FF cmp byte [fBigFAT],TRUE ;Is it? ;AN000; 1304 ****************** warning: byte data exceeds bounds [-w+number-overflow] 1305 ; $IF E ;Not if fBigFat is set.... ;AN000; 0 00003A2E 7504 JNE DD_IF64 0 00003A30 8D36[E706] lea si,[FAT16_String] ;Got 16 bit FAT ;AN000; 1308 ; $ENDIF ; ;AN000; 1309 DD_IF64: 1310 ;Copy file system string ; ; 0 00003A34 B90800 mov cx,8 ; to buffer ;AN000; 0 00003A37 8D3E[0007] lea di,[Media_ID_Buffer + Media_ID_File_System] ; " " ;AN000; 0 00003A3B F2A4 repnz movsb ; " " " " ;AN000; 1314 Generic_IOCtl equ GENERIC_IOCTL ; NASM port equate 0 00003A3D B00D mov al,Generic_IOCtl ;Generic IOCtl call ;AN000; 1316 Drive equ drive ; NASM port label 0 00003A3F 8A1E[0000] mov bl,[Drive] ;Get drive ;AN000; 0 00003A43 FEC3 inc bl ;Make it 1 based ;AN000; 0 00003A45 30FF xor bh,bh ;Set bh=0 ;AN000; 1320 RawIO equ RAWIO ; NASM port equate 0 00003A47 B508 mov ch,RawIO ;Set Media ID call ;AN000; 1322 Set_Media_ID equ SET_MEDIA_ID ; NASM port equate 0 00003A49 B146 mov cl,Set_Media_ID 0 00003A4B BA[EF06] mov dx,offset Media_ID_Buffer ;Point at buffer ;AN000; 0 00003A4E B444CD21 DOS_Call IOCtl ;Do function call ;AN000; 1326 ; $IF C ;Error ? (Write or old boot rec);AN000; 0 00003A52 7309 JNC DD_IF66 0 00003A54 BA[0000]E8[0000] Message msgBootWriteError ;Indicate we couldn't write it ;AN000; 0 00003A5A F9 stc ;CY=1 for error return ;AN000; 1330 ; $ELSE ;Set Media ID okay ;AN000; 0 00003A5B EB01 JMP SHORT DD_EN66 1332 DD_IF66: 0 00003A5D F8 clc ;CY=0 for good return ;AN000; 1334 ; $ENDIF ; ;AN000; 1335 DD_EN66: 1336 ; $ENDIF ; ;AN000; 1337 DD_EN62: 0 00003A5E C3 ret ; ;AN000; 1339 1340 WriteBootSector endp ; ;AN000; 1341 1342 1343 ;***************************************************************************** 1344 ;Routine name Create_Serial_ID 1345 ;***************************************************************************** 1346 ; 1347 ;DescriptioN&gml Create unique 32 bit serial number by getting current date and 1348 ; time and then scrambling it around. 1349 ; 1350 ;Called Procedures: Message (macro) 1351 ; 1352 ;Change History&gml Created 4/20/87 MT 1353 ; 1354 ;Input&gml None 1355 ; 1356 ;Output&gml Media_ID_Buffer.Serial_Number = set 1357 ; AX,CX,DX destroyed 1358 ; Serial_Num_Low/High = Serial number generated 1359 ; 1360 ;Psuedocode 1361 ;---------- 1362 ; 1363 ; Get date (INT 21h, AH=2Bh) 1364 ; Get time (INT 21h, AH=2Ch) 1365 ; Serial_ID+0 = DX reg date + DX reg time 1366 ; Serial_ID+2 = CX reg date + CX reg time 1367 ; Serial_Num_Low = Serial_ID+2 1368 ; Serial_Num_High = Serial_ID+0 1369 ; ret 1370 ;***************************************************************************** 1371 1372 Procedure Create_Serial_ID ; ;AN000; 1373 0 00003A5F B42ACD21 DOS_Call Get_Date ;Get date from DOS ;AN000; 0 00003A63 51 push cx ;Save results ;AN000; 0 00003A64 52 push dx ; ;AN000; 0 00003A65 B42CCD21 DOS_Call Get_Time ;Get_Time ;AN000; 0 00003A69 89D0 mov ax,dx ;Scramble it ;AN000; 0 00003A6B 5A pop dx ; ;AN000; 0 00003A6C 01D0 add ax,dx ; ;AN000; 0 00003A6E A3[F306] mov word ptr [Media_ID_Buffer + Media_ID_Serial_Number+2],ax ; ;AC004; 0 00003A71 A3[2E00] mov [Serial_Num_Low],ax ; ;AN000; 0 00003A74 89C8 mov ax,cx ; ;AN000; 0 00003A76 59 pop cx ; ;AN000; 0 00003A77 01C8 add ax,cx ; ;AN000; 0 00003A79 A3[F106] mov word ptr [Media_ID_Buffer + Media_ID_Serial_Number],ax ; ;AC004; 0 00003A7C A3[3000] mov [Serial_Num_High],ax ; ;AN000; 0 00003A7F C3 ret ; ;AN000; 1389 1390 Create_Serial_ID endp ; ;AN000; 1391 1392 ;------------------------------------------------------------------------------- 1393 1394 ; OemDone: 1395 ; 1396 OemDone proc near 1397 1398 ; if /b write out a fake dos & bios 0 00003A80 F706[0000]0002 test word [switchmap], SWITCH_B 0 00003A86 7406 jz Switch8? 0 00003A88 E88200 call WriteBogusDos 0 00003A8B 7301C3 retc 1403 1404 Switch8?: 0 00003A8E F706[0000]0001 test word [switchmap], SWITCH_8 0 00003A94 7405 jz HardDisk? 0 00003A96 E8E300 call ConvertToOldDirectoryFormat 0 00003A99 72F2 retc 1409 1410 HardDisk?: 0 00003A9B 803E[0100]05 cmp byte [deviceParameters + DP_DeviceType], DEV_HARDDISK 0 00003AA0 F8 clc 0 00003AA1 75EA retnz 0 00003AA3 E85901 call SetPartitionTable 1415 0 00003AA6 C3 return 1417 1418 OemDone endp 1419 1420 ;------------------------------------------------------------------------------ 1421 === Switch to base=000080h -> "DATA" 1422 section data 1423 1424 %if IBMCOPYRIGHT 1425 biosFilename db "x:\ibmbio.com",0 1426 dosFilename db "x:\ibmdos.com",0 1427 %else 0 000015B8 783A5C696F2E737973 biosFilename db "x:\io.sys",0 0 000015C1 00 0 000015C2 783A5C6D73646F732E dosFilename db "x:\msdos.sys",0 0 000015CB 73797300 1430 %endif 1431 === Switch to base=001900h -> "CODE" 1432 section code ; data ends 1433 1434 ; simple code to stuff bogus dos in old-style diskette. 1435 1436 BogusDos: 0 00003AA7 0E push cs 0 00003AA8 1F pop ds 0 00003AA9 B020 mov al,20h 0 00003AAB E620 out 20h,al ; turn on the timer so the disk motor 0 00003AAD BE1E00 mov si,mesofs ; shuts off 0 00003AB0 90 nop ; identicalise 1443 sys_mess_loop: 0 00003AB1 AC lodsb 1445 %if IBMCOPYRIGHT 1446 end_sys_loop: 1447 %endif 0 00003AB2 08C0 or al,al 0 00003AB4 7409 jz end_sys_loop 0 00003AB6 B40E mov ah,14 0 00003AB8 BB0700 mov bx,7 0 00003ABB CD10 int 16 0 00003ABD EBF2 jmp sys_mess_loop 1454 %ifn IBMCOPYRIGHT 1455 end_sys_loop: 0 00003ABF 30E4 xor ah, ah ; get next char function 0 00003AC1 CD16 int 16h ; call keyboard services 0 00003AC3 CD19 int 19h ; reboot 1459 %endif 1460 1461 ;=== Push trace listing source: boot.cl1 1462 %include "boot.cl1" ; NASM included file 1 <1> ; boot.cl1 2 <1> 3 <1> 4 <1> ;_______________________ 5 <1> 0 00003AC5 0D0A4E6F6E2D537973 SYSMSG DB 13,10,"Non-System disk or disk error",13,10 0 00003ACE 74656D206469736B20 0 00003AD7 6F72206469736B2065 0 00003AE0 72726F720D0A 0 00003AE6 5265706C6163652061 DB "Replace and press any key when ready",13,10,0 0 00003AEF 6E6420707265737320 0 00003AF8 616E79206B65792077 0 00003B01 68656E207265616479 0 00003B0A 0D0A00 1463 ;=== Pop trace listing source 1464 sysmsg equ SYSMSG ; NASM port label 1465 mesofs equ sysmsg - BogusDos 1466 1467 WriteBogusDos proc near 1468 0 00003B0D A0[0000] mov al,[driveLetter] 0 00003B10 A2[0807] mov [biosFilename],al 0 00003B13 A2[1207] mov [dosFilename],al 1472 ATTR_HIDDEN equ attr_hidden ; NASM port equate 1473 ATTR_SYSTEM equ attr_system ; NASM port equate 0 00003B16 B90600 mov cx, ATTR_HIDDEN | ATTR_SYSTEM 0 00003B19 8D16[0807] lea dx, [biosFilename] 1476 CREAT equ Creat ; NASM port equate 0 00003B1D B43C mov ah,CREAT 0 00003B1F CD21 int 21h 0 00003B21 89C3 mov bx,ax 0 00003B23 B9B888 mov cx, BIOS_SIZE 0 00003B26 1E push ds 0 00003B27 0E push cs 0 00003B28 1F pop ds 1484 assume ds:code 0 00003B29 8D16[B704] lea dx, [BogusDos] 1486 WRITE equ Write ; NASM port equate 0 00003B2D B440 mov ah,WRITE 0 00003B2F CD21 int 21h 0 00003B31 1F pop ds 1490 assume ds:data 1491 CLOSE equ Close ; NASM port equate 0 00003B32 B43E mov ah,CLOSE 0 00003B34 CD21 int 21h 0 00003B36 B90600 mov cx, ATTR_HIDDEN | ATTR_SYSTEM 0 00003B39 8D16[1207] lea dx, [dosFilename] 0 00003B3D B43C mov ah,CREAT 0 00003B3F CD21 int 21h 0 00003B41 89C3 mov bx,ax 0 00003B43 B98890 mov cx, DOS_SIZE 0 00003B46 8D16[B704] lea dx, [BogusDos] 0 00003B4A B440 mov ah,WRITE 0 00003B4C CD21 int 21h 0 00003B4E B43E mov ah,CLOSE 0 00003B50 CD21 int 21h 1505 ; Comunicate system size to the main format program 1506 DOS equ Dos ; NASM port label 1507 FileSizeInBytes equ fileSizeInBytes ; NASM port equate 0 00003B52 C706[0400]8890 mov word [DOS + FileSizeInBytes],DOS_SIZE ;an000; dms;get size of DOS 0 00003B58 C706[0600]0000 mov word [DOS + FileSizeInBytes+2],00h ;an000; dms; 1510 0 00003B5E 31D2 xor dx,dx 0 00003B60 B88890 mov ax,DOS_SIZE 0 00003B63 E8[0000] call AddToSystemSize 1514 0 00003B66 C706[0400]B888 mov word [Bios + FileSizeInBytes],BIOS_SIZE ;an000; dms;get size of BIOS 0 00003B6C C706[0600]0000 mov word [Bios + FileSizeInBytes+2],00h ;an000; dms; 1517 0 00003B72 31D2 xor dx,dx 0 00003B74 B8B888 mov ax,BIOS_SIZE 0 00003B77 E8[0000] call AddToSystemSize 1521 0 00003B7A F8 clc 0 00003B7B C3 return 1524 1525 WriteBogusDos endp 1526 1527 ;------------------------------------------------------------------------------- 1528 1529 ConvertToOldDirectoryFormat proc near 1530 1531 ; 1532 ; convert to 1.1 directory 1533 ; 0 00003B7C A0[0000] mov al,[drive] ; Get 1st sector of directory 0 00003B7F B90100 mov cx,1 ; 1.1 directory always starts on 0 00003B82 BA0300 mov dx,3 ; sector 3 0 00003B85 8D1E[DB04] lea bx,[scratchBuffer] 1538 ;Root Directory always in 1st 32mb of partition 0 00003B89 C706[0200]0000 mov word [Read_Write_Relative + Start_Sector_High],0 ; ;AN000; 0 00003B8F E8[0000] call Read_Disk ; ;AC000; 0 00003B92 7308 jnc DirectoryRead 0 00003B94 BA[0000]E8[0000] Message msgDirectoryReadError ; ;AC000; 0 00003B9A F9 stc 0 00003B9B C3 ret 1545 DirectoryRead: 1546 1547 ; fix attribute of ibmbio and ibmdos 0 00003B9C 8D1E[DB04] lea bx,[scratchBuffer] 0 00003BA0 C6470B06 mov byte ptr [bx + dir_attr], ATTR_HIDDEN | ATTR_SYSTEM 0 00003BA4 83C320 add bx, dir_entry_struc_size 0 00003BA7 C6470B06 mov byte ptr [bx + dir_attr], ATTR_HIDDEN | ATTR_SYSTEM 1552 1553 wrtdir: 0 00003BAB A0[0000] mov al,[drive] ; write out the directory 0 00003BAE 98 cbw 0 00003BAF B90100 mov cx,1 0 00003BB2 BA0300 mov dx,3 0 00003BB5 8D1E[DB04] lea bx,[scratchBuffer] 1559 ;Root Directory always in 1st 32mb of partition 0 00003BB9 C706[0200]0000 mov word [Read_Write_Relative + Start_Sector_High],0 ; ;AN000; 0 00003BBF E8[0000] call Write_Disk ; ;AC000; 0 00003BC2 7308 jnc DirectoryWritten 0 00003BC4 BA[0000]E8[0000] Message msgDirectoryWriteError ; ;AC000; 0 00003BCA F9 stc 0 00003BCB C3 ret 1566 DirectoryWritten: 1567 0 00003BCC F706[0000]0100 test word [switchmap], SWITCH_S ; Was system requested? 0 00003BD2 75A7 retnz ; yes, don't write old boot sector 0 00003BD4 A0[0000] mov al,[drive] 0 00003BD7 98 cbw 0 00003BD8 BB[DB00] mov bx,offset boot2 ; no, write old boot sector 0 00003BDB 833E[1600]01 cmp word [deviceParameters + DP_BPB + BPB_Heads], 1 0 00003BE0 7405 je bootset8 0 00003BE2 C747030301 mov word ptr [bx+3],0103h ; start address for double sided drives 1576 bootset8: 0 00003BE7 B90100 mov cx,1 0 00003BEA 31D2 xor dx,dx 1579 ;Boot record in 1st 32mb of partition 0 00003BEC C706[0200]0000 mov word [Read_Write_Relative + Start_Sector_High],0 ; ;AN000; 0 00003BF2 E8[0000] call Write_Disk ; ;AC000; 0 00003BF5 7384 retnc 1583 0 00003BF7 BA[0000]E8[0000] Message msgBootWriteError ; ;AC000; 0 00003BFD F9 stc 0 00003BFE C3 ret 1587 1588 ConvertToOldDirectoryFormat endp 1589 1590 ;------------------------------------------------------------------------------- 1591 1592 a_PartitionTableEntry struc 0 000035F0 ?? BootInd db ? 0 000035F1 ?? BegHead db ? 0 000035F2 ?? BegSector db ? 0 000035F3 ?? BegCylinder db ? 0 000035F4 ?? SysInd db ? 0 000035F5 ?? EndHead db ? 0 000035F6 ?? EndSector db ? 0 000035F7 ?? EndCylinder db ? 0 000035F8 ???????? RelSec dd ? 0 000035FC ???????? CSec dd ? 1603 a_PartitionTableEntry ends 1604 1605 ; structure of the IBM hard disk boot sector: 1606 IBMBoot STRUC 1607 00000000 db 512 - (4*a_PartitionTableEntry_struc_size + 2) dup(?) 1608 000001BE PartitionTable db 4*a_PartitionTableEntry_struc_size dup(?) 0 000037EE ???? Signature dw ? 1610 IBMBoot ENDS 1611 1612 1613 ;***************************************************************************** 1614 ;Routine name: SetPartitionTable 1615 ;***************************************************************************** 1616 ; 1617 ;Description: Find location for DOS partition in partition table, get the 1618 ; correct system indicator byte, and write it out. If can not 1619 ; read/write boot record or can't find DOS partition, display 1620 ; error 1621 ; 1622 ;Called Procedures: Message (macro) 1623 ; Determine_Partition_Type 1624 ; ReadSector 1625 ; WriteSector 1626 ; 1627 ;Change History: Created 4/20/87 MT 1628 ; 1629 ;Input: None 1630 ; 1631 ;Output: CY set if error 1632 ; 1633 ;Psuedocode 1634 ;---------- 1635 ; 1636 ; Read the partition table (Call ReadSector) 1637 ; IF ok 1638 ; IF boot signature of 55AAh 1639 ; Point at system partition table 1640 ; SEARCH 1641 ; Assume DOS found 1642 ; IF System_Indicator <> 1,AND 1643 ; IF System_Indicator <> 4,AND 1644 ; IF System_Indicator <> 6 1645 ; STC (DOS not found) 1646 ; ELSE 1647 ; CLC 1648 ; ENDIF 1649 ; EXITIF DOS found (CLC) 1650 ; CALL Determine_Partition_Type 1651 ; Write the partition table (CALL WriteSector) 1652 ; IF error 1653 ; Display boot write error message 1654 ; stc 1655 ; ELSE 1656 ; clc 1657 ; ENDIF 1658 ; ORELSE 1659 ; Point at next partition entry (add 16 to partition table ptr) 1660 ; ENDLOOP if checked all 4 partition entries 1661 ; Display Bad partition table message 1662 ; stc 1663 ; ENDSRCH 1664 ; ELSE invalid boot record 1665 ; Display Bad partition table message 1666 ; stc 1667 ; ENDIF 1668 ; ELSE error 1669 ; Display Partition table error 1670 ; stc 1671 ; ENDIF 1672 ; ret 1673 ;***************************************************************************** 1674 1675 Procedure SetPartitionTable ; ;AN000; 1676 0 00003BFF 31C0 xor ax, ax ;Head ;AC000; 0 00003C01 31DB xor bx, bx ;Cylinder ;AC000; 0 00003C03 31C9 xor cx, cx ;Sector ;AC000; 0 00003C05 8D16[DB00] lea dx, [boot2] ;Never use 1.x boot on hardfile,; ; 0 00003C09 E8C800 call ReadSector ;this will use space as buffer ; ; 1682 ; $IF NC ;If read okay ;AN000; 0 00003C0C 7260 JC DD_IF70 1684 Boot2 equ boot2 ; NASM port label 0 00003C0E 813E[D902]55AA cmp word [Boot2 + Boot_Signature],Boot_ID ; ;AC000; 1686 ; $IF E ;Does signature match? ;AN000; 0 00003C14 754F JNE DD_IF71 0 00003C16 8D1E[9902] lea bx, [boot2 + PartitionTable] ;Yes, point at partition table ;AN000; 1689 ; $SEARCH ;Look for DOS partition ;AN000; 1690 DD_DO72: 1691 sysind equ SysInd ; NASM port equate 0 00003C1A 807F0401 cmp byte [bx + sysind],FAT12_File_System ; ;AC000; 1693 ; $IF NE,AND ; ;AN000; 0 00003C1E 740F JE DD_IF73 0 00003C20 807F0404 cmp byte [bx + sysind],FAT16_File_System ; ;AC000; 1696 ; $IF NE,AND ; ;AN000; 0 00003C24 7409 JE DD_IF73 0 00003C26 807F0406 cmp byte [bx + sysind],New_File_System ; ;AC000; 1699 ; $IF NE ; ;AN000; 0 00003C2A 7403 JE DD_IF73 0 00003C2C F9 stc ;We didn't find partition ;AN000; 1702 ; $ELSE ; ;AN000; 0 00003C2D EB01 JMP SHORT DD_EN73 1704 DD_IF73: 0 00003C2F F8 clc ;Indicate found partition ;AN000; 1706 ; $ENDIF ; ;AN000; 1707 DD_EN73: 1708 ; $EXITIF NC ;Get correct id for it ;AN000; 0 00003C30 7221 JC DD_IF72 0 00003C32 E84100 CALL Determine_Partition_Type ; ;AN000; 0 00003C35 B80000 mov ax, 0 ;Head ; ; 0 00003C38 BB0000 mov bx, 0 ;Cylinder ; ; 0 00003C3B B90000 mov cx, 0 ;Sector ; ; 0 00003C3E 8D16[DB00] lea dx, [boot2] ; ; ; 0 00003C42 E89A00 call WriteSector ;Write out partition table ; ; 1716 ; $IF C ;Error writing boot record ;AN000; 0 00003C45 7309 JNC DD_IF77 0 00003C47 BA[0000]E8[0000] MESSAGE msgPartitionTableWriteError ; ;AC000; 0 00003C4D F9 stc ;Set CY to indicate error ; ; 1720 ; $ELSE ; ;AN000; 0 00003C4E EB01 JMP SHORT DD_EN77 1722 DD_IF77: 0 00003C50 F8 clc ;No error means no CY ; ; 1724 ; $ENDIF ; ;AN000; 1725 DD_EN77: 1726 ; $ORELSE ; ;AN000; 0 00003C51 EB10 JMP SHORT DD_SR72 1728 DD_IF72: 0 00003C53 83C310 add bx,a_PartitionTableEntry_struc_size ; ; ; 0 00003C56 81FB[D902] cmp bx,(offset Boot2 + PartitionTable)+4*a_PartitionTableEntry_struc_size ; ; 1731 ; $ENDLOOP ;Checked all 4 partition entries;AN000; 0 00003C5A EBBE JMP SHORT DD_DO72 0 00003C5C BA[0000]E8[0000] MESSAGE msgBadPartitionTable ;Tell user bad table ;AC000; 0 00003C62 F9 stc ;Set CY for exit ; ; 1735 ; $ENDSRCH ; ;AN000; 1736 DD_SR72: 1737 ; $ELSE ;Invalid boot record ;AN000; 0 00003C63 EB07 JMP SHORT DD_EN71 1739 DD_IF71: 0 00003C65 BA[0000]E8[0000] MESSAGE msgBadPartitionTable ; ;AC000; 0 00003C6B F9 stc ;Set CY for error return ; ; 1742 ; $ENDIF ; ;AN000; 1743 DD_EN71: 1744 ; $ELSE ;Couldn't read boot record ;AN000; 0 00003C6C EB07 JMP SHORT DD_EN70 1746 DD_IF70: 0 00003C6E BA[0000]E8[0000] MESSAGE msgPartitionTableReadError ; ;AC000; 0 00003C74 F9 stc ;Set CY for error return ; ; 1749 ; $ENDIF ; ;AN000; 1750 DD_EN70: 0 00003C75 C3 ret ; ; ; 1752 1753 SetPartitionTable endp ; ;AN000; 1754 1755 ;***************************************************************************** 1756 ;Routine name: Determine_Partition_Type 1757 ;***************************************************************************** 1758 ; 1759 ;DescriptioN: Set the system indicator field to its correct value as 1760 ; determined by the following rules: 1761 ; 1762 ; - Set SysInd = 01h if partition or logical drive size is < 10mb 1763 ; and completely contained within the first 32mb of DASD. 1764 ; - Set SysInd = 04h if partition or logical drive size is >10mb, 1765 ; <32mb, and completely contained within the first 32mb of DASD 1766 ; - Set SysInd to 06h if partition or logical drive size is > 32mb, 1767 ; 1768 ;Called Procedures: Message (macro) 1769 ; 1770 ;Change History: Created 3/18/87 MT 1771 ; 1772 ;Input: BX has offset of partition table entry 1773 ; fBigFAT = TRUE if 16bit FAT 1774 ; 1775 ;Output: BX.SysInd = correct partition system indicator value (1,4,6) 1776 ; 1777 ;Psuedocode 1778 ;---------- 1779 ; Add partition start location to length of partition 1780 ; IF end > 32mb 1781 ; BX.SysInd = 6 1782 ; ELSE 1783 ; IF fBigFat 1784 ; BX.SysInd = 4 1785 ; ELSE 1786 ; BX.SysInd = 1 1787 ; ENDIF 1788 ; ret 1789 ;***************************************************************************** 1790 1791 Procedure Determine_Partition_Type ;AN000; 1792 1793 Csec equ CSec ; NASM port equate 0 00003C76 8B570E mov dx,word ptr [bx + Csec + 2] ;an000; dms;Get high word of sector count 0 00003C79 83FA00 cmp dx,0 ;AN000; ;> 32Mb? 1796 ; $IF NE ;AN000; ;yes 0 00003C7C 7406 JE DD_IF87 0 00003C7E C6470406 mov byte [BX + SysInd],New_File_System ;AN000; ;type 6 1799 ; $ELSE ;AN000; 0 00003C82 EB2C JMP SHORT DD_EN87 1801 DD_IF87: 0 00003C84 E82A00 call Calc_Total_Sectors_For_Partition ;an000; dms;returns DX:AX total sectors 1803 BPB_HiddenSectors equ BPB_HIDDENSECTORS ; NASM port equate 0 00003C87 833E[1A00]00 cmp word [DeviceParameters + DP_BPB + BPB_HiddenSectors + +2],0 ;an000; dms;> 32Mb? 1805 ; $if ne ;an000; dms;yes 0 00003C8C 7406 JE DD_IF89 0 00003C8E C6470406 mov byte [bx + SysInd],New_File_System ;an000; dms; type 6 1808 ; $else ;an000; dms; 0 00003C92 EB1C JMP SHORT DD_EN89 1810 DD_IF89: 0 00003C94 83FA00 cmp dx,0 ;an000; dms; partition > 32 Mb? 1812 ; $if ne ;an000; dms; yes 0 00003C97 7406 JE DD_IF91 0 00003C99 C6470406 mov byte [bx + SysInd],New_File_System ;an000; dms; type 6 1815 ; $else ;an000; dms; < 32 Mb partition 0 00003C9D EB11 JMP SHORT DD_EN91 1817 DD_IF91: 1818 fBigFat equ fBigFAT ; NASM port label 1819 True equ TRUE ; NASM port equate 0 00003C9F 803E[0000]FF cmp byte [fBigFat],True ;an000; ;16 bit FAT 1820 ****************** warning: byte data exceeds bounds [-w+number-overflow] 1821 ; $IF E ;AC000; ;yes 0 00003CA4 7506 JNE DD_IF93 0 00003CA6 C6470404 mov byte [BX + SysInd],FAT16_File_System ;an000; ;type 4 1824 ; $ELSE ;an000; ;12 bit FAT 0 00003CAA EB04 JMP SHORT DD_EN93 1826 DD_IF93: 0 00003CAC C6470401 mov byte [bx + SysInd],FAT12_File_System ;an000; ;type 1 1828 ; $ENDIF ;AN000; 1829 DD_EN93: 1830 ; $ENDIF ;an000; 1831 DD_EN91: 1832 ; $ENDIF ;an000; 1833 DD_EN89: 1834 ; $endif ;an000; 1835 DD_EN87: 0 00003CB0 C3 ret ;an000; 1837 1838 Determine_Partition_Type endp ; ;AN000; 1839 1840 1841 ;========================================================================= 1842 ; Calc_Total_Sectors_For_Partition : This routine determines the 1843 ; total number of sectors within 1844 ; this partition. 1845 ; 1846 ; Inputs : DeviceParameters 1847 ; 1848 ; Outputs : DX:AX - Double word partition size 1849 ;========================================================================= 1850 1851 Procedure Calc_Total_Sectors_For_Partition ;an000; dms; 1852 0 00003CB1 A1[1800] mov ax,word ptr [DeviceParameters + DP_BPB + BPB_HiddenSectors + +0] ;an000; dms; low word 0 00003CB4 8B16[1A00] mov dx,word ptr [DeviceParameters + DP_BPB + BPB_HiddenSectors + +2] ;an000; dms; high word 0 00003CB8 833E[0F00]00 cmp word [DeviceParameters + DP_BPB + BPB_TotalSectors],0 ;an000; dms; extended BPB? 1856 ; $if e ;an000; dms; yes 0 00003CBD 750D JNE DD_IF99 0 00003CBF 0306[1C00] add ax,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +0] ;an000; dms; add in low word 0 00003CC3 83D200 adc dx,0 ;an000; dms; pick up carry if any 0 00003CC6 0316[1E00] add dx,word ptr [DeviceParameters + DP_BPB + BPB_BigTotalSectors + +2] ;an000; dms; add in high word 1861 ; $else ;an000; dms; standard BPB 0 00003CCA EB07 JMP SHORT DD_EN99 1863 DD_IF99: 0 00003CCC 0306[0F00] add ax,word ptr [DeviceParameters + DP_BPB + BPB_TotalSectors] ;an000; dms; add in total sector count 0 00003CD0 83D200 adc dx,0 ;an000; dms; pick up carry if any 1866 ; $endif ;an000; dms; 1867 DD_EN99: 1868 0 00003CD3 C3 ret 1870 1871 Calc_Total_Sectors_For_Partition endp 1872 1873 1874 ;------------------------------------------------------------------------------- 1875 ; ReadSector: 1876 ; Read one sector 1877 ; 1878 ; Input: 1879 ; ax - head 1880 ; bx - cylinder 1881 ; cx - sector 1882 ; dx - transfer address 1883 1884 ReadSector proc near 1885 1886 TrackReadWritePacket equ trackReadWritePacket ; NASM port label 1887 TRWP_FirstSector equ TRWP_FIRSTSECTOR ; NASM port equate 0 00003CD4 890E[3800] mov [TrackReadWritePacket + TRWP_FirstSector], cx 0 00003CD8 B96108 mov cx,(RAWIO << 8) | READ_TRACK 0 00003CDB E80C00 call SectorIO 0 00003CDE C3 return 1892 1893 ReadSector endp 1894 1895 ;------------------------------------------------------------------------------- 1896 ; WriteSector: 1897 ; Write one sector 1898 ; 1899 ; Input: 1900 ; ax - head 1901 ; bx - cylinder 1902 ; cx - sector 1903 ; dx - transfer address 1904 1905 WriteSector proc near 1906 0 00003CDF 890E[3800] mov [TrackReadWritePacket + TRWP_FirstSector], cx 0 00003CE3 B94108 mov cx,(RAWIO << 8) | WRITE_TRACK 0 00003CE6 E80100 call SectorIO 0 00003CE9 C3 return 1911 1912 WriteSector endp 1913 1914 ;------------------------------------------------------------------------------- 1915 ; SectorIO: 1916 ; Read/Write one sector 1917 ; 1918 ; Input: 1919 ; ax - head 1920 ; bx - cylinder 1921 ; cx - (RAWIO shl 8) or READ_TRACK 1922 ; - (RAWIO shl 8) or WRITE_TRACK 1923 ; dx - transfer address 1924 1925 SectorIO proc near 1926 1927 TRWP_Head equ TRWP_HEAD ; NASM port equate 0 00003CEA A3[3400] mov [TrackReadWritePacket + TRWP_Head], ax 1929 TRWP_Cylinder equ TRWP_CYLINDER ; NASM port equate 0 00003CED 891E[3600] mov [TrackReadWritePacket + TRWP_Cylinder], bx 1931 TRWP_TransferAddress equ TRWP_TRANSFERADDRESS ; NASM port equate 0 00003CF1 8916[3C00] mov WORD PTR [TrackReadWritePacket + TRWP_TransferAddress], dx 0 00003CF5 8C1E[3E00] mov WORD PTR [TrackReadWritePacket + TRWP_TransferAddress + 2], ds 1934 TRWP_SectorsToReadWrite equ TRWP_SECTORSTOREADWRITE ; NASM port equate 0 00003CF9 C706[3A00]0100 mov word [TrackReadWritePacket + TRWP_SectorsToReadWrite], 1 1936 0 00003CFF 8A1E[0000] mov bl, [drive] 0 00003D03 FEC3 inc bl 0 00003D05 B80D44 mov ax, (IOCTL << 8) | GENERIC_IOCTL 0 00003D08 8D16[3300] lea dx, [trackReadWritePacket] 0 00003D0C CD21 int 21H 0 00003D0E C3 return 1943 1944 SectorIO endp 1945 1946 ;------------------------------------------------------------------------------- 1947 === Switch to base=000080h -> "DATA" 1948 section data 1949 0 000015CF ?? oldDrive db ? 1951 0 000015D0 FF FCBforVolumeIdSearch db 0ffH 0 000015D1 0000000000 db 5 dup(0) 0 000015D6 08 db 08H 0 000015D7 00 db 0 0 000015D8 3F3F3F3F3F3F3F3F3F db "???????????" 0 000015E1 3F3F 0 000015E3 000000000000000000 db 40 DUP(0) 0 000015EC 000000000000000000 0 000015F5 000000000000000000 0 000015FE 000000000000000000 0 00001607 00000000 1958 === Switch to base=001900h -> "CODE" 1959 section code ; data ends 1960 1961 GetVolumeId proc near 1962 ; Input: 1963 ; dl = drive 1964 ; di = name buffer 1965 1966 ; Save current drive 0 00003D0F B419 mov ah,19H 0 00003D11 CD21 int 21H 0 00003D13 A2[1F07] mov [oldDrive], al 1970 1971 ; Change current drive to the drive that has the volume id we want 0 00003D16 B40E mov ah, 0eH 0 00003D18 CD21 int 21H 1974 1975 ; Search for the volume id 0 00003D1A B411 mov ah, 11H 0 00003D1C 8D16[2007] lea dx, [FCBforVolumeIdSearch] 0 00003D20 CD21 int 21H 0 00003D22 50 push ax 1980 1981 ; Restore current drive 0 00003D23 B40E mov ah, 0eH 0 00003D25 8A16[1F07] mov dl,[oldDrive] 0 00003D29 CD21 int 21H 1985 1986 ; Did the search succeed? 0 00003D2B 58 pop ax 0 00003D2C 08C0 or al,al 0 00003D2E 7402 jz CopyVolumeId 0 00003D30 F9 stc 0 00003D31 C3 ret 1992 1993 CopyVolumeId: 1994 ; Find out where the FCB for the located volume id was put 0 00003D32 B42F mov ah,2fH 0 00003D34 CD21 int 21H 1997 1998 ; Copy the Volume Id 0 00003D36 89DE mov si, bx 0 00003D38 83C608 add si, 8 0 00003D3B 06 push es 0 00003D3C 1E push ds 0 00003D3D 07 pop es 0 00003D3E 1F pop ds 0 00003D3F B90B00 mov cx, 11 0 00003D42 F3A4 rep movsb 0 00003D44 06 push es 0 00003D45 1F pop ds 2009 0 00003D46 F8 clc 0 00003D47 C3 ret 2012 2013 GetVolumeId endp 2014 === Switch to base=000080h -> "DATA" 2015 section data 0 0000160B 000000000000000000 oldVolumeId db 11 dup(0) 0 00001614 0000 === Switch to base=001900h -> "CODE" 2017 section code ; data ends 2018 2019 CheckVolumeId proc near 2020 2021 ; Get the volume id that's on the disk 0 00003D48 8D3E[5B07] lea di, [oldVolumeId] 0 00003D4C 8A16[0000] mov dl, [drive] 0 00003D50 E8BCFF call GetVolumeId 0 00003D53 7302 jnc Ask_User ;Did we find one? 0 00003D55 F8 clc ;No, return with no error 0 00003D56 C3 ret 2028 2029 ; Ask the user to enter the volume id that he/she thinks is on the disk 2030 ; (first blank out the input buffer) 2031 Ask_User: 2032 0 00003D57 BA[0000]E8[0000] Message msgWhatIsVolumeId? ; ;AC000; 2034 ;lea dx, ptr_msgWhatIsVolumeId? 2035 ;call std_printf 0 00003D5D E8[0000] call user_string 0 00003D60 E8[0000] call crlf 2038 2039 ; If the user just pressed ENTER, then there must be no label 0 00003D63 803E[0100]00 cmp byte [inbuff+1], 0 0 00003D68 7508 jne CompareVolumeIds 0 00003D6A 803E[5B07]00 cmp byte [oldVolumeId], 0 0 00003D6F 7534 jne BadVolumeId 0 00003D71 C3 ret 2045 2046 CompareVolumeIds: 2047 ; pad the reponse with blanks 2048 ; The buffer is big enough so just add 11 blanks to what the user typed in 0 00003D72 1E push ds 0 00003D73 07 pop es 0 00003D74 B90B00 mov cx, Label_Length ;AC000; 0 00003D77 31DB xor bx,bx 0 00003D79 8A1E[0100] mov bl, [inbuff + 1] 0 00003D7D 8D3E[0200] lea di, [inbuff + 2] 0 00003D81 01DF add di, bx 0 00003D83 B020 mov al, ' ' 0 00003D85 F3AA rep stosb 2058 ; Make the reply all uppercase 2059 Inbuff equ inbuff ; NASM port label 2060 ASCIIZ_End equ Asciiz_End ; NASM port equate 0 00003D87 C606[0D00]00 mov byte [Inbuff+2+Label_Length],ASCIIZ_End ;Make string ASCIIZ ;AN000; 0 00003D8C BA[0200] mov dx, offset inbuff + 2 ;Start of buffer ;AC000; 0 00003D8F B022 mov al,22h ;Capitalize asciiz ;AC000; 0 00003D91 B465CD21 DOS_Call GetExtCntry ;Do it ;AC000; 2065 2066 ; Now compare what the user specified with what is really out there 0 00003D95 B90B00 mov cx, Label_Length ; ;AC000; 0 00003D98 8D36[0200] lea si, [inbuff + 2] 0 00003D9C 8D3E[5B07] lea di, [oldVolumeId] 0 00003DA0 F3A6 repe cmpsb 0 00003DA2 7501 jne BadVolumeId 0 00003DA4 C3 ret 2073 2074 BadVolumeId: 2075 msgBadVolumeID equ msgBadVolumeId ; NASM port label 0 00003DA5 BA[0000]E8[0000] Message msgBadVolumeID ; ;AC000; 0 00003DAB F9 stc 0 00003DAC C3 ret 2079 2080 CheckVolumeId endp 2081 2082 2083 Check_Switch_8_B proc near 2084 0 00003DAD F706[0000]0002 test word [SwitchMap], SWITCH_B ;/8/B <> /V because ;AC007; 2086 ; $IF NZ,AND ; old directory type ;AC007; 0 00003DB3 741D JZ DD_IF102 0 00003DB5 F706[0000]0001 test word [SwitchMap], Switch_8 ; used which didn't support ;AC007; 2089 ; $IF NZ,AND ; volume labels. ;AC007; 0 00003DBB 7415 JZ DD_IF102 0 00003DBD F706[0000]0200 test word [SwitchMap], SWITCH_V ; ;AC007; 2092 ; $IF NZ ; ;AC007; 0 00003DC3 740D JZ DD_IF102 0 00003DC5 BA[0000]E8[0000] Message msgIncompatibleParameters ;Tell user ;AC007; 0 00003DCB C606[0000]FF mov byte [Fatal_Error],Yes ;Bad stuff ;AC007; 2096 ; $ELSE ;No problem so far ;AC007; 0 00003DD0 EB65 JMP SHORT DD_EN102 2098 DD_IF102: 0 00003DD2 F706[0000]0002 test word [SwitchMap], Switch_B ;Can't reserve space and ;AC007; 2100 ; $IF NZ,AND ; install sys files at the ;AC007; 0 00003DD8 7415 JZ DD_IF104 0 00003DDA F706[0000]0100 test word [SwitchMap], Switch_S ; same time. ;AC007; 2103 ; $IF NZ ; No /S/B ;AC007; 0 00003DE0 740D JZ DD_IF104 0 00003DE2 BA[0000]E8[0000] Message msgIncompatibleParameters ;Tell user ;AC007; 0 00003DE8 C606[0000]FF mov byte [Fatal_Error],Yes ;Bad stuff ;AC007; 2107 ; $ELSE ;Still okay ;AC007; 0 00003DED EB48 JMP SHORT DD_EN104 2109 DD_IF104: 0 00003DEF F706[0000]4000 test word [SwitchMap],Switch_1 ;/1/8/4 not okay with /N/T ;AC007; 2111 ; $IF NZ,OR ; ;AC007; 0 00003DF5 7510 JNZ DD_LL106 0 00003DF7 F706[0000]0001 test word [SwitchMap],Switch_8 ; ;AC007; 2114 ; $IF NZ,OR ; ;AC007; 0 00003DFD 7508 JNZ DD_LL106 0 00003DFF F706[0000]8000 test word [SwitchMap],Switch_4 ; ;AC007; 2117 ; $IF NZ ; ;AC007; 0 00003E05 7430 JZ DD_IF106 2119 DD_LL106: 0 00003E07 F706[0000]3000 test word [SwitchMap],(Switch_T | Switch_N) ; ;AC007; 2121 ; $IF NZ ;Found /T/N <> /1/8 ;AC007; 0 00003E0D 740D JZ DD_IF107 0 00003E0F BA[0000]E8[0000] Message msgIncompatibleParameters ;Tell user ;AC007; 0 00003E15 C606[0000]FF mov byte [Fatal_Error],Yes ;Bad stuff ;AC007; 2125 ; $ELSE ; ;ac007; 0 00003E1A EB1B JMP SHORT DD_EN107 2127 DD_IF107: 0 00003E1C F706[0000]0200 test word [SwitchMap],Switch_V ;ac007; 2129 ; $IF NZ,AND ;ac007; 0 00003E22 7413 JZ DD_IF109 0 00003E24 F706[0000]0001 test word [SwitchMap],Switch_8 ;ac007; 2132 ; $IF NZ ;ac007; 0 00003E2A 740B JZ DD_IF109 0 00003E2C BA[0000]E8[0000] Message msgIncompatibleParameters ;ac007; 0 00003E32 C606[0000]FF mov byte [Fatal_Error],Yes ;ac007; 2136 ; $ENDIF ;ac007; 2137 DD_IF109: 2138 ; $ENDIF ; ;AC007; 2139 DD_EN107: 2140 ; $ENDIF ; ;AC007; 2141 DD_IF106: 2142 ; $ENDIF ; ;AC007; 2143 DD_EN104: 2144 ; $ENDIF ; ;AC007; 2145 DD_EN102: 0 00003E37 C3 ret 2147 2148 Check_Switch_8_B endp 2149 2150 2151 ; (no prior section) ; code ends 2152 end 2153 === Trace listing source: forexec.lst 1 ;page ,132 2 ;***************************************************************************** 3 ;***************************************************************************** 4 ;UTILITY NAME: FORMAT.COM 5 ; 6 ;MODULE NAME: FOREXEC.SAL 7 ; 8 ; 9 ; 10 ; ================ 11 ; =EXEC_FS_FORMAT= 12 ; ================ 13 ; = 14 ; ========= 15 ; ==Shrink= 16 ; ========= 17 ; ============= 18 ; ==Setup_EXEC= 19 ; ============= 20 ; ============ ============== 21 ; ==EXEC_ArgV============EXEC_Program= 22 ; ============ ============== 23 ; ===================== ============== 24 ; ==EXEC_Cur_Directory===EXEC_Program= 25 ; ===================== ============== 26 ; =============== ===================== ============== 27 ; ==EXEC_Routine=========Build_Path_And_EXEC===EXEC_Program= 28 ; ============== ===================== ============== 29 ; 30 ; Change List: AN000 - New code DOS 3.3 spec additions 31 ; AC000 - Changed code DOS 3.3 spec additions 32 ;***************************************************************************** 33 ;***************************************************************************** 34 35 ;title DOS 3.30 FORMAT EXEC Module 36 37 %IF 1 38 %warning out: ASSEMBLING: DOS 3.3 FORMAT EXEC LOADER 38 ****************** warning: out: ASSEMBLING: DOS 3.3 FORMAT EXEC LOADER [-w+user] 39 %warning out: 39 ****************** warning: out: [-w+user] 40 %ENDIF 41 === Switch to base=001900h -> "CODE" 42 section code public align=16 class=CODE 43 assume cs:code 44 ; (no prior section) ; code ends 45 46 ; 47 ;***************************************************************************** 48 ; Include files 49 ;***************************************************************************** 50 ; 51 52 [list -] 134 <1> 54 %include "formacro.mac" 1 <1> ; 2 <1> ;****************************************************************************** 3 <1> ; Message Macro Definitions 4 <1> ;****************************************************************************** 5 <1> ; 6 <1> 7 <1> EXTRN Display_Interface:near 8 <1> 9 <1> 10 <1> ; NASM original macros 11 <1> 12 <1> ;----------------------------------------------------------------------------- 13 <1> 14 <1> %imacro Message 1.nolist 15 <1> mov dx,offset %1 wrt data 16 <1> call Display_Interface 17 <1> %endmacro 18 <1> 19 <1> ;----------------------------------------------------------------------------- 20 <1> 21 <1> %imacro Parse_Message 0.nolist 22 <1> push ds 23 <1> mov dx,data 24 <1> mov ds,dx 25 <1> mov word ptr [Parse_Error_Msg],ax 26 <1> mov dx,offset Parse_Error_Msg ; ;AN000; 27 <1> call Display_Interface ; ;AN000; 28 <1> pop ds ; 29 <1> %endmacro 30 <1> 31 <1> ;----------------------------------------------------------------------------- 32 <1> 33 <1> %imacro Extended_Message 0.nolist 34 <1> push ds 35 <1> mov dx,data 36 <1> mov ds,dx 37 <1> mov word ptr [Extended_Error_Msg],ax 38 <1> mov dx,offset Extended_Error_Msg wrt data 39 <1> call Display_Interface ; ;AN000; 40 <1> pop ds 41 <1> %endmacro 42 <1> 43 <1> ; 44 <1> ;***************************************************************************** 45 <1> ; General Macro's 46 <1> ;***************************************************************************** 47 <1> ; 48 <1> 49 <1> %imacro Procedure 1.nolist 50 <1> %1 proc 51 <1> Public %1 52 <1> %endmacro 53 <1> 54 <1> ;----------------------------------------------------------------------------- 55 <1> 56 <1> %imacro DOS_Call 1.nolist 57 <1> mov ah, %1 58 <1> int 21h 59 <1> %endmacro 60 <1> ;----------------------------------------------------------------------------- 61 <1> 62 <1> %imacro Popff 0.nolist 63 <1> jmp strict short $+3 64 <1> iret 65 <1> push cs 66 <1> call near $-2 67 <1> %endmacro 68 <1> 69 <1> ;----------------------------------------------------------------------------- 70 <1> 71 <1> %imacro Set_Data_Segment 0.nolist 72 <1> push ax 73 <1> mov ax,data ;Point to data segment 74 <1> mov ds,ax ; 75 <1> push ds 76 <1> pop es 77 <1> pop ax 78 <1> assume ds:data,es:data 79 <1> %endmacro 80 <1> 81 <1> ; end of NASM original macros 55 %include "syscall.mac" 1 <1> ; SCCSID = @(#)syscall.asm 1.1 85/04/10 2 <1> ;BREAK 3 <1> ;SUBTTL system call definitions 4 <1> ;PAGE 5 <1> 6 <1> Abort EQU 0 ; 0 0 7 <1> Std_Con_Input EQU 1 ; 1 1 8 <1> Std_Con_Output EQU 2 ; 2 2 9 <1> Std_Aux_Input EQU 3 ; 3 3 10 <1> Std_Aux_Output EQU 4 ; 4 4 11 <1> Std_Printer_Output EQU 5 ; 5 5 12 <1> Raw_Con_IO EQU 6 ; 6 6 13 <1> Raw_Con_Input EQU 7 ; 7 7 14 <1> Std_Con_Input_No_Echo EQU 8 ; 8 8 15 <1> Std_Con_String_Output EQU 9 ; 9 9 16 <1> Std_Con_String_Input EQU 10 ; 10 A 17 <1> Std_Con_Input_Status EQU 11 ; 11 B 18 <1> Std_Con_Input_Flush EQU 12 ; 12 C 19 <1> Disk_Reset EQU 13 ; 13 D 20 <1> Set_Default_Drive EQU 14 ; 14 E 21 <1> FCB_Open EQU 15 ; 15 F 22 <1> FCB_Close EQU 16 ; 16 10 23 <1> Dir_Search_First EQU 17 ; 17 11 24 <1> Dir_Search_Next EQU 18 ; 18 12 25 <1> FCB_Delete EQU 19 ; 19 13 26 <1> FCB_Seq_Read EQU 20 ; 20 14 27 <1> FCB_Seq_Write EQU 21 ; 21 15 28 <1> FCB_Create EQU 22 ; 22 16 29 <1> FCB_Rename EQU 23 ; 23 17 30 <1> Get_Default_Drive EQU 25 ; 25 19 31 <1> Set_DMA EQU 26 ; 26 1A 32 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 33 <1> ; C A V E A T P R O G R A M M E R ; 34 <1> ; ; 35 <1> Get_Default_DPB EQU 31 ; 31 1F 36 <1> ; ; 37 <1> ; C A V E A T P R O G R A M M E R ; 38 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 39 <1> FCB_Random_Read EQU 33 ; 33 21 40 <1> FCB_Random_Write EQU 34 ; 34 22 41 <1> Get_FCB_File_Length EQU 35 ; 35 23 42 <1> Get_FCB_Position EQU 36 ; 36 24 43 <1> Set_Interrupt_Vector EQU 37 ; 37 25 44 <1> Create_Process_Data_Block EQU 38 ; 38 26 45 <1> FCB_Random_Read_Block EQU 39 ; 39 27 46 <1> FCB_Random_Write_Block EQU 40 ; 40 28 47 <1> Parse_File_Descriptor EQU 41 ; 41 29 48 <1> Get_Date EQU 42 ; 42 2A 49 <1> Set_Date EQU 43 ; 43 2B 50 <1> Get_Time EQU 44 ; 44 2C 51 <1> Set_Time EQU 45 ; 45 2D 52 <1> Set_Verify_On_Write EQU 46 ; 46 2E 53 <1> ; Extended functionality group 54 <1> Get_DMA EQU 47 ; 47 2F 55 <1> Get_Version EQU 48 ; 48 30 56 <1> Keep_Process EQU 49 ; 49 31 57 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 58 <1> ; C A V E A T P R O G R A M M E R ; 59 <1> ; ; 60 <1> Get_DPB EQU 50 ; 50 32 61 <1> ; ; 62 <1> ; C A V E A T P R O G R A M M E R ; 63 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 64 <1> Set_CTRL_C_Trapping EQU 51 ; 51 33 65 <1> Get_InDOS_Flag EQU 52 ; 52 34 66 <1> Get_Interrupt_Vector EQU 53 ; 53 35 67 <1> Get_Drive_Freespace EQU 54 ; 54 36 68 <1> Char_Oper EQU 55 ; 55 37 69 <1> International EQU 56 ; 56 38 70 <1> ; Directory Group 71 <1> MKDir EQU 57 ; 57 39 72 <1> RMDir EQU 58 ; 58 3A 73 <1> CHDir EQU 59 ; 59 3B 74 <1> ; File Group 75 <1> Creat EQU 60 ; 60 3C 76 <1> Open EQU 61 ; 61 3D 77 <1> Close EQU 62 ; 62 3E 78 <1> Read EQU 63 ; 63 3F 79 <1> Write EQU 64 ; 64 40 80 <1> Unlink EQU 65 ; 65 41 81 <1> LSeek EQU 66 ; 66 42 82 <1> CHMod EQU 67 ; 67 43 83 <1> IOCtl EQU 68 ; 68 44 84 <1> XDup EQU 69 ; 69 45 85 <1> XDup2 EQU 70 ; 70 46 86 <1> Current_Dir EQU 71 ; 71 47 87 <1> ; Memory Group 88 <1> Alloc EQU 72 ; 72 48 89 <1> Dealloc EQU 73 ; 73 49 90 <1> Setblock EQU 74 ; 74 4A 91 <1> ; Process Group 92 <1> Exec EQU 75 ; 75 4B 93 <1> Exit EQU 76 ; 76 4C 94 <1> WaitProcess EQU 77 ; 77 4D 95 <1> Find_First EQU 78 ; 78 4E 96 <1> ; Special Group 97 <1> Find_Next EQU 79 ; 79 4F 98 <1> ; SPECIAL SYSTEM GROUP 99 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 100 <1> ; C A V E A T P R O G R A M M E R ; 101 <1> ; ; 102 <1> Set_Current_PDB EQU 80 ; 80 50 103 <1> Get_Current_PDB EQU 81 ; 81 51 104 <1> Get_In_Vars EQU 82 ; 82 52 105 <1> SetDPB EQU 83 ; 83 53 106 <1> ; ; 107 <1> ; C A V E A T P R O G R A M M E R ; 108 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 109 <1> Get_Verify_On_Write EQU 84 ; 84 54 110 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 111 <1> ; C A V E A T P R O G R A M M E R ; 112 <1> ; ; 113 <1> Dup_PDB EQU 85 ; 85 55 114 <1> ; ; 115 <1> ; C A V E A T P R O G R A M M E R ; 116 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 117 <1> Rename EQU 86 ; 86 56 118 <1> File_Times EQU 87 ; 87 57 119 <1> AllocOper EQU 88 ; 88 58 120 <1> ; Network extention system calls 121 <1> GetExtendedError EQU 89 ; 89 59 122 <1> CreateTempFile EQU 90 ; 90 5A 123 <1> CreateNewFile EQU 91 ; 91 5B 124 <1> LockOper EQU 92 ; 92 5C Lock and Unlock 125 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 126 <1> ; C A V E A T P R O G R A M M E R ; 127 <1> ; ; 128 <1> ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall, 129 <1> ; CloseByName, CloseUser, 130 <1> ; CloseUserProcess, 131 <1> ; GetOpenFileList 132 <1> ; ; 133 <1> ; C A V E A T P R O G R A M M E R ; 134 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 135 <1> UserOper EQU 94 ; 94 5E Get and Set 136 <1> AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel 137 <1> xNameTrans EQU 96 ; 96 60 138 <1> PathParse EQU 97 ; 97 61 139 <1> GetCurrentPSP EQU 98 ; 98 62 140 <1> Hongeul EQU 99 ; 99 63 141 <1> ECS_CALL EQU 99 ; 99 63 ;; DBCS support 142 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 143 <1> ; C A V E A T P R O G R A M M E R ; 144 <1> ; ; 145 <1> Set_Printer_Flag EQU 100 ; 100 64 146 <1> ; ; 147 <1> ; C A V E A T P R O G R A M M E R ; 148 <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; 149 <1> GetExtCntry EQU 101 ; 101 65 150 <1> GetSetCdPg EQU 102 ; 102 66 151 <1> ExtHandle EQU 103 ; 103 67 152 <1> Commit EQU 104 ; 104 68 153 <1> GetSetMediaID EQU 105 ; 105 69 154 <1> IFS_IOCTL EQU 107 ; 107 6B 155 <1> ExtOpen EQU 108 ; 108 6C 156 <1> ; 157 <1> ; 158 <1> Set_Oem_Handler EQU 248 ; 248 F8 159 <1> OEM_C1 EQU 249 ; 249 F9 160 <1> OEM_C2 EQU 250 ; 250 FA 161 <1> OEM_C3 EQU 251 ; 251 FB 162 <1> OEM_C4 EQU 252 ; 252 FC 163 <1> OEM_C5 EQU 253 ; 253 FD 164 <1> OEM_C6 EQU 254 ; 254 FE 165 <1> OEM_C7 EQU 255 ; 255 FF 56 %include "forequ.mac" 1 <1> ; ; ; 2 <1> 3 <1> NO equ 0 4 <1> YES equ ~ NO 5 <1> FSExec equ NO ;an018; dms;conditional assembly 6 <1> ShipDisk equ NO ;an000; dms;ship disk flag 7 <1> 8 <1> Boot_ID equ 0AA55h 9 <1> DOS_Found equ 0 10 <1> 11 <1> Not_Include equ 0 12 <1> Do_Include equ 1 13 <1> 14 <1> INIT equ 0 15 <1> 16 <1> FAT12_File_System equ 01h 17 <1> FAT16_File_System equ 04h 18 <1> New_File_System equ 06h 19 <1> 20 <1> FS_String_Max_Length equ 5 21 <1> 22 <1> Paragraph_Size equ 16 ; ;AN005; 23 <1> Len_FS_String_Buffer equ 13 24 <1> 25 <1> Net_Check equ 1200h 26 <1> Assign_Check equ 8000h 27 <1> 28 <1> Found_Yes equ 1 29 <1> Found_No equ 0 30 <1> 31 <1> Asciiz_End equ 0 32 <1> DBCS equ 81h 33 <1> DBCS_Blank equ 40h 34 <1> DBCS_Vector_Size equ 2 35 <1> End_Of_Vector equ 0 36 <1> 37 <1> 38 <1> Blank equ " " 39 <1> 40 <1> Label_Length equ 11 41 <1> CR equ 13 42 <1> 43 <1> DBCS_VECTOR equ NO 44 <1> 45 <1> ;Limits 46 <1> BIG_FAT_THRESHOLD equ 4086 47 <1> 48 <1> ;------------------------------------------------------------------------------- 49 <1> 50 <1> 51 <1> 52 <1> 53 <1> 54 <1> DRNUM EQU 5CH 55 <1> 56 <1> 57 <1> 58 <1> ; Exit status defines 59 <1> ExitOK equ 0 60 <1> ExitCtrlC equ 3 61 <1> ExitFatal equ 4 62 <1> ExitNo equ 5 63 <1> 64 <1> 65 <1> ;------------------------------------------------------------------------------- 66 <1> ; These are the data structures which we will need 67 <1> 68 <1> 69 <1> Media_ID struc 0 00003E40 ???? Media_ID_Info_Level dw ? 0 00003E42 ???????? Media_ID_Serial_Number dd ? 72 00000006 <1> Media_ID_Volume_Label db 11 dup(?) 0 00003E51 ???????????????? Media_ID_File_System db 8 dup(?) 74 <1> Media_ID ends 75 <1> 76 <1> 77 <1> Relative_Sector_Buffer struc ; ;AN000; 78 <1> 0 00003E40 ???? Start_Sector_Low dw ? ;Low word of RBA sector ;AN000; 0 00003E42 ???? Start_Sector_High dw ? ;High word of RBA sector ;AN000; 0 00003E44 ???? Number_Sectors dw ? ;Number of sectors ;AN000; 0 00003E46 ???? Buffer_Offset dw ? ;Address of data buffer ;AN000; 0 00003E48 ???? Buffer_Segment dw ? ; ;AN000; 84 <1> 85 <1> Relative_Sector_Buffer ends ; ;AN000; 86 <1> 87 <1> 88 <1> ;Per system file data structure 89 <1> 90 <1> a_FileStructure struc 0 00003E40 ???? fileHandle DW ? 0 00003E42 ???? fileSizeInParagraphs DW ? 0 00003E44 ???????? fileSizeInBytes DD ? 0 00003E48 ???????? fileOffset DD ? 0 00003E4C ???? fileStartSegment DW ? 0 00003E4E ???? fileDate DW ? 0 00003E50 ???? fileTime DW ? 98 <1> a_FileStructure ends 99 <1> 100 <1> ;------------------------------------------------------------------------------- 101 <1> 102 <1> LOGBOOTSECT equ 1 103 <1> Set_Drv_Owner equ 0Fh ; IOCTL subfunction 104 <1> Custom_Media equ 0F0H ; Media byte for custom format 105 <1> Dual_8_Media equ 0FFh ; Dual sided 8 sectored 106 <1> Single_8_Media equ 0FEh ; Single sided 8 sectored 107 <1> Dual_9_Media equ 0FDh ; Dual sided 9 sectored 108 <1> Single_9_Media equ 0FCh ; Single sided 9 sectored 109 <1> Dual_15_Media equ 0F9h ; Dual sided 15 sectored 110 <1> Fixed_Disk equ 0F8h ; Fixed Disk 111 <1> Invalid_Drive equ 000Fh ; Extended error 15 112 <1> Max_Format_Size equ 0FFFFh ; Max bytes to Format ;an015; dms; 113 <1> Multi_Track_Format equ 02h ; Multi-track format ;an015; dms; 114 <1> Single_Track_Format equ 00h ; Single track format ;an015; dms; 115 <1> Select_Disk_Message equ 0ADC1h ; an016; dms; 57 [list +] 58 59 ; 60 ;***************************************************************************** 61 ; Public Data 62 ;***************************************************************************** 63 ; 64 65 Public Drive_Letter_Msg 66 67 ; 68 ;***************************************************************************** 69 ; Public Routines 70 ;***************************************************************************** 71 ; 72 73 74 %IF FSExec ;an018; dms;if /FS: desired 75 76 EXEC_FS_Format equ Exec_FS_Format ; NASM port label 77 Public EXEC_FS_Format 78 79 %ENDIF ;FSExec ;an018; dms;end /FS: conditional 80 81 Extrn GetFSiz:near 82 83 84 ; 85 ;***************************************************************************** 86 ; External Data Declarations 87 ;***************************************************************************** 88 ; 89 90 extrn ExitStatus:Byte 91 extrn Fatal_Error:Byte 92 extrn FS_String_Buffer:Byte 93 extrn msgEXECFailure:Byte 94 extrn PSP_Segment:Word 95 extrn drive:byte 96 97 ; 98 ;**************************************************************************** 99 ; Structures 100 ;**************************************************************************** 101 ; 102 103 104 Exec_Block_Parms struc 0 00003E40 ???? Segment_Env dw ? 0 00003E42 ???? Offset_Command dw ? 0 00003E44 ???? Segment_Command dw ? 0 00003E46 ???? Offset_FCB1 dw ? 0 00003E48 ???? Segment_FCB1 dw ? 0 00003E4A ???? Offset_FCB2 dw ? 0 00003E4C ???? Segment_FCB2 dw ? 112 113 Exec_Block_Parms ends 114 115 116 ; 117 ;**************************************************************************** 118 ; Equates 119 ;**************************************************************************** 120 ; 121 122 123 String_Done equ 0 124 No_Error equ 0 125 Error equ 1 126 Stderr equ 2 127 Stack_Space equ 02eh ;an000; dms; IBM addition ROM paras 128 129 ; 130 ;**************************************************************************** 131 ; PSP Area 132 ;**************************************************************************** 133 ; 134 === Switch to base=000000h -> "PSP" 135 section PSP public align=16 class=DUMMY 136 0 00000000 00 times 80h db 0 ; NASM identicalise: reserve space 138 139 absolute 2Ch 140 PSP_ENV_SEGMENT label word 141 142 FCB1 equ 5Ch 143 144 FCB2 equ 6Ch 145 146 absolute 80h 147 Command_Line label byte 148 149 150 ; (no prior section) ; PSP ends 151 152 ; 153 ;**************************************************************************** 154 ; Data Area 155 ;**************************************************************************** 156 ; 157 === Switch to base=000080h -> "DATA" 158 section data public align=16 class=DATA 159 assume ds:data,es:nothing 160 161 Exec_Block: ; NASM structure instance 162 Exec_Block_Parms_size equ Exec_Block_Parms_struc_size ; NASM port equate 163 istruc Exec_Block_Parms 0 00001620 ?? iend 0 0000162E 000000000000000000 EXEC_Path db 66 dup(0) 0 00001637 000000000000000000 0 00001640 000000000000000000 0 00001649 000000000000000000 0 00001652 000000000000000000 0 0000165B 000000000000000000 0 00001664 000000000000000000 0 0000166D 000000 166 0 00001670 413A00 Drive_Letter_Msg db "A:",0 ;Drive for exec fail message 168 0 00001673 ???? SP_Save dw ? ;an000; dms; 0 00001675 ???? SS_Save dw ? ;an000; dms; 171 172 173 ;These next two should stay togather 174 ; --------------------------------------- 175 ; 0 00001677 504154483D Path_String db "PATH=" ; ;AN000; 177 Len_Path_String equ $ - Path_String ; ;AN000; 178 ; 179 ;---------------------------------------- 180 181 182 183 184 ;These should stay togather 185 ; --------------------------------------- 186 ; 0 0000167C 464F524D4154 Search_FORMAT db "FORMAT" ; ;AC000; 188 Len_Search_FORMAT equ $ - Search_FORMAT ; ; ; 189 Search_Format_End equ $ 190 ; ; ; 191 ;---------------------------------------- 192 193 194 ;These next two should stay togather 195 ; --------------------------------------- 196 197 198 199 200 201 ; (no prior section) ; data ends 202 === Switch to base=001900h -> "CODE" 203 section code 204 assume cs:code,ds:data 205 206 ; 207 ;**************************************************************************** 208 ; Main Routine 209 ;**************************************************************************** 210 ; 211 ; 212 ; 213 ; 214 ; 215 216 %IF FSExec ;an018; dms;if /FS: desired 217 218 219 Procedure Exec_FS_Format ; ;AC000; 220 221 Set_Data_Segment ; 222 call Set_FCB1_Drive ;an000;dms; 223 call Shrink ; ; ; 224 mov al,[ExitStatus] ;Setblock fail? ;AC000; 225 cmp al,Error ; " " " " ; ; 226 ; $IF NE ;Nah, keep crusin! ;AN000; 227 JE DD_IF1 228 call Setup_Exec ; ; ; 229 Exec_Argv equ EXEC_Argv ; NASM port label 230 call Exec_Argv ;try exec from dir BASIC loaded ; ; 231 mov al,[ExitStatus] ; ;AC000; 232 cmp al,Error ; ; ; 233 ; $IF E,AND ; ;AC000; 234 JNE DD_IF2 235 call Exec_Cur_Directory ; ; ; 236 mov al,[ExitStatus] ;Try exec from cur directory ;AC000; 237 cmp al,Error ; ; ; 238 ; $IF E,AND ; ;AC000; 239 JNE DD_IF2 240 call EXEC_Routine ; ; ; 241 mov al,[ExitStatus] ; ;AC000; 242 cmp al,Error ; ; ; 243 ; $IF E ; ;AC000; 244 JNE DD_IF2 245 ; mov bl,FCB1 ;Get target drive from FCB 246 ; mov bl,Drive ;an000;dms; 247 push ds ;an000;dms;save ds 248 push si ;an000;dms;save si 249 mov si,[PSP_Segment] ;an000;dms;get psp 250 mov ds,si ;an000;dms;put psp in ds 251 assume ds:PSP ;an000;dms; 252 253 mov si,FCB1 ;an000;dms;ptr to 1st. FCB 254 mov bl,byte ptr [si] ;an000;dms;get drive ID 255 256 pop si ;an000;dms;restore si 257 pop ds ;an000;dms;restore ds 258 Set_Data_Segment ;an000;dms;set segments 259 260 cmp bl,0 ;Is it default drive? ;AN000; 261 ; $IF E ;Yes, turn it into drive letter ;AN000; 262 JNE DD_IF3 263 push ax ;Save exit code ;AN000; 264 DOS_Call Get_Default_Drive ;Get the default drive ;AN000; 265 add al,"A" ;Turn into drive letter ;AN000; 266 mov [Drive_Letter_Msg],al ;Save it in message ;AN000; 267 pop ax ;Get return code back ;AN000; 268 ; $ELSE ;Not default, A=1 ;AN000; 269 JMP SHORT DD_EN3 270 DD_IF3: 271 add bl,"A"-1 ;Convert to drive letter ;AN000; 272 mov [Drive_Letter_Msg],bl ; ;AN000; 273 ; $ENDIF ;AN000; 274 DD_EN3: 275 Message msgEXECFailure ; ;AC000; 276 ; $ELSE ; ;AN000; 277 JMP SHORT DD_EN2 278 DD_IF2: 279 DOS_Call WaitProcess ; ;AC000; 280 mov [ExitStatus],al ; ; ; 281 ; $ENDIF ; ;AN000; 282 DD_EN2: 283 ; $ENDIF 284 DD_IF1: 285 mov byte [Fatal_Error],YES ;Not really, indicates FS used ;AN000; 286 ret ; ; ; 287 288 Exec_FS_Format endp 289 290 291 ; 292 ;**************************************************************************** 293 ; Shrink 294 ;**************************************************************************** 295 ; 296 ; 297 ; 298 ; 299 300 301 Procedure Shrink ; ;AC000; 302 303 mov ax,cs ;an000; dms;get code segment 304 mov bx,ds ;an000; dms;get data segment 305 sub ax,bx ;an000; dms;data seg size 306 mov bx,ax ;an000; dms;save paras 307 mov ax,offset End_Program ;Get the offset of end of loader; ; 308 mov cl,4 ;Div by 16 to get para's ; ; 309 shr ax,cl ; ; ; 310 add bx,ax ;an000; dms;add in code space 311 add bx,Stack_Space ;an000; dms;adjust for stack 312 add bx,11h ;an000; dms;give PSP space 313 mov ax,[PSP_Segment] 314 mov es,ax 315 assume es:nothing 316 317 DOS_Call SetBlock ; ;AC000; 318 ; $IF C ;If didn't work, quit ;AC000; 319 JNC DD_IF9 320 Message msgEXECFailure ; ; ; 321 mov byte [ExitStatus],Error ;Bad stuff, time to quit ;AN000; 322 ; $ENDIF ; ;AN000; 323 DD_IF9: 324 ret ; ; ; 325 326 Shrink endp ; ;AN000; 327 328 329 ; 330 ;**************************************************************************** 331 ; Setup_Exec 332 ;**************************************************************************** 333 ; 334 ; 335 ; 336 ; 337 338 Procedure Setup_Exec ; ;AC000; 339 340 Set_Data_Segment 341 mov ax,[PSP_Segment] ;Get segment of PSP ;AN000; 342 mov ds,ax ; " " " " ;AN000; 343 ; ; 344 assume ds:PSP 345 ;Setup dword pointer to command line to be passed 346 347 mov [es:Exec_Block + Segment_Command],ax ;Segment for command line ; ; 348 mov word [es:Exec_Block + Offset_Command],offset Command_Line ; ; ; 349 350 ;Setup dword pointer to first FCB to be passed 351 352 mov [es:Exec_Block + Segment_FCB1],ax ;Segment for FCB1 ; ; 353 mov word [es:Exec_Block + Offset_FCB1],offset FCB1 ;Offset of FCB at 05Ch ; ; 354 355 ;Setup dword pointer to second FCB to be passed ; ; 356 357 mov [es:Exec_Block + Segment_FCB2],ax ;Segment for FCB2 ; ; 358 mov word [es:Exec_Block + Offset_FCB2],offset FCB2 ;Offset of FCB at 06Ch ; ; 359 360 ;Setup segment of Environment string, get from PSP ; ; 361 362 PSP_Env_Segment equ PSP_ENV_SEGMENT ; NASM port label 363 mov ax,[PSP_Env_Segment] ; ; ; 364 mov [es:Exec_Block + Segment_Env],ax ; ; ; 365 Set_Data_Segment 366 ret ; ; ; 367 368 369 Setup_EXEC endp ; ;AN000; 370 371 ; 372 ;**************************************************************************** 373 ; Exec_Argv 374 ;**************************************************************************** 375 ; 376 ; Read the environment to get the Argv(0) string, which contains the drive, 377 ; path and filename that was loaded for FORMAT.COM. This will be used to find 378 ; the xxxxxfmt.exe, assuming that it is in the same location or path as 379 ; FORMAT.COM 380 ; 381 382 Procedure EXEC_Argv ; ;AC000; 383 384 Set_Data_Segment ;DS,ES = DATA 385 cld ; ; ; 386 mov ax,[Exec_Block + Segment_Env] ;Get the environment ; ; 387 mov ds,ax ;Get addressability ; ; 388 389 assume ds:nothing 390 391 xor si,si ;Start at beginning ; ; 392 ; $DO ;Find argv(0) location ;AN000; 393 DD_DO11: 394 ; $DO ;Look for 0 ;AN000; 395 DD_DO12: 396 inc si ;Get character ; ; 397 cmp byte ptr [si-1],0 ;Find string seperator? ; ; 398 ; $ENDDO E ;Yep ;AC000; 399 JNE DD_DO12 400 inc si ;Get next char ; ; 401 cmp byte ptr [si-1],0 ;Are we at Argv(0)? (00?) ; ; 402 ; $ENDDO E ;Yes if we found double 0's ;AC000; 403 JNE DD_DO11 404 add si,2 ;Skip the word count ; ; 405 mov di,si ;Save where string starts ; ; 406 ; $DO ;Find length of Argv(0) string ;AN000; 407 DD_DO15: 408 inc si ;Get char ; ; 409 cmp byte ptr [si-1],0 ;Is it the end? ; ; 410 ; $ENDDO E ;End found if 0 found ;AC000; 411 JNE DD_DO15 412 mov cx,si ;Get number of bytes in string ; ; 413 sub cx,di ;Put in cx reg for rep count ; ; 414 mov si,di ;Point to path ; ; 415 mov di,offset es:EXEC_Path ;Point to where to put it ; ; 416 rep movsb ;Move the string ; ; 417 Set_Data_Segment ; ;AN000' 418 dec di ;Point at end of ArgV string ; ; 419 std ;Look backwards ;AN000; 420 ; $DO ;Find 'FORMAT' in ARGV string ;AC000; 421 DD_DO17: 422 mov cx,Len_Search_FORMAT ;Get length to compare ;AC000; 423 mov si,offset Search_FORMAT_End-1 ;Look at comp string from end ;AC000; 424 repe cmpsb ;See if same string ;AC000; 425 ; $ENDDO E ; ;AC000; 426 JNE DD_DO17 427 mov si,offset FS_String_Buffer ; ;AN000; 428 inc di ;DI = replacement point-1 ;AC000; 429 cld ;Set direction flag back ;AN000; 430 mov cx,Len_FS_String_Buffer ;Length of string to move ;AN000; 431 rep movsb ;Build part of the path ; ; 432 call EXEC_Program ; ; ; 433 ret ; ; ; 434 435 EXEC_ArgV endp ; ;AN000; 436 437 ; 438 ;**************************************************************************** 439 ; EXEC_Program 440 ;**************************************************************************** 441 ; 442 ; 443 ; 444 ; 445 446 Procedure EXEC_Program ; ;AC000; 447 448 Set_Data_Segment ; ;AN000; 449 mov byte [ExitStatus],No_Error ;Setup to Exec the file ; ; 450 Exec_Path equ EXEC_Path ; NASM port label 451 mov dx,offset Exec_Path ; ; ; 452 mov bx,offset Exec_Block ; ; ; 453 mov al,0 ; ; ; 454 mov word ptr [SP_Save],sp ;an000; dms;save sp 455 mov word ptr [SS_Save],ss ;an000; dms;save ss 456 457 DOS_Call Exec ; ;AC000; 458 459 cli ;an000; dms;turn off int's 460 mov sp,word ptr [SP_Save] ;an000; dms;retrieve sp 461 mov ss,word ptr [SS_Save] ;an000; dms;retrieve ss 462 sti ;an000; dms;turn on int's 463 464 465 ; $IF C ;CY means failure ;AC000; 466 JNC DD_IF19 467 mov byte [ExitStatus],Error ;Set error code ; ; 468 ; $ENDIF ; ;AN000; 469 DD_IF19: 470 ret ; ; ; 471 472 EXEC_Program endp ; ;AN000; 473 474 475 ; 476 ;**************************************************************************** 477 ; EXEC_Routine 478 ;**************************************************************************** 479 ; 480 ; 481 ; 482 ; 483 484 Procedure EXEC_Routine ; ;AN000; 485 486 Set_Data_Segment ; ;AN000; 487 mov byte [ExitStatus],Error ;Assume the worst ; ; 488 cld ; ; ; 489 push ds ; ; ; 490 mov ax,[Exec_Block + Segment_Env] ;Get the environment ; ; 491 mov ds,ax ;Get addressability ; ; 492 assume ds:nothing ; 493 494 xor si,si ;Start at beginning ; ; 495 ; $SEARCH ; ;AC000; 496 DD_DO21: 497 cmp word ptr [si],0 ;End of the Evironment? ; ; 498 ; $EXITIF E ;Reached end, no more look ;AC000; 499 JNE DD_IF21 500 ; ; ; 501 ; $ORELSE ;Look for 'PATH=' in environment;AN000; 502 JMP SHORT DD_SR21 503 DD_IF21: 504 mov di,offset Path_String ; " " " " ;AC000; 505 mov cx,Len_Path_String ; " " " " ;AC000; 506 repe cmpsb ; " " " " ;AC000; 507 ; $LEAVE E ;Found if EQ ;AC000; 508 JE DD_EN21 509 ; $ENDLOOP ;Found PATH in environment ;AC000; 510 JMP SHORT DD_DO21 511 DD_EN21: 512 call Build_Path_And_Exec ; ;AN000; 513 ; $ENDSRCH ; ; ; 514 DD_SR21: 515 pop ds ; ; ; 516 ret ; ; ; 517 518 EXEC_Routine endp 519 520 ; 521 ;**************************************************************************** 522 ; Build_Path_For_EXEC 523 ;**************************************************************************** 524 ; 525 ; 526 ; 527 ; 528 529 Procedure Build_Path_And_Exec ; ;AN000; 530 531 ; $DO ; ;AC000; 532 DD_DO27: 533 cmp byte ptr [si],0 ;All path entries done? ; ; 534 ; $IF NE ; ;AC000; 535 JE DD_IF28 536 mov di,offset EXEC_Path ;Point at where to put path ; ; 537 mov byte ptr [es:di],0 ;End path just in case ; ; 538 ; $DO ; ;AC000; 539 DD_DO29: 540 cmp byte ptr [si],0 ;End of Path? ; ; 541 ; $LEAVE E ; ;AC000; 542 JE DD_EN29 543 cmp byte ptr [si],';' ;End of entry? ; ; 544 ; $if e ;yes ;an000; dms; 545 JNE DD_IF31 546 inc si ;point to next character ;an000; dms; 547 jmp EXIT_BPE_LOOP ;exit loop ;an000; dms; 548 ; $endif ; ;an000; dms; 549 DD_IF31: 550 movsb ;Put char in path string ; ; 551 ; $ENDDO ; ;AN000; 552 JMP SHORT DD_DO29 553 DD_EN29: 554 555 EXIT_BPE_LOOP: ; ;an000; dms; 556 ;Path filled in,get backslash ; ; 557 cmp byte ptr [si-1],0 ;Any path there? ; ; 558 ; $IF NE ; ;AC000; 559 JE DD_IF34 560 ;Nope ; ; 561 cmp byte ptr [si-1],"\" ;Need a backslash? ; ; 562 ; $IF NE ; ;AC000; 563 JE DD_IF35 564 mov byte ptr [es:di],"\" ;Yes, put one in ; ; 565 inc di ;Line it up for next stuff ; ; 566 inc si ; ; ; 567 ; $ENDIF ; ;AN000; 568 DD_IF35: 569 push si ;Save place in path 570 push ds ;Save segment for environment ;AN000; 571 push es ;Xchange ds/es ;an000; dms; 572 pop ds ; ;an000; dms; 573 mov si,offset FS_String_Buffer ;Fill in filename ; ; 574 mov cx, Len_FS_String_Buffer ; ; ; 575 rep movsb ; ; ; 576 Exec_Program equ EXEC_Program ; NASM port label 577 call Exec_Program ; ; ; 578 cmp byte [ExitStatus],No_Error ;E if EXEC okay ;AN000; 579 pop ds ;Get Env segment back ; ; 580 pop si ;Get place in path back 581 ; $ENDIF ;E if all paths done ;AN000; 582 DD_IF34: 583 ; $ENDIF ;E if all paths done ;AN000; 584 DD_IF28: 585 ; $ENDDO E ;Exit if E ;AN000; 586 JNE DD_DO27 587 ret ; ;AN000; 588 589 Build_Path_And_EXEC Endp ; ;AN000; 590 591 592 593 ; 594 ;**************************************************************************** 595 ; Exec_Cur_Directory 596 ;**************************************************************************** 597 ; 598 ; 599 ; 600 ; 601 602 Procedure Exec_Cur_Directory ; ;AC000; 603 604 Set_Data_Segment ; ;AN000; 605 mov si,offset FS_String_Buffer ;Setup path for current dir ; ; 606 mov di,offset EXEC_Path ; ; ; 607 mov cx,Len_FS_String_Buffer ; ; ; 608 rep movsb ; ; ; 609 call EXEC_Program ; ; ; 610 ret ; ; ; 611 612 EXEC_Cur_Directory endp ; ;AN000; 613 614 ;========================================================================= 615 ; Set_FCB1_Drive : This routine sets the 1st. byte of the FCB1, 616 ; the drive identifier, to the default drive. 617 ;========================================================================= 618 619 Procedure Set_FCB1_Drive ;an000;dms;set drive ID 620 621 push ds ;an000;dms;save ds 622 push si ;an000;dms;save si 623 624 mov si,[PSP_Segment] ;an000;dms;get segment of PSP 625 mov ds,si ;an000;dms;put it in ds 626 assume ds:PSP ;an000;dms; 627 mov si,FCB1 ;an000;dms;ptr to FCB1 628 mov byte ptr [si],00h ;an000;dms;set drive ID to 629 ; default drive 630 pop si ;an000;dms;restore si 631 pop ds ;an000;dms;restore ds 632 Set_Data_Segment ;an000;dms;set up segmentation 633 ret ;an000;dms; 634 635 Set_FCB1_Drive endp ;an000;dms; 636 637 %ENDIF ;FSExec ;an018; dms;end /FS: conditional 638 ; assembly 639 640 public End_Program 641 End_Program label byte 642 643 ; (no prior section) ; code ends 644 end 645