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.

2141 lines
56 KiB

  1. ;******************************************************************************
  2. ;
  3. ; Copyright (c) 1992 Insignia Solutions Ltd.
  4. ;
  5. ; Program:
  6. ;
  7. ; Purpose:
  8. ;
  9. ; Version:
  10. ;
  11. ; Author: Dave Bartlett
  12. ; Modifications:
  13. ; 1) Tim June 92. Changes to get DEC PC working. Take over
  14. ; IVT entries 6h (illegal instruction), 11h (equipment
  15. ; check), 16h (keyboard BIOS), 17h (printer),
  16. ; 42h (default video).
  17. ; 2) Tim June 92. Changed version to 1.11
  18. ; 3) Tim June 92. Avoid accesses to host ROM as far as
  19. ; possible. Take over lots of IVT entries and continue to
  20. ; point them at this driver.
  21. ; 4) Tim July 92. Version num 1.12, put pseudo ROM stuff back in.
  22. ; 5) Tim July 92. v 1.13, use SoftPC video BIOS when windowed.
  23. ;
  24. ; 6) 12-Sep-1992 Jonle, Merged with ntio.sys
  25. ; cleanup usage of assumes espcially with ES
  26. ; optimized loading of IVT
  27. ; other general cleanup
  28. ;
  29. ; This obj module is intially loaded in a temporary memory location
  30. ; along with ntio.sys. Ntio.sys will copy the resident code (marked by
  31. ; SpcKbdBeg, SpcKbdEnd) into the permanent memory location which resides
  32. ; just below the normal device drivers loaded by config.sys.
  33. ;
  34. ; The nonresident intialization code is run with CS= temp seg
  35. ; and DS= final seg.
  36. ;
  37. ;******************************************************************************
  38. .286
  39. include vint.inc
  40. ;================================================================
  41. ; Macros and includes
  42. ;================================================================
  43. bop MACRO callid
  44. db 0c4h,0c4h,callid
  45. endm
  46. BIOS_CPU_QUIT equ 0FEh
  47. BIOS_KB_INT equ 9
  48. BIOS_INT15 equ 15h
  49. BIOS_PRINTER_IO equ 17h
  50. UNEXP_BOP equ 2
  51. RTC_WAIT_FLAG equ 0a0h ; offset of rtc_wait_flag in bios data seg
  52. VERSIONID equ 0BEEFh
  53. FULLSCREEN equ 1
  54. MAX_VIDEO_FUNC equ 1Ch
  55. GET_FONT_FUNC equ 11h
  56. VID_MODECHANGE equ 0
  57. MOUSE_LIGHT_PEN equ 4
  58. MIN_MOUSE_FUNC equ 0F0H
  59. MAX_MOUSE_FUNC equ 0F7H
  60. XTRA_MOUSE_FUNC equ 0FAH
  61. MS_VIDEO_STRING equ 13FFH
  62. MOUSE_VID_BOP equ 0BEh
  63. EGA_VIDEO_BOP equ 42h
  64. PRT_NOTBUSY equ 80h
  65. PRT_NUM_PORTS equ 3
  66. PRT_STATE_READY equ 0
  67. PRT_IRQ equ 10h
  68. PRT_LPT_BUSY equ 1
  69. TIMER_LOW equ 6ch
  70. TIMER_HIGH equ 6eh
  71. TIMER_OVFL equ 70h
  72. MOTOR_STATUS equ 3fh
  73. MOTOR_COUNT equ 40h
  74. ; Keyboard buf ptrs
  75. BUFFER_HEAD equ 1ah
  76. BUFFER_TAIL equ 1ch
  77. BUFFER_START equ 80h
  78. BUFFER_END equ 82h
  79. ; kb_flag and LED bits
  80. KB_FLAG equ 17h
  81. CAPS_STATE equ 40h
  82. NUM_STATE equ 20h
  83. SCROLL_STATE equ 10h
  84. KB_FLAG_1 equ 18h
  85. KB_FLAG_2 equ 97h
  86. KB_LEDS equ 07h ; Keyboard LED state bits
  87. KB_PR_LED equ 40h ; Mode indicator update
  88. KB_FLAG_3 equ 96h
  89. LC_E1 equ 01h
  90. LC_E0 equ 02h
  91. ;..............................................keyboard constants
  92. ; bits in kb_flag
  93. RIGHT_SHIFT = 1
  94. LEFT_SHIFT = 2
  95. CTL_SHIFT = 4
  96. ALT_SHIFT = 8
  97. ; bit in kb_flag_1
  98. HOLD_STATE = 8
  99. SCROLL_SHIFT = 10h
  100. NUM_SHIFT = 20h
  101. CAPS_SHIFT = 40h
  102. INS_SHIFT = 80h
  103. SYS_SHIFT = 04h
  104. ; IBM scan codes
  105. CTL_KEY = 29
  106. LEFT_SHIFTKEY = 42
  107. RIGHT_SHIFTKEY = 54
  108. ALT_KEY = 56
  109. CAPS_KEY = 58
  110. NUM_KEY = 69
  111. SCROLL_KEY = 70
  112. INS_KEY = 82
  113. ;
  114. ; Segment definitions for ntio.sys,
  115. ;
  116. include biosseg.inc
  117. SpcKbdSeg segment
  118. assume cs:SpcKbdSeg,ds:nothing,es:nothing
  119. ;
  120. ; SpcKbdBeg - SpcKbdEnd
  121. ;
  122. ; Marks the resident code, anything outside of these markers
  123. ; is discarded after intialization
  124. ; 13-Sep-1992 Jonle
  125. ;
  126. public SpcKbdBeg
  127. SpcKbdBeg label byte
  128. ;
  129. ; Reduced data table for Video 7 modes 0 and 2.
  130. ; This table is extracted from our video7 ROM. Only text modes are
  131. ; required, mode 0 and 1 are identical as are modes 2 and 3.
  132. ;
  133. ega_parm_setup:
  134. ;--40x25--
  135. DB 40,24,16 ; width,height,character height
  136. DW 00800H ; Page size in bytes
  137. DB 008H, 003H, 000H, 002H ; Sequencer Parameters
  138. DB 067H ;Misc Reg
  139. ; CRTC Parameters
  140. DB 02dH, 027H, 028H, 090H, 02bH
  141. DB 0a0H, 0bfH, 01fH, 000H, 04fH
  142. DB 00dH, 00eH, 000H, 000H, 000H
  143. DB 000H, 09cH, 0aeH, 08fH, 014H
  144. DB 01fH, 096H, 0b9H, 0a3H, 0ffH
  145. ; Attribute parameters
  146. DB 000H, 001H, 002H, 003H, 004H
  147. DB 005H, 014H, 007H, 038H, 039H
  148. DB 03aH, 03bH, 03cH, 03dH, 03eH
  149. DB 03fH, 00cH, 000H, 00fH, 008H
  150. ; Graph parameters
  151. DB 000H, 000H, 000H, 000H, 000H
  152. DB 010H, 00eH, 000H, 0ffH
  153. ;--80x25--
  154. DB 80,24,16 ; width,height,character height
  155. DW 01000H ; Page size in bytes
  156. DB 000H, 003H, 000H, 002H ; Sequencer Parameters
  157. DB 067H ;Misc Reg
  158. ; CRTC Parameters
  159. DB 05fH, 04fH, 050H, 082H, 055H
  160. DB 081H, 0bfH, 01fH, 000H, 04fH
  161. DB 00dH, 00eH, 000H, 000H, 000H
  162. DB 000H, 09cH, 08eH, 08fH, 028H
  163. DB 01fH, 096H, 0b9H, 0a3H, 0ffH
  164. ; Attribute parameters
  165. DB 000H, 001H, 002H, 003H, 004H
  166. DB 005H, 014H, 007H, 038H, 039H
  167. DB 03aH, 03bH, 03cH, 03dH, 03eH
  168. DB 03fH, 00cH, 000H, 00fH, 008H
  169. ; Graph parameters
  170. DB 000H, 000H, 000H, 000H, 000H
  171. DB 010H, 00eH, 000H, 0ffH
  172. ;--80x25 mono--
  173. DB 80,24,16 ; width,height,character height
  174. DW 01000H ; Page size in bytes
  175. DB 000H, 003H, 000H, 003H ; Sequencer Parameters
  176. DB 0a6H ;Misc Reg
  177. ; CRTC Parameters
  178. DB 05fH, 04fH, 050H, 082H, 055H
  179. DB 081H, 0bfH, 01fH, 000H, 04dH
  180. DB 00bH, 00cH, 000H, 000H, 000H
  181. DB 000H, 083H, 0a5H, 05dH, 028H
  182. DB 00dH, 063H, 0baH, 0a3H, 0ffH
  183. ; Attribute parameters
  184. DB 000H, 008H, 008H, 008H, 008H
  185. DB 008H, 008H, 008H, 010H, 018H
  186. DB 018H, 018H, 018H, 018H, 018H
  187. DB 018H, 00eH, 000H, 00fH, 008H
  188. ; Graph parameters
  189. DB 000H, 000H, 000H, 000H, 000H
  190. DB 010H, 00aH, 000H, 0ffH
  191. ; Mode b (font load)
  192. DB 5eh,32H,8 ; width,height,character height
  193. DW 09700H ; Page size in bytes
  194. DB 001H, 00fH, 000H, 006H ; Sequencer Parameters
  195. DB 0e7H ;Misc Reg
  196. ; CRTC Parameters
  197. DB 06dH, 05dH, 05eH, 090H, 061H
  198. DB 08fH, 0bfH, 01fH, 000H, 040H
  199. DB 000H, 000H, 000H, 000H, 000H
  200. DB 000H, 0a2H, 08eH, 099H, 02fH
  201. DB 000H, 0a1H, 0b9H, 0e3H, 0ffH
  202. ; Attribute parameters
  203. DB 000H, 001H, 002H, 003H, 004H
  204. DB 005H, 014H, 007H, 038H, 039H
  205. DB 03aH, 03bH, 03cH, 03dH, 03eH
  206. DB 03fH, 001H, 000H, 00fH, 000H
  207. ; Graph parameters
  208. DB 000H, 000H, 000H, 000H, 000H
  209. DB 000H, 005H, 00fH, 0ffH
  210. ;--350 scanline 40x25
  211. DB 40,24,14 ; width,height,character height
  212. DW 00800H ; Page size in bytes
  213. DB 009H, 003H, 000H, 002H ; Sequencer Parameters
  214. DB 0a3H ;Misc Reg
  215. ; CRTC Parameters
  216. DB 02dH, 027H, 028H, 090H, 02bH
  217. DB 0a0H, 0bfH, 01fH, 000H, 04dH
  218. DB 00bH, 00cH, 000H, 000H, 000H
  219. DB 000H, 083H, 0a5H, 05dH, 014H
  220. DB 01fH, 063H, 0baH, 0a3H, 0ffH
  221. ; Attribute parameters
  222. DB 000H, 001H, 002H, 003H, 004H
  223. DB 005H, 014H, 007H, 038H, 039H
  224. DB 03aH, 03bH, 03cH, 03dH, 03eH
  225. DB 03fH, 008H, 000H, 00fH, 000H
  226. ; Graph parameters
  227. DB 000H, 000H, 000H, 000H, 000H
  228. DB 010H, 00eH, 000H, 0ffH
  229. ;--350 scanline 80x25
  230. DB 80,24,14 ; width,height,character height
  231. DW 01000H ; Page size in bytes
  232. DB 001H, 003H, 000H, 002H ; Sequencer Parameters
  233. DB 0a3H ;Misc Reg
  234. ; CRTC Parameters
  235. DB 05fH, 04fH, 050H, 082H, 055H
  236. DB 081H, 0bfH, 01fH, 000H, 04dH
  237. DB 00bH, 00cH, 000H, 000H, 000H
  238. DB 000H, 083H, 0a5H, 05dH, 028H
  239. DB 01fH, 063H, 0baH, 0a3H, 0ffH
  240. ; Attribute parameters
  241. DB 000H, 001H, 002H, 003H, 004H
  242. DB 005H, 014H, 007H, 038H, 039H
  243. DB 03aH, 03bH, 03cH, 03dH, 03eH
  244. DB 03fH, 008H, 000H, 00fH, 000H
  245. ; Graph parameters
  246. DB 000H, 000H, 000H, 000H, 000H
  247. DB 010H, 00eH, 000H, 0ffH
  248. ;
  249. ; End of baby mode table.
  250. ;
  251. ; Table of VGA bios 'capability' info for func 1b to point at.
  252. vga_1b_table db 07fh, 060h, 00fh, 000h, 000h, 000h, 000h, 007h
  253. db 002h, 008h, 0ffh, 00eh, 000h, 000h, 03fh, 000h
  254. ; Configuration table for INT 15 Func C0 to point at.
  255. conf_table dw 008h
  256. ;; db 000h, 0fch, 002h, 000h, 070h, 000h, 000h, 000h, 000h
  257. db 000h, 0fch, 002h, 074h, 070h, 000h, 000h, 000h, 000h
  258. PRT_BUF_SIZE equ 255
  259. ;================================================================
  260. ; Printer status table
  261. ;================================================================
  262. prt_status db PRT_NUM_PORTS dup (?)
  263. prt_state db PRT_NUM_PORTS dup (?)
  264. prt_control db PRT_NUM_PORTS dup (?)
  265. prt_lpt_stat db PRT_NUM_PORTS dup (?)
  266. cur_buf_size dw PRT_BUF_SIZE
  267. prt_data_buf db PRT_BUF_SIZE dup (?) ; buffer in the 16bit side for perf.
  268. cur_lpt db 0ffh ; buffer is not being used
  269. cur_count dw ?
  270. cur_busy db 0 ; initially not busy
  271. ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  272. ; Keyboard tables
  273. ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  274. shift_keys: ;K6
  275. DB INS_KEY,CAPS_KEY,NUM_KEY,SCROLL_KEY
  276. DB ALT_KEY,CTL_KEY,LEFT_SHIFTKEY,RIGHT_SHIFTKEY
  277. shift_masks: ;K7
  278. DB INS_SHIFT,CAPS_SHIFT,NUM_SHIFT,SCROLL_SHIFT
  279. DB ALT_SHIFT,CTL_SHIFT,LEFT_SHIFT,RIGHT_SHIFT
  280. ctl_n_table: ;K8
  281. DB 27, -1, 0, -1, -1, -1, 30, -1
  282. DB -1, -1, -1, 31, -1, 127, 148, 17
  283. DB 23, 5, 18, 20, 25, 21, 9, 15
  284. DB 16, 27, 29, 10, -1, 1, 19, 4
  285. DB 6, 7, 8, 10, 11, 12, -1, -1
  286. DB -1, -1, 28, 26, 24, 3, 22, 2
  287. DB 14, 13, -1, -1, -1, -1, 150, -1
  288. DB ' ', -1
  289. ctl_f_table: ;K9
  290. DB 94, 95, 96, 97, 98, 99, 100, 101
  291. DB 102, 103, -1, -1, 119, 141, 132, 142
  292. DB 115, 143, 116, 144, 117, 145, 118, 146
  293. DB 147, -1, -1, -1, 137, 138
  294. lowercase:
  295. DB 27, '1', '2', '3', '4', '5', '6', '7', '8', '9' ;K10
  296. DB '0', '-', '=', 8, 9, 'q', 'w', 'e', 'r', 't'
  297. DB 'y', 'u', 'i', 'o', 'p', '[', ']', 13, -1, 'a'
  298. DB 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', 39
  299. DB 96, -1, 92, 'z', 'x', 'c', 'v', 'b', 'n', 'm'
  300. DB ',', '.', '/', -1, '*', -1, ' ', -1
  301. lc_tbl_scan:
  302. DB 59, 60, 61, 62, 63, 64, 65, 66, 67, 68
  303. DB -1, -1
  304. base_case:
  305. DB 71, 72, 73, -1, 75, -1, 77, -1, 79, 80
  306. DB 81, 82, 83, -1, -1, 92, 133, 134 ;K15
  307. uppercase: ;K11
  308. DB 27, '!', '@', '#', '$', '%', '^', '&', '*', '('
  309. DB ')', '_', '+', 8, 0, 'Q', 'W', 'E', 'R', 'T'
  310. DB 'Y', 'U', 'I', 'O', 'P', '{', '}', 13, -1, 'A'
  311. DB 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"'
  312. DB 126, -1, '|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M'
  313. DB '<', '>', '?', -1, 0, -1, ' ', -1;
  314. ucase_scan:
  315. DB 84, 85, 86, 87, 88, 89, 90, 91, 92, 93
  316. DB -1, -1
  317. numb_state:
  318. DB '7', '8', '9', '-', '4', '5', '6', '+', '1', '2' ;K14
  319. DB '3', '0', '.' , -1, -1, 124, 135, 136
  320. alt_table:
  321. DB 82, 79, 80, 81, 75, 76, 77, 71, 72, 73 ;K30
  322. DB 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
  323. DB 30, 31, 32, 33, 34, 35, 36, 37, 38, 44
  324. DB 45, 46, 47, 48, 49, 50
  325. ;================================================================
  326. ; Keyboard break caller
  327. ;================================================================
  328. keyboard_break_caller:
  329. int 1bh ;keyboard break
  330. bop %BIOS_CPU_QUIT
  331. ;================================================================
  332. ; Print screen caller
  333. ;================================================================
  334. print_screen_caller:
  335. int 5h ;print screen
  336. bop %BIOS_CPU_QUIT
  337. ;================================================================
  338. ; Int 15 caller
  339. ;================================================================
  340. ; Tim modified int 15 caller. Copied from BIOS2. It gives CPU
  341. ; a chance to take other interrupts. Suspect the extra jumps are
  342. ; now harmless with IRET hooking.
  343. ;int15h_caller:
  344. ;int 15h
  345. ;bop %BIOS_CPU_QUIT
  346. int15h_caller:
  347. int 15h ; Cassette I/O.
  348. jmp k1
  349. k1: jmp k2
  350. k2: jmp k3
  351. k3: BOP %BIOS_CPU_QUIT
  352. ;================================================================
  353. ; Unexpected interrupt handler
  354. ;================================================================
  355. unexp_int:
  356. bop %UNEXP_BOP
  357. jmp iret_com
  358. ;================================================================
  359. ;Int 13 caller
  360. ;================================================================
  361. int13h_caller:
  362. int 13h
  363. bop %BIOS_CPU_QUIT
  364. ;================================================================
  365. ; New interrupt 9h handler
  366. ;================================================================
  367. int09h_vector:
  368. push ax
  369. xor ax, ax
  370. bop %BIOS_KB_INT
  371. pop ax
  372. jmp iret_com
  373. ; CarbonCopy traces int 9 in order to gain control
  374. ; over where the kbd data is coming from (the physical kbd
  375. ; or the serial link) The kbd_inb instruction must be visible
  376. ; in the 16 bit code via int 1 tracing, for CarbonCopy to work.
  377. ; Softpc assumes the exact location of the first nop
  378. ; relative to the bop just above.
  379. nop
  380. nop
  381. in al, 60h ; keyba_io_buffers
  382. nop
  383. nop
  384. BOP %BIOS_CPU_QUIT
  385. ;=================================================================
  386. ; IRET hooks bop table
  387. ;=================================================================
  388. IRET_HOOK = 5dh ;IRET hook BOP
  389. iret_bop_table:
  390. bop %IRET_HOOK
  391. db 0
  392. iret_end_first_entry:
  393. bop %IRET_HOOK
  394. db 1
  395. bop %IRET_HOOK
  396. db 2
  397. bop %IRET_HOOK
  398. db 3
  399. bop %IRET_HOOK
  400. db 4
  401. bop %IRET_HOOK
  402. db 5
  403. bop %IRET_HOOK
  404. db 6
  405. bop %IRET_HOOK
  406. db 7
  407. bop %IRET_HOOK
  408. db 8
  409. bop %IRET_HOOK
  410. db 9
  411. bop %IRET_HOOK
  412. db 10
  413. bop %IRET_HOOK
  414. db 11
  415. bop %IRET_HOOK
  416. db 12
  417. bop %IRET_HOOK
  418. db 13
  419. bop %IRET_HOOK
  420. db 14
  421. bop %IRET_HOOK
  422. db 15
  423. ;================================================================
  424. ; New interrupt 13h handler
  425. ;================================================================
  426. int13h_vector:
  427. cmp dl,80h ; 0 - 7f are floppy commands
  428. jb int40h_vector
  429. cmp ah,2 ; we fail the direct access commands
  430. jb diskcmd ; read/write/seek/verify/format
  431. cmp ah,5 ; but let others go through (disk tables etc)
  432. jbe faildisk
  433. cmp ah,0ah
  434. jb diskcmd
  435. cmp ah,0ch
  436. ja diskcmd
  437. faildisk:
  438. push ax
  439. mov ax,1 ; direct access error panel
  440. bop 59h
  441. pop ax ; preserve AL for safety sake
  442. mov ah, 80h ; error - timeout
  443. stc
  444. retf 2
  445. diskcmd:
  446. bop 13h
  447. retf 2
  448. ;================================================================
  449. ; New interrupt 40h handler
  450. ;================================================================
  451. int40h_vector:
  452. ; cmp ah,2 ; we fail the direct access commands
  453. ; jb flopcmd ; read/write/seek/verify/format
  454. ; cmp ah,5 ; but let others go through (disk tables etc)
  455. ; jbe failflop
  456. ; cmp ah,0ah
  457. ; jb flopcmd
  458. ; cmp ah,0ch
  459. ; ja flopcmd
  460. failflop:
  461. ; push ax
  462. ; mov ax,0 ; direct access error panel
  463. ; bop 59h
  464. ; pop ax
  465. ; mov ah, 80h ; error - timeout
  466. ; stc
  467. ; retf 2
  468. flopcmd:
  469. bop 40h
  470. retf 2
  471. ;; waiting for diskette interrupt
  472. wait_int:
  473. push ds
  474. push ax
  475. push cx
  476. mov ax, 40h
  477. mov ds, ax
  478. mov cx, 10h
  479. wait_int_loop:
  480. mov al, [3Eh]
  481. test al, 80h
  482. loopz wait_int_loop
  483. pop cx
  484. pop ax
  485. pop ds
  486. bop %BIOS_CPU_QUIT
  487. ;; floppy parameters table
  488. floppy_table label byte
  489. DB 01 ;; 360KB in 360KB
  490. DW OFFSET md_tbl1
  491. DB 82H ;; 360KB in 1,2MB
  492. DW OFFSET md_tbl2
  493. DB 02 ;; 1.2MB in 1.2MB
  494. DW OFFSET md_tbl3
  495. DB 03 ;; 720KB in 720KB
  496. DW OFFSET md_tbl4
  497. DB 84H ;; 720KB in 1.44MB
  498. DW OFFSET md_tbl5
  499. DB 04 ;; 1.44MB in 1.44MB
  500. DW OFFSET md_tbl6
  501. DB 85h ;; 720KB in 2.88MB
  502. DW OFFSET md_tbl7
  503. DB 85h ;; 1.44MB in 2.88MB
  504. DW OFFSET md_tbl8
  505. DB 5 ;; 2.88MB in 2.88MB
  506. DW OFFSET md_tbl9
  507. md_tbl1:
  508. ; MEDIA = 40 track low data rate; DRIVE = 40 track low data rate
  509. DB 0DFh ; 1st specify byte
  510. DB 2 ; 2nd specify byte
  511. DB 25H ; motor off wait time
  512. DB 2 ; ie 2 bytes/sector
  513. DB 9 ; sectors/track
  514. DB 02Ah ; gap length
  515. DB 0FFh ; data length
  516. DB 050h ; gap length for format
  517. DB 0F6h ; fill byte for format
  518. DB 15 ; head settle time/ms
  519. DB 8 ; ie 1s motor start time
  520. DB 39 ; maximum track number
  521. DB 80H ; transfer rate
  522. md_tbl2:
  523. ; MEDIA = 40 track low data rate; DRIVE = 80 track high data rate
  524. DB 0DFh ; 1st specify byte
  525. DB 2 ; 2nd specify byte
  526. DB 25H ; motor off wait time
  527. DB 2 ; ie 2 bytes/sector
  528. DB 9 ; sectors/track
  529. DB 02Ah ; gap length
  530. DB 0FFh ; data length
  531. DB 050h ; gap length for format
  532. DB 0F6h ; fill byte for format
  533. DB 15 ; head settle time/ms
  534. DB 8 ; ie 1s motor start time
  535. DB 39 ; maximum track number
  536. DB 40H ; transfer rate
  537. md_tbl3:
  538. ; MEDIA = 80 track high data rate; DRIVE = 80 track high data rate
  539. DB 0DFh ; 1st specify byte
  540. DB 2 ; 2nd specify byte
  541. DB 25H ; motor off wait time
  542. DB 2 ; ie 2 bytes/sector
  543. DB 15 ; sectors/track
  544. DB 01Bh ; gap length
  545. DB 0FFh ; data length
  546. DB 054h ; gap length for format
  547. DB 0F6h ; fill byte for format
  548. DB 15 ; head settle time/ms
  549. DB 8 ; ie 1s motor start time
  550. DB 79 ; maximum track number
  551. DB 0 ; transfer rate
  552. md_tbl4:
  553. ; MEDIA = 80 track low data rate; DRIVE = 80 track low data rate
  554. DB 0DFh ; 1st specify byte
  555. DB 2 ; 2nd specify byte
  556. DB 25H ; motor off wait time
  557. DB 2 ; ie 2 bytes/sector
  558. DB 9 ; sectors/track
  559. DB 02Ah ; gap length
  560. DB 0FFh ; data length
  561. DB 050h ; gap length for format
  562. DB 0F6h ; fill byte for format
  563. DB 15 ; head settle time/ms
  564. DB 8 ; ie 1s motor start ime
  565. DB 79 ; maximum track number
  566. DB 80H ; transfer rate
  567. md_tbl5:
  568. ; MEDIA = 80 track low data rate; DRIVE = 80 track high data rate
  569. DB 0DFh ; 1st specify byte
  570. DB 2 ; 2nd specify byte
  571. DB 25H ; motor off wait time
  572. DB 2 ; ie 2 bytes/sector
  573. DB 9 ; sectors/track
  574. DB 02Ah ; gap length
  575. DB 0FFh ; data length
  576. DB 050h ; gap length for format
  577. DB 0F6h ; fill byte for format
  578. DB 15 ; head settle time/ms
  579. DB 8 ; ie 1s motor start time
  580. DB 79 ; maximum track number
  581. DB 80H ; transfer rate
  582. md_tbl6:
  583. ; MEDIA = 80 track high data rate; DRIVE = 80 track high data rate
  584. DB 0AFh ; 1st specify byte
  585. DB 2 ; 2nd specify byte
  586. DB 25H ; motor off wait time
  587. DB 2 ; ie 2 bytes/sector
  588. DB 18 ; sectors/track
  589. DB 01Bh ; gap length
  590. DB 0FFh ; data length
  591. DB 06Ch ; gap length for format
  592. DB 0F6h ; fill byte for format
  593. DB 15 ; head settle time/ms
  594. DB 8 ; ie 1s motor start time
  595. DB 79 ; maximum track number
  596. DB 0 ; transfer rate
  597. md_tbl7:
  598. ;MEDIA = 80 tracks, 9 sectors/track; DRIVE = 80 tracks, 36 sectotrs per track
  599. DB 0E1h ; 1st specify byte
  600. DB 2 ; 2nd specify byte
  601. DB 25H ; motor off wait time
  602. DB 2 ; ie 2 bytes/sector
  603. DB 9 ; sectors/track
  604. DB 02Ah ; gap length
  605. DB 0FFh ; data length
  606. DB 050h ; gap length for format
  607. DB 0F6h ; fill byte for format
  608. DB 15 ; head settle time/ms
  609. DB 8 ; ie 1s motor start ime
  610. DB 79 ; maximum track number
  611. DB 80H ; transfer rate
  612. md_tbl8:
  613. ;MEDIA = 80 tracks, 18 sectors/track; DRIVE = 80 tracks, 36 sectotrs per track
  614. DB 0D1h ; 1st specify byte
  615. DB 2 ; 2nd specify byte
  616. DB 25H ; motor off wait time
  617. DB 2 ; ie 2 bytes/sector
  618. DB 18 ; sectors/track
  619. DB 01Bh ; gap length
  620. DB 0FFh ; data length
  621. DB 065h ; gap length for format
  622. DB 0F6h ; fill byte for format
  623. DB 15 ; head settle time/ms
  624. DB 8 ; ie 1s motor start time
  625. DB 79 ; maximum track number
  626. DB 0 ; transfer rate
  627. md_tbl9:
  628. ;MEDIA = 80 tracks, 36 sectors/track; DRIVE = 80 tracks, 36 sectotrs per track
  629. DB 0A1h ; 1st specify byte
  630. DB 2 ; 2nd specify byte
  631. DB 25H ; motor off wait time
  632. DB 2 ; ie 2 bytes/sector
  633. DB 36 ; sectors/track
  634. DB 038h ; gap length
  635. DB 0FFh ; data length
  636. DB 053h ; gap length for format
  637. DB 0F6h ; fill byte for format
  638. DB 15 ; head settle time/ms
  639. DB 8 ; ie 1s motor start time
  640. DB 79 ; maximum track number
  641. DB 0C0h ; transfer rate
  642. floppy_table_len equ $ - floppy_table
  643. bios_floppy_table label byte
  644. DB 0DFh ; 1st specify byte
  645. DB 2 ; 2nd specify byte
  646. DB 25H ; motor off wait time
  647. DB 2 ; ie 2 bytes/sector
  648. DB 18 ; sectors/track
  649. DB 01Bh ; gap length
  650. DB 0FFh ; data length
  651. DB 054h ; gap length for format
  652. DB 0F6h ; fill byte for format
  653. DB 15 ; head settle time/ms
  654. DB 8 ; ie 1s motor start time
  655. bios_floppy_table_len equ $ - bios_floppy_table
  656. ;===============================================================
  657. ; New interrupt 15h handler
  658. ;================================================================
  659. ; Tim, modified this to be like a "normal" SoftPC ROM.
  660. ; Copied from BIOS2, but rtc_wait_flag is now referenced via ES not
  661. ; DS.
  662. ;
  663. ; 17-Sep-1992 Jonle , ES ref to rtc_wait was change from assume ES
  664. ; to seg overides to prevent accidents in assuming.
  665. ;
  666. ;int15h_vector:
  667. ;bop %BIOS_INT15
  668. ;iret
  669. ;;;;;;;;;STF hide this int15h_vector:
  670. int15h_vector:
  671. call DOSTI
  672. cmp ah, 88h
  673. je lbl1
  674. cmp ah, 91h
  675. je lbl1
  676. cmp ah, 86h
  677. je lbl2
  678. BOP 15h
  679. RETF 2
  680. lbl1: BOP 15h
  681. jmp iret_com
  682. lbl2: BOP 15h
  683. jc lbl5
  684. push cx
  685. push dx
  686. push es ; Tim, save ES not DS.
  687. mov ax, 40 ; point es to biosdata
  688. mov es, ax
  689. xchg dx, cx
  690. lbl3:
  691. test byte ptr es:[RTC_WAIT_FLAG], 080h ; check for end of wait
  692. loopz lbl3 ; dec timeout delay
  693. jnz lbl4 ; exit if wait ended
  694. sub dx, 1 ; dec error timeout counter
  695. jnc lbl3 ; loop till counters timeout
  696. lbl4:
  697. mov byte ptr es:[RTC_WAIT_FLAG], 0 ; set function inactive
  698. pop es ; Kipper, restore ES not DS.
  699. pop dx
  700. pop cx
  701. clc
  702. lbl5:
  703. RETF 2
  704. ;=================================================================
  705. ; Regular SoftPC int 17 handler (especially important for DEC PCs)
  706. ;=================================================================
  707. int17h_vector:
  708. ;
  709. ; Do a get status purely in 16-bit code but only if the printer is ready and
  710. ;we don't have interrupts turned on. Otherwise we must do a BOP and let 32-bit
  711. ;code handle it.
  712. ;
  713. push si
  714. push dx
  715. push ax
  716. mov ax, dx ; dx = adapter no., ensure it is no
  717. xor dx, dx ; greater than PRT_NUM_PORTS.
  718. mov si, PRT_NUM_PORTS
  719. div si
  720. mov si, dx
  721. pop ax
  722. cmp ah, 2
  723. je do_prt_status
  724. or ah,ah
  725. je do_write
  726. jmp do_print_bop
  727. do_prt_status:
  728. cmp byte ptr cs:[si + prt_state], PRT_STATE_READY
  729. jne do_print_bop
  730. test byte ptr cs:[si + prt_control], PRT_IRQ
  731. je get_status
  732. jmp short do_print_bop
  733. do_write:
  734. cmp byte ptr cs:[cur_lpt],0ffh
  735. jne check_lpti
  736. mov byte ptr cs:[cur_lpt],dl
  737. mov word ptr cs:[cur_count],0
  738. mov byte ptr cs:[cur_busy],0ffh
  739. jmp short do_print_bop
  740. check_lpti:
  741. cmp byte ptr cs:[cur_lpt],dl
  742. je buf_ok
  743. push si
  744. xor si,si
  745. bop %BIOS_PRINTER_IO
  746. pop si
  747. mov word ptr cs:[cur_count],0
  748. mov byte ptr cs:[cur_lpt],dl
  749. jmp short do_print_bop
  750. buf_ok:
  751. mov dx,word ptr cs:[cur_count]
  752. mov si,dx
  753. mov byte ptr cs:[si + prt_data_buf],al
  754. inc word ptr cs:[cur_count]
  755. cmp word ptr cs:[cur_count],PRT_BUF_SIZE
  756. jne no_flushing
  757. xor si,si ; sub-function 0 for this bop
  758. bop %BIOS_PRINTER_IO
  759. test ah,08h
  760. jz flush_ok
  761. dec word ptr cs:[cur_count]
  762. jmp short int17h_end
  763. flush_ok:
  764. mov word ptr cs:[cur_count],0
  765. no_flushing:
  766. mov ah,90h
  767. jmp short int17h_end
  768. do_print_bop:
  769. mov si,0ffffh ; sub-function 1
  770. bop %BIOS_PRINTER_IO
  771. jmp int17h_end
  772. get_status:
  773. test byte ptr cs:[si + prt_lpt_stat], PRT_LPT_BUSY
  774. jne noset
  775. or byte ptr cs:[si + prt_status], PRT_NOTBUSY
  776. noset:
  777. mov ah, cs:[si + prt_status]
  778. and ah, 0f8h
  779. xor ah, 48h
  780. int17h_end:
  781. pop dx
  782. pop si
  783. iret_com:
  784. FIRET
  785. ;=================================================================
  786. ; Pseudo-ROM vectuz, copied from BIOS2.ASM
  787. ;=================================================================
  788. dummy_vector: ; Copied from BIOS2.ASM
  789. jmp iret_com
  790. illegal_bop_vector:
  791. bop 72h
  792. jmp iret_com
  793. intD11_vector:
  794. bop 72h
  795. jmp iret_com
  796. int05h_vector: ; Print Screen func. copied from BIOS2.ASM
  797. call DOSTI
  798. PUSH AX
  799. PUSH BX
  800. PUSH CX
  801. PUSH DX
  802. PUSH DS
  803. ;::::::::::::::::::::::::::::::::: Setup DS to point to BIOS data area
  804. MOV AX,40H
  805. MOV DS,AX
  806. ;::::::::::::::::::::::::::::::: Print screen already in progress ????
  807. CMP BYTE PTR DS:[100H],1
  808. JE end_print
  809. ;::::::::::::::::::::::::::::::::::::::::::::::: Set print screen busy
  810. MOV BYTE PTR DS:[100h],1
  811. ;:::::::::::::::::::::::::::::::::::::::::::::::::::: Get video status
  812. MOV AH,15
  813. INT 10H
  814. MOV CH,AH ;No of columns
  815. ;:::::::::::::::::::::::::::::::::: Setup no. of columns/rows to print
  816. BOP 80H ;(BIOS_PS_PRIVATE_1)
  817. MOV CL,AL ;No of rows
  818. ;::::::::::::::::::::::::::::::::::: Print line feed / carriage return
  819. CALL print_crlf
  820. ;:::::::::::::::::::::::::::::::::::::::::: Get current cursor postion
  821. PUSH CX
  822. MOV AH,3
  823. INT 10H
  824. POP CX
  825. ;::::::::::::::::::::::::::::::::::::::::::::::::: Save cursor postion
  826. PUSH DX ;save current cursor postion
  827. XOR DH,DH ;current row being processed
  828. start_print_col:
  829. XOR DL,DL ;current column being processed
  830. ;::::::::::::::::::::::::::::::::::::::::::::::: Start printing screen
  831. start_print_row:
  832. ;:::::::::::::::::::::::::::::::::::::::::::::::::: Set cursor postion
  833. PUSH DX ;save current row,column
  834. MOV AH,2
  835. INT 10H
  836. ;::::::::::::::::::::::::::::::::::: Read character at current postion
  837. MOV AH,8
  838. INT 10H
  839. ;::::::::::::::::::::::::::::::::::::::::::::::::::::: Print character
  840. OR al,al
  841. JNZ print_char
  842. MOV AL,20H
  843. print_char:
  844. XOR DX,DX
  845. XOR AH,AH
  846. INT 17H
  847. ;:::::::::::::::::::::::::::::::::::::::::::: Check for printer errors
  848. POP DX ;Restore current row,column
  849. AND AH,25H
  850. JZ cont2
  851. MOV BYTE PTR DS:[100H],0FFH
  852. JMP short exit_print
  853. ;::::::::::::::::::::::::::::::::::::::::::: Move to mext print column
  854. cont2:
  855. INC DL ;Inc current column
  856. CMP DL,CH ;Current col compared to no. of cols
  857. JB start_print_row
  858. ;:::::::::::::::::::::::::::::::::::::::::: End of column, print CR/LF
  859. CALL print_crlf
  860. ;:::::::::::::::::::::::::::::::::::::::::::::::::: More rows to print
  861. INC DH ;Inc current row
  862. CMP DH,CL ;Current row compared to no. of rows
  863. JBE start_print_col
  864. MOV BYTE PTR DS:[0100H],0
  865. ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Exit print
  866. exit_print:
  867. ;:::::::::::::::::::::::::::::::::::::; Restore orginal cursor postion
  868. POP DX
  869. MOV AH,2
  870. INT 10H
  871. ;:::::::::::::::::::::::::::::::::::::::::::::::::::: Tidy up and exit
  872. end_print:
  873. POP DS
  874. POP DX
  875. POP CX
  876. POP BX
  877. POP AX
  878. jmp iret_com
  879. ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Print CR/LF
  880. print_crlf:
  881. PUSH DX
  882. XOR DX,DX
  883. MOV AX,0DH
  884. INT 17H
  885. XOR DX,DX
  886. MOV AX,0AH
  887. INT 17H
  888. POP DX
  889. RET
  890. ; End of int05_vector (print screen).
  891. int06h_vector:
  892. bop 06h
  893. jmp iret_com
  894. ; IVT 7 is set to unexpected interrupt.
  895. int08h_vector:
  896. ; The usual int8 handler modified for optimum performance.
  897. ; - stays in 16 bit code (no BOP)
  898. ; - keeps interrupts off when not needed
  899. ; - calls int 1c directly
  900. ;
  901. call DOCLI ; make sure interrupts stay off until iret
  902. push es
  903. push ds ; save some registers
  904. push ax
  905. push dx
  906. mov ax, 40h ; set ds to bios data area
  907. mov ds, ax
  908. xor ax, ax
  909. mov es, ax ; set es to IVT seg for i1c callout
  910. inc word ptr ds:[TIMER_LOW] ; inc time counters
  911. jnz i8v1
  912. inc word ptr ds:[TIMER_HIGH]
  913. i8v1:
  914. cmp word ptr ds:[TIMER_HIGH], 018h ; check for 24 hours, wrap point
  915. jnz i8v2
  916. cmp word ptr ds:[TIMER_LOW], 0b0h
  917. jnz i8v2
  918. mov word ptr ds:[TIMER_HIGH], ax ; 24 hour wrap, set OVFL bit
  919. mov word ptr ds:[TIMER_LOW], ax
  920. mov byte ptr ds:[TIMER_OVFL], 1
  921. or al, 8 ; set Overflow bit for fake flags
  922. ;--- ; skip floppy motor stuff
  923. i8v2: ; handle the floppy motor stuff
  924. push ax
  925. dec byte ptr ds:[MOTOR_COUNT]
  926. jnz i8v3
  927. and byte ptr ds:[MOTOR_STATUS], 0f0h
  928. mov al, 0ch
  929. mov dx, 03f2h ; costly outb happens 1/256 timer tics...
  930. out dx, al
  931. i8v3:
  932. pop ax
  933. ; call int1c user routine directly
  934. lahf ; get lobyte of flags for fake flags
  935. xchg ah,al
  936. push ax ; put fake flags on the stack
  937. call dword ptr es:[1ch*4] ; do it!
  938. call DOCLI ; make sure interrupts stay off until iret
  939. mov al, 20h ; send eoi
  940. out 20h, al
  941. pop dx ;restore the stack
  942. pop ax
  943. pop ds
  944. pop es
  945. jmp iret_com
  946. int0e_vector:
  947. bop 0eh
  948. jmp iret_com
  949. DOCLI:
  950. FCLI
  951. ret
  952. DOSTI:
  953. FSTI
  954. ret
  955. ;
  956. ; Tim August 92. Video BIOS grabber.
  957. ; Call SPC BIOS when in windowed mode and the host BIOS when in full-screen.
  958. ; Controled by value of 'use_host_int10'.
  959. ; Try to limit bops by validating calling values. Mouse has to get first shot
  960. ; and then video bios.
  961. ;
  962. use_host_int10 db 01h ; native/softpc bios flag
  963. changing_mode db 01h ; delay handshake if in bios mode change
  964. PUBLIC int10h_vector
  965. int10h_vector:
  966. cmp use_host_int10, FULLSCREEN
  967. je nativebios
  968. cmp ah,VID_MODECHANGE ; mode change??
  969. je modechange
  970. cmp ah,MAX_VIDEO_FUNC ; range check
  971. ja mousecheck ; not a vid func but mouse has higher
  972. cmp ah,MOUSE_LIGHT_PEN ; light pen special case
  973. je mousebios
  974. spcbios:
  975. bop EGA_VIDEO_BOP ; regular windowed Int 10
  976. jmp viddone
  977. mousecheck:
  978. cmp ah,MIN_MOUSE_FUNC ; range check mouse fn f0-f7 + fa.
  979. jb badvid
  980. cmp ah,MAX_MOUSE_FUNC
  981. jbe mousebios
  982. cmp ah,XTRA_MOUSE_FUNC
  983. jne badvid
  984. mousebios: ; call softpc mouse video entrypoint
  985. bop MOUSE_VID_BOP
  986. jmp viddone
  987. modechange: ; windowed modechange. Mouse gets a look
  988. mov changing_mode,1 ; then softpc video bios. If gfx mode then
  989. bop MOUSE_VID_BOP ; will go fullscreen
  990. ;;;nop
  991. ;;;nop ; nops aid debugging
  992. ;;;bop EGA_VIDEO_BOP ; will go fullscreen here
  993. nop
  994. nop
  995. push ax ; save video mode which may have top bit set
  996. and ax,7fh
  997. cmp al,3
  998. jbe endmode ; if graphics mode, repeat modechange to setup
  999. cmp al,7 ; video card, else fall through
  1000. je endmode
  1001. pop ax
  1002. jmp nativebios
  1003. endmode:
  1004. pop ax
  1005. mov changing_mode,0 ; Clear 'mode changing' flag.
  1006. viddone:
  1007. jmp iret_com
  1008. badvid: ; unrecognised video func
  1009. stc
  1010. jmp viddone
  1011. nativebios:
  1012. mov changing_mode,0 ; Clear 'mode changing' flag.
  1013. cmp ax,MS_VIDEO_STRING ; ensure not MS special video string fn
  1014. je ms_wrt_string
  1015. cmp ah,MIN_MOUSE_FUNC ; could be a mouse call
  1016. jb chk_mse_vid
  1017. cmp ah,MAX_MOUSE_FUNC ; range check mouse fn f0-f7 + fa.
  1018. jbe mousebios
  1019. cmp ah,XTRA_MOUSE_FUNC
  1020. je mousebios
  1021. jmp jmp_native ; probably bad func but...
  1022. chk_mse_vid:
  1023. cmp ah,MOUSE_LIGHT_PEN ; mouse handles light pen
  1024. je mousebios
  1025. cmp ah,VID_MODECHANGE
  1026. jne chk_font_change
  1027. bop MOUSE_VID_BOP ; mouse wants first sniff at mode changes
  1028. jmp jmp_native ; then fall through
  1029. chk_font_change:
  1030. cmp ah,GET_FONT_FUNC
  1031. jne jmp_native
  1032. bop MOUSE_VID_BOP ; select mouse buffer for new no. of lines
  1033. ; then fall through
  1034. jmp_native:
  1035. db 0EAh ; far jump
  1036. host_int10 dd ? ; to native int 10 vector
  1037. ms_wrt_string:
  1038. push si
  1039. push di
  1040. push bp
  1041. go_loop1:
  1042. mov dx,46h ; looks a good value for flags
  1043. push dx ; make an iret frame
  1044. push cs
  1045. mov bx, offset go_cont
  1046. push bx
  1047. mov bx,7 ; set foreground color
  1048. mov ah,0eh ; set command to write a character
  1049. mov al,es:[di] ; get char
  1050. inc di
  1051. jmp jmp_native ; make far jmp to int 10 vector
  1052. go_cont:
  1053. loop go_loop1 ;repeat until all through
  1054. pop bp
  1055. pop di
  1056. pop si
  1057. mov ax,1 ; return success
  1058. jmp viddone
  1059. ;
  1060. ; int 42 - 'old' video bios entry point. Use same windowed/fullscreen
  1061. ; redirection as Int 10 above.
  1062. ;
  1063. int42h_vector:
  1064. cmp use_host_int10, FULLSCREEN
  1065. jz maybe_host_42_bios
  1066. bop 10h ; old video bop
  1067. jmp iret_com
  1068. ; If it's the special BIOS print string function, don't call the
  1069. ; host video BIOS cos it won't know what we are talking about.
  1070. ; It's only in our video BIOS.
  1071. maybe_host_42_bios:
  1072. cmp AH, 013h
  1073. jnz gogo_host_42_bios
  1074. cmp AL, 0ffh
  1075. jz ms_wrt_string ; reuse path from Int 10
  1076. gogo_host_42_bios:
  1077. db 0EAh ; far jump
  1078. host_int42 dd ? ; to native int 42 vector
  1079. int10h_caller:
  1080. int 10h ; Re-entrant video entry point.
  1081. bop 0feh
  1082. int11h_vector: ; Equipment check.
  1083. bop 11h
  1084. jmp iret_com
  1085. int12h_vector: ; Get memory size, copied from BIOS2.ASM
  1086. bop 12h
  1087. jmp iret_com
  1088. ; IVT 13 is floppy io, grabbed above to fake error status.
  1089. int14h_vector: ; RS-232 serial comms, copied from BIOS2
  1090. bop 14h
  1091. jmp iret_com
  1092. ; Int 15 cassette io, is done above.
  1093. ; Idle indicators- All word sized, and dword aligned
  1094. ; Int 16 keyboard vector
  1095. align 4
  1096. public Icounter,CharsPerTick,MinTicks
  1097. Icounter dw 0
  1098. dw 0
  1099. CharsPerTick dw 0
  1100. dw 0
  1101. MinTicks dw 50
  1102. dw 0
  1103. int16h_vector:
  1104. push ds
  1105. push bx
  1106. mov bx, 40h ; bios data adressable
  1107. mov ds, bx
  1108. cmp ah, 10h
  1109. call DOCLI ; make sure interrupts are off
  1110. jb i16vStdFns
  1111. jmp i16vExtFns
  1112. ; The dispatch code must preserve the jz,dec,dec pattern
  1113. ; to return the same ah value as is returned by the
  1114. ; standard bios (0 for supported unless otherwise documented
  1115. ; and nonzero for unsupported). This is because some apps look
  1116. ; at the ret value of ah even tho it is a side effect of the
  1117. ; original dispatch code in the rom bios.
  1118. i16vStdFns:
  1119. or ah, ah
  1120. jz i16v00h ; read key, wait
  1121. dec ah
  1122. jz i16v01h ; read key no wait
  1123. dec ah
  1124. jz i16v02h ; get shift state
  1125. dec ah
  1126. jz i16viret ; we don't support ah=3, set kbd rate
  1127. dec ah
  1128. jz i16viret ; undefined function
  1129. dec ah
  1130. jz i16v05h ; push char into kbd buffer
  1131. ; the rest are undefined\unsupported
  1132. ; normal iret exit
  1133. i16viret:
  1134. pop bx
  1135. pop ds
  1136. jmp iret_com
  1137. ; return shift state in al
  1138. i16v02h:
  1139. mov al, ds:[KB_FLAG]
  1140. jmp i16viret
  1141. i16v05h:
  1142. push si
  1143. mov bx, word ptr ds:[BUFFER_TAIL]
  1144. mov si, bx
  1145. call IncrBuffPtr
  1146. cmp bx, word ptr ds:[BUFFER_HEAD]
  1147. je i16v05h1
  1148. mov word ptr ds:[si], cx
  1149. mov word ptr ds:[BUFFER_TAIL], bx
  1150. mov al, 0
  1151. pop si
  1152. jmp i16viret
  1153. i16v05h1:
  1154. mov al, 1
  1155. pop si
  1156. jmp i16viret
  1157. ; read a character, wait if none available
  1158. i16v00h:
  1159. mov bx, word ptr ds:[BUFFER_HEAD]
  1160. cmp bx, word ptr ds:[BUFFER_TAIL]
  1161. jne i16v00h1
  1162. call DOSTI
  1163. mov ax, 09002h
  1164. int 15h ; wait device
  1165. i16v00h0:
  1166. call DOCLI
  1167. mov bx, word ptr ds:[BUFFER_HEAD]
  1168. cmp bx, word ptr ds:[BUFFER_TAIL]
  1169. i16v00h1:
  1170. call UpdateLed
  1171. jne i16v00h2
  1172. call IdlePoll
  1173. jmp i16v00h0
  1174. i16v00h2: ; translate.....
  1175. mov ax, [bx]
  1176. call IncrBuffPtr
  1177. mov word ptr ds:[BUFFER_HEAD], bx
  1178. call TranslateStd
  1179. jc i16v00h0
  1180. call IdleInit
  1181. jmp i16viret
  1182. ; read a character, nowait if none available
  1183. i16v01h:
  1184. mov bx, word ptr ds:[BUFFER_HEAD] ;;maybe should turn IF on ??
  1185. cmp bx, word ptr ds:[BUFFER_TAIL]
  1186. mov ax, [bx]
  1187. call UpdateLed
  1188. je i16vretf1
  1189. call IdleInit
  1190. call TranslateStd
  1191. call DOSTI
  1192. jnc i16vretf5 ; got a key, all done!
  1193. call IncrBuffPtr ; throw away key
  1194. mov word ptr ds:[BUFFER_HEAD], bx
  1195. jmp i16v01h ; go for the next one
  1196. ; ExtKbd read a character, nowait if none available
  1197. i16v11h:
  1198. mov bx, word ptr ds:[BUFFER_HEAD] ;;maybe should turn IF on ??
  1199. cmp bx, word ptr ds:[BUFFER_TAIL]
  1200. mov ax, [bx]
  1201. call UpdateLed
  1202. je i16vretf1 ; common retf stuff for nowait
  1203. call IdleInit
  1204. call TranslateExt
  1205. call DOSTI
  1206. jmp i16vretf5
  1207. ; retf2 exit preserving flags
  1208. i16vretf1:
  1209. call DOSTI
  1210. push ax
  1211. lahf
  1212. push ax
  1213. mov ax, cs:Icounter
  1214. cmp ax, cs:MinTicks
  1215. jb i16vretf2
  1216. mov ah, 1 ; polling kbd, idle now
  1217. BOP 16h
  1218. jmp i16vretf4
  1219. i16vretf2:
  1220. inc cs:CharsPerTick
  1221. i16vretf4:
  1222. pop ax
  1223. sahf
  1224. pop ax
  1225. i16vretf5:
  1226. pop bx
  1227. pop ds
  1228. retf 2
  1229. i16vExtFns:
  1230. sub ah, 10h
  1231. jz i16v10h ; extended read key, wait
  1232. dec ah
  1233. jz i16v11h ; extended read key, nowait
  1234. dec ah
  1235. jz i16v12h ; extended shift status
  1236. jmp i16viret ; undefined
  1237. ; return extended shift state
  1238. i16v12h:
  1239. mov al, ds:[KB_FLAG_1]
  1240. mov ah, al
  1241. and al, SYS_SHIFT
  1242. push cx
  1243. mov cl, 5
  1244. shl al, cl
  1245. pop cx
  1246. and ah, NOT (SYS_SHIFT+HOLD_STATE+INS_SHIFT)
  1247. or al, ah
  1248. mov ah, ds:[KB_FLAG_3]
  1249. and ah, NOT (LC_E1+LC_E0)
  1250. or ah, al
  1251. mov al, ds:[KB_FLAG]
  1252. jmp i16viret
  1253. ; ExtKbd read a character, wait if none available
  1254. i16v10h:
  1255. mov bx, word ptr ds:[BUFFER_HEAD]
  1256. cmp bx, word ptr ds:[BUFFER_TAIL]
  1257. jne i16v10h1
  1258. call DOSTI
  1259. mov ax, 09002h
  1260. int 15h ; wait device
  1261. i16v10h0:
  1262. call DOCLI
  1263. mov bx, word ptr ds:[BUFFER_HEAD]
  1264. cmp bx, word ptr ds:[BUFFER_TAIL]
  1265. i16v10h1:
  1266. call UpdateLed
  1267. jne i16v10h2
  1268. call IdlePoll
  1269. jmp i16v10h0
  1270. i16v10h2: ; translate.....
  1271. mov ax, [bx]
  1272. call IncrBuffPtr
  1273. mov word ptr ds:[BUFFER_HEAD], bx
  1274. call TranslateExt
  1275. call IdleInit
  1276. jmp i16viret
  1277. ; IdlePoll - Spins waiting for a key, doing idle callouts as needed
  1278. ; flags trashed, all registers preserved
  1279. ; interrupts are left on upon exit
  1280. ;
  1281. IdlePoll proc near
  1282. push ax
  1283. call DOSTI
  1284. mov ah, 2 ; Idle_waitio
  1285. BOP 16h
  1286. IPoll1:
  1287. mov bx, word ptr ds:[BUFFER_HEAD]
  1288. cmp bx, word ptr ds:[BUFFER_TAIL] ; interrupts are off only
  1289. jne IPoll3 ; safe to peek for change
  1290. mov ax, cs:Icounter
  1291. cmp ax, cs:MinTicks
  1292. jae IPoll2
  1293. inc cs:CharsPerTick
  1294. jmp IPoll1
  1295. IPoll2:
  1296. mov ah, 1 ; idle now
  1297. BOP 16h
  1298. IPoll3:
  1299. pop ax
  1300. ret
  1301. IdlePoll endp
  1302. ; IdleInit - reinits the idle indicators, dups functionality
  1303. ; of IDLE_init()
  1304. ;
  1305. IdleInit proc near
  1306. mov cs:Icounter, 0
  1307. mov cs:CharsPerTick, 0
  1308. ret
  1309. IdleInit endp
  1310. ; TranslateExt - Retrieves and translates next scan code
  1311. ; pair for extended kbd
  1312. ;
  1313. ; input: ax - raw scan code pair
  1314. ; output: ax - translated scan code pair
  1315. ;
  1316. ; all other flags,registers preserved
  1317. TranslateExt proc near
  1318. push bx
  1319. push ax
  1320. lahf
  1321. mov bx, ax
  1322. pop ax
  1323. push bx
  1324. cmp al, 0f0h
  1325. jne TExt1
  1326. or ah, ah
  1327. jz TExt1
  1328. xor al, al
  1329. TExt1:
  1330. mov bx, ax
  1331. pop ax
  1332. sahf
  1333. mov ax, bx
  1334. pop bx
  1335. ret
  1336. TranslateExt endp
  1337. ; TranslateStd - Retrieves and translates next scan code
  1338. ; pair for standard kbd
  1339. ;
  1340. ; input: ax - raw scan code pair
  1341. ; output: ax - translated scan code pair
  1342. ; returns carry for throw away
  1343. ; all other flags,registers preserved
  1344. TranslateStd proc near
  1345. push bx
  1346. push ax
  1347. lahf
  1348. mov bx, ax
  1349. pop ax
  1350. push bx
  1351. cmp ah, 0e0h
  1352. jne TStd1
  1353. ; keypad enter or '/'
  1354. mov ah, 1ch ; assume enter key
  1355. cmp al, 0dh
  1356. je TStdNoCarry
  1357. cmp al, 0ah
  1358. je TStdNoCarry
  1359. mov ah, 35h ; oops it was key pad!
  1360. jmp TStdNoCarry
  1361. TStd1:
  1362. cmp ah, 84h
  1363. ja TStdCarry ; extended key ?
  1364. cmp al, 0f0h ; fill in key ?
  1365. jne TStd2
  1366. or ah, ah ; ah = 0 is special
  1367. jz TStdNoCarry
  1368. jmp TStdCarry
  1369. TStd2:
  1370. cmp al, 0e0h ; convert to compatible output
  1371. jne TStdNoCarry
  1372. or ah, ah
  1373. jz TStdNoCarry
  1374. xor al, al
  1375. TStdNoCarry:
  1376. mov bx, ax
  1377. pop ax
  1378. sahf
  1379. mov ax, bx
  1380. pop bx
  1381. clc
  1382. ret
  1383. TStdCarry:
  1384. mov bx, ax
  1385. pop ax
  1386. sahf
  1387. mov ax, bx
  1388. pop bx
  1389. stc
  1390. ret
  1391. TranslateStd endp
  1392. ; IncrBuffPtr - increments the buffer pointer
  1393. ;
  1394. ; input: ds:bx - curr buf ptr
  1395. ; output: ds:bx - new buf ptr
  1396. ; does not update the bios buf ptr
  1397. IncrBuffPtr proc near
  1398. inc bx
  1399. inc bx
  1400. cmp bx, word ptr ds:[BUFFER_END]
  1401. jne ibpExit
  1402. mov bx, word ptr ds:[BUFFER_START]
  1403. ibpExit:
  1404. ret
  1405. IncrBuffPtr endp
  1406. ; UpdateLed - forms the data byte for the mode indicators
  1407. ; updates the led bits (MAKE_LED,SEND_LED)
  1408. ;
  1409. ; input: none
  1410. ; output: led bits updated
  1411. ;
  1412. ; Caveats: all low flags,registers preserved
  1413. ; MUST be called with interrupts off
  1414. ; does not update the kbd hardware (send_led)
  1415. ;
  1416. UpdateLed proc near
  1417. push bx
  1418. push cx
  1419. push ax
  1420. lahf
  1421. push ax
  1422. ; make_led
  1423. mov al, byte ptr ds:[KB_FLAG] ; get led bits
  1424. and al, CAPS_STATE+NUM_STATE+SCROLL_STATE
  1425. mov cl, 4
  1426. rol al, cl ; shift for kb_flag_2
  1427. and al, KB_LEDS ; only led mode bits
  1428. mov bl, byte ptr ds:[KB_FLAG_2]
  1429. xor bl, al ; see of different
  1430. and bl, KB_LEDS ; only led mode bits
  1431. jz UledExit
  1432. test byte ptr ds:[KB_FLAG_2], KB_PR_LED ;if update under way
  1433. jnz ULedExit ; skip update
  1434. or byte ptr ds:[KB_FLAG_2], KB_PR_LED ;else upd in progress
  1435. mov ah, 3 ; inform softpc to set lights
  1436. BOP 16h
  1437. and byte ptr ds:[KB_FLAG_2], NOT KB_LEDS ;clear led bits
  1438. or byte ptr ds:[KB_FLAG_2], al ;stick in new led bits
  1439. and byte ptr ds:[KB_FLAG_2], NOT KB_PR_LED ;clear upd bit
  1440. ULedExit:
  1441. pop ax
  1442. sahf
  1443. pop ax
  1444. pop cx
  1445. pop bx
  1446. ret
  1447. UpdateLed endp
  1448. ; IVT 17 is printer IO, done above.
  1449. int18h_vector: ; ROM BASIC, copied from BIOS2.ASM
  1450. bop 18h
  1451. jmp iret_com
  1452. int19h_vector: ; reboot vector, we terminate vdm!
  1453. bop 19h
  1454. jmp iret_com
  1455. IdleTicLo dw 0
  1456. IdleTicHi dw 0
  1457. IdleTicNum db 0
  1458. int1Ah_vector: ; Time of day.
  1459. call DOSTI
  1460. cmp ah, 2
  1461. jl i1aTic1
  1462. bop 1ah
  1463. jmp iret_com
  1464. i1aTic1:
  1465. push ds ; bios data adressable
  1466. push bx
  1467. push ax
  1468. mov ax, 40h
  1469. mov ds, ax
  1470. pop ax
  1471. call DOCLI
  1472. or ah, ah ; fn 0 or fn 1 ?
  1473. jnz i1aTic5
  1474. i1aTic2:
  1475. mov al, byte ptr ds:[TIMER_OVFL] ; GetTickCount
  1476. mov cx, word ptr ds:[TIMER_HIGH]
  1477. mov dx, word ptr ds:[TIMER_LOW]
  1478. ; If time stamp is within 1 tic of curr tic count
  1479. ; do idle polling managment
  1480. cmp cs:IdleTicHi, cx ; check TIMER_HIGH
  1481. jnz i1aTic8
  1482. mov bx, cs:IdleTicLo ; check TIMER_LOW
  1483. cmp bx, dx
  1484. jz i1aTic3
  1485. inc bx
  1486. cmp bx, dx
  1487. jnz i1aTic8
  1488. i1aTic3:
  1489. inc cs:IdleTicNum ; Yes, inc poll count
  1490. cmp cs:IdleTicNum, 16 ; Is poll count too hi ?
  1491. jb i1aTic9
  1492. call DOSTI
  1493. xor ax,ax ; Yes, do idle BOP
  1494. dec cs:IdleTicLo ; make sure only bop once
  1495. BOP 5ah
  1496. call DOCLI
  1497. jmp short i1aTic2
  1498. i1aTic5:
  1499. mov word ptr ds:[TIMER_LOW], dx ; SetTickCount
  1500. mov word ptr ds:[TIMER_HIGH], cx
  1501. i1aTic8:
  1502. mov cs:IdleTicNum, 0 ; reset idle indicators
  1503. i1aTic9:
  1504. mov cs:IdleTicLo, dx ; store time stamp
  1505. mov cs:IdleTicHi, cx
  1506. mov byte ptr ds:[TIMER_OVFL], 0 ; common TicCount exit
  1507. pop bx
  1508. pop ds
  1509. jmp iret_com
  1510. ; IVT 1B is keyboard break, set to dummy.
  1511. int1Eh_vector:
  1512. bop 1eh
  1513. jmp iret_com
  1514. int70h_vector: ; Real time clock, copied from BIOS1.ASM
  1515. bop 70h ; rtc_bios.c:rtc_int()
  1516. jmp iret_com
  1517. int4Ah_caller:
  1518. call DOSTI ; Called from base\bios\rtc_bios.c:rtc_int()
  1519. int 4ah ; User installed alarm.
  1520. jmp r1
  1521. r1: jmp r2
  1522. r2: jmp r3
  1523. r3:
  1524. call DOCLI
  1525. bop 0feh
  1526. int71h_vector: ; redirect, copied from BIOS1.ASM
  1527. bop 71h
  1528. int 0Ah
  1529. jmp iret_com
  1530. int75h_vector: ; NPX 287.
  1531. bop 75h
  1532. int 02h
  1533. jmp iret_com
  1534. ;=================================================================
  1535. ; End of pseudo-ROM vectuz.
  1536. ;=================================================================
  1537. ;================================================================
  1538. ; Wait for interrupts
  1539. ;================================================================
  1540. cpu_nop_code:
  1541. call DOSTI
  1542. jmp short nxt1
  1543. nxt1: jmp short nxt2
  1544. nxt2: jmp short nxt3
  1545. nxt3: bop %BIOS_CPU_QUIT
  1546. public SpcKbdEnd
  1547. SpcKbdEnd label byte
  1548. align 4 ;; makes MIPS happy
  1549. ; offset table for redirected functions
  1550. kio_table dw 29 dup(?)
  1551. public InstSpcKbd
  1552. ;
  1553. ; InstSpcKbd - Installs the softpc custom interrupt hooks
  1554. ;
  1555. ; Inputs: ds == Resident location of SysInitSeg
  1556. ; Outputs: None
  1557. ;
  1558. InstSpcKbd proc near
  1559. pusha
  1560. call DOCLI
  1561. ; The following vectors are used for both x86\mips
  1562. ; The dos interrupts Int 25\Int26 are handled by the dos kerenl
  1563. xor ax, ax
  1564. mov es, ax
  1565. mov word ptr es:[08h*4], offset int08h_vector
  1566. mov word ptr es:[(08h*4)+2], ds
  1567. mov word ptr es:[09h*4], offset int09h_vector
  1568. mov word ptr es:[(09h*4)+2], ds
  1569. mov word ptr es:[13h*4], offset int13h_vector
  1570. mov word ptr es:[(13h*4)+2], ds
  1571. mov word ptr es:[16h*4], offset int16h_vector
  1572. mov word ptr es:[(16h*4)+2], ds
  1573. mov word ptr es:[40h*4], offset int40h_vector
  1574. mov word ptr es:[(40h*4)+2], ds
  1575. mov word ptr es:[19h*4], offset int19h_vector
  1576. mov word ptr es:[(19h*4)+2], ds
  1577. mov word ptr es:[1ah*4], offset int1Ah_vector
  1578. mov word ptr es:[(1ah*4)+2], ds
  1579. ; BOP 5F - send interesting addresses to softpc C BIOS
  1580. ; CS seg of kio_table
  1581. ; DS seg of resident keyboard code
  1582. ; DI offset of bop table
  1583. ; CX size of bop table entry
  1584. ; SI offset of kio_table
  1585. mov si,offset sysinitgrp:kio_table
  1586. push ds
  1587. push cs
  1588. pop ds
  1589. mov word ptr [si], offset shift_keys ;K6
  1590. mov word ptr [si+2], offset shift_masks ;K7
  1591. mov word ptr [si+4], offset ctl_n_table ;K8
  1592. mov word ptr [si+6], offset ctl_f_table ;K9
  1593. mov word ptr [si+8], offset lowercase ;K10
  1594. mov word ptr [si+10], offset uppercase ;K11
  1595. mov word ptr [si+12], offset alt_table ;K30
  1596. mov word ptr [si+14], offset dummy_vector
  1597. mov word ptr [si+16], offset print_screen_caller
  1598. mov word ptr [si+18], offset int15h_caller
  1599. mov word ptr [si+20], offset cpu_nop_code
  1600. mov word ptr [si+22], offset int15h_vector
  1601. mov word ptr [si+24], offset Icounter
  1602. mov word ptr [si+26], offset int4Ah_caller
  1603. mov word ptr [si+28], offset keyboard_break_caller
  1604. mov word ptr [si+30], offset int10h_caller
  1605. mov word ptr [si+32], offset int10h_vector
  1606. mov word ptr [si+34], offset use_host_int10
  1607. mov word ptr [si+36], offset ega_parm_setup
  1608. mov word ptr [si+38], offset changing_mode
  1609. mov word ptr [si+40], offset prt_status
  1610. mov word ptr [si+42], offset wait_int
  1611. mov word ptr [si+44], offset floppy_table
  1612. mov word ptr [si+46], offset vga_1b_table
  1613. mov word ptr [si+48], offset conf_table
  1614. mov word ptr [si+50], offset int08h_vector
  1615. mov word ptr [si+52], offset int13h_vector
  1616. mov word ptr [si+54], offset int13h_caller
  1617. ; The last entry is reserved for assertion checking
  1618. mov word ptr [si+56], VERSIONID
  1619. pop ds
  1620. ; mov si, offset kio_table
  1621. mov di, offset iret_bop_table
  1622. mov cx, offset iret_end_first_entry - offset iret_bop_table
  1623. mov ax, VERSIONID
  1624. bop 5fh
  1625. jc isk_int9
  1626. jmp isk_Exit
  1627. isk_int9:
  1628. ; save old video int
  1629. xor ax, ax
  1630. mov es, ax
  1631. mov bx, es:[40h]
  1632. mov si, offset host_int10
  1633. mov word ptr ds:[si], bx
  1634. mov bx, es:[42h]
  1635. mov word ptr ds:[si+2], bx
  1636. ; save old secondary video int (42h)
  1637. mov bx, es:[108h]
  1638. mov si, offset host_int42
  1639. mov word ptr ds:[si], bx
  1640. mov bx, es:[10ah]
  1641. mov word ptr ds:[si+2], bx
  1642. ;-----------------------------------------------------------
  1643. ;
  1644. ; Crazy vector grabber
  1645. ;
  1646. ; Works OK on DEC PC when grab INT's 6, 11, 16, 17, 42.
  1647. ; Now try and avoid all accesses to host ROM.
  1648. ;
  1649. ; At this point we assume ES=0
  1650. ;-----------------------------------------------------------
  1651. ; Grab some prominent vectors for pseudo-ROM routines.
  1652. ; start at Int 0h and work our way up as needed
  1653. cld
  1654. mov di, 20
  1655. mov ax, offset int05h_vector ; INT 05h
  1656. stosw ; Print screen
  1657. mov ax, ds
  1658. stosw
  1659. mov ax, offset int06h_vector ; INT 06h
  1660. stosw ; Illegal instruction.
  1661. mov ax, ds
  1662. stosw
  1663. mov ax, offset unexp_int ; INT 07h
  1664. stosw
  1665. mov ax, ds
  1666. stosw
  1667. ; int 8h Timer hardware vector already done for both x86\mips
  1668. ; int 9h kbd hardware vector already done for both x86\mips
  1669. add di, 8
  1670. mov ax, offset unexp_int ; INT 0ah
  1671. stosw
  1672. mov ax, ds
  1673. stosw
  1674. mov ax, offset unexp_int ; INT 0bh
  1675. stosw
  1676. mov ax, ds
  1677. stosw
  1678. mov ax, offset unexp_int ; INT 0ch
  1679. stosw
  1680. mov ax, ds
  1681. stosw
  1682. mov ax, offset unexp_int ; INT 0dh
  1683. stosw
  1684. mov ax, ds
  1685. stosw
  1686. mov ax, offset int0e_vector ; INT 0eh
  1687. stosw ; Floppy hardware int.
  1688. mov ax, ds
  1689. stosw
  1690. mov ax, offset unexp_int ; INT 0fh
  1691. stosw
  1692. mov ax, ds
  1693. stosw
  1694. mov ax, offset int10h_vector ; INT 10h
  1695. stosw
  1696. mov ax, ds
  1697. stosw
  1698. mov ax, offset int11h_vector ; INT 11h
  1699. stosw ; Equipment check.
  1700. mov ax, ds
  1701. stosw
  1702. mov ax, offset int12h_vector ; INT 12h
  1703. stosw ; Get memory size.
  1704. mov ax, ds
  1705. stosw
  1706. ; int 13h already done (see above) for both mips\x86
  1707. mov di, 14h*4 ; Communications.
  1708. mov ax, offset int14h_vector
  1709. stosw
  1710. mov ax, ds
  1711. stosw
  1712. mov ax, offset int15h_vector ; INT 15h
  1713. stosw
  1714. mov ax, ds
  1715. stosw
  1716. ; int 16h kbd hardware vector already done for both x86\mips
  1717. add di, 4
  1718. mov ax, offset int17h_vector ; INT 17h
  1719. stosw
  1720. mov ax, ds
  1721. stosw
  1722. mov ax, offset int18h_vector ; INT 18h
  1723. stosw ; ROM BASIC.
  1724. mov ax, ds
  1725. stosw
  1726. ; int 19h (reboot vector) already done for both x86\mips
  1727. ; int 1ah, time of day, already done for both x86\mips
  1728. mov di, 1Bh*4
  1729. mov ax, offset dummy_vector ; INT 1Bh
  1730. stosw ; Keyboard break.
  1731. mov ax, ds
  1732. stosw
  1733. mov ax, offset dummy_vector ; INT 1Ch
  1734. stosw ; Timer tick.
  1735. mov ax, ds
  1736. stosw
  1737. mov di, 1Eh*4 ; Floppy parameters.
  1738. mov ax, offset bios_floppy_table
  1739. stosw
  1740. mov ax, ds
  1741. stosw
  1742. ; int 40h already done (see above) for both mips\x86
  1743. mov di, 41h*4
  1744. mov ax, offset unexp_int ; INT 41h
  1745. stosw ; Hard disk parameters.
  1746. mov ax, ds
  1747. stosw
  1748. mov ax, offset int42h_vector ; INT 42h
  1749. stosw ; Default video.
  1750. mov ax, ds
  1751. stosw
  1752. mov di, 70h*4 ; Real time clock init.
  1753. mov ax, offset int70h_vector
  1754. stosw
  1755. mov ax, ds
  1756. stosw
  1757. mov ax, offset int71h_vector ; INT 71h Redirect.
  1758. stosw
  1759. mov ax, ds
  1760. stosw
  1761. mov ax, offset intD11_vector ; INT 72h D11 int
  1762. stosw
  1763. mov ax, ds
  1764. stosw
  1765. mov ax, offset intD11_vector ; INT 73h D11 int
  1766. stosw
  1767. mov ax, ds
  1768. stosw
  1769. mov ax, offset intD11_vector ; INT 74h D11 int
  1770. stosw
  1771. mov ax, ds
  1772. stosw
  1773. mov ax, offset int75h_vector ; INT 75h 287 int
  1774. stosw
  1775. mov ax, ds
  1776. stosw
  1777. mov ax, offset intD11_vector ; INT 76h D11 int
  1778. stosw
  1779. mov ax, ds
  1780. stosw
  1781. mov ax, offset intD11_vector ; INT 77h D11 int
  1782. stosw
  1783. mov ax, ds
  1784. stosw
  1785. isk_Exit:
  1786. call DOSTI
  1787. popa
  1788. ret
  1789. InstSpcKbd endp
  1790. SpcKbdSeg ends
  1791. end