Leaked source code of windows server 2003
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.

961 lines
32 KiB

  1. AltLeftShift EQU 10
  2. AltRightShift EQU 9
  3. CtrlLeftShift EQU 5
  4. CtrlRightShift EQU 4
  5. CtrlAlt EQU 12
  6. caps_bit equ 01000000b
  7. nums_bit equ 00100000b
  8. NUMKBTONOI EQU 29
  9. NUMKBDIAL EQU 9
  10. NUMSEMICODES EQU 122
  11. NUMKBCODES EQU 102
  12. ISWINDOWSNT EQU 3205H
  13. ROM_BIOS_DATA SEGMENT AT 40H ;BIOS statuses held here, also kb buffer
  14. ORG 17h
  15. bios_kbd_stat db ? ;keyboard status byte
  16. ORG 1AH
  17. HEAD DW ? ;Unread chars go from Head to Tail
  18. TAIL DW ?
  19. BUFFER DW 16 DUP (?) ;The buffer itself
  20. BUFFER_END LABEL WORD
  21. ROM_BIOS_DATA ENDS
  22. CODE SEGMENT PARA PUBLIC 'CODE'
  23. ASSUME CS:CODE
  24. ORG 100H
  25. BEGIN: JMP INITIALIZE
  26. MYSIG DB 'G.Kozyrakis'
  27. NEW_INT09H PROC NEAR ;The keyboard interrupt will now come here.
  28. ASSUME CS:CODE
  29. PUSH AX ;Save the used registers for good form
  30. PUSH BX
  31. PUSH CX
  32. PUSH DX
  33. PUSH DI
  34. PUSH SI
  35. PUSH DS
  36. PUSH ES
  37. PUSHF ;First, call old keyboard interrupt
  38. CALL OLD_INT09H
  39. CMP CS:[CHECKFLAG],1
  40. JNE JEXIT
  41. CLI
  42. ASSUME DS:ROM_BIOS_DATA ;Examine the char just put in
  43. MOV BX,ROM_BIOS_DATA
  44. MOV DS,BX
  45. MOV BX,TAIL ;Point to current tail
  46. MOV CL,Bios_kbd_stat
  47. MOV CH,CL
  48. AND CH,1FH
  49. AND CL,0Fh
  50. CMP CL,AltRightShift
  51. JNE NOGREEKSWITCH
  52. MOV GrFlag,AltRightShift
  53. MOV SemiFlag,0
  54. JMP SHORT START
  55. NOGREEKSWITCH:
  56. CMP CL,AltLeftShift
  57. JNE CHKSEMI
  58. MOV GrFlag,0
  59. MOV SemiFlag,0
  60. JMP SHORT START
  61. CHKSEMI:
  62. MOV CL,Bios_kbd_stat
  63. AND CL,CtrlLeftShift
  64. CMP CL,CtrlLeftShift
  65. JNE START
  66. SemiGr:
  67. XOR SemiFlag,CtrlLeftShift
  68. START:
  69. CMP BX,HEAD ;If at head, kbd int has deleted char
  70. JE JEXIT ;So leave
  71. SUB BX,2 ;Point to just read in character
  72. CMP BX,OFFSET BUFFER ;Did we undershoot buffer?
  73. JAE NO_WRAP ;Nope
  74. MOV BX,OFFSET BUFFER_END ;Yes -- move to buffer top
  75. SUB BX,2 ;Point to just read in character
  76. NO_WRAP:
  77. MOV DX, [BX] ;** Typed character in DX now **
  78. cmp DL,32
  79. jne NOTOGGLE
  80. mov CL,CH
  81. and CL,0Fh
  82. cmp CL,CtrlAlt
  83. jne NOTOGGLE
  84. xor GrFlag,AltRightShift
  85. MOV SemiFlag,0
  86. MOV TAIL,BX ;take tono out of kbr buffer
  87. JMP EXIT
  88. NOTOGGLE:
  89. TEST CH,10h
  90. JZ NOSCROLL
  91. cmp dh,7ah
  92. ja NOSCROLL
  93. cmp dh,78h
  94. jb NOSCROLL
  95. push es
  96. push ds
  97. mov ax,CS
  98. mov es,ax
  99. mov ds,ax
  100. push bx
  101. mov al,dh
  102. sub al,77h
  103. CALL ChangeCP
  104. pop bx
  105. pop ds
  106. pop es
  107. MOV TAIL,BX ;take tono out of kbr buffer
  108. JMP EXIT
  109. NOSCROLL:
  110. MOV SI,KBOffset
  111. ADD SI,(NUMKBTONOI+NUMKBDIAL)*2 ;Semicodes
  112. CMP SemiFlag,CtrlLeftShift
  113. JE GREEKS
  114. ADD SI,NUMSEMICODES*2 ;KBCodes
  115. CMP GrFlag,AltRightShift
  116. JE GREEKS
  117. JEXIT: JMP EXIT
  118. GREEKS:
  119. CMP ToneStat,0
  120. JE CHKTN
  121. MOV SI,KBOffset ;KBTONOI
  122. CMP ToneStat,22h
  123. JNE TCNT
  124. ADD SI,NUMKBTONOI*2 ;KBDIAL
  125. TCNT: CMP DX,CS:[SI] ;Compare to first key
  126. JE FOUNDONE ;yes
  127. ADD SI,4 ;Point to next key
  128. CMP CS:[SI],0FFFFH ;check for end;
  129. JNE TCNT ;No continue with next table entry
  130. CMP ToneStat,0
  131. JE NoTonos
  132. MOV TAIL,BX
  133. NoTonos:
  134. MOV ToneStat,0
  135. MOV TAIL,BX
  136. CHKTN:
  137. CMP DH,27H ;is it a tonos
  138. JNE NEXT
  139. ISTONOS:
  140. MOV ToneStat,27h ;yes
  141. MOV TAIL,BX ;take tono out of kbr buffer
  142. JMP SHORT EXIT
  143. NEXT: CMP DH,28H ;is it dialytika
  144. JNE CONT
  145. MOV ToneStat,22h
  146. MOV TAIL,BX ;take dialytika out of kbr buffer
  147. JMP SHORT EXIT
  148. CONT: CMP DX,CS:[SI] ;Compare to first key
  149. JE FOUNDONE ;yes
  150. ADD SI,4 ;Point to next key
  151. CMP CS:[SI],0FFFFH ;check for end;
  152. JNE CONT ;No continue with next table entry
  153. JMP SHORT EXIT ;No keys matched. Jump Out.
  154. FOUNDONE:
  155. MOV DX,CS:[SI+2]
  156. MOV [BX],DX
  157. MOV ToneStat,0
  158. EXIT:
  159. STI
  160. PUSH BP
  161. MOV AH,03
  162. INT 10H
  163. CMP CH,CL
  164. JAE NO_CURSOR
  165. MOV CX,CURSOR1
  166. XOR CH,CH
  167. CMP SemiFlag,0
  168. JNE SET_CURSOR
  169. MOV CX,CURSOR1
  170. CMP GRFlag,0
  171. JNE SET_CURSOR
  172. MOV CX,CURSOR0
  173. SET_CURSOR:
  174. MOV AH,1
  175. INT 10h
  176. NO_CURSOR:
  177. POP BP
  178. POP ES ;Do the Pops of all registers.
  179. POP DS
  180. POP SI
  181. POP DI
  182. POP DX
  183. POP CX
  184. POP BX
  185. POP AX
  186. IRET ;An interrupt needs an IRET
  187. NEW_INT09H ENDP
  188. ChangeCP PROC NEAR
  189. CLI
  190. Mov ES:[KBOffset],OFFSET ES:[TAB928]
  191. CMP AL,3
  192. JE ChangeAll
  193. Mov ES:[KBOffset],OFFSET ES:[TAB869]
  194. CMP AL,2
  195. JE ChangeAll
  196. Mov ES:[KBOffset],OFFSET ES:[TAB737]
  197. CMP AL,1
  198. JNE NOCHCP
  199. ChangeAll:
  200. MOV CS:[CPTable],AL
  201. NOCHCP:
  202. STI
  203. RET
  204. ChangeCP ENDP
  205. ;* Multiplex - Handler for Interrupt 2Fh (Multiplex Interrupt). Checks
  206. ;* AH for this TSR's identity number. If no match (indicating call is
  207. ;* not intended for this TSR), Multiplex passes control to the previous
  208. ;* Interrupt 2Fh handler.
  209. ;*
  210. ;* Params: AH = Handler identity number
  211. ;* AL = Function number 0-2
  212. ;*
  213. ;* Return: AL = 0FFh (function 0)
  214. ;* "GK" in BX (function 0)
  215. ;* ES = Current CS (function 0)
  216. ;* DH = Greek State for function 1 ( 9 or 10)
  217. ;* DL = Code Page (1:=737 2:=869 3:=928) for function 2
  218. Multiplex PROC FAR
  219. .IF ah != 0CCh ; If this handler not requested,
  220. jmp cs:MULTEX_ISR ; pass control to old Int 2Fh
  221. .ENDIF ; handler
  222. push cs
  223. pop es
  224. .IF al == 0 ; If function 0 (verify presence),
  225. mov al, 0FFh ; AL = 0FFh,
  226. mov bx, "GK"
  227. mov dh, CS:[GRFlag]
  228. mov dl, CS:[CPTable]
  229. .ELSEIF al == 1
  230. mov CS:[GRFlag],dh
  231. .ELSEIF al == 2
  232. mov al,dl
  233. push ds
  234. push cs
  235. pop ds
  236. CALL ChangeCP
  237. pop ds
  238. .ENDIF ; set ES:DI = far address
  239. iret
  240. Multiplex ENDP
  241. BIOS_ISR LABEL DWORD
  242. OLD_INT09H DD ? ;Location of old kbd interrupt
  243. MULTEX_ISR LABEL DWORD
  244. OLD_INT2FH DD ? ;Location of old multiplex interrupt
  245. ToneStat DB 0 ;Set to 1 when tonos is pressed
  246. GrFlag DB 0
  247. SemiFlag DB 0
  248. CURSOR0 DW 0B0CH
  249. CURSOR1 DW 070CH
  250. CHECKFLAG DB 1
  251. CPTable DB 0
  252. OS_Ver DW 0
  253. KBOffset DW OFFSET TAB737
  254. TAB737 dw 1E61H, 1EE1H ; a Tonoi
  255. dw 1265H, 12E2H ; e
  256. dw 2368H, 23E3H ; h
  257. dw 1769H, 17E5H ; i
  258. dw 186FH, 18E6H ; o
  259. dw 1579H, 15E7H ; y
  260. dw 2F76H, 2FE9H ; v
  261. DW 1e41H, 1EEAH ; A
  262. dw 1245H, 12EBH ; E
  263. DW 2348H, 23ECH ; H
  264. DW 1749H, 17EDH ; I
  265. DW 184fH, 18EEH ; O
  266. DW 1559H, 15EFH ; Y
  267. DW 2f56H, 00F0H ; V
  268. dw 0FFFFH
  269. KBDIAL dw 1769H, 17E4H ; i
  270. dw 1579H, 15E8H ; y
  271. dw 1749H, 1749H
  272. DW 1559H, 1559H
  273. dw 0FFFFH
  274. SEMICODES dw 3b00H, 3bC9H ; � F1
  275. dw 3c00H, 3cBBH ; � F2
  276. dw 3e00H, 3eC8H ; � F3
  277. dw 3d00H, 3dBCH ; � F4
  278. dw 3f00H, 3fCDH ; � F5
  279. dw 4000H, 40BAH ; � F6
  280. dw 4100H, 41CCH ; � F7
  281. dw 4200H, 42B9H ; � F8
  282. dw 4300H, 43CBH ; � F9
  283. dw 4400H, 44CAH ; � F10
  284. dw 5400H, 54DAH ; � shift+F1
  285. dw 5500H, 55BFH ; �
  286. dw 5700H, 57C0H ; �
  287. dw 5600H, 56D9H ; �
  288. dw 5800H, 58C4H ; �
  289. dw 5900H, 59B3H ; �
  290. dw 5a00H, 5aC3H ; �
  291. dw 5b00H, 5bB4H ; �
  292. dw 5c00H, 5cC2H ; �
  293. dw 5d00H, 5dC1H ; � shift+F10
  294. dw 6200H, 62CEH ; �
  295. dw 6C00H, 6CC5H ; �
  296. dw 1000h, 10DBH ; � alt +Q
  297. dw 1100h, 11B0H ; � alt +E
  298. dw 1200h, 12B1H ; �
  299. dw 1300h, 13B2H ; �
  300. dw 1400h, 14DCH ; �
  301. dw 1500h, 15DFH ; �
  302. dw 6F00H, 6FB5H ; �
  303. dw 6500H, 65B6H ; �
  304. dw 5f00H, 5fB7H ; �
  305. dw 6900H, 69B8H ; �
  306. dw 6000H, 60BDH ; �
  307. dw 6A00H, 6ABEH ; �
  308. dw 6E00H, 6EC6H ; �
  309. dw 6400H, 64C7H ; �
  310. dw 6700H, 67CFH ; � ctrl +F10
  311. dw 7100H, 71D0H ; � alt +F10
  312. dw 6600H, 66D1H ; �
  313. dw 7000H, 70D2H ; �
  314. dw 6100H, 61D3H ; �
  315. dw 6B00H, 6BD4H ; �
  316. dw 6800H, 68D5H ; � alt +F1
  317. dw 5e00H, 5eD6H ; � ctrl +F1
  318. dw 6300H, 63D7H ; �
  319. dw 6D00H, 6DD8H ; �
  320. dw 1600h, 16DDH ; �
  321. dw 1700h, 17DEH ; �
  322. dw 7800h, 78F1H ; � alt +1
  323. dw 7A00H, 7AF2H ; �
  324. dw 7900H, 79F3H ; � alt +2
  325. dw 1800h, 18F4H ; �
  326. dw 1900h, 19F5H ; � alt +P
  327. dw 7B00H, 7BF6H ; �
  328. dw 7C00H, 7CF7H ; �
  329. dw 7D00H, 7DF8H ; �
  330. dw 7E00H, 7EF9H ; �
  331. dw 7F00H, 7FFBH ; �
  332. dw 8000H, 80FDH ; �
  333. dw 8100H, 81FCH ; �
  334. dw 8200H, 82FEH ; � alt +-
  335. KBCODES dw 1E61H, 1898H ; a
  336. dw 3062H, 3099H ; b
  337. dw 2267H, 229AH ; g
  338. dw 2064H, 209BH ; d
  339. dw 1265H, 129CH ; e
  340. dw 2C7AH, 2C9DH ; z
  341. dw 2368H, 239EH ; h
  342. dw 1675H, 169FH ; u
  343. dw 1769H, 17A0H ; i
  344. dw 256BH, 25A1H ; k
  345. dw 266CH, 26A2H ; l
  346. dw 326DH, 32A3H ; m
  347. dw 316EH, 31A4H ; n
  348. dw 246AH, 24A5H ; j
  349. dw 186FH, 18A6H ; o
  350. dw 1970H, 19A7H ; p
  351. dw 1372H, 13A8H ; r
  352. dw 1F73H, 1FA9H ; s
  353. dw 1474H, 14ABH ; t
  354. dw 1579H, 15ACH ; y
  355. dw 2166H, 21ADH ; f
  356. dw 2D78H, 2DAEH ; x
  357. dw 2E63H, 2EAFH ; c
  358. dw 2F76H, 00E0H ; v
  359. dw 1177H, 11AAH ; w
  360. dw 1E41H, 1E80H ; A
  361. dw 3042H, 3081H ; B
  362. dw 2247H, 2282H ; G
  363. dw 2044H, 2083H ; D
  364. dw 1245H, 1284H ; E
  365. dw 2C5AH, 2C85H ; Z
  366. dw 2348H, 2386H ; H
  367. dw 1655H, 1687H ; U
  368. dw 1749H, 1788H ; I
  369. dw 254BH, 2589H ; K
  370. dw 264CH, 268AH ; L
  371. dw 324DH, 328BH ; M
  372. dw 314EH, 318CH ; N
  373. dw 244AH, 248DH ; J
  374. dw 184FH, 188EH ; O
  375. dw 1950H, 198FH ; P
  376. dw 1352H, 1390H ; R
  377. dw 1F53H, 1F91H ; S
  378. dw 1454H, 1492H ; T
  379. dw 1559H, 1593H ; Y
  380. dw 2146H, 2194H ; F
  381. dw 2D58H, 2D95H ; X
  382. dw 2E43H, 2E96H ; C
  383. dw 2F56H, 2F97H ; V
  384. dw 1157H, 117eH ; w
  385. DW 0FFFFH
  386. TAB869 dw 1E61H, 1E9BH ; a
  387. dw 1265H, 129DH ; e
  388. dw 2368H, 239EH ; h
  389. dw 1769H, 179FH ; i
  390. dw 186FH, 18A2H ; o
  391. dw 1579H, 15A3H ; y
  392. dw 2F76H, 2FFDH ; v
  393. DW 1e41H, 1E86H ; A
  394. dw 1245H, 128DH ; E
  395. DW 2348H, 238FH ; H
  396. DW 1749H, 1790H ; I
  397. DW 184fH, 1892H ; O
  398. DW 1559H, 1595H ; Y
  399. DW 2f56H, 2F98H ; V
  400. dw 0FFFFH
  401. dw 1769H, 17A0H ; i
  402. dw 1579H, 15FBH ; y
  403. dw 1749H, 17ADH ; I
  404. DW 1559H, 15D1H ; Y
  405. dw 0FFFFH
  406. dw 3b00H, 3bC9H ; � F1
  407. dw 3c00H, 3cBBH ; � F2
  408. dw 3e00H, 3eC8H ; � F3
  409. dw 3d00H, 3dBCH ; � F4
  410. dw 3f00H, 3fCDH ; � F5
  411. dw 4000H, 40BAH ; � F6
  412. dw 4100H, 41CCH ; � F7
  413. dw 4200H, 42B9H ; � F8
  414. dw 4300H, 43CBH ; � F9
  415. dw 4400H, 44CAH ; � F10
  416. dw 5400H, 54DAH ; � shift+F1
  417. dw 5500H, 55BFH ; �
  418. dw 5700H, 57C0H ; �
  419. dw 5600H, 56D9H ; �
  420. dw 5800H, 58C4H ; �
  421. dw 5900H, 59B3H ; �
  422. dw 5a00H, 5aC3H ; �
  423. dw 5b00H, 5bB4H ; �
  424. dw 5c00H, 5cC2H ; �
  425. dw 5d00H, 5dC1H ; � shift+F10
  426. dw 6200H, 62CEH ; �
  427. dw 6C00H, 6CC5H ; �
  428. dw 1000h, 10DBH ; � alt +Q
  429. dw 1100h, 11B0H ; � alt +E
  430. dw 1200h, 12B1H ; �
  431. dw 1300h, 13B2H ; �
  432. dw 1400h, 14DCH ; �
  433. dw 1500h, 15DFH ; �
  434. dw 6F00H, 6FABH ; �
  435. dw 6500H, 65AEH ; �
  436. dw 5f00H, 5fAFH ; �
  437. dw 6900H, 69B8H ; �
  438. dw 6000H, 60BDH ; �
  439. dw 6A00H, 6ABEH ; �
  440. dw 6E00H, 6EC6H ; �
  441. dw 6400H, 64C7H ; �
  442. dw 6700H, 67CFH ; � ctrl +F10
  443. dw 7100H, 71D0H ; � alt +F10
  444. dw 6600H, 66D1H ; �
  445. dw 7000H, 70D2H ; �
  446. dw 6100H, 61D3H ; �
  447. dw 6B00H, 6BD4H ; �
  448. dw 6800H, 68D5H ; � alt +F1
  449. dw 5e00H, 5eD6H ; � ctrl +F1
  450. dw 6300H, 63D7H ; �
  451. dw 6D00H, 6DD8H ; �
  452. dw 1600h, 16DDH ; �
  453. dw 1700h, 17DEH ; �
  454. dw 7800h, 78AEH ; � alt +1
  455. dw 7A00H, 7AABH ; �
  456. dw 7900H, 79AFH ; � alt +2
  457. dw 1800h, 18F0H ; �
  458. dw 1900h, 19F1H ; � alt +P
  459. dw 7B00H, 7BF7H ; �
  460. dw 7C00H, 7CF5H ; �
  461. dw 7D00H, 7DF8H ; �
  462. dw 7E00H, 7EF9H ; �
  463. dw 7F00H, 7FFBH ; �
  464. dw 8000H, 80FDH ; �
  465. dw 8100H, 81FCH ; �
  466. dw 8200H, 82FEH ; � alt +-
  467. dw 1E61H, 18D6H ; a
  468. dw 3062H, 30D7H ; b
  469. dw 2267H, 22D8H ; g
  470. dw 2064H, 20DDH ; d
  471. dw 1265H, 12DEH ; e
  472. dw 2C7AH, 00E0H ; z
  473. dw 2368H, 23E1H ; h
  474. dw 1675H, 16E2H ; u
  475. dw 1769H, 17E3H ; i
  476. dw 256BH, 25E4H ; k
  477. dw 266CH, 26E5H ; l
  478. dw 326DH, 32E6H ; m
  479. dw 316EH, 31E7H ; n
  480. dw 246AH, 24E8H ; j
  481. dw 186FH, 18E9H ; o
  482. dw 1970H, 19EAH ; p
  483. dw 1372H, 13EBH ; r
  484. dw 1F73H, 1FECH ; s
  485. dw 1474H, 14EEH ; t
  486. dw 1579H, 15F2H ; y
  487. dw 2166H, 21F3H ; f
  488. dw 2D78H, 2DF4H ; x
  489. dw 2E63H, 2EF6H ; c
  490. dw 2F76H, 2FFAH ; v
  491. dw 1177H, 11EDH ; w
  492. dw 1E41H, 1EA4H ; A
  493. dw 3042H, 30A5H ; B
  494. dw 2247H, 22A6H ; G
  495. dw 2044H, 20A7H ; D
  496. dw 1245H, 12A8H ; E
  497. dw 2C5AH, 2CA9H ; Z
  498. dw 2348H, 23AAH ; H
  499. dw 1655H, 16ACH ; U
  500. dw 1749H, 17ADH ; I
  501. dw 254BH, 25B5H ; K
  502. dw 264CH, 26B6H ; L
  503. dw 324DH, 32B7H ; M
  504. dw 314EH, 31B8H ; N
  505. dw 244AH, 24BDH ; J
  506. dw 184FH, 18BEH ; O
  507. dw 1950H, 19C6H ; P
  508. dw 1352H, 13C7H ; R
  509. dw 1F53H, 1FCFH ; S
  510. dw 1454H, 14D0H ; T
  511. dw 1559H, 15D1H ; Y
  512. dw 2146H, 21D2H ; F
  513. dw 2D58H, 2DD3H ; X
  514. dw 2E43H, 2ED4H ; C
  515. dw 2F56H, 2FD5H ; V
  516. dw 1157H, 117eH ; w
  517. dw 0FFFFH
  518. TAB928 dw 1E61H, 1EDCH ; a
  519. dw 1265H, 12DDH ; e
  520. dw 2368H, 23DEH ; h
  521. dw 1769H, 17DFH ; i
  522. dw 186FH, 18FCH ; o
  523. dw 1579H, 15FDH ; y
  524. dw 2F76H, 2FFEH ; v
  525. DW 1e41H, 1EB6H ; A
  526. dw 1245H, 12B8H ; E
  527. DW 2348H, 23B9H ; H
  528. DW 1749H, 17BAH ; I
  529. DW 184fH, 18BCH ; O
  530. DW 1559H, 15BEH ; Y
  531. DW 2f56H, 2FBFH ; V
  532. dw 0FFFFH
  533. dw 1769H, 17FAH ; i
  534. dw 1579H, 15FBH ; y
  535. dw 1749H, 17DAH ; I
  536. DW 1559H, 15DBH ; Y
  537. dw 0FFFFH
  538. dw 3b00H, 3b91H ; � F1
  539. dw 3c00H, 3c87H ; � F2
  540. dw 3e00H, 3e90H ; � F3
  541. dw 3d00H, 3d88H ; � F4
  542. dw 3f00H, 3f95H ; � F5
  543. dw 4000H, 4086H ; � F6
  544. dw 4100H, 4194H ; � F7
  545. dw 4200H, 4285H ; � F8
  546. dw 4300H, 4393H ; � F9
  547. dw 4400H, 4492H ; � F10
  548. dw 5400H, 5498H ; � shift+F1
  549. dw 5500H, 5589H ; �
  550. dw 5700H, 578AH ; �
  551. dw 5600H, 5697H ; �
  552. dw 5800H, 588EH ; �
  553. dw 5900H, 5983H ; �
  554. dw 5a00H, 5a8dH ; �
  555. dw 5b00H, 5b84H ; �
  556. dw 5c00H, 5c8cH ; �
  557. dw 5d00H, 5d8bH ; � shift+F10
  558. dw 6200H, 6296H ; �
  559. dw 6C00H, 6C8fH ; �
  560. dw 1000h, 1099H ; � alt +Q
  561. dw 1100h, 1180H ; � alt +E
  562. dw 1200h, 1281H ; �
  563. dw 1300h, 1382H ; �
  564. dw 1400h, 149aH ; �
  565. dw 1600h, 169bH ; �
  566. ; differ in other CPs
  567. dw 6F00H, 6F00H ; �
  568. dw 6500H, 6500H ; �
  569. dw 5f00H, 5f00H ; �
  570. dw 6900H, 6900H ; �
  571. dw 6000H, 6000H ; �
  572. dw 6A00H, 6A00H ; �
  573. dw 6E00H, 6E00H ; �
  574. dw 6400H, 6400H ; �
  575. dw 6700H, 6700H ; � ctrl +F10
  576. dw 7100H, 7100H ; � alt +F10
  577. dw 6600H, 6600H ; �
  578. dw 7000H, 7000H ; �
  579. dw 6100H, 6100H ; �
  580. dw 6B00H, 6B00H ; �
  581. dw 6800H, 6800H ; � alt +F1
  582. dw 5e00H, 5e00H ; � ctrl +F1
  583. dw 6300H, 6300H ; �
  584. dw 2b00H, 00a7H ; �
  585. dw 1500h, 00e0H ; �
  586. dw 1700h, 17c0H ; �
  587. dw 7800h, 78B1H ; � alt +1
  588. dw 7A00H, 7AABH ; �
  589. dw 7900H, 79BBH ; � alt +2
  590. dw 1800h, 18a7H ; �
  591. dw 1900h, 19a9H ; � alt +P
  592. dw 7B00H, 7BF6H ; �
  593. dw 7C00H, 7CF7H ; �
  594. dw 7D00H, 7Db0H ; �
  595. dw 7E00H, 7Eb7H ; �
  596. dw 7F00H, 7F9cH ; �
  597. dw 8000H, 80b2H ; �
  598. dw 8100H, 81b3H ; �
  599. dw 8200H, 82bdH ; � alt +-
  600. dw 1E61H, 18E1H ; a
  601. dw 3062H, 30E2H ; b
  602. dw 2267H, 22E3H ; g
  603. dw 2064H, 20E4H ; d
  604. dw 1265H, 12E5H ; e
  605. dw 2C7AH, 2CE6H ; z
  606. dw 2368H, 23E7H ; h
  607. dw 1675H, 16E8H ; u
  608. dw 1769H, 17E9H ; i
  609. dw 256BH, 25EAH ; k
  610. dw 266CH, 26EBH ; l
  611. dw 326DH, 32ECH ; m
  612. dw 316EH, 31EDH ; n
  613. dw 246AH, 24EEH ; j
  614. dw 186FH, 18EFH ; o
  615. dw 1970H, 00F0H ; p
  616. dw 1372H, 13F1H ; r
  617. dw 1F73H, 1FF3H ; s
  618. dw 1474H, 14F4H ; t
  619. dw 1579H, 15F5H ; y
  620. dw 2166H, 21F6H ; f
  621. dw 2D78H, 2DF7H ; x
  622. dw 2E63H, 2EF8H ; c
  623. dw 2F76H, 2FF9H ; v
  624. dw 1177H, 11F2H ; w
  625. dw 1E41H, 1EC1H ; A
  626. dw 3042H, 30C2H ; B
  627. dw 2247H, 22C3H ; G
  628. dw 2044H, 20C4H ; D
  629. dw 1245H, 12C5H ; E
  630. dw 2C5AH, 2CC6H ; Z
  631. dw 2348H, 23C7H ; H
  632. dw 1655H, 16C8H ; U
  633. dw 1749H, 17C9H ; I
  634. dw 254BH, 25CAH ; K
  635. dw 264CH, 26CBH ; L
  636. dw 324DH, 32CCH ; M
  637. dw 314EH, 31CDH ; N
  638. dw 244AH, 24CEH ; J
  639. dw 184FH, 18CFH ; O
  640. dw 1950H, 19D0H ; P
  641. dw 1352H, 13D1H ; R
  642. dw 1F53H, 1FD3H ; S
  643. dw 1454H, 14D4H ; T
  644. dw 1559H, 15D5H ; Y
  645. dw 2146H, 21D6H ; F
  646. dw 2D58H, 2DD7H ; X
  647. dw 2E43H, 2ED8H ; C
  648. dw 2F56H, 2FD9H ; V
  649. dw 1157H, 117eH ; w
  650. dw 0FFFFH
  651. INITIALIZE PROC NEAR
  652. ASSUME DS:CODE
  653. PUSH CS
  654. POP ES
  655. MOV AX,3306H
  656. INT 21H
  657. MOV OS_Ver,BX
  658. MOV AX,0CC00h
  659. INT 2Fh
  660. CMP AL,0FFh
  661. JNE PARSE
  662. CMP BX,"GK"
  663. JNE PARSE
  664. MOV INSTALL_FLAG,1 ;Program is already installed
  665. MOV CS:[CodePage],DL ;If installed DL holds active CP
  666. ;
  667. ;
  668. PARSE:
  669. CLD ;CLEAR DIRECTION
  670. XOR CH,CH
  671. MOV SI,80H ;Point DS:SI to command line
  672. MOV CL,[SI]
  673. CMP CL,0
  674. JE ENDSCAN
  675. INC SI
  676. INIT1: LODSB
  677. CMP AL,"/"
  678. JE SLASHCAR
  679. INIT6: LOOP INIT1
  680. JMP ENDSCAN
  681. SLASHCAR:
  682. CMP BYTE PTR [SI],'?'
  683. JNE NO_HELP
  684. JMP DISP_HELP
  685. NO_HELP:
  686. CMP BYTE PTR [SI],'8'
  687. JE INIT2
  688. CMP BYTE PTR [SI],'9'
  689. JE INIT3
  690. CMP BYTE PTR [SI],'7'
  691. JE INIT4
  692. CMP BYTE PTR [SI],'4'
  693. JE INIT4
  694. AND BYTE PTR [SI],0DFh ;Change char to uppercase
  695. ; CMP BYTE PTR [SI],'U'
  696. ; JE UNINSTALL ;Yes, then uninstall program
  697. CMP BYTE PTR [SI],'H' ; Ask for help
  698. JNE INIT6 ; No branch
  699. DISP_HELP:
  700. CALL DISP_BANNER
  701. MOV DX,OFFSET HELP_BANNER
  702. MOV AH,9
  703. INT 21H
  704. MOV AX,4C00H ;Exit with ERRORLEVEL = 0
  705. INT 21H
  706. INIT2:
  707. CMP BYTE PTR [SI+1],'6'
  708. JNE INIT6
  709. CMP BYTE PTR [SI+2],'9'
  710. JNE INIT6
  711. MOV CS:[CodePage],2
  712. JMP INIT6
  713. INIT3:
  714. CMP BYTE PTR [SI+1],'2'
  715. JNE INIT6
  716. CMP BYTE PTR [SI+2],'8'
  717. JNE INIT6
  718. MOV CS:[CodePage],3
  719. JMP INIT6
  720. INIT4:
  721. CMP BYTE PTR [SI+1],'3'
  722. JNE INIT6
  723. CMP BYTE PTR [SI+2],'7'
  724. JNE INIT6
  725. MOV CS:[CodePage],1
  726. JMP INIT6
  727. ENDSCAN:
  728. MOV AL,CS:[CodePage]
  729. CMP AL,ES:[CPTable]
  730. JE NOCP
  731. MOV ES:[CHECKFLAG],1 ;Clear CHECKFLAG byte
  732. MOV ES:[CPTable],AL
  733. CALL ChangeCP
  734. NOCP:
  735. CMP INSTALL_FLAG,1 ;Branch if not installed
  736. JNE INSTALL1
  737. MOV DX,OFFSET CONFIRM_MSG3 ;Print confirmation message
  738. JMP SHORT CONFIRM_AND_EXIT ;And exit
  739. UNINSTALL:
  740. CMP INSTALL_FLAG,1 ;Error if not installed
  741. JE UNINSTALL2
  742. MOV AL,3
  743. MOV DX,OFFSET ERRMSG1 ;Initialize error pointer
  744. JMP ERROR_EXIT
  745. UNINSTALL2:
  746. CALL REMOVE ;Uninstall the program
  747. JNC UNINSTALL3
  748. MOV AL,4
  749. MOV DX,OFFSET ERRMSG2 ;Initialize error pointer
  750. JMP ERROR_EXIT
  751. UNINSTALL3:
  752. MOV DX,OFFSET CONFIRM_MSG2 ;Print confirmation message
  753. CONFIRM_AND_EXIT:
  754. PUSH DX
  755. CALL DISP_BANNER
  756. POP DX
  757. MOV AH,9
  758. INT 21H
  759. MOV AX,4C00H ;Exit with ERRORLEVEL = 0
  760. INT 21H
  761. ERROR_EXIT:
  762. PUSH AX ;Save registers
  763. MOV AH,9
  764. INT 21H
  765. POP AX ;Error code
  766. MOV AH,4CH ;Terminate with ERRORLEVEL set
  767. INT 21H
  768. INSTALL1:
  769. PUSH ES
  770. MOV AX,3509H
  771. INT 21H
  772. MOV WORD PTR OLD_INT09H,BX ;Address and put it in our location
  773. MOV WORD PTR OLD_INT09H+2,ES
  774. MOV DX,OFFSET NEW_INT09H
  775. MOV AX,2509H
  776. INT 21h
  777. mov ax, 352Fh ; Request DOS Function 35h
  778. int 21h ; Get interrupt vector in ES:BX
  779. MOV WORD PTR OLD_INT2FH,BX ;Address and put it in our location
  780. MOV WORD PTR OLD_INT2FH+2,ES
  781. MOV DX,OFFSET MultiPlex
  782. MOV AX,252Fh
  783. INT 21h
  784. CALL DISP_BANNER
  785. POP ES
  786. MOV AX,DS:[2CH] ;Get environment segment
  787. MOV ES,AX ; address from PSP
  788. MOV AH,49H ;Then deallocate environment
  789. INT 21H ; space reserved by DOS
  790. INT 11H
  791. TEST AL,10H
  792. JNZ NOCGA
  793. MOV CURSOR0,0607H
  794. MOV CURSOR1,0307H
  795. NOCGA:
  796. MOV DX,OFFSET INITIALIZE
  797. INT 27H
  798. DISP_BANNER:
  799. MOV DX,OFFSET MSGSTRT
  800. MOV AH,9
  801. INT 21h
  802. MOV DX,OFFSET MSG869
  803. CMP CS:[CodePage],2
  804. JE DISPREST
  805. MOV DX,OFFSET MSG928
  806. CMP CS:[CodePage],3
  807. JE DISPREST
  808. MOV DX,OFFSET MSG737
  809. DISPREST:
  810. MOV AH,9
  811. INT 21h
  812. CMP OS_Ver,ISWINDOWSNT
  813. JNE BANNER_END
  814. MOV DX,OFFSET MSGONNT
  815. MOV AH,9
  816. INT 21H
  817. BANNER_END:
  818. RET
  819. INITIALIZE ENDP
  820. ;-----------------------------------------------------------------------------
  821. ;REMOVE deallocates the memory block addressed by ES and restores the
  822. ;Interrupt vector displaced on installation.
  823. ;-----------------------------------------------------------------------------
  824. REMOVE PROC NEAR
  825. PUSH ES ;Get current interrupt
  826. MOV AX,352FH
  827. INT 21H
  828. MOV BX,ES
  829. POP ES
  830. MOV AX,ES
  831. CMP BX,AX ;Program cannot be uninstalled
  832. JNE NO_RESTORE_VECTOR
  833. PUSH ES ;Get current interrupt
  834. MOV AX,3509H
  835. INT 21H
  836. MOV BX,ES
  837. POP ES
  838. MOV AX,ES
  839. CMP BX,AX ;Program cannot be uninstalled
  840. JE RESTORE_VECTOR
  841. NO_RESTORE_VECTOR:
  842. STC ;Return with CF = 1 for error
  843. RET
  844. RESTORE_VECTOR:
  845. PUSH DS ;Restore displaced interrupt
  846. ASSUME DS:NOTHING ; vector
  847. LDS DX,ES:[BIOS_ISR]
  848. MOV AX,2509H
  849. INT 21H
  850. LDS DX,ES:[MULTEX_ISR]
  851. MOV AX,252fH
  852. INT 21H
  853. POP DS
  854. ASSUME DS:CODE
  855. NOT WORD PTR ES:[BEGIN] ;Remove fingerprint
  856. MOV AH,49H ;Free memory given to
  857. INT 21H ; original program block
  858. RET ;Exit with CF intact
  859. REMOVE ENDP
  860. INSTALL_FLAG DB 0
  861. CodePage DB 1
  862. MSGSTRT DB 0ah,0dh
  863. DB 'GREEK Driver for MS-DOS. Copyright 1994 Microsoft Hellas',0ah,0dh
  864. DB 'Active Code Page is ','$'
  865. MSG737 DB '737',0ah,0dh,'$'
  866. MSG869 DB '869',0ah,0dh,'$'
  867. MSG928 DB '928',0ah,0dh,'$'
  868. MSGONNT DB 'Running under MS Windows NT',10,13,'$'
  869. ERRMSG1 DB "Greek driver not loaded",0dh,0ah,"$"
  870. ERRMSG2 DB "Cannot unload Greek driver",0dh,0ah,"$"
  871. CONFIRM_MSG2 DB "Driver unloaded.",0dh,0ah,"$"
  872. CONFIRM_MSG3 DB "Driver loaded."
  873. Dummy DB 0dh,0ah,"$"
  874. HELP_BANNER DB 0ah,0dh
  875. DB 'Hotkeys for keyboard switching are:',0ah,0dh
  876. DB ' Alt + Right Shift, Greek On ',0ah,0dh
  877. DB ' Alt + Left Shift, Greek Off',0ah,0dh
  878. DB ' Ctrl + Right Shift, Semigraphics',0ah,0dh,0ah,0dh
  879. DB 'For code page switching,',0ah,0dh
  880. DB 'set Scroll Lock on and press:',0ah,0dh
  881. DB ' Alt + 1 for C.P. 737',0ah,0dh
  882. DB ' Alt + 2 for C.P. 869',0ah,0dh
  883. DB ' Alt + 3 for C.P. 928',0ah,0dh
  884. DB 0dh,0ah,'Valid switches are:',0dh,0ah
  885. DB ' /737: code page 737 (default)',0dh,0ah
  886. DB ' /869: code page IBM 869',0dh,0ah
  887. DB ' /928: code page ELOT 928',0dh,0ah,'$'
  888. CODE ENDS
  889. END BEGIN