diff options
Diffstat (limited to '')
| -rw-r--r-- | v4.0/src/DOS/DOSMES.ASM | 442 |
1 files changed, 442 insertions, 0 deletions
diff --git a/v4.0/src/DOS/DOSMES.ASM b/v4.0/src/DOS/DOSMES.ASM new file mode 100644 index 0000000..3770c5d --- /dev/null +++ b/v4.0/src/DOS/DOSMES.ASM | |||
| @@ -0,0 +1,442 @@ | |||
| 1 | ; SCCSID = @(#)dosmes.asm 1.7 85/10/23 | ||
| 2 | ; SCCSID = @(#)dosmes.asm 1.7 85/10/23 | ||
| 3 | ; | ||
| 4 | ; Message file for Internationalized messages. There is | ||
| 5 | ; only one message here available for translation. | ||
| 6 | ; | ||
| 7 | ; | ||
| 8 | ; Revision history | ||
| 9 | ; A000 version 4.00 Jan. 1988 | ||
| 10 | ; | ||
| 11 | |||
| 12 | IFNDEF KANJI | ||
| 13 | KANJI EQU FALSE | ||
| 14 | ENDIF | ||
| 15 | |||
| 16 | IFNDEF Rainbow | ||
| 17 | Rainbow EQU FALSE | ||
| 18 | ENDIF | ||
| 19 | |||
| 20 | include dossym.inc | ||
| 21 | include dosmac.inc | ||
| 22 | include doscntry.inc | ||
| 23 | |||
| 24 | CONSTANTS SEGMENT WORD PUBLIC 'CONST' | ||
| 25 | |||
| 26 | PUBLIC UserNum, OEMNum | ||
| 27 | Public DMES001S,DMES001E | ||
| 28 | DMES001S Label byte | ||
| 29 | USERNUM DW ? ; 24 bit user number | ||
| 30 | DB ? | ||
| 31 | IF IBM | ||
| 32 | IF IBMCOPYRIGHT | ||
| 33 | OEMNUM DB 0 ; 8 bit OEM number | ||
| 34 | ELSE | ||
| 35 | OEMNUM DB 0FFH ; 8 bit OEM number | ||
| 36 | ENDIF | ||
| 37 | ELSE | ||
| 38 | OEMNUM DB 0FFH | ||
| 39 | ENDIF | ||
| 40 | |||
| 41 | |||
| 42 | DMES001E label byte | ||
| 43 | CONSTANTS ENDS | ||
| 44 | |||
| 45 | TABLE SEGMENT BYTE PUBLIC 'TABLE' | ||
| 46 | Public DMES002S | ||
| 47 | DMES002S label byte | ||
| 48 | |||
| 49 | |||
| 50 | ; The following table is used for DOS 3.3 | ||
| 51 | ;DOS country and code page information is defined here for DOS 3.3. | ||
| 52 | ;The initial value for ccDosCountry is 1 (USA). | ||
| 53 | ;The initial value for ccDosCodepage is 850. | ||
| 54 | ; | ||
| 55 | ; | ||
| 56 | PUBLIC COUNTRY_CDPG,UCASE_TAB,FILE_UCASE_TAB | ||
| 57 | PUBLIC FILE_CHAR_TAB | ||
| 58 | ; | ||
| 59 | ; country and code page infomation | ||
| 60 | ; | ||
| 61 | COUNTRY_CDPG label byte | ||
| 62 | |||
| 63 | db 0,0,0,0,0,0,0,0 ; reserved words | ||
| 64 | db '\COUNTRY.SYS',0 ; path name of country.sys | ||
| 65 | db 51 dup (?) | ||
| 66 | dw 437 ; system code page id | ||
| 67 | dw 6 ; number of entries | ||
| 68 | db SetUcase ; Ucase type | ||
| 69 | dw OFFSET DOSGROUP:UCASE_TAB ;pointer to upper case table | ||
| 70 | dw 0 ; segment of poiter | ||
| 71 | db SetUcaseFile ; Ucase file char type | ||
| 72 | dw OFFSET DOSGROUP:FILE_UCASE_TAB ;pointer to file upper case table | ||
| 73 | dw 0 ; segment of poiter | ||
| 74 | db SetFileList ; valid file chars type | ||
| 75 | dw OFFSET DOSGROUP:FILE_CHAR_TAB ;pointer to valid file char tab | ||
| 76 | dw 0 ; segment of poiter | ||
| 77 | db SetCollate ; collate type | ||
| 78 | dw OFFSET DOSGROUP:COLLATE_TAB ;pointer to collate table | ||
| 79 | dw 0 ; segment of poiter | ||
| 80 | db SetDBCS ;AN000; DBCS Ev 2/12/KK | ||
| 81 | dw OFFSET DOSGROUP:DBCS_TAB ;AN000;;pointer to DBCS Ev table 2/12/KK | ||
| 82 | dw 0 ;AN000; segment of poiter 2/12/KK | ||
| 83 | db SetCountryInfo ; country info type | ||
| 84 | dw NEW_COUNTRY_SIZE ; extended country info size | ||
| 85 | dw 1 ; USA country id | ||
| 86 | dw 437 ; USA system code page id | ||
| 87 | dw 0 ; date format | ||
| 88 | db '$',0,0,0,0 ; currency symbol | ||
| 89 | db ',',0 ; thousand separator | ||
| 90 | db '.',0 ; decimal separator | ||
| 91 | db '-',0 ; date separator | ||
| 92 | db ':',0 ; time separator | ||
| 93 | db 0 ; currency format flag | ||
| 94 | db 2 ; # of disgit in currency | ||
| 95 | db 0 ; time format | ||
| 96 | dw OFFSET DOSGROUP:MAP_CASE ;mono case routine entry point | ||
| 97 | dw 0 ; segment of entry point | ||
| 98 | db ',',0 ; data list separator | ||
| 99 | dw 0,0,0,0,0 ; reserved | ||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | ; | ||
| 104 | ; | ||
| 105 | ; | ||
| 106 | ; | ||
| 107 | ; | ||
| 108 | ; upper case table | ||
| 109 | ; | ||
| 110 | UCASE_TAB label byte | ||
| 111 | dw 128 | ||
| 112 | db 128,154,069,065,142,065,143,128 | ||
| 113 | db 069,069,069,073,073,073,142,143 | ||
| 114 | db 144,146,146,079,153,079,085,085 | ||
| 115 | db 089,153,154,155,156,157,158,159 | ||
| 116 | db 065,073,079,085,165,165,166,167 | ||
| 117 | db 168,169,170,171,172,173,174,175 | ||
| 118 | db 176,177,178,179,180,181,182,183 | ||
| 119 | db 184,185,186,187,188,189,190,191 | ||
| 120 | db 192,193,194,195,196,197,198,199 | ||
| 121 | db 200,201,202,203,204,205,206,207 | ||
| 122 | db 208,209,210,211,212,213,214,215 | ||
| 123 | db 216,217,218,219,220,221,222,223 | ||
| 124 | db 224,225,226,227,228,229,230,231 | ||
| 125 | db 232,233,234,235,236,237,238,239 | ||
| 126 | db 240,241,242,243,244,245,246,247 | ||
| 127 | db 248,249,250,251,252,253,254,255 | ||
| 128 | |||
| 129 | ; | ||
| 130 | ; file upper case table | ||
| 131 | ; | ||
| 132 | FILE_UCASE_TAB label byte | ||
| 133 | dw 128 | ||
| 134 | db 128,154,069,065,142,065,143,128 | ||
| 135 | db 069,069,069,073,073,073,142,143 | ||
| 136 | db 144,146,146,079,153,079,085,085 | ||
| 137 | db 089,153,154,155,156,157,158,159 | ||
| 138 | db 065,073,079,085,165,165,166,167 | ||
| 139 | db 168,169,170,171,172,173,174,175 | ||
| 140 | db 176,177,178,179,180,181,182,183 | ||
| 141 | db 184,185,186,187,188,189,190,191 | ||
| 142 | db 192,193,194,195,196,197,198,199 | ||
| 143 | db 200,201,202,203,204,205,206,207 | ||
| 144 | db 208,209,210,211,212,213,214,215 | ||
| 145 | db 216,217,218,219,220,221,222,223 | ||
| 146 | db 224,225,226,227,228,229,230,231 | ||
| 147 | db 232,233,234,235,236,237,238,239 | ||
| 148 | db 240,241,242,243,244,245,246,247 | ||
| 149 | db 248,249,250,251,252,253,254,255 | ||
| 150 | |||
| 151 | ; | ||
| 152 | ; file char list | ||
| 153 | ; | ||
| 154 | FILE_CHAR_TAB label byte | ||
| 155 | dw 22 ; length | ||
| 156 | db 1,0,255 ; include all | ||
| 157 | db 0,0,20h ; exclude 0 - 20h | ||
| 158 | db 2,14,'."/\[]:|<>+=;,' ; exclude 14 special | ||
| 159 | db 24 dup (?) ; reserved | ||
| 160 | ; | ||
| 161 | ; collate table | ||
| 162 | ; | ||
| 163 | COLLATE_TAB label byte | ||
| 164 | dw 256 | ||
| 165 | db 0,1,2,3,4,5,6,7 | ||
| 166 | db 8,9,10,11,12,13,14,15 | ||
| 167 | db 16,17,18,19,20,21,22,23 | ||
| 168 | db 24,25,26,27,28,29,30,31 | ||
| 169 | db " ","!",'"',"#","$","%","&","'" | ||
| 170 | db "(",")","*","+",",","-",".","/" | ||
| 171 | db "0","1","2","3","4","5","6","7" | ||
| 172 | db "8","9",":",";","<","=",">","?" | ||
| 173 | db "@","A","B","C","D","E","F","G" | ||
| 174 | db "H","I","J","K","L","M","N","O" | ||
| 175 | db "P","Q","R","S","T","U","V","W" | ||
| 176 | db "X","Y","Z","[","\","]","^","_" | ||
| 177 | db "`","A","B","C","D","E","F","G" | ||
| 178 | db "H","I","J","K","L","M","N","O" | ||
| 179 | db "P","Q","R","S","T","U","V","W" | ||
| 180 | db "X","Y","Z","{","|","}","~",127 | ||
| 181 | db "C","U","E","A","A","A","A","C" | ||
| 182 | db "E","E","E","I","I","I","A","A" | ||
| 183 | db "E","A","A","O","O","O","U","U" | ||
| 184 | db "Y","O","U","$","$","$","$","$" | ||
| 185 | db "A","I","O","U","N","N",166,167 | ||
| 186 | db "?",169,170,171,172,"!",'"','"' | ||
| 187 | db 176,177,178,179,180,181,182,183 | ||
| 188 | db 184,185,186,187,188,189,190,191 | ||
| 189 | db 192,193,194,195,196,197,198,199 | ||
| 190 | db 200,201,202,203,204,205,206,207 | ||
| 191 | db 208,209,210,211,212,213,214,215 | ||
| 192 | db 216,217,218,219,220,221,222,223 | ||
| 193 | db 224,"S" | ||
| 194 | db 226,227,228,229,230,231 | ||
| 195 | db 232,233,234,235,236,237,238,239 | ||
| 196 | db 240,241,242,243,244,245,246,247 | ||
| 197 | db 248,249,250,251,252,253,254,255 | ||
| 198 | ; | ||
| 199 | ; dbcs is not supported in DOS 3.3 | ||
| 200 | ; DBCS_TAB CC_DBCS <> | ||
| 201 | ; | ||
| 202 | ; DBCS for DOS 4.00 2/12/KK | ||
| 203 | PUBLIC DBCS_TAB | ||
| 204 | DBCS_TAB label byte ;AN000; 2/12/KK | ||
| 205 | dw 0 ;AN000; 2/12/KK max number | ||
| 206 | db 16 dup(0) ;AN000; 2/12/KK | ||
| 207 | |||
| 208 | ; dw 6 ; 2/12/KK | ||
| 209 | ; db 081h,09fh ; 2/12/KK | ||
| 210 | ; db 0e0h,0fch ; 2/12/KK | ||
| 211 | ; db 0,0 ; 2/12/KK | ||
| 212 | ; | ||
| 213 | ; | ||
| 214 | include divmes.asm | ||
| 215 | include yesno.asm | ||
| 216 | |||
| 217 | TABLE ENDS | ||
| 218 | |||
| 219 | CODE SEGMENT BYTE PUBLIC 'CODE' | ||
| 220 | ASSUME CS:DOSGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING | ||
| 221 | |||
| 222 | ;CASE MAPPER ROUTINE FOR 80H-FFH character range, DOS 3.3 | ||
| 223 | ; ENTRY: AL = Character to map | ||
| 224 | ; EXIT: AL = The converted character | ||
| 225 | ; Alters no registers except AL and flags. | ||
| 226 | ; The routine should do nothing to chars below 80H. | ||
| 227 | ; | ||
| 228 | ; Example: | ||
| 229 | |||
| 230 | Procedure MAP_CASE,FAR | ||
| 231 | CMP AL,80H | ||
| 232 | JAE Map1 ;Map no chars below 80H ever | ||
| 233 | RET | ||
| 234 | Map1: | ||
| 235 | SUB AL,80H ;Turn into index value | ||
| 236 | PUSH DS | ||
| 237 | PUSH BX | ||
| 238 | MOV BX,OFFSET DOSGROUP:UCASE_TAB + 2 | ||
| 239 | FINISH: | ||
| 240 | PUSH CS ;Move to DS | ||
| 241 | POP DS | ||
| 242 | XLAT ds:[bx] ;Get upper case character | ||
| 243 | POP BX | ||
| 244 | POP DS | ||
| 245 | L_RET: RET | ||
| 246 | EndProc MAP_CASE | ||
| 247 | |||
| 248 | SUBTTL EDIT FUNCTION ASSIGNMENTS AND HEADERS | ||
| 249 | PAGE | ||
| 250 | ; The following two tables implement the current buffered input editing | ||
| 251 | ; routines. The tables are pairwise associated in reverse order for ease | ||
| 252 | ; in indexing. That is; The first entry in ESCTAB corresponds to the last | ||
| 253 | ; entry in ESCFUNC, and the last entry in ESCTAB to the first entry in ESCFUNC. | ||
| 254 | |||
| 255 | |||
| 256 | TABLE SEGMENT | ||
| 257 | PUBLIC CANCHAR | ||
| 258 | CANCHAR DB CANCEL ;Cancel line character | ||
| 259 | PUBLIC ESCCHAR | ||
| 260 | ESCCHAR DB ESCCH ;Lead-in character for escape sequences | ||
| 261 | IF NOT Rainbow | ||
| 262 | ESCTAB LABEL BYTE | ||
| 263 | IF NOT IBM | ||
| 264 | IF WANG | ||
| 265 | DB 0C0h ; ^Z inserter | ||
| 266 | DB 0C1H ; Copy one char | ||
| 267 | DB 0C1H ; Copy one char | ||
| 268 | DB 0C7H ; Skip one char | ||
| 269 | DB 08AH ; Copy to char | ||
| 270 | DB 088H ; Skip to char | ||
| 271 | DB 09AH ; Copy line | ||
| 272 | DB 0CBH ; Kill line (no change in template) | ||
| 273 | DB 08BH ; Reedit line (new template) | ||
| 274 | DB 0C3H ; Backspace | ||
| 275 | DB 0C6H ; Enter insert mode | ||
| 276 | DB 0D6H ; Exit insert mode | ||
| 277 | DB 0C6H ; Escape character | ||
| 278 | DB 0C6H ; End of table | ||
| 279 | ELSE | ||
| 280 | ; VT52 equivalences | ||
| 281 | DB "Z" ; ^Z inserter | ||
| 282 | DB "S" ; F1 Copy one char | ||
| 283 | DB "S" ; F1 Copy one char | ||
| 284 | DB "V" ; F4 Skip one char | ||
| 285 | DB "T" ; F2 Copy to char | ||
| 286 | DB "W" ; F5 Skip to char | ||
| 287 | DB "U" ; F3 Copy line | ||
| 288 | DB "E" ; SHIFT ERASE Kill line (no change in template) | ||
| 289 | DB "J" ; ERASE Reedit line (new template) | ||
| 290 | DB "D" ; LEFT Backspace | ||
| 291 | DB "P" ; BLUE Enter insert mode | ||
| 292 | DB "Q" ; RED Exit insert mode | ||
| 293 | DB "R" ; GRAY Escape character | ||
| 294 | DB "R" ; End of table | ||
| 295 | ENDIF | ||
| 296 | ENDIF | ||
| 297 | IF IBM | ||
| 298 | DB 64 ; Ctrl-Z - F6 | ||
| 299 | DB 77 ; Copy one char - --> | ||
| 300 | DB 59 ; Copy one char - F1 | ||
| 301 | DB 83 ; Skip one char - DEL | ||
| 302 | DB 60 ; Copy to char - F2 | ||
| 303 | DB 62 ; Skip to char - F4 | ||
| 304 | DB 61 ; Copy line - F3 | ||
| 305 | DB 61 ; Kill line (no change to template ) - Not used | ||
| 306 | DB 63 ; Reedit line (new template) - F5 | ||
| 307 | DB 75 ; Backspace - <-- | ||
| 308 | DB 82 ; Enter insert mode - INS (toggle) | ||
| 309 | DB 82 ; Exit insert mode - INS (toggle) | ||
| 310 | DB 65 ; Escape character - F7 | ||
| 311 | DB 65 ; End of table | ||
| 312 | ENDIF | ||
| 313 | ESCEND LABEL BYTE | ||
| 314 | ESCTABLEN EQU ESCEND-ESCTAB | ||
| 315 | |||
| 316 | ESCFUNC LABEL WORD | ||
| 317 | short_addr GETCH ; Ignore the escape sequence | ||
| 318 | short_addr TWOESC | ||
| 319 | short_addr EXITINS | ||
| 320 | short_addr ENTERINS | ||
| 321 | short_addr BACKSP | ||
| 322 | short_addr REEDIT | ||
| 323 | short_addr KILNEW | ||
| 324 | short_addr COPYLIN | ||
| 325 | short_addr SKIPSTR | ||
| 326 | short_addr COPYSTR | ||
| 327 | short_addr SKIPONE | ||
| 328 | short_addr COPYONE | ||
| 329 | short_addr COPYONE | ||
| 330 | short_addr CTRLZ | ||
| 331 | ENDIF | ||
| 332 | TABLE ENDS | ||
| 333 | |||
| 334 | ; | ||
| 335 | ; OEMFunction key is expected to process a single function | ||
| 336 | ; key input from a device and dispatch to the proper | ||
| 337 | ; routines leaving all registers UNTOUCHED. | ||
| 338 | ; | ||
| 339 | ; Inputs: CS, SS are DOSGROUP | ||
| 340 | ; Outputs: None. This function is expected to JMP to one of | ||
| 341 | ; the following labels: | ||
| 342 | ; | ||
| 343 | ; GetCh - ignore the sequence | ||
| 344 | ; TwoEsc - insert an ESCChar in the buffer | ||
| 345 | ; ExitIns - toggle insert mode | ||
| 346 | ; EnterIns - toggle insert mode | ||
| 347 | ; BackSp - move backwards one space | ||
| 348 | ; ReEdit - reedit the line with a new template | ||
| 349 | ; KilNew - discard the current line and start from scratch | ||
| 350 | ; CopyLin - copy the rest of the template into the line | ||
| 351 | ; SkipStr - read the next character and skip to it in the template | ||
| 352 | ; CopyStr - read next char and copy from template to line until char | ||
| 353 | ; SkipOne - advance position in template one character | ||
| 354 | ; CopyOne - copy next character in template into line | ||
| 355 | ; CtrlZ - place a ^Z into the template | ||
| 356 | ; Registers that are allowed to be modified by this function are: | ||
| 357 | ; AX, CX, BP | ||
| 358 | |||
| 359 | Procedure OEMFunctionKey,NEAR | ||
| 360 | ASSUME DS:NOTHING,ES:NOTHING,SS:DOSGROUP | ||
| 361 | IF DBCS ;AN000; | ||
| 362 | extrn intCNE0:near ;AN000; 2/17/KK | ||
| 363 | CALL intCNE0 ;AN000; 2/17/KK | ||
| 364 | ELSE ;AN000; | ||
| 365 | invoke $std_con_input_no_echo ; Get the second byte of the sequence | ||
| 366 | ENDIF ;AN000; | ||
| 367 | IF NOT Rainbow | ||
| 368 | MOV CL,ESCTABLEN ; length of table for scan | ||
| 369 | PUSH DI ; save DI (cannot change it!) | ||
| 370 | MOV DI,OFFSET DOSGROUP:ESCTAB ; offset of second byte table | ||
| 371 | REPNE SCASB ; Look it up in the table | ||
| 372 | POP DI ; restore DI | ||
| 373 | SHL CX,1 ; convert byte offset to word | ||
| 374 | MOV BP,CX ; move to indexable register | ||
| 375 | JMP [BP+OFFSET DOSGROUP:ESCFUNC] ; Go to the right routine | ||
| 376 | ENDIF | ||
| 377 | IF Rainbow | ||
| 378 | |||
| 379 | TransferIf MACRO value,address | ||
| 380 | local a | ||
| 381 | CMP AL,value | ||
| 382 | JNZ a | ||
| 383 | transfer address | ||
| 384 | a: | ||
| 385 | ENDM | ||
| 386 | |||
| 387 | CMP AL,'[' ; is it second lead char | ||
| 388 | JZ EatParm ; yes, go walk tree | ||
| 389 | GoGetCh: | ||
| 390 | transfer GetCh ; no, ignore sequence | ||
| 391 | EatParm: | ||
| 392 | invoke $std_con_input_no_echo ; get argument | ||
| 393 | CMP AL,'A' ; is it alphabetic arg? | ||
| 394 | JAE EatAlpha ; yes, go snarf one up | ||
| 395 | XOR BP,BP ; init digit counter | ||
| 396 | JMP InDigit ; jump into internal eat digit routine | ||
| 397 | EatNum: | ||
| 398 | invoke $std_con_input_no_echo ; get next digit | ||
| 399 | InDigit: | ||
| 400 | CMP AL,'9' ; still a digit? | ||
| 401 | JA CheckNumEnd ; no, go check for end char | ||
| 402 | SUB AL,'0' ; turn into potential digit | ||
| 403 | JL GoGetCh ; oops, not a digit, ignore | ||
| 404 | MOV CX,BP ; save BP for 10 multiply | ||
| 405 | CBW ; make AL into AX | ||
| 406 | SHL BP,1 ; 2*BP | ||
| 407 | SHL BP,1 ; 4*BP | ||
| 408 | ADD BP,CX ; 5*BP | ||
| 409 | SHL BP,1 ; 10*BP | ||
| 410 | ADD BP,AX ; 10*BP + digit | ||
| 411 | JMP EatNum ; continue with number | ||
| 412 | CheckNumEnd: | ||
| 413 | CMP AL,7Eh ; is it end char ~ | ||
| 414 | JNZ GoGetCh ; nope, ignore key sequence | ||
| 415 | MOV AX,BP | ||
| 416 | transferIf 1,SkipStr ; FIND key | ||
| 417 | transferIf 2,EnterIns ; INSERT HERE key | ||
| 418 | transferIf 3,SkipOne ; REMOVE | ||
| 419 | transferIf 4,CopyStr ; SELECT | ||
| 420 | transferIf 17,TwoEsc ; INTERRUPT | ||
| 421 | transferIf 18,ReEdit ; RESUME | ||
| 422 | transferIf 19,KilNew ; CANCEL | ||
| 423 | transferIf 21,CtrlZ ; EXIT | ||
| 424 | transferIf 29,CopyLin ; DO | ||
| 425 | JMP GoGetCh | ||
| 426 | EatAlpha: | ||
| 427 | CMP AL,'O' ; is it O? | ||
| 428 | JA GoGetCh ; no, after assume bogus | ||
| 429 | JZ EatPQRS ; eat the rest of the bogus key | ||
| 430 | transferIf 'C',CopyOne ; RIGHT | ||
| 431 | transferIf 'D',BackSp ; LEFT | ||
| 432 | JMP GoGetCh | ||
| 433 | EatPQRS: | ||
| 434 | invoke $std_con_input_no_echo ; eat char after O | ||
| 435 | JMP GoGetCh | ||
| 436 | ENDIF | ||
| 437 | |||
| 438 | EndProc OEMFunctionKey | ||
| 439 | |||
| 440 | CODE ENDS | ||
| 441 | |||
| 442 | END | ||