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.

965 lines
25 KiB

  1. CODE SEGMENT
  2. ASSUME CS:CODE,DS:CODE
  3. ORG 100h
  4. INCLUDE EQU.INC
  5. Start:
  6. jmp PrgStart
  7. eom = 0
  8. LogoPos = 0600h
  9. CodePos = LogoPos+421h
  10. MemPos = LogoPos+521h
  11. FilePos = LogoPos+621h
  12. PrinterPos = LogoPos+721h
  13. HekeyPos = LogoPos+821h
  14. HjkeyPos = LogoPos+921h
  15. KbdPos = LogoPos+0a21h
  16. HelpPos = LogoPos+0C10h
  17. MenuData STRUC
  18. mFlag db ?
  19. mCurPos dw ?
  20. mFlagAddr dw ?
  21. mKbdSrv dw ?
  22. mMaxItem db ?
  23. mCurItem db ?
  24. mHelpMsg dw ?
  25. mMenuMsg dw ?
  26. MenuData ENDS
  27. ; mFlag
  28. ByteDisp = 00000010b
  29. StringDisp = 00000100b
  30. ;------------------------
  31. LogoMsg label byte
  32. db ' ���������������������������������������������������Ŀ',cr,lf
  33. db ' � HanGeul BIOS setup program Version 6.12 �',cr,lf
  34. db ' � (C)Copyright Qnix computer Co., Ltd. 1992 �',cr,lf
  35. db ' ���������������������������������������������������Ĵ',cr,lf
  36. db ' � CODE/SPEC. � �',cr,lf
  37. db ' � FONT MEMORY � �',cr,lf
  38. db ' � FONT FILENAME � �',cr,lf
  39. db ' � PRINTER TYPE � �',cr,lf
  40. db ' � HAN/ENG KEY � �',cr,lf
  41. db ' � HANJA KEY � �',cr,lf
  42. db ' � KBD TYPE � �',cr,lf
  43. db ' ���������������������������������������������������Ĵ',cr,lf
  44. db ' � �',cr,lf
  45. db ' �����������������������������������������������������'
  46. LogoLng = $-LogoMsg
  47. MenuSelHelp db 'USAGE : cursor, enter, ESC ',eom
  48. StringSelHelp label byte
  49. CodeSelHelp db 'USAGE : up, down, BS, enter, ESC',eom
  50. CodeSelHelpLng = $-CodeSelHelp-1
  51. SaveMsg db ' Save and exit (N/y) ',eom
  52. DefaultMsg db 'default',eom
  53. DefaultMsgLng = $-DefaultMsg-1
  54. FileCreatErrMsg db cr,lf,'File creation error !',7,cr,lf,'$'
  55. ;------------------------
  56. GrpCnvtTbl db '�',''
  57. db '�',''
  58. db '�',''
  59. db '�',''
  60. db '�',''
  61. db '�',''
  62. db '�',''
  63. db '�',''
  64. db '�',''
  65. db '�',''
  66. GrpCnvtTblLng = ($-GrpCnvtTbl)/2
  67. ;------------------------
  68. MenuSelect label byte
  69. db 48h,1 ; up
  70. db 50h,2 ; down
  71. db 4bh,3 ; left
  72. db 4dh,4 ; right
  73. db 1ch,5 ; enter
  74. db 01h,6 ; ESC
  75. dw -1
  76. MakeCode label byte
  77. db 48h,1 ; up
  78. db 50h,2 ; down
  79. db 4bh,8 ; left
  80. db 4dh,9 ; right
  81. db 1ch,5 ; enter
  82. db 01h,6 ; ESC
  83. dw -1
  84. MakeString label byte
  85. db 48h,1 ; up
  86. db 50h,2 ; down
  87. db 1ch,5 ; enter
  88. db 01h,6 ; ESC
  89. db 0eh,7 ; BS
  90. dw -1
  91. ;------------------------
  92. MainTbl label word
  93. dw offset Sub1Tbl
  94. dw offset Sub2Tbl
  95. dw offset Sub3Tbl
  96. dw offset Sub4Tbl
  97. dw offset Sub5Tbl
  98. dw offset Sub6Tbl
  99. dw offset Sub7Tbl
  100. MainTblLng = ($-MainTbl)/2
  101. Sub1Tbl label byte
  102. db 0
  103. dw CodePos
  104. dw offset Sub1DataTbl
  105. dw offset KbdMenu
  106. db Sub1DataTblLng
  107. CurCode db 1
  108. dw offset MenuSelHelp
  109. dw offset Sub1Msg1
  110. dw offset Sub1Msg2
  111. dw offset Sub1Msg3
  112. dw offset Sub1Msg4
  113. Sub1Msg1 db 'English ',eom
  114. Sub1Msg2 db 'KS C 5842 - 1991',eom
  115. Sub1Msg3 db 'Chohab ',eom
  116. Sub1Msg4 db 'Wansung 7 bit ',eom
  117. Sub1DataTbl label byte
  118. db 0
  119. db WSung or HangeulMode
  120. db Chab or HangeulMode
  121. db WSung7 or HangeulMode
  122. Sub1DataTblLng = $-Sub1DataTbl
  123. Sub2Tbl label byte
  124. db 0
  125. dw MemPos
  126. dw offset Sub2DataTbl
  127. dw offset KbdMenu
  128. db Sub2DataTblLng
  129. CurMem db 0
  130. dw offset MenuSelHelp
  131. dw offset Sub2Msg1
  132. dw offset Sub2Msg2
  133. dw offset Sub2Msg3
  134. dw offset Sub2Msg4
  135. dw offset Sub2Msg5
  136. Sub2Msg1 db 'Automatic',eom
  137. Sub2Msg2 db 'HIMEM ',eom
  138. Sub2Msg3 db 'EMS ',eom
  139. Sub2Msg4 db 'Extended ',eom
  140. Sub2Msg5 db 'Real ',eom
  141. Sub2DataTbl label byte
  142. db 0
  143. db HiMem
  144. db EmsMem
  145. db ExtMem
  146. db RealMem
  147. Sub2DataTblLng = $-Sub2DataTbl
  148. Sub3Tbl label byte
  149. db StringDisp
  150. dw FilePos
  151. dw offset FontFileName
  152. dw offset KbdString
  153. db 1
  154. db 0
  155. dw offset StringSelHelp
  156. Sub4Tbl label byte
  157. db 0
  158. dw PrinterPos
  159. dw offset Sub4DataTbl
  160. dw offset KbdMenu
  161. db Sub4DataTblLng
  162. CurPrinter db 1
  163. dw offset MenuSelHelp
  164. dw offset Sub4Msg1
  165. dw offset Sub4Msg2
  166. dw offset Sub4Msg3
  167. dw offset Sub4Msg4
  168. dw offset Sub4Msg5
  169. dw offset Sub4Msg6
  170. Sub4Msg1 db 'none select ',eom
  171. Sub4Msg2 db 'KS ',eom
  172. Sub4Msg3 db 'QLBP ',eom
  173. Sub4Msg4 db 'KSSM ',eom
  174. Sub4Msg5 db 'KSSM(Chohab)',eom
  175. Sub4Msg6 db 'TG(Chohab) ',eom
  176. Sub4DataTbl label byte
  177. db NoPrt
  178. db KsPrt
  179. db wLbp
  180. db wKmPrt
  181. db cKmPrt
  182. db TgPrt
  183. Sub4DataTblLng = $-Sub4DataTbl
  184. Sub5Tbl label byte
  185. db ByteDisp
  186. dw HekeyPos
  187. dw offset HeKey
  188. dw offset KbdCode
  189. db 1
  190. db 0
  191. dw offset MenuSelHelp
  192. Sub6Tbl label byte
  193. db ByteDisp
  194. dw HjkeyPos
  195. dw offset HjKey
  196. dw offset KbdCode
  197. db 1
  198. db 0
  199. dw offset MenuSelHelp
  200. Sub7Tbl label byte
  201. db 0
  202. dw KbdPos
  203. dw offset Sub7DataTbl
  204. dw offset KbdMenu
  205. db Sub7DataTblLng
  206. CurKbd db 0
  207. dw offset MenuSelHelp
  208. dw offset Sub7Msg1
  209. dw offset Sub7Msg2
  210. Sub7Msg1 db 'Default',eom
  211. Sub7Msg2 db '101 KBD',eom
  212. Sub7DataTbl label byte
  213. db 0
  214. db SetKbd101
  215. Sub7DataTblLng = $-Sub7DataTbl
  216. ;------------------------
  217. MenuPos dw 0 ; main table index
  218. CharCnt dw 0 ; char counter
  219. CurPos dw FilePos
  220. OrgMode db 0
  221. NorAttr db 0
  222. SelAttr db 0
  223. BakAttr db 0
  224. FileName db 'C:\HECON.CFG',eom
  225. Handle dw 0
  226. ;------------------------
  227. ConfigData label byte
  228. CfgFilename db 'HECON.CFG' ; 9 byte
  229. CodeStat db HangeulMode
  230. FontFileName db 'FONT.SYS'
  231. db 24 dup(0) ; drive/path/filename
  232. MemStat db 0 ; real/EMS/ext./HIMEM
  233. HeKey db 0
  234. HjKey db 0
  235. PrinterStat db 0
  236. KbdType db 0
  237. db 3 dup(0) ; reserved
  238. ;------------------------
  239. PrgStart:
  240. call Modeset
  241. call SetAttribute
  242. call DisplayLogo
  243. call OpenFile
  244. call DisplayAll
  245. mov ah,1
  246. xor bh,bh
  247. mov cx,220dh
  248. int 10h
  249. call Action
  250. call RestoreScreen
  251. Exit:
  252. mov ah,4ch
  253. int 21h
  254. ;------------------------------------------------------------------------
  255. Modeset:
  256. mov ah,0fh
  257. int 10h
  258. mov [OrgMode],al
  259. int 11h
  260. test al,30h
  261. mov ax,7
  262. jpe @f
  263. mov al,3
  264. @@:
  265. int 10h
  266. mov ah,1
  267. mov cx,2000h
  268. int 10h
  269. ret
  270. ;------------------------
  271. SetAttribute:
  272. int 11h
  273. mov [NorAttr],70h
  274. mov [SelAttr],7
  275. mov [BakAttr],70h
  276. cmp al,30h
  277. jpe @f
  278. mov [NorAttr],70h
  279. mov [SelAttr],7
  280. mov [BakAttr],70h
  281. @@:
  282. ret
  283. ;------------------------
  284. DisplayLogo:
  285. mov ax,920h
  286. xor bh,bh
  287. mov bl,[BakAttr]
  288. mov cx,80*25
  289. int 10h
  290. push es
  291. mov ax,0fd00h
  292. int 10h
  293. mov si,bx
  294. mov si,es:[si+16]
  295. mov ah,byte ptr es:[si+7+4+1]
  296. pop es
  297. cmp al,0fdh
  298. jnz DisplayLogoDo ; jump if english environment
  299. test ah,00000001b
  300. jz DisplayLogoDo ; jump if english mode
  301. mov di,offset LogoMsg
  302. mov cx,LogoLng
  303. @@:
  304. mov al,[di]
  305. call ChgTblGrp
  306. mov [di],al
  307. inc di
  308. loop @b
  309. DisplayLogoDo:
  310. mov bp,offset LogoMsg
  311. mov dx,LogoPos
  312. mov cx,LogoLng
  313. mov bl,[NorAttr]
  314. xor bh,bh
  315. mov ax,1300h
  316. int 10h
  317. ret
  318. ChgTblGrp:
  319. push cx
  320. mov bl,al
  321. mov si,offset GrpCnvtTbl
  322. mov cx,GrpCnvtTblLng
  323. @@:
  324. lodsw
  325. cmp al,bl
  326. jz @f
  327. loop @b
  328. mov ah,bl
  329. @@:
  330. mov al,ah
  331. pop cx
  332. ret
  333. ;------------------------
  334. OpenFile:
  335. mov ah,19h
  336. int 21h
  337. cmp al,2
  338. jbe @f
  339. mov al,2
  340. @@:
  341. add al,'A'
  342. mov si,offset Filename
  343. mov [si],al ; set drive latter
  344. mov dx,offset FileName
  345. mov ax,3d02h
  346. int 21h
  347. jc GetConfigFileCreat
  348. mov [Handle],ax
  349. mov dx,offset ConfigData
  350. mov ah,3fh
  351. mov bx,[Handle]
  352. mov cx,50
  353. int 21h
  354. jnc GetConfigFileRead
  355. GetConfigFileCreat:
  356. mov dx,offset FileName
  357. mov ah,3ch
  358. mov cx,2 ; hidden file
  359. int 21h
  360. mov [Handle],ax
  361. jnc @f
  362. mov ah,9
  363. mov dx,offset FileCreatErrMsg
  364. int 21h
  365. @@:
  366. ret
  367. GetConfigFileRead:
  368. mov si,offset CfgFilename
  369. mov di,offset FileName
  370. add di,3
  371. mov cx,9
  372. rep cmpsb
  373. jnz GetConfigFileCreat
  374. ;
  375. mov ah,[CodeStat]
  376. and ah,not ChabLoad
  377. mov si,offset Sub1DataTbl
  378. mov bx,si
  379. mov cx,Sub1DataTblLng
  380. @@:
  381. lodsb
  382. cmp al,ah
  383. jz @f
  384. loop @b
  385. @@:
  386. sub si,bx
  387. mov bx,si
  388. dec bx
  389. mov [CurCode],bl
  390. ;
  391. mov ah,[MemStat]
  392. mov si,offset Sub2DataTbl
  393. mov bx,si
  394. mov cx,Sub2DataTblLng
  395. @@:
  396. lodsb
  397. cmp al,ah
  398. jz @f
  399. loop @b
  400. @@:
  401. sub si,bx
  402. mov bx,si
  403. dec bx
  404. mov [CurMem],bl
  405. ;
  406. mov ah,[PrinterStat]
  407. mov si,offset Sub4DataTbl
  408. mov bx,si
  409. mov cx,Sub4DataTblLng
  410. @@:
  411. lodsb
  412. cmp al,ah
  413. jz @f
  414. loop @b
  415. @@:
  416. sub si,bx
  417. mov bx,si
  418. dec bx
  419. mov [CurPrinter],bl
  420. ;
  421. mov ah,[KbdType]
  422. mov si,offset Sub7DataTbl
  423. mov bx,si
  424. mov cx,Sub7DataTblLng
  425. @@:
  426. lodsb
  427. cmp al,ah
  428. jz @f
  429. loop @b
  430. @@:
  431. sub si,bx
  432. mov bx,si
  433. dec bx
  434. mov [CurKbd],bl
  435. ret
  436. ;------------------------
  437. DisplayAll:
  438. mov cx,MainTblLng
  439. @@:
  440. push cx
  441. mov bl,[NorAttr]
  442. call DispMenu
  443. inc [MenuPos]
  444. pop cx
  445. loop @b
  446. mov [MenuPos],0
  447. mov bl,[SelAttr]
  448. call DispMenu
  449. call DispHelp
  450. ret
  451. ;------------------------------------------------------------------------
  452. Action:
  453. xor ah,ah
  454. int 16h
  455. mov bx,[MenuPos]
  456. shl bx,1
  457. mov bx,[bx+MainTbl]
  458. call [bx+mKbdSrv]
  459. jnc @f
  460. mov ax,0e07h
  461. int 10h
  462. jmp short Action
  463. @@:
  464. mov cl,ah
  465. xor ch,ch
  466. shl cx,1
  467. mov si,cx
  468. call [si].ActionTbl
  469. jnc Action
  470. ret
  471. ActionTbl label word
  472. dw offset EditString ; 0
  473. dw offset MenuUp ; 1
  474. dw offset MenuDown ; 2
  475. dw offset MenuPost ; 3
  476. dw offset MenuNext ; 4
  477. dw offset CheckSave ; 5
  478. dw offset Escape ; 6
  479. dw offset EditBs ; 7
  480. dw offset CodeDec ; 8
  481. dw offset CodeInc ; 9
  482. ;------------------------
  483. EditString:
  484. cmp [CharCnt],StringLng
  485. jae EditStringErr
  486. mov si,[MenuPos]
  487. shl si,1
  488. mov si,[si+MainTbl]
  489. mov di,[si].mFlagAddr
  490. cmp [CharCnt],0
  491. jnz @f
  492. push ax
  493. push di
  494. mov dx,[si].mCurPos
  495. mov [CurPos],dx
  496. mov di,offset FontFileName
  497. mov cx,StringLng
  498. xor al,al
  499. rep stosb
  500. pop di
  501. pop ax
  502. @@:
  503. add di,[CharCnt]
  504. mov [di],al
  505. inc [CharCnt]
  506. mov bl,[SelAttr]
  507. call DispMenu
  508. inc [CurPos]
  509. mov dx,[CurPos]
  510. mov ah,2
  511. xor bh,bh
  512. int 10h
  513. clc
  514. ret
  515. EditStringErr:
  516. call Beep
  517. clc
  518. ret
  519. ;------------------------
  520. MenuUp:
  521. mov [CharCnt],0
  522. mov [CurPos],FilePos
  523. mov bl,[NorAttr]
  524. call DispMenu
  525. dec [MenuPos]
  526. cmp [MenuPos],-1
  527. jnz @f
  528. mov [MenuPos],MainTblLng-1
  529. @@:
  530. call DispHelp
  531. mov bl,[SelAttr]
  532. call DispMenu
  533. call CursorControl
  534. clc
  535. ret
  536. ;------------------------
  537. MenuDown:
  538. mov [CharCnt],0
  539. mov [CurPos],FilePos
  540. mov bl,[NorAttr]
  541. call DispMenu
  542. inc [MenuPos]
  543. cmp [MenuPos],MainTblLng
  544. jb @f
  545. mov [MenuPos],0
  546. @@:
  547. call DispHelp
  548. mov bl,[SelAttr]
  549. call DispMenu
  550. call CursorControl
  551. clc
  552. ret
  553. ;------------------------
  554. MenuPost:
  555. mov si,[MenuPos]
  556. shl si,1
  557. mov si,[si+MainTbl]
  558. mov al,[si].mMaxItem
  559. dec [si].mCurItem
  560. cmp [si].mCurItem,-1
  561. jnz @f
  562. dec al
  563. mov [si].mCurItem,al
  564. @@:
  565. mov bl,[SelAttr]
  566. call DispMenu
  567. clc
  568. ret
  569. ;------------------------
  570. MenuNext:
  571. mov si,[MenuPos]
  572. shl si,1
  573. mov si,[si+MainTbl]
  574. mov al,[si].mMaxItem
  575. inc [si].mCurItem
  576. cmp [si].mCurItem,al
  577. jb @f
  578. mov [si].mCurItem,0
  579. @@:
  580. mov bl,[SelAttr]
  581. call DispMenu
  582. clc
  583. ret
  584. ;------------------------
  585. CheckSave:
  586. xor bh,bh
  587. mov ah,3
  588. int 10h
  589. and ch,not 20h
  590. mov ah,1
  591. int 10h
  592. mov dx,HelpPos
  593. mov bl,[NorAttr]
  594. xor bh,bh
  595. mov ah,2
  596. int 10h
  597. mov cx,CodeSelHelpLng
  598. mov ah,9
  599. mov al,' '
  600. int 10h
  601. mov si,offset SaveMsg
  602. mov bl,[SelAttr]
  603. call DispString
  604. xor ah,ah
  605. int 16h
  606. or al,20h
  607. cmp al,'y'
  608. jnz CheckSaveEnd
  609. mov bl,[CurCode]
  610. xor bh,bh
  611. mov al,[bx+Sub1DataTbl]
  612. mov [CodeStat],al
  613. mov bl,[CurMem]
  614. xor bh,bh
  615. mov al,[bx+Sub2DataTbl]
  616. mov [MemStat],al
  617. mov bl,[CurKbd]
  618. xor bh,bh
  619. mov al,[bx+Sub7DataTbl]
  620. mov [KbdType],al
  621. mov bl,[CurPrinter]
  622. xor bh,bh
  623. mov al,[bx+Sub4DataTbl]
  624. mov [PrinterStat],al
  625. cmp [PrinterStat],NoPrt
  626. jz @f
  627. or [CodeStat],ChabLoad
  628. @@:
  629. test [CodeStat],Chab or WSung7
  630. jz @f
  631. or [CodeStat],ChabLoad
  632. @@:
  633. test [CodeStat],ChabLoad
  634. jnz @f
  635. and [CodeStat],not (Chab or WSung7)
  636. mov [PrinterStat],NoPrt
  637. @@:
  638. xor cx,cx
  639. xor dx,dx
  640. mov bx,[Handle]
  641. mov ax,4200h
  642. int 21h
  643. mov dx,offset ConfigData
  644. mov ah,40h
  645. mov cx,50
  646. int 21h
  647. mov ah,3eh
  648. int 21h
  649. stc
  650. ret
  651. CheckSaveEnd:
  652. call DispHelp
  653. call CursorControl
  654. mov bl,[SelAttr]
  655. call DispMenu
  656. clc
  657. ret
  658. ;------------------------
  659. Escape:
  660. stc
  661. ret
  662. ;------------------------
  663. EditBs:
  664. cmp [CharCnt],0
  665. jz EditBsErr
  666. dec [CharCnt]
  667. mov si,[MenuPos]
  668. shl si,1
  669. mov si,[si+MainTbl]
  670. mov di,[si].mFlagAddr
  671. add di,[CharCnt]
  672. mov byte ptr [di],0
  673. mov bl,[SelAttr]
  674. call DispMenu
  675. dec [CurPos]
  676. mov dx,[CurPos]
  677. mov ah,2
  678. xor bh,bh
  679. int 10h
  680. clc
  681. ret
  682. EditBsErr:
  683. call Beep
  684. clc
  685. ret
  686. ;------------------------
  687. CodeDec:
  688. mov si,[MenuPos]
  689. shl si,1
  690. mov si,[si+MainTbl]
  691. mov dx,[si].mCurPos
  692. mov si,[si].mFlagAddr
  693. mov bl,[SelAttr]
  694. dec byte ptr [si]
  695. jz CodeDefMsg
  696. CodeHexMsg:
  697. mov bl,[NorAttr]
  698. xor bh,bh
  699. mov ah,2
  700. int 10h
  701. mov cx,DefaultMsgLng
  702. mov ah,9
  703. mov al,' '
  704. int 10h
  705. mov bl,[SelAttr]
  706. call DispMenu
  707. ret
  708. ;------------------------
  709. CodeInc:
  710. mov si,[MenuPos]
  711. shl si,1
  712. mov si,[si+MainTbl]
  713. mov dx,[si].mCurPos
  714. mov si,[si].mFlagAddr
  715. mov bl,[SelAttr]
  716. inc byte ptr [si]
  717. jnz CodeHexMsg
  718. CodeDefMsg:
  719. mov bl,[SelAttr]
  720. mov si,offset DefaultMsg
  721. call DispString
  722. ret
  723. ;------------------------------------------------------------------------
  724. DispMenu:
  725. mov si,[MenuPos]
  726. shl si,1
  727. mov si,[si+MainTbl]
  728. mov dx,[si].mCurPos
  729. mov al,[si].mFlag
  730. and ax,00000110b
  731. mov di,ax
  732. call [di].DispMenuTbl
  733. ret
  734. DispMenuTbl label word
  735. dw offset DispMenuStringMsg
  736. dw offset DispByteMsg
  737. dw offset DispStringMsg
  738. dw offset DispStringMsg
  739. DispMenuStringMsg:
  740. mov al,[si].mCurItem
  741. xor ah,ah
  742. shl ax,1
  743. add si,ax
  744. mov si,[si].mMenuMsg
  745. call DispString
  746. ret
  747. DispByteMsg:
  748. mov si,[si].mFlagAddr
  749. mov al,[si]
  750. or al,al
  751. jnz @f
  752. mov si,offset DefaultMsg
  753. push bx
  754. mov bl,[NorAttr]
  755. xor bh,bh
  756. mov ah,2
  757. int 10h
  758. mov cx,DefaultMsgLng
  759. mov ah,9
  760. mov al,' '
  761. int 10h
  762. pop bx
  763. call DispString
  764. ret
  765. @@:
  766. mov ah,al
  767. and ax,0f00fh
  768. shr ah,1
  769. shr ah,1
  770. shr ah,1
  771. shr ah,1
  772. add ax,'00'
  773. cmp al,'9'
  774. jbe @f
  775. add al,7
  776. @@:
  777. cmp ah,'9'
  778. jbe @f
  779. add ah,7
  780. @@:
  781. push ax
  782. mov al,ah
  783. mov cx,1
  784. xor bh,bh
  785. mov ah,2
  786. int 10h
  787. mov ah,9
  788. int 10h
  789. inc dl
  790. mov ah,2
  791. int 10h
  792. pop ax
  793. mov ah,9
  794. int 10h
  795. ret
  796. DispStringMsg:
  797. xor bh,bh
  798. mov ah,2
  799. int 10h
  800. mov cx,StringLng
  801. mov ah,9
  802. mov al,' '
  803. int 10h
  804. mov si,[si].mFlagAddr
  805. call DispString
  806. mov ax,920h
  807. int 10h ; clear han 1st flag
  808. mov dx,[CurPos]
  809. xor bh,bh
  810. mov ah,2
  811. int 10h
  812. ret
  813. ;------------------------
  814. DispHelp:
  815. mov si,[MenuPos]
  816. shl si,1
  817. mov si,[si+MainTbl]
  818. mov si,[si].mHelpMsg
  819. mov bl,[NorAttr]
  820. mov dx,HelpPos
  821. call DispString
  822. ret
  823. ;------------------------
  824. RestoreScreen:
  825. mov al,[OrgMode]
  826. xor ah,ah
  827. int 10h
  828. ret
  829. ;------------------------
  830. KbdMenu:
  831. mov si,offset MenuSelect
  832. call ParsingKey
  833. ret
  834. ;------------------------
  835. KbdCode:
  836. mov si,offset MakeCode
  837. call ParsingKey
  838. ret
  839. ;------------------------
  840. KbdString:
  841. mov bh,al
  842. mov si,offset MakeString
  843. call ParsingKey
  844. jnc @f
  845. mov al,bh
  846. xor ah,ah ; CLC
  847. @@:
  848. ret
  849. ;------------------------
  850. ParsingKey:
  851. mov bl,ah
  852. @@:
  853. lodsw
  854. cmp ax,-1
  855. jz @f
  856. cmp al,bl
  857. jnz @b
  858. ret
  859. @@:
  860. stc
  861. ret
  862. ;------------------------
  863. Beep:
  864. mov ax,0e07h
  865. int 10h
  866. ret
  867. ;------------------------
  868. CursorControl:
  869. push dx
  870. xor bh,bh
  871. mov ah,3
  872. int 10h
  873. or ch,20h
  874. cmp [MenuPos],3-1
  875. jnz @f
  876. and ch,not 20h
  877. mov si,[MenuPos]
  878. shl si,1
  879. mov si,[si+MainTbl]
  880. mov dx,[si].mCurPos
  881. mov [CurPos],dx
  882. @@:
  883. mov ah,1
  884. int 10h
  885. pop dx
  886. ret
  887. ;------------------------
  888. DispString:
  889. mov cx,1
  890. xor bh,bh
  891. @@:
  892. mov ah,2
  893. int 10h
  894. lodsb
  895. cmp al,eom
  896. jz @f
  897. mov ah,9
  898. int 10h
  899. inc dl
  900. jmp short @b
  901. @@:
  902. ret
  903. CODE ENDS
  904. END Start
  905.