DOS 3.30 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

485 lines
14 KiB

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