home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / egaf02.zip / EGAF.ASM next >
Assembly Source File  |  1989-11-11  |  58KB  |  2,138 lines

  1.         PAGE    60,75
  2.         TITLE   DRIVERS.ASM
  3.  
  4. ;       Modified DRIVERS module - Jim Kyle, 11-08-89
  5. ;       Based on EGA.OBJ which was in turn based on CLIPPER.LIB
  6. ;       Supports all CRT layouts for UltraVision (r), VGA, EGA
  7. ;
  8. ;       Does NOT change CRT layout at all; must be set before entry
  9. ;
  10. ;       Adds new functions __HOME and __BRC; HOME puts cursor at
  11. ;       0,0 while BRC puts it in bottom right corner of screen. No
  12. ;       value is returned from either.
  13. ;
  14. ;       Also adds functions _SET25, _SET28, _SET43, and _SET50 which reset
  15. ;       the CRT controllers for EGA/VGA cards to the corresponding
  16. ;       numbers of lines. CALL _SET43, for example, to set 43 lines
  17. ; ---------------
  18. ; rmb - 11-10-89:
  19. ;       on the EGA or the VGA, and _SET50 for 50 lines on the VGA.
  20. ; ---------------
  21. ;       These three functions all use video BIOS calls (1114, 1111,
  22. ;       and 1112, respectively) to assign new fonts and change the
  23. ;       screen size. DO NOT USE THESE if you are also using UltraVision;
  24. ;       they will fight each other!
  25.  
  26. _DATA   SEGMENT WORD PUBLIC 'DATA'
  27. _DATA   ENDS
  28.  
  29. DRIVERS_TEXT    SEGMENT BYTE PUBLIC 'CODE'
  30. DRIVERS_TEXT    ENDS
  31.  
  32. DGROUP  GROUP   _DATA
  33.  
  34.         PUBLIC  __COLORD, __NO_SNOW
  35.         PUBLIC  __ROWOFF, __COLOFF, __MAXROW, __MAXCOL
  36.         PUBLIC  __SFORE, __SBACK, __EFORE, __EBACK
  37.         PUBLIC  __XFORE, __XBACK, __BORDER, __BACK
  38.         PUBLIC  __SCRSIZE
  39.  
  40.         PUBLIC  __FKEYCNT, __IKEY, __LKEY, __IMODE
  41.         PUBLIC  __X121X, __PERROR, NROWS, NCOLS
  42.  
  43.         PUBLIC  __SINIT, __SEND, __SHANDLE, __SETDPTR, __SETWIN
  44.         PUBLIC  __COUT, __SOUT, __SETCURS, __GETCURS
  45.         PUBLIC  __SETCTYP, __GETCTYP,__SCROLL, __SBOX
  46.         PUBLIC  __SETSTD, __SETENH, __SETUNS, __SETATTR
  47.         PUBLIC  __CLREOL, __CLREOS, __CLRALL
  48.         PUBLIC  __SCRSAVE, __SCRREST, __WINSAVE, __WINREST
  49.  
  50.         PUBLIC  __KINIT, __KEND, __KHANDLE, __SETFKEY
  51.         PUBLIC  __SET_TA, __CCLR, __CSTAT, __CIN, __BRKSTAT
  52.  
  53.         PUBLIC  __PINIT, __PEND, __PHANDLE, __POUT, __HOME, __BRC
  54.         PUBLIC  _SET25, _SET28, _SET43, _SET50
  55. PAGE
  56. _DATA   SEGMENT
  57.         assume  CS : _DATA
  58.         assume  DS : DGROUP
  59.  
  60. __COLORD        dw      0               ; NZ if color card present
  61. __NO_SNOW       dw      0               ; NZ for nosnow actions
  62. __ROWOFF        dw      0               ; start of window
  63. __COLOFF        dw      0
  64. __MAXROW        dw      42              ; end of window
  65. __MAXCOL        dw      79
  66. __SFORE         dw      080h            ; color codes
  67. __SBACK         dw      040h
  68. __EFORE         dw      100h
  69. __EBACK         dw      040h
  70. __XFORE         dw      100h
  71. __XBACK         dw      040h
  72. __BORDER        dw      040h
  73. __BACK          dw      040h
  74. __SCRSIZE       dw      2*25*80         ; regen buffer size in bytes
  75.  
  76. DspHdl          dw      1               ; for redirecting input
  77. CurRow          dw      0               ; current cursor position
  78. CurCol          dw      0
  79. CurSor          dw      1               ; flag, 0 = cursor OFF, else ON
  80.                 dw      0
  81. VidBase         dw      0               ; for direct write, not used
  82.                 dw      0,0
  83. CurAtr          db      0               ; video attribute in force
  84.  
  85. __FKEYCNT       dw      40
  86. __IKEY          dw      0               ; current keystroke
  87. __LKEY          dw      0               ; LASTKEY() value
  88. __IMODE         dw      0               ; debugging flag???
  89. KbdHdl          dw      0               ; DOS handle for STDIN
  90.  
  91. StrLen          dw      0               ; len+far ptr to string for FKEY
  92. StrPtr          dd      0
  93.  
  94. KBfrSz          dw      0               ; size of KB Buffer
  95. KBfrPt          dd      0               ; far pointer to KB Buffer
  96.  
  97. KBGetP          dw      0               ; offsets within KB buffer
  98. KBPutP          dw      0
  99.  
  100. XTable          dw      DGROUP:Mode07           ; pointers to Xlate tables
  101.                 dw      DGROUP:KeyVals          ; (calc from __IMODE value)
  102.  
  103.                 dw      DGROUP:Mode168
  104.                 dw      DGROUP:KeyVals
  105.  
  106.                 dw      DGROUP:Mode168
  107.                 dw      DGROUP:KeyVals
  108.  
  109.                 dw      DGROUP:Mode168          ; menu mode ?
  110.                 dw      DGROUP:KeyVals
  111.  
  112.                 dw      DGROUP:Mode168
  113.                 dw      DGROUP:KeyVals
  114.  
  115.                 dw      DGROUP:Mode168
  116.                 dw      DGROUP:KeyVals
  117.  
  118.                 dw      DGROUP:Mode168
  119.                 dw      DGROUP:KeyVals
  120.  
  121.                 dw      DGROUP:Mode07
  122.                 dw      DGROUP:KeyVals
  123.  
  124.                 dw      DGROUP:Mode168
  125.                 dw      DGROUP:KeyVals
  126.  
  127. Mode07          db      1
  128.                 dw      0002            ; default return if not in table
  129.                 db      2
  130.                 dw      0013h, 0081h    ; Ctl-S
  131.                 db      2
  132.                 dw      0120h, 0083h    ; Alt-D
  133.                 db      2
  134.                 dw      012eh, 0080h    ; Alt-C
  135.                 db      0cdh            ; force default return
  136.  
  137. Mode168         db      1               ; action codes for keys...
  138.                 dw      0001            ; default return (ignore)
  139.                 db      2
  140.                 dw      0001h, 000Ch    ; Ctl-A         field left
  141.                 db      2
  142.                 dw      0002h, 0024h    ; Ctl-B
  143.                 db      2
  144.                 dw      0003h, 0021h    ; Ctl-C
  145.                 db      2
  146.                 dw      0004h, 0008h    ; Ctl-D         cursor right
  147.                 db      2
  148.                 dw      0005h, 000Fh    ; Ctl-E         cursor up
  149.                 db      2
  150.                 dw      0006h, 000Dh    ; Ctl-F         field right
  151.                 db      2
  152.                 dw      0007h, 0004h    ; Ctl-G
  153.                 db      2
  154.                 dw      0008h, 0003h    ; BkSpc
  155.                 db      2
  156.                 dw      0009h, 0025h    ; Tab
  157.                 db      2
  158.                 dw      000ah, 0010h    ; LF            cursor down
  159.                 db      2
  160.                 dw      000dh, 0006h    ; CR
  161.                 db      2
  162.                 dw      0012h, 0020h    ; Ctl-R
  163.                 db      2
  164.                 dw      0013h, 0007h    ; Ctl-S         cursor left
  165.                 db      2
  166.                 dw      0014h, 000Bh    ; Ctl-T
  167.                 db      2
  168.                 dw      0015h, 0005h    ; Ctl-U
  169.                 db      2
  170.                 dw      0016h, 0015h    ; Ctl-V         toggle INS
  171.                 db      2
  172.                 dw      0017h, 0013h    ; Ctl-W
  173.                 db      2
  174.                 dw      0018h, 0010h    ; Ctl-X         cursor down
  175.                 db      2
  176.                 dw      0019h, 000Eh    ; Ctl-Y
  177.                 db      2
  178.                 dw      001bh, 0014h    ; Esc
  179.                 db      3
  180.                 dw      0020h, 00ffh, 0002h     ; normal chars  (use)
  181.                 db      2
  182.                 dw      0120h, 0083     ; Alt-D
  183.                 db      2
  184.                 dw      012eh, 0080     ; Alt-C
  185.                 db      4
  186.                 dw      013bh, 0144h, 0ff4eh    ; F1-F10
  187.                 db      4
  188.                 dw      0154h, 0171h, 0ff3fh    ; F11-F40
  189.                 db      2
  190.                 dw      0147h, 0009h    ; Home
  191.                 db      2
  192.                 dw      0148h, 000Fh    ; Up
  193.                 db      2
  194.                 dw      0149h, 0020h    ; PgUp
  195.                 db      2
  196.                 dw      014bh, 0007h    ; Left
  197.                 db      2
  198.                 dw      014dh, 0008h    ; Right
  199.                 db      2
  200.                 dw      014fh, 000Ah    ; End
  201.                 db      2
  202.                 dw      0150h, 0010h    ; Down
  203.                 db      2
  204.                 dw      0151h, 0021h    ; PgDn
  205.                 db      2
  206.                 dw      0152h, 0015h    ; Ins
  207.                 db      2
  208.                 dw      0153h, 0004h    ; Del
  209.                 db      2
  210.                 dw      0173h, 000Ch    ; C-Left
  211.                 db      2
  212.                 dw      0174h, 000Dh    ; C-Right
  213.                 db      2
  214.                 dw      0175h, 0012h    ; C-End
  215.                 db      2
  216.                 dw      0176h, 0023h    ; C-PgDn
  217.                 db      2
  218.                 dw      0177h, 0011h    ; C-Home
  219.                 db      2
  220.                 dw      0184h, 0022h    ; C-PgUp
  221.                 db      0cdh
  222.  
  223. KeyVals         db      2
  224.                 dw      013bh, 001ch            ; F1            28
  225.                 db      5
  226.                 dw      013ch, 0144h, 0ffffh    ; F2-F10        -1 -9
  227.                 db      5
  228.                 dw      0154h, 0171h, 0fff6h    ; F11-F40      -10 -39
  229.                 db      2
  230.                 dw      0147h, 0001h            ; Home           1
  231.                 db      2
  232.                 dw      0148h, 0005h            ; Up             5
  233.                 db      2
  234.                 dw      0149h, 0012h            ; PgUp          18
  235.                 db      2
  236.                 dw      014bh, 0013h            ; Left          19
  237.                 db      2
  238.                 dw      014dh, 0004h            ; Right          4
  239.                 db      2
  240.                 dw      014fh, 0006h            ; End            6
  241.                 db      2
  242.                 dw      0150h, 0018h            ; Down          24
  243.                 db      2
  244.                 dw      0151h, 0003h            ; PgDn           3
  245.                 db      2
  246.                 dw      0152h, 0016h            ; Ins           22
  247.                 db      2
  248.                 dw      0153h, 0007h            ; Del            7
  249.                 db      2
  250.                 dw      0173h, 001ah            ; C-Left        26
  251.                 db      2
  252.                 dw      0174h, 0002h            ; C-Right        2
  253.                 db      2
  254.                 dw      0175h, 0017h            ; C-End         23
  255.                 db      2
  256.                 dw      0176h, 001eh            ; C-PgDn        30
  257.                 db      2
  258.                 dw      0177h, 001dh            ; C-Home        29
  259.                 db      2
  260.                 dw      0184h, 001fh            ; C-PgUp        31
  261.                 db      0cdh
  262.  
  263. __X121X         dw      0
  264. __PERROR        dw      0
  265. PrtHdl          dw      4
  266. PrtDev          dw      1
  267. nRows           db      25              ; added jk - abs max rows
  268. nCols           db      80              ; added jk - abs max cols
  269.  
  270. _DATA   ENDS
  271. PAGE
  272. DRIVERS_TEXT    SEGMENT
  273.         assume  CS : DRIVERS_TEXT
  274.         assume  DS : DGROUP
  275.  
  276. SetMode proc    near            ; used only by __SINIT
  277.         push    bp
  278.         mov     al,003h         ; set text mode
  279.         int     010h
  280. ;       mov     ax,01112h       ; set 8x8 ROM font (43-line)
  281. ;       mov     bl,000h
  282. ;       int     010h
  283.         pop     bp
  284.         ret
  285. SetMode endp
  286.  
  287. PutChar proc    near
  288.         push    es
  289.         push    si
  290.         push    ax
  291.         push    bx
  292.         push    cx
  293.         push    dx
  294.         mov     bl,byte ptr CurAtr
  295.         xor     bh,bh                   ; display page 0
  296.         mov     cx,00001h               ; one character
  297.         mov     ah,009h                 ; write C+A via BIOS
  298.         int     010h
  299.         pop     dx
  300.         pop     cx
  301.         pop     bx
  302.         pop     ax
  303.         pop     si
  304.         pop     es
  305.         ret
  306. PutChar endp
  307.  
  308. AdvCrsr proc    near
  309.         push    ax
  310.         push    bx
  311.         push    cx
  312.         push    dx
  313.         mov     dh,byte ptr CurRow
  314.         mov     dl,byte ptr CurCol
  315.         inc     dl
  316.         cmp     dl,byte ptr __MAXCOL
  317.         jna     $L13
  318.         xor     dl,dl
  319.         inc     dh
  320.         cmp     dh,byte ptr __MAXROW
  321.         jna     $L13
  322.         call    ScrolUp
  323.         mov     dh,byte ptr __MAXROW
  324. $L13:   mov     byte ptr CurRow,dh
  325.         mov     byte ptr CurCol,dl
  326.         add     dh,byte ptr __ROWOFF
  327.         add     dl,byte ptr __COLOFF
  328.         xor     bx,bx
  329.         mov     ah,002h                 ; update cursor via BIOS
  330.         int     010h
  331.         pop     dx
  332.         pop     cx
  333.         pop     bx
  334.         pop     ax
  335.         ret
  336. AdvCrsr endp
  337.  
  338. DoChar  proc    near                    ; output char and step cursor
  339.         call    PutChar
  340.         call    AdvCrsr
  341.         ret
  342. DoChar  endp
  343.  
  344. Beep    proc    near                    ; sound the bell via BIOS
  345.         push    es
  346.         push    si
  347.         push    cx
  348.         mov     al,007h
  349.         mov     ah,00Eh
  350.         int     010h
  351.         pop     cx
  352.         pop     si
  353.         pop     es
  354.         ret
  355. Beep    endp
  356.  
  357. BkSp    proc    near                    ; backspace unless at top
  358.         push    es
  359.         push    si
  360.         push    ax
  361.         push    bx
  362.         push    cx
  363.         push    dx
  364.         mov     dh,byte ptr CurRow      ; check position
  365.         mov     dl,byte ptr CurCol
  366.         test    dx,0FFFFh
  367.         jz      BKSpNo                  ; at top, ignore
  368.         dec     dl
  369.         jns     BksRow                  ; not at front
  370.         mov     dl,byte ptr __MAXCOL    ; at front, wrap
  371.         dec     dh                      ;   to line above
  372. BksRow: mov     byte ptr CurRow,dh
  373.         mov     byte ptr CurCol,dl
  374.         call    PutCur
  375.         mov     al,' '                  ; blank out char
  376.         call    PutChar
  377. BKSpNo: pop     dx
  378.         pop     cx
  379.         pop     bx
  380.         pop     ax
  381.         pop     si
  382.         pop     es
  383.         ret
  384. BkSp    endp
  385.  
  386. LnFd:   push    es
  387.         push    si
  388.         push    ax
  389.         push    bx
  390.         push    cx
  391.         push    dx
  392.         mov     dh,byte ptr CurRow
  393.         mov     dl,byte ptr CurCol
  394.         inc     dh
  395.         cmp     dh,byte ptr __MAXROW
  396.         jna     LnFdOK
  397.         call    ScrolUp
  398.         mov     dh,byte ptr __MAXROW
  399. LnFdOK: mov     byte ptr CurRow,dh
  400.         add     dh,byte ptr __ROWOFF
  401.         add     dl,byte ptr __COLOFF
  402.         xor     bx,bx
  403.         mov     ah,002h
  404.         int     010h
  405.         pop     dx
  406.         pop     cx
  407.         pop     bx
  408.         pop     ax
  409.         pop     si
  410.         pop     es
  411.         ret
  412.  
  413.  
  414. CaRt:   push    es
  415.         push    si
  416.         push    ax
  417.         push    bx
  418.         push    cx
  419.         push    dx
  420.         mov     word ptr CurCol,00000h
  421.         mov     dh,byte ptr CurRow
  422.         mov     dl,byte ptr CurCol
  423.         add     dh,byte ptr __ROWOFF
  424.         add     dl,byte ptr __COLOFF
  425.         xor     bx,bx
  426.         mov     ah,002h
  427.         int     010h
  428.         pop     dx
  429.         pop     cx
  430.         pop     bx
  431.         pop     ax
  432.         pop     si
  433.         pop     es
  434.         ret
  435.  
  436. ChkLim  proc    near                    ; check CX against DX and MaxLim
  437.         cmp     ch,nRows                ; return CY if out of range
  438.         jnc     NoGo                    ; DX = window limit
  439.         cmp     cl,nCols                ; CX = trial cursor r,c
  440.         jnc     NoGo
  441.         cmp     dh,nRows
  442.         jnc     NoGo
  443.         cmp     dl,nCols
  444.         jnc     NoGo
  445.         cmp     ch,dh
  446.         jnc     NoGo
  447.         cmp     cl,dl
  448. NoGo:   cmc
  449.         ret
  450. ChkLim  endp
  451.  
  452. AddBot: push    es
  453.         push    si
  454.         push    ax
  455.         push    bx
  456.         push    cx
  457.         push    dx
  458.         call    ChkLim                  ; test for validity
  459.         jc      $L24                    ; out of bounds, ignore
  460.         mov     al,001h                 ; in bounds, scroll up by 1
  461.         mov     bh,byte ptr CurAtr
  462.         mov     bl,bh
  463.         mov     ah,006h
  464.         int     010h
  465. $L24:   pop     dx
  466.         pop     cx
  467.         pop     bx
  468.         pop     ax
  469.         pop     si
  470.         pop     es
  471.         ret
  472.  
  473. AddTop: push    es
  474.         push    si
  475.         push    ax
  476.         push    bx
  477.         push    cx
  478.         push    dx
  479.         call    ChkLim
  480.         jc      $L25
  481.         mov     al,001h
  482.         mov     bh,byte ptr CurAtr
  483.         mov     bl,bh
  484.         mov     ah,007h
  485.         int     010h
  486. $L25:   pop     dx
  487.         pop     cx
  488.         pop     bx
  489.         pop     ax
  490.         pop     si
  491.         pop     es
  492.         ret
  493.  
  494. AddNew: push    es
  495.         push    si
  496.         push    ax
  497.         push    bx
  498.         push    cx
  499.         push    dx
  500.         call    ChkLim
  501.         jc      $L26
  502.         mov     al,nRows                ; for faster clearing - jk
  503.         mov     bh,byte ptr CurAtr
  504.         mov     bl,bh
  505.         mov     ah,006h
  506.         int     010h
  507. $L26:   pop     dx
  508.         pop     cx
  509.         pop     bx
  510.         pop     ax
  511.         pop     si
  512.         pop     es
  513.         ret
  514.  
  515. GetLim: mov     ch,byte ptr __ROWOFF    ; TLC of window
  516.         mov     cl,byte ptr __COLOFF
  517.         mov     dh,byte ptr __MAXROW    ; BRC rel to window
  518.         mov     dl,byte ptr __MAXCOL
  519.         add     dh,ch
  520.         add     dl,cl
  521.         ret                             ; DX = real BRC
  522.  
  523. ScrolUp proc    near
  524.         push    cx
  525.         push    dx
  526.         call    GetLim
  527.         call    AddBot
  528.         pop     dx
  529.         pop     cx
  530.         ret
  531. ScrolUp endp
  532.  
  533. ScrolDn proc    near                    ; not called!
  534.         push    cx
  535.         push    dx
  536.         call    GetLim
  537.         call    AddTop
  538.         pop     dx
  539.         pop     cx
  540.         ret
  541. ScrolDn endp
  542.  
  543. ClrScr  proc    near
  544.         push    cx
  545.         push    dx
  546.         call    GetLim
  547.         call    AddNew
  548.         pop     dx
  549.         pop     cx
  550.         ret
  551. ClrScr  endp
  552.  
  553. OutStr: push    es
  554.         push    si
  555.         push    ax
  556.         push    bx
  557.         push    dx
  558.         mov     si,__MAXROW
  559.         mov     di,__MAXCOL
  560.         mov     bx,cx
  561. $L33:   mov     dh,byte ptr CurRow
  562.         add     dh,byte ptr __ROWOFF
  563.         mov     dl,byte ptr CurCol
  564.         add     dl,byte ptr __COLOFF
  565.         mov     cx,di
  566.         sub     cx,CurCol
  567.         inc     cx
  568.         cmp     cx,bx
  569.         jnc     $L31
  570.         sub     bx,cx
  571.         push    bx
  572.         push    ax
  573.         xor     bx,bx
  574.         mov     ah,002h
  575.         int     010h
  576.         mov     bl,byte ptr CurAtr
  577.         xor     bh,bh
  578.         pop     ax
  579.         push    ax
  580.         mov     ah,009h
  581.         int     010h
  582.         pop     ax
  583.         pop     bx
  584.         mov     CurCol,00000h
  585.         cmp     CurRow,si
  586.         jnc     OTSEnd
  587.         inc     CurRow
  588.         jmp     short $L33
  589. $L31:   mov     cx,bx
  590.         add     CurCol,cx
  591.         push    ax
  592.         xor     bx,bx
  593.         mov     ah,002h
  594.         int     010h
  595.         mov     bl,byte ptr CurAtr
  596.         xor     bh,bh
  597.         pop     ax
  598.         mov     ah,009h
  599.         int     010h
  600.         cmp     CurCol,di               ; current col past limit?
  601.         jna     OTSEnd                  ; no
  602.         mov     CurCol,00000h           ; yes, do CR
  603.         cmp     CurRow,si               ; on last row?
  604.         jnc     OTSEnd                  ; yes, just wrap, no scroll
  605.         inc     CurRow                  ; no, move to next
  606. OTSEnd: mov     dh,byte ptr CurRow      ; update cursor position
  607.         mov     dl,byte ptr CurCol
  608.         call    PutCur
  609.         pop     dx
  610.         pop     bx
  611.         pop     ax
  612.         pop     si
  613.         pop     es
  614.         ret
  615.  
  616. __SINIT proc    far
  617.         push    bp
  618.         push    si
  619.         push    di
  620.         mov     bp,sp
  621.         int     011h
  622.         mov     __COLORD,0
  623.         mov     bx,0B000h
  624.         and     ax,30h
  625.         cmp     ax,30h
  626.         je      init1
  627.         mov     __COLORD,1
  628.         mov     bx,0B800h
  629. ;       call    SetMode         ; set BIOS mode to 3 for text if color
  630. init1:  mov     VidBase,bx
  631. ;       xor     bx,bx           ; get cursor position, not needed
  632. ;       mov     ah,003h
  633. ;       int     010h
  634.         xor     ax,ax           ; set cursor to HOME position
  635.         mov     bx,ax
  636. ;       mov     al,dh
  637. ;       mov     bl,dl
  638.         mov     CurRow,ax
  639.         mov     CurCol,bx
  640.         call    FAR PTR __SETSTD
  641.         mov     ax,1130h        ; now get row, col max values
  642.         xor     dx,dx
  643.         int     10h
  644.         or      dl,dl
  645.         jnz     init2
  646.         mov     dl,24
  647. init2:  mov     byte ptr __MAXROW,dl
  648.         inc     dl
  649.         mov     nrows,dl
  650.         push    dx
  651.         mov     ah,0fh
  652.         int     10h
  653.         mov     ncols,ah
  654.         mov     al,ah
  655.         dec     ah
  656.         mov     byte ptr __MAXCOL,ah
  657.         pop     bx
  658.         mul     bl              ; calc buffer size
  659.         add     ax,ax
  660.         mov     __SCRSIZE,ax
  661.         pop     di
  662.         pop     si
  663.         pop     bp
  664.         ret
  665. __SINIT endp
  666.  
  667. __SEND  proc    far             ; jk 11-01-89
  668.         ret
  669. __SEND  endp
  670.  
  671. __SHANDLE proc  far
  672.         push    bp
  673.         push    si
  674.         push    di
  675.         mov     bp,sp
  676.         mov     ax,word ptr [bp+00Ah]
  677.         mov     DspHdl,ax
  678.         pop     di
  679.         pop     si
  680.         pop     bp
  681.         ret
  682. __SHANDLE endp
  683.  
  684. __SETDPTR proc  far
  685.         ret                     ; jk 11-01-89
  686. __SETDPTR endp
  687.  
  688. __SETWIN proc   far
  689.         push    bp
  690.         push    si
  691.         push    di
  692.         mov     bp,sp
  693.         mov     ch,byte ptr [bp+00Ah]
  694.         mov     cl,byte ptr [bp+00Ch]
  695.         mov     dh,byte ptr [bp+00Eh]
  696.         mov     dl,byte ptr [bp+010h]
  697.         mov     ax,cx
  698.         or      ax,dx
  699.         jnz     $L38
  700.         mov     dh,nRows        ; default to entire screen
  701.         mov     dl,nCols
  702.         sub     dx,0101h
  703. $L38:   call    ChkLim
  704.         jc      $L39            ; bigger than screen, ignore
  705.         sub     dh,ch
  706.         sub     dl,cl
  707.         mov     ax,CurRow
  708.         mov     bx,CurCol
  709.         add     ax,__ROWOFF
  710.         add     bx,__COLOFF
  711.         mov     byte ptr __ROWOFF,ch
  712.         mov     byte ptr __COLOFF,cl
  713.         mov     byte ptr __MAXROW,dh
  714.         mov     byte ptr __MAXCOL,dl
  715.         sub     ax,__ROWOFF
  716.         js      $L40
  717.         sub     bx,__COLOFF
  718.         js      $L40
  719.         cmp     ax,__MAXROW
  720.         ja      $L40
  721.         cmp     bx,__MAXCOL
  722.         ja      $L40
  723.         mov     CurRow,ax
  724.         mov     CurCol,bx
  725.         jmp     short $L39
  726. $L40:   push    ax
  727.         mov     ax,00000h
  728.         push    bp
  729.         mov     bp,sp
  730.         xchg    ax,word ptr [bp+002h]
  731.         pop     bp
  732.         push    ax
  733.         mov     ax,00000h
  734.         push    bp
  735.         mov     bp,sp
  736.         xchg    ax,word ptr [bp+002h]
  737.         pop     bp
  738.         call    FAR PTR __SETCURS
  739.         add     sp,+004h
  740. $L39:   pop     di
  741.         pop     si
  742.         pop     bp
  743.         ret
  744. __SETWIN endp
  745.  
  746. __COUT  proc   far
  747.         push    bp
  748.         push    si
  749.         push    di
  750.         mov     bp,sp
  751.         mov     cx,word ptr [bp+00Eh]   ; length of string
  752.         jcxz    $L41
  753.         les     si,[bp+00Ah]    ; far pointer to string
  754.  
  755. $L44:   push    cx
  756.         lods    byte ptr es:[si]
  757.         cmp     al,020h         ; Ctrl char?
  758.         ja      $L49            ; no, send it out
  759.         cmp     al,008h         ; yes, test for actions
  760.         jne     $L46
  761.         call    BkSp
  762.         jmp     short $L51      ; then close the loop
  763. $L46:   cmp     al,00Dh
  764.         jne     $L47
  765.         call    CaRt
  766.         jmp     short $L51
  767. $L47:   cmp     al,00Ah
  768.         jne     $L48
  769.         call    LnFd
  770.         jmp     short $L51
  771. $L48:   cmp     al,007h
  772.         jne     $L49
  773.         call    Beep
  774.         jmp     short $L51
  775. $L49:   call    DoChar          ; send the character
  776. $L51:   pop     cx
  777.         loop    $L44
  778.  
  779. $L41:   pop     di
  780.         pop     si
  781.         pop     bp
  782.         ret
  783. __COUT  endp
  784.  
  785. __SOUT  proc    far
  786.         push    bp
  787.         push    si
  788.         push    di
  789.         mov     bp,sp
  790.         mov     cx,[bp+00Eh]    ; count
  791.         jcxz    $L55
  792.         les     si,[bp+00Ah]    ; pointer to string
  793.         mov     bx,__MAXCOL
  794.         mov     dx,__MAXROW
  795.  
  796. $L57:   lods    byte ptr es:[si]
  797.         call    PutChar
  798.         cmp     CurCol,bx
  799.         jc      $L56
  800.         cmp     CurRow,dx
  801.         jnc     $L55
  802. $L56:   call    AdvCrsr
  803.         loop    $L57
  804.  
  805. $L55:   pop     di
  806.         pop     si
  807.         pop     bp
  808.         ret
  809. __SOUT  endp
  810.  
  811. __SETCURS proc   far            ; CALL __setcurs WITH row, col
  812.         push    bp
  813.         push    si
  814.         push    di
  815.         mov     bp,sp
  816.         mov     ax,[bp+00Ah]    ; get new row value
  817.         cmp     ax,__MAXROW     ; test against window
  818.         ja      $L58            ; out of range, ignore
  819.         mov     bx,[bp+00Ch]    ; get new col value
  820.         cmp     bx,__MAXCOL     ; test against window
  821.         ja      $L58            ; out of range, ignore
  822.         mov     CurRow,ax       ; in range, set as current
  823.         mov     CurCol,bx
  824.         add     ax,__ROWOFF     ; adjust to real values
  825.         add     bx,__COLOFF
  826.         mov     dh,al           ; set up for BIOS call
  827.         mov     dl,bl
  828.         xor     bx,bx
  829.         mov     ah,002h         ; and put it there
  830.         int     010h
  831. $L58:   pop     di
  832.         pop     si
  833.         pop     bp
  834.         ret
  835. __SETCURS endp
  836.  
  837. __GETCURS  proc   far
  838.         push    bp
  839.         push    si
  840.         push    di
  841.         mov     bp,sp
  842.         mov     ah,byte ptr CurRow
  843.         mov     al,byte ptr CurCol
  844.         pop     di
  845.         pop     si
  846.         pop     bp
  847.         ret
  848. __GETCURS  endp
  849.  
  850. __SETCTYP proc   far
  851.         push    bp
  852.         push    si
  853.         push    di
  854.         mov     bp,sp
  855.         mov     ax,word ptr [bp+00Ah]
  856.         mov     word ptr CurSor,ax
  857.         mov     cx,02607h
  858.         test    word ptr [bp+00Ah],0FFFFh
  859.         jz      $L60
  860.         mov     cx,00B0Ch
  861.         test    word ptr __COLORD,0FFFFh
  862.         jz      $L60
  863.         mov     cx,00607h
  864. $L60:   mov     ah,001h
  865.         int     010h
  866.         pop     di
  867.         pop     si
  868.         pop     bp
  869.         ret
  870. __SETCTYP endp
  871.  
  872. __GETCTYP proc   far
  873.         push    bp
  874.         push    si
  875.         push    di
  876.         mov     bp,sp
  877.         mov     ax,word ptr CurSor
  878.         pop     di
  879.         pop     si
  880.         pop     bp
  881.         ret
  882. __GETCTYP endp
  883.  
  884. __SCROLL proc   far
  885.         push    bp
  886.         push    si
  887.         push    di
  888.         mov     bp,sp
  889.         mov     ch,byte ptr [bp+00Ah]   ; top
  890.         mov     cl,byte ptr [bp+00Ch]   ; left
  891.         mov     dh,byte ptr [bp+00Eh]   ; bottom
  892.         mov     dl,byte ptr [bp+010h]   ; right
  893.         add     ch,byte ptr __ROWOFF
  894.         add     dh,byte ptr __ROWOFF
  895.         add     cl,byte ptr __COLOFF
  896.         add     dl,byte ptr __COLOFF
  897.         mov     ax,[bp+012h]            ; number of rows
  898.         test    ax,ax
  899.         jz      $L61
  900.         jns     $L62
  901.         neg     ax
  902. $L63:   call    AddTop
  903.         dec     ax
  904.         jnz     $L63
  905.         jmp     short $L64
  906. $L62:   call    AddBot
  907.         dec     ax
  908.         jnz     $L62
  909.         jmp     short $L64
  910. $L61:   call    AddNew
  911. $L64:   pop     di
  912.         pop     si
  913.         pop     bp
  914.         ret
  915. __SCROLL endp
  916.  
  917. PutCur: push    es
  918.         push    si
  919.         push    dx
  920.         push    cx
  921.         push    bx
  922.         push    ax
  923.         mov     al,dh
  924.         xor     dh,dh
  925.         push    dx
  926.         push    ax
  927.         call    __SETCURS
  928.         add     sp,+004h
  929.         pop     ax
  930.         pop     bx
  931.         pop     cx
  932.         pop     dx
  933.         pop     si
  934.         pop     es
  935.         ret
  936.  
  937. GtBxCh: lods    byte ptr es:[si]
  938.         or      al,al
  939.         jnz     $L67
  940.         dec     si
  941.         or      bl,bl
  942.         jnz     $L66
  943.         mov     al,' '          ; default to blank
  944.         jmp     short $L67
  945. $L66:   cmp     bh,008h
  946.         jnc     $L67
  947.         mov     al,byte ptr es:[si-001h]
  948. $L67:   inc     bh
  949.         ret
  950.  
  951. __SBOX  proc   far
  952.         push    bp
  953.         push    si
  954.         push    di
  955.         mov     bp,sp
  956.         cld
  957.         mov     ax,[bp+00Eh]
  958.         cmp     ax,__MAXROW
  959.         ja      $L68                    ; bottom is out of bounds
  960.         mov     ax,[bp+010h]
  961.         cmp     ax,__MAXCOL
  962.         ja      $L68                    ; right is out of bounds
  963.         mov     ax,[bp+00Ah]
  964.         cmp     ax,[bp+00Eh]
  965.         ja      $L68                    ; top below bottom
  966.         mov     ax,[bp+00Ch]
  967.         cmp     ax,[bp+010h]
  968.         jna     $L69                    ; left to left of right
  969. $L68:   jmp     $S70
  970. $L69:   les     si,[bp+012h]            ; get ptr to string
  971.         xor     bx,bx
  972. $L72:   cmp     byte ptr es:[bx+si],000h
  973.         jz      $L71                    ; end of string
  974.         inc     bl                      ; count string length
  975.         jmp     $L72
  976. $L71:   mov     dh,byte ptr [bp+00Ah]   ; position to top
  977.         mov     dl,byte ptr [bp+00Ch]   ; and left
  978.         mov     byte ptr CurRow,dh
  979.         mov     byte ptr CurCol,dl
  980.         call    PutCur
  981.         mov     cx,[bp+010h]            ; get right
  982.         sub     cl,dl                   ; calc width
  983.         dec     cx
  984.         call    GtBxCh                  ; get first box char
  985.         push    ax
  986.         mov     ax,[bp+00Ah]
  987.         cmp     ax,[bp+00Eh]
  988.         pop     ax
  989.         jnz     $L74                    ; top <> bottom
  990.         inc     cx                      ; were same, skip top
  991.         inc     cx
  992.         jmp     short $L75
  993. $L74:   push    ax                      ; save top
  994.         mov     ax,[bp+010h]            ; compare cols
  995.         cmp     ax,[bp+00Ch]
  996.         pop     ax
  997.         jz      $L75                    ; right == left
  998.         push    cx
  999.         mov     cx,00001h
  1000.         call    OutStr                  ; put TLC char
  1001.         pop     cx
  1002. $L75:   call    GtBxCh                  ; get top line char
  1003.         or      cx,cx
  1004.         jng     $L77
  1005.         call    OutStr                  ; put top line
  1006. $L77:   call    GtBxCh                  ; get third char
  1007.         or      cx,cx
  1008.         mov     cx,[bp+00Eh]
  1009.         jl      $L78
  1010.         cmp     cx,[bp+00Ah]
  1011.         jnz     $L79
  1012.         jmp     $S80                    ; don't draw
  1013. $L79:   push    cx
  1014.         mov     cx,00001h
  1015.         call    OutStr                  ; put TRC char
  1016.         pop     cx
  1017. $L78:   mov     dh,byte ptr [bp+00Ah]   ; calc right side size
  1018.         mov     dl,byte ptr [bp+010h]
  1019.         sub     cx,[bp+00Ah]
  1020.         dec     cx
  1021.         call    GtBxCh                  ; get the char
  1022.         push    ax
  1023.         mov     ax,[bp+010h]
  1024.         cmp     ax,[bp+00Ch]
  1025.         pop     ax
  1026.         jnz     $L81                    ; right <> left
  1027.         inc     cx
  1028.         push    cx
  1029.         mov     cx,00001h
  1030.         call    OutStr
  1031.         pop     cx
  1032. $L81:   jcxz    $L82                    ; no count
  1033. $L83:   inc     dh                      ; draw vertical line
  1034.         inc     CurRow
  1035.         dec     CurCol
  1036.         call    PutCur
  1037.         push    cx
  1038.         mov     cx,00001h
  1039.         call    OutStr
  1040.         pop     cx
  1041.         loop    $L83
  1042. $L82:   inc     dh                      ; now do bottom
  1043.         inc     CurRow
  1044.         call    GtBxCh
  1045.         push    ax
  1046.         mov     ax,[bp+010h]
  1047.         cmp     ax,[bp+00Ch]
  1048.         pop     ax
  1049.         ja      $L84            ; ??????
  1050.         jmp     $S80
  1051. $L84:   dec     CurCol
  1052.         call    PutCur
  1053.         mov     cx,00001h
  1054.         call    OutStr
  1055.         call    GtBxCh
  1056.         mov     cx,[bp+010h]
  1057.         sub     cx,[bp+00Ch]
  1058.         mov     dl,byte ptr [bp+00Ch]
  1059.         inc     dl
  1060.         mov     byte ptr CurCol,dl
  1061.         call    PutCur
  1062.         dec     cx
  1063.         jcxz    $L85
  1064.         call    OutStr
  1065. $L85:   call    GtBxCh
  1066.         dec     dl
  1067.         mov     byte ptr CurCol,dl
  1068.         call    PutCur
  1069.         mov     cx,00001h
  1070.         call    OutStr
  1071.         call    GtBxCh
  1072.         mov     cx,[bp+00Eh]
  1073.         sub     cx,[bp+00Ah]
  1074.         dec     cx
  1075.         jcxz    $L86
  1076. $L87:   dec     dh                      ; do left vertical
  1077.         dec     CurRow
  1078.         dec     CurCol
  1079.         call    PutCur
  1080.         push    cx
  1081.         mov     cx,00001h
  1082.         call    OutStr
  1083.         pop     cx
  1084.         loop    $L87
  1085. $L86:   call    GtBxCh                  ; fill interior
  1086.         or      al,al
  1087.         jz      $S80
  1088.         mov     bx,[bp+00Eh]
  1089.         sub     bx,[bp+00Ah]
  1090.         dec     bx
  1091.         or      bx,bx
  1092.         jz      $S80
  1093.         mov     cx,[bp+010h]
  1094.         sub     cx,[bp+00Ch]
  1095.         dec     cx
  1096.         jcxz    $S80
  1097.         inc     dl
  1098. $L88:   push    cx
  1099.         call    OutStr
  1100.         inc     dh
  1101.         inc     CurRow
  1102.         call    PutCur
  1103.         pop     cx
  1104.         dec     bx
  1105.         jnz     $L88
  1106. $S80:   mov     dh,byte ptr [bp+00Ah]   ; set cursor to TLC
  1107.         inc     dh
  1108.         mov     byte ptr CurRow,dh
  1109.         mov     dl,byte ptr [bp+00Ch]
  1110.         inc     dl
  1111.         mov     byte ptr CurCol,dl
  1112.         call    PutCur
  1113. $S70:   pop     di
  1114.         pop     si
  1115.         pop     bp
  1116.         ret
  1117. __SBOX  endp
  1118.  
  1119. DoColr: xor     dl,dl
  1120.         mov     cx,ax
  1121.         or      cx,bx
  1122.         test    cx,08000h
  1123.         jnz     $L89
  1124.         test    cx,00010h
  1125.         jz      $L90
  1126.         or      dl,080h
  1127. $L90:   test    cx,00008h
  1128.         jz      $L91
  1129.         or      dl,008h
  1130. $L91:   test    __COLORD,0FFFFh
  1131.         jnz     $L92
  1132.         test    cx,00020h
  1133.         jz      $L92
  1134.         or      dl,001h
  1135. $L92:   test    ax,00080h
  1136.         jz      $L93
  1137.         or      ax,00007h
  1138. $L93:   test    bx,00080h
  1139.         jz      $L94
  1140.         or      bx,+007h
  1141. $L94:   test    cx,00100h
  1142.         jz      $L95
  1143.         test    bx,00007h
  1144.         jnz     $L95
  1145.         or      bx,+007h
  1146. $L95:   test    cx,00200h
  1147.         jz      $L89
  1148.         xor     ax,ax
  1149.         mov     bx,ax
  1150.         mov     dl,al
  1151. $L89:   mov     cl,004h
  1152.         shl     bl,CL
  1153.         or      dl,bl
  1154.         and     al,00Fh
  1155.         or      dl,al
  1156.         mov     byte ptr CurAtr,dl
  1157.         test    __COLORD,0FFFFh
  1158.         jz      $L96
  1159.         mov     ax,__BORDER
  1160.         test    ax,00080h
  1161.         jz      $L97
  1162.         or      ax,00007h
  1163. $L97:   and     ax,0000Fh
  1164.         mov     dx,003D9h
  1165.         out     dx,al
  1166. $L96:   ret
  1167.  
  1168. __SETSTD proc   far
  1169.         push    bp
  1170.         push    si
  1171.         push    di
  1172.         mov     bp,sp
  1173.         mov     ax,__SFORE
  1174.         mov     bx,__SBACK
  1175.         call    DoColr
  1176.         pop     di
  1177.         pop     si
  1178.         pop     bp
  1179.         ret
  1180. __SETSTD endp
  1181.  
  1182. __SETENH proc   far
  1183.         push    bp
  1184.         push    si
  1185.         push    di
  1186.         mov     bp,sp
  1187.         mov     ax,__EFORE
  1188.         mov     bx,__EBACK
  1189.         call    DoColr
  1190.         pop     di
  1191.         pop     si
  1192.         pop     bp
  1193.         ret
  1194. __SETENH endp
  1195.  
  1196. __SETUNS proc   far
  1197.         push    bp
  1198.         push    si
  1199.         push    di
  1200.         mov     bp,sp
  1201.         mov     ax,__XFORE
  1202.         mov     bx,__XBACK
  1203.         call    DoColr
  1204.         pop     di
  1205.         pop     si
  1206.         pop     bp
  1207.         ret
  1208. __SETUNS endp
  1209.  
  1210. __SETATTR proc   far
  1211.         push    bp
  1212.         push    si
  1213.         push    di
  1214.         mov     bp,sp
  1215.         mov     ax,[bp+00Ah]
  1216.         or      ax,[bp+00Ch]
  1217.         or      ax,[bp+00Eh]
  1218.         or      ax,[bp+010h]
  1219.         or      ax,[bp+012h]
  1220.         or      ax,[bp+014h]
  1221.         or      ax,[bp+016h]
  1222.         or      ax,[bp+018h]
  1223.         jnz     $L99
  1224.         mov     ax,00080h
  1225.         mov     __SFORE,ax
  1226.         mov     ax,00040h
  1227.         mov     __SBACK,ax
  1228.         mov     ax,00100h
  1229.         mov     __EFORE,ax
  1230.         mov     ax,00040h
  1231.         mov     __EBACK,ax
  1232.         mov     ax,00100h
  1233.         mov     __XFORE,ax
  1234.         mov     ax,00040h
  1235.         mov     __XBACK,ax
  1236.         mov     ax,00040h
  1237.         mov     __BORDER,ax
  1238.         mov     ax,00040h
  1239.         mov     __BACK,ax
  1240.         jmp     short $L100
  1241.  
  1242. $L99:   mov     ax,[bp+00Ah]
  1243.         or      ax,[bp+00Ch]
  1244.         jz      $L101
  1245.         mov     ax,[bp+00Ah]
  1246.         mov     __SFORE,ax
  1247.         mov     ax,[bp+00Ch]
  1248.         mov     __SBACK,ax
  1249. $L101:  mov     ax,[bp+00Eh]
  1250.         or      ax,[bp+010h]
  1251.         jz      $L102
  1252.         mov     ax,[bp+00Eh]
  1253.         mov     __EFORE,ax
  1254.         mov     ax,[bp+010h]
  1255.         mov     __EBACK,ax
  1256. $L102:  mov     ax,[bp+012h]
  1257.         or      ax,[bp+014h]
  1258.         jz      $L103
  1259.         mov     ax,[bp+012h]
  1260.         mov     __XFORE,ax
  1261.         mov     ax,[bp+014h]
  1262.         mov     __XBACK,ax
  1263. $L103:  mov     ax,[bp+016h]
  1264.         or      ax,ax
  1265.         jz      $L104
  1266.         mov     __BORDER,ax
  1267. $L104:  mov     ax,[bp+018h]
  1268.         or      ax,ax
  1269.         jz      $L100
  1270.         mov     __BACK,ax
  1271. $L100:  call    __SETSTD
  1272.         pop     di
  1273.         pop     si
  1274.         pop     bp
  1275.         ret
  1276. __SETATTR endp
  1277.  
  1278. __CLREOL proc   far
  1279.         push    bp
  1280.         push    si
  1281.         push    di
  1282.         mov     bp,sp
  1283.         push    cx
  1284.         push    CurCol
  1285.         push    CurRow
  1286.         mov     cx,__MAXCOL
  1287.         sub     cx,CurCol
  1288.         inc     cx
  1289.         mov     al,020h
  1290.         call    OutStr
  1291.         pop     CurRow
  1292.         pop     CurCol
  1293.         mov     dl,byte ptr CurCol
  1294.         mov     dh,byte ptr CurRow
  1295.         call    PutCur
  1296.         pop     cx
  1297.         pop     di
  1298.         pop     si
  1299.         pop     bp
  1300.         ret
  1301. __CLREOL endp
  1302.  
  1303. __CLREOS proc   far
  1304.         push    bp
  1305.         push    si
  1306.         push    di
  1307.         mov     bp,sp
  1308.         mov     ax,CurRow
  1309.         push    ax
  1310.         mov     bx,CurCol
  1311.         push    bx
  1312.         mov     cx,__MAXROW
  1313.         sub     cx,ax
  1314.         inc     cx
  1315. $L106:  push    cx
  1316.         call    __CLREOL
  1317.         pop     cx
  1318.         dec     cx
  1319.         jz      $L105
  1320.         push    cx
  1321.         call    LnFd
  1322.         pop     cx
  1323.         jmp     short $L106
  1324. $L105:  pop     CurCol
  1325.         pop     CurRow
  1326.         mov     dl,byte ptr CurCol
  1327.         mov     dh,byte ptr CurRow
  1328.         call    PutCur
  1329.         pop     di
  1330.         pop     si
  1331.         pop     bp
  1332.         ret
  1333. __CLREOS endp
  1334.  
  1335. __CLRALL proc   far
  1336.         push    bp
  1337.         push    si
  1338.         push    di
  1339.         mov     bp,sp
  1340.         call    ClrScr
  1341.         mov     CurRow,00000h
  1342.         mov     CurCol,00000h
  1343.         xor     dx,dx
  1344.         call    PutCur
  1345.         pop     di
  1346.         pop     si
  1347.         pop     bp
  1348.         ret
  1349. __CLRALL endp
  1350.  
  1351. WinSav: call    ChkLim
  1352.         jc      $L108
  1353.         push    CurSor
  1354.         push    cx
  1355.         push    cx
  1356.         push    dx
  1357.         push    es
  1358.         push    di
  1359.         push    ax
  1360.         mov     ax,00000h
  1361.         push    bp
  1362.         mov     bp,sp
  1363.         xchg    ax,[bp+002h]
  1364.         pop     bp
  1365.         call    __SETCTYP
  1366.         add     sp,+002h
  1367.         pop     di
  1368.         pop     es
  1369.         pop     dx
  1370.         pop     cx
  1371.         sub     dh,ch
  1372.         inc     dh
  1373.         sub     dl,cl
  1374.         inc     dl
  1375.         mov     cl,dl
  1376.         xor     ch,ch
  1377.         mov     bl,dh
  1378.         xor     bh,bh
  1379.         pop     dx
  1380.         mov     ax,dx
  1381.         cld
  1382. $L110:  push    ax
  1383.         push    bx
  1384.         push    cx
  1385. $L109:  push    cx
  1386.         push    dx
  1387.         push    di
  1388.         xor     bx,bx
  1389.         mov     ah,002h
  1390.         int     010h
  1391.         xor     bx,bx
  1392.         mov     ah,008h
  1393.         int     010h
  1394.         pop     di
  1395.         pop     dx
  1396.         pop     cx
  1397.         stosw
  1398.         inc     dl
  1399.         loop    $L109
  1400.         pop     cx
  1401.         pop     bx
  1402.         pop     ax
  1403.         mov     dl,al
  1404.         inc     dh
  1405.         dec     bx
  1406.         jnz     $L110
  1407.         mov     dh,byte ptr CurRow
  1408.         mov     dl,byte ptr CurCol
  1409.         call    PutCur
  1410.         pop     CurSor
  1411.         push    CurSor
  1412.         call    __SETCTYP
  1413.         add     sp,+002h
  1414. $L108:  ret
  1415.  
  1416. WinRst: call    ChkLim
  1417.         jnc     WR_OK
  1418.         jmp     WREnd
  1419. WR_OK:  push    CurSor                          ; save for later restore
  1420.         push    cx
  1421.         push    cx
  1422.         push    dx
  1423.         push    es
  1424.         push    di
  1425.         push    ax
  1426.         mov     ax,00000h
  1427.         push    bp
  1428.         mov     bp,sp
  1429.         xchg    ax,[bp+002h]
  1430.         pop     bp
  1431.         call    __SETCTYP                       ; hide the cursor
  1432.         add     sp,+002h
  1433.         pop     di
  1434.         pop     es
  1435.         pop     dx
  1436.         pop     cx
  1437.         sub     dh,ch
  1438.         inc     dh
  1439.         sub     dl,cl
  1440.         inc     dl
  1441.         mov     cl,dl
  1442.         xor     ch,ch
  1443.         mov     bl,dh
  1444.         xor     bh,bh
  1445.         pop     dx
  1446.         mov     ax,dx
  1447.         push    ds
  1448.         push    es
  1449.         pop     ds
  1450.         mov     si,di
  1451.         cld
  1452. WRRow:  push    ax                      ; copy each row
  1453.         push    bx
  1454.         push    cx
  1455. WRChr:  push    cx                      ; copy each char
  1456.         push    dx
  1457.         push    si
  1458.         xor     bx,bx
  1459.         mov     ah,002h                 ; position cursor for write
  1460.         int     010h
  1461.         pop     si
  1462.         lodsw                           ; get from saved buffer
  1463.         push    si
  1464.         mov     bl,ah
  1465.         xor     bh,bh
  1466.         mov     cx,00001h
  1467.         mov     ah,009h                 ; write the character
  1468.         int     010h
  1469.         pop     si
  1470.         pop     dx
  1471.         pop     cx
  1472.         inc     dl                      ; advance cursor position
  1473.         loop    WRChr
  1474.         pop     cx                      ; restore row count
  1475.         pop     bx
  1476.         pop     ax
  1477.         mov     dl,al
  1478.         inc     dh                      ; advance cursor row
  1479.         dec     bx                      ; tally row count
  1480.         jnz     WRRow
  1481.         pop     ds
  1482.         mov     dh,byte ptr CurRow      ; restore cursor location
  1483.         mov     dl,byte ptr CurCol
  1484.         call    PutCur
  1485.         pop     CurSor
  1486.         push    CurSor
  1487.         call    __SETCTYP               ; and un-hide it
  1488.         add     sp,+002h
  1489. WREnd:  ret
  1490.  
  1491. __SCRSAVE proc   far
  1492.         push    bp
  1493.         push    si
  1494.         push    di
  1495.         mov     bp,sp
  1496.         mov     ch,byte ptr __ROWOFF
  1497.         mov     cl,byte ptr __COLOFF
  1498.         mov     dh,byte ptr __MAXROW
  1499.         mov     dl,byte ptr __MAXCOL
  1500.         add     dh,ch
  1501.         add     dl,cl
  1502.         les     di,[bp+00Ah]
  1503.         call    WinSav
  1504.         pop     di
  1505.         pop     si
  1506.         pop     bp
  1507.         ret
  1508. __SCRSAVE endp
  1509.  
  1510. __SCRREST proc   far
  1511.         push    bp
  1512.         push    si
  1513.         push    di
  1514.         mov     bp,sp
  1515.         mov     ch,byte ptr __ROWOFF
  1516.         mov     cl,byte ptr __COLOFF
  1517.         mov     dh,byte ptr __MAXROW
  1518.         mov     dl,byte ptr __MAXCOL
  1519.         add     dh,ch
  1520.         add     dl,cl
  1521.         les     di,[bp+00Ah]
  1522.         call    WinRst
  1523.         pop     di
  1524.         pop     si
  1525.         pop     bp
  1526.         ret
  1527. __SCRREST endp
  1528.  
  1529. __WINSAVE proc   far
  1530.         push    bp
  1531.         push    si
  1532.         push    di
  1533.         mov     bp,sp
  1534.         mov     ch,byte ptr [bp+00Ah]
  1535.         mov     cl,byte ptr [bp+00Ch]
  1536.         mov     dh,byte ptr [bp+00Eh]
  1537.         mov     dl,byte ptr [bp+010h]
  1538.         add     ch,byte ptr __ROWOFF
  1539.         add     cl,byte ptr __COLOFF
  1540.         add     dh,byte ptr __ROWOFF
  1541.         add     dl,byte ptr __COLOFF
  1542.         les     di,[bp+012h]
  1543.         call    WinSav
  1544.         pop     di
  1545.         pop     si
  1546.         pop     bp
  1547.         ret
  1548. __WINSAVE endp
  1549.  
  1550. __WINREST proc   far
  1551.         push    bp
  1552.         push    si
  1553.         push    di
  1554.         mov     bp,sp
  1555.         mov     ch,byte ptr [bp+00Ah]
  1556.         mov     cl,byte ptr [bp+00Ch]
  1557.         mov     dh,byte ptr [bp+00Eh]
  1558.         mov     dl,byte ptr [bp+010h]
  1559.         add     ch,byte ptr __ROWOFF
  1560.         add     cl,byte ptr __COLOFF
  1561.         add     dh,byte ptr __ROWOFF
  1562.         add     dl,byte ptr __COLOFF
  1563.         les     di,[bp+012h]
  1564.         call    WinRst
  1565.         pop     di
  1566.         pop     si
  1567.         pop     bp
  1568.         ret
  1569. __WINREST endp
  1570.  
  1571. XltKey: cld
  1572.         mov     cx,ax           ; save for compare
  1573.         mov     dx,ax           ; and for default retval
  1574. $L123:  lodsb
  1575.         cmp     al,001h
  1576.         jne     $L118
  1577.         lodsw                   ; get default retval
  1578.         mov     dx,ax
  1579.         jmp     $L123           ; and go again
  1580. $L118:  cmp     al,002h
  1581.         jne     $L119
  1582.         lodsw                   ; match for entry
  1583.         cmp     cx,ax
  1584.         jne     Skip1           ; no, try next
  1585.         lodsw
  1586.         jmp     short $L122     ; yes, get out
  1587. $L119:  cmp     al,003h
  1588.         jne     $L120
  1589.         lodsw                   ; check for range
  1590.         cmp     cx,ax
  1591.         jl      Skip2
  1592.         lodsw
  1593.         cmp     cx,ax
  1594.         jg      Skip1           ; nope, try again
  1595.         lodsw
  1596.         jmp     short $L122     ; yes, get out
  1597. $L120:  cmp     al,004h
  1598.         jne     $L121
  1599.         lodsw
  1600.         cmp     cx,ax
  1601.         jl      Skip2
  1602.         lodsw
  1603.         cmp     cx,ax
  1604.         jg      Skip1
  1605.         lodsw
  1606.         add     ax,cx
  1607.         jmp     short $L122
  1608. $L121:  cmp     al,005h
  1609.         jne     $L117
  1610.         lodsw
  1611.         cmp     cx,ax
  1612.         jl      Skip2
  1613.         cmp     cx,word ptr [si]
  1614.         jg      Skip2
  1615.         sub     cx,ax
  1616.         add     si,+002h
  1617.         lodsw
  1618.         sub     ax,cx
  1619.         jmp     short $L122
  1620. $L117:  mov     ax,dx
  1621.         jmp     short $L122
  1622. Skip2:  add     si,+002h
  1623. Skip1:  add     si,+002h
  1624.         jmp     $L123
  1625. $L122:  ret
  1626.  
  1627. KeyXlt: mov     si,__IMODE      ; mode index
  1628.         shl     si,1
  1629.         shl     si,1
  1630.         push    si              ; save for action code
  1631.         push    ax
  1632.         add     si,+002h        ; get second one first
  1633.         mov     si,XTable[si]   ;   from KeyVals table
  1634.         call    XltKey
  1635.         mov     __IKEY,ax       ; and save key value
  1636.         pop     ax
  1637.         pop     si
  1638.         mov     si,XTable[si]   ; then get action code
  1639.         call    XltKey          ;   from MODExx table
  1640.         ret
  1641.  
  1642. KBWait: mov     dl,0FFh
  1643.         mov     ah,006h
  1644.         int     021h
  1645.         mov     ah,000h
  1646.         jz      KBWait          ; wait for a key
  1647.         cmp     al,000h
  1648.         jnz     $L128           ; not extended
  1649.         mov     ah,006h
  1650.         int     021h
  1651.         mov     ah,000h
  1652.         add     ax,00100h       ; extended, scancode+100h
  1653. $L128:  call    KeyXlt
  1654.         ret
  1655.  
  1656. StrbKB: mov     ah,00Bh         ; check KB status
  1657.         int     021h
  1658.         mov     ah,000h
  1659.         test    ax,ax
  1660.         jz      $L130           ; no key
  1661.         mov     ax,00002h       ; have keystroke
  1662.         mov     __IKEY,00000h
  1663. $L130:  ret
  1664.  
  1665. BmpKbP: inc     bx              ; step by 2
  1666.         inc     bx
  1667.         cmp     bx,KBfrSz       ; past end of ring?
  1668.         jc      $L132           ; no, okay
  1669.         xor     bx,bx           ; yes, set to start
  1670. $L132:  ret
  1671.  
  1672. GetKey: mov     dl,0FFh
  1673.         mov     ah,006h         ; get key from DOS
  1674.         int     021h
  1675.         mov     ah,000h
  1676.         jz      GK2             ; no key available, out
  1677.         cmp     al,0
  1678.         jne     GK1             ; not extended, use it
  1679.         mov     ah,006h         ; get next from DOS
  1680.         int     021h
  1681.         mov     ah,000h
  1682.         add     ax,0100h        ; flag as scancode
  1683. GK1:    push    ax
  1684.         call    KeyXlt          ; translate it
  1685.         sub     ax,00080h
  1686.         cmp     ax,00007h
  1687.         pop     ax
  1688.         jna     $L133
  1689.         mov     KBGetP,00000h   ; flush the buffer
  1690.         mov     KBPutP,00000h
  1691. $L133:  mov     bx,KBPutP       ; get PUT offset
  1692.         mov     si,bx
  1693.         call    BmpKbP          ; step to free spot
  1694.         cmp     bx,KBGetP       ; buffer full?
  1695.         jnz     $L137           ; no, put it down
  1696.         jmp     GetKey          ; yes, ignore this one
  1697. $L137:  mov     KBPutP,bx       ; first update offset
  1698.         push    es
  1699.         les     bx,KBfrPt       ; then get base
  1700.         mov     es:[bx+si],ax   ; and store the keystroke
  1701.         pop     es
  1702.         jmp     GetKey          ; now close the loop
  1703. GK2:    ret
  1704.  
  1705. __KINIT proc    far             ; initialize keyboard
  1706.         push    bp
  1707.         push    si
  1708.         push    di
  1709.         mov     bp,sp
  1710.         push    ds
  1711.         mov     dx,cs           ; disable Ctrl-C interrupt
  1712.         mov     ds,dx
  1713.         mov     dx,offset I23Vec
  1714.         mov     al,023h
  1715.         mov     ah,025h
  1716.         int     021h
  1717.         pop     ds
  1718.         pop     di
  1719.         pop     si
  1720.         pop     bp
  1721.         ret
  1722. __KINIT endp
  1723.  
  1724. __KEND  proc   far
  1725.         ret             ; jk 11-01-89
  1726. __KEND  endp
  1727.  
  1728. __KHANDLE proc   far
  1729.         push    bp
  1730.         push    si
  1731.         push    di
  1732.         mov     bp,sp
  1733.         mov     ax,[bp+00Ah]
  1734.         mov     KbdHdl,ax
  1735.         pop     di
  1736.         pop     si
  1737.         pop     bp
  1738.         ret
  1739. __KHANDLE endp
  1740.  
  1741. __SETFKEY proc   far
  1742.         push    bp
  1743.         push    si
  1744.         push    di
  1745.         mov     bp,sp
  1746.         les     si,[bp+00Ah]
  1747.         mov     word ptr StrPtr+2,es
  1748.         mov     word ptr StrPtr,si
  1749.         mov     si,[bp+00Eh]
  1750.         mov     StrLen,si
  1751.         pop     di
  1752.         pop     si
  1753.         pop     bp
  1754.         ret
  1755. __SETFKEY endp
  1756.  
  1757. TstKey  proc    near
  1758.         test    StrLen,0FFFFh
  1759.         jz      $L145
  1760.         les     si,StrPtr
  1761.         xor     ah,ah
  1762.         lodsb
  1763.         cmp     al,';'          ; check for pseudo-CR
  1764.         jnz     $L146
  1765.         mov     al,00Dh
  1766. $L146:  call    KeyXlt
  1767.         or      bx,+001h
  1768. $L145:  ret
  1769. TstKey  endp
  1770.  
  1771. TakKey  proc    near
  1772.         test    StrLen,0FFFFh
  1773.         jz      $L147
  1774.         xor     ah,ah
  1775.         les     si,StrPtr
  1776.         cld
  1777.         lodsb
  1778.         mov     word ptr es:StrPtr,si
  1779.         dec     StrLen
  1780.         cmp     al,';'
  1781.         jnz     $L148
  1782.         mov     al,00Dh
  1783. $L148:  call    KeyXlt
  1784.         or      bx,+001h
  1785. $L147:  ret
  1786. TakKey  endp
  1787.  
  1788. TstBKy  proc    near
  1789.         mov     bx,KBGetP
  1790.         cmp     bx,KBPutP
  1791.         jz      $L149
  1792.         push    es
  1793.         les     si,KBfrPt
  1794.         mov     ax,es:[bx+si]
  1795.         pop     es
  1796.         call    KeyXlt
  1797.         or      bx,+001h
  1798. $L149:  ret
  1799. TstBKy  endp
  1800.  
  1801. GetBKy  proc    near
  1802.         mov     bx,KBGetP
  1803.         cmp     bx,KBPutP
  1804.         jz      $L150
  1805.         push    es
  1806.         les     si,KBfrPt
  1807.         mov     ax,es:[bx+si]
  1808.         pop     es
  1809.         call    BmpKbP
  1810.         mov     KBGetP,bx
  1811.         call    KeyXlt
  1812.         or      bx,+001h
  1813. $L150:  ret
  1814. GetBKy  endp
  1815.  
  1816. __SET_TA proc   far
  1817.         push    bp
  1818.         push    si
  1819.         push    di
  1820.         mov     bp,sp
  1821.         mov     ax,[bp+00Ah]
  1822.         mov     word ptr KBfrPt,ax
  1823.         mov     ax,[bp+00Ch]
  1824.         mov     word ptr KBfrPt+2,ax
  1825.         mov     ax,[bp+00Eh]
  1826.         mov     KBfrSz,ax
  1827.         xor     ax,ax
  1828.         mov     KBGetP,ax
  1829.         mov     KBPutP,ax
  1830.         pop     di
  1831.         pop     si
  1832.         pop     bp
  1833.         ret
  1834. __SET_TA endp
  1835.  
  1836. __CCLR  proc   far
  1837.         push    bp
  1838.         push    si
  1839.         push    di
  1840.         mov     bp,sp
  1841.         call    GetKey
  1842.         xor     ax,ax
  1843.         mov     KBGetP,ax
  1844.         mov     KBPutP,ax
  1845.         mov     StrLen,ax
  1846.         pop     di
  1847.         pop     si
  1848.         pop     bp
  1849.         ret
  1850. __CCLR  endp
  1851.  
  1852. __CSTAT proc    far
  1853.         push    bp
  1854.         push    si
  1855.         push    di
  1856.         mov     bp,sp
  1857.         test    KBfrSz,0FFFFh
  1858.         jz      $L152
  1859.         call    GetKey
  1860.         call    TstKey
  1861.         jnz     $L154
  1862.         call    TstBKy
  1863.         jnz     $L154
  1864.         xor     ax,ax
  1865. $L154:  jmp     short $L156
  1866. $L152:  call    TstKey
  1867.         jnz     $L154
  1868.         call    StrbKB
  1869. $L156:  pop     di
  1870.         pop     si
  1871.         pop     bp
  1872.         ret
  1873. __CSTAT endp
  1874.  
  1875. __CIN   proc    far
  1876.         push    bp
  1877.         push    si
  1878.         push    di
  1879.         mov     bp,sp
  1880.         test    KBfrSz,0FFFFh
  1881.         jz      $L158
  1882. $L162:  call    GetKey
  1883.         call    TakKey
  1884.         jnz     $L160
  1885.         call    GetBKy
  1886.         jnz     $L160
  1887.         jmp     $L162
  1888. $L158:  call    TakKey
  1889.         jnz     $L160
  1890.         call    KBWait
  1891. $L160:  mov     bx, __IKEY
  1892.         mov     __LKEY,bx
  1893.         pop     di
  1894.         pop     si
  1895.         pop     bp
  1896.         ret
  1897. __CIN   endp
  1898.  
  1899. __BRKSTAT proc  far
  1900.         push    bp
  1901.         push    si
  1902.         push    di
  1903.         mov     bp,sp
  1904.         mov     ah,001h
  1905.         int     016h
  1906.         mov     ax,00000h
  1907.         jz      $L164
  1908.         call    __CSTAT
  1909. $L164:  pop     di
  1910.         pop     si
  1911.         pop     bp
  1912.         ret
  1913. __BRKSTAT endp
  1914.  
  1915. I23Vec: iret
  1916.  
  1917. __PINIT proc    far
  1918.         push    bp
  1919.         push    si
  1920.         push    di
  1921.         mov     bp,sp
  1922.         push    ax
  1923.         mov     ax,00004h
  1924.         push    bp
  1925.         mov     bp,sp
  1926.         xchg    ax,[bp+002h]
  1927.         pop     bp
  1928.         call    FAR PTR __PHANDLE
  1929.         add     sp,+002h
  1930.         mov     __X121X,00000h
  1931.         pop     di
  1932.         pop     si
  1933.         pop     bp
  1934.         ret
  1935. __PINIT endp
  1936.  
  1937. __PEND  proc    far
  1938.         ret
  1939. __PEND  endp
  1940.  
  1941. __PHANDLE proc    far
  1942.         push    bp
  1943.         push    si
  1944.         push    di
  1945.         mov     bp,sp
  1946.         mov     bx,[bp+00Ah]
  1947.         mov     PrtHdl,bx
  1948.         mov     al,000h
  1949.         mov     ah,044h
  1950.         int     021h
  1951.         and     dx,00080h
  1952.         mov     PrtDev,dx
  1953.         pop     di
  1954.         pop     si
  1955.         pop     bp
  1956.         ret
  1957. __PHANDLE endp
  1958.  
  1959. __POUT  proc    far
  1960.         push    bp
  1961.         push    si
  1962.         push    di
  1963.         mov     bp,sp
  1964.         mov     __PERROR,00000h
  1965.         mov     cx,[bp+00Eh]
  1966.         jcxz    $L167
  1967.         mov     bx,PrtHdl
  1968.         test    PrtDev,0FFFFh
  1969.         jz      $L168
  1970. $L170:  push    cx
  1971.         push    ds
  1972.         mov     cx,00001h
  1973.         lds     dx,[bp+00Ah]
  1974.         mov     ah,040h
  1975.         int     021h
  1976.         pop     ds
  1977.         pop     cx
  1978.         jc      $L169
  1979.         inc     word ptr [bp+00Ah]
  1980.         loop    $L170
  1981.         cmp     byte ptr [bp+00Ah],00Ah
  1982.         jz      $L171
  1983.         add     __X121X,cx
  1984.         jmp     short $L172
  1985.         nop
  1986. $L171:  mov     __X121X,00000h
  1987. $L172:  mov     ax,00000h
  1988. $L169:  mov     __PERROR,ax
  1989.         mov     ax,[bp+00Eh]
  1990.         sub     ax,cx
  1991.         jmp     short $L167
  1992.         nop
  1993. $L168:  push    ds
  1994.         lds     dx,[bp+00Ah]
  1995.         mov     ah,040h
  1996.         int     021h
  1997.         pop     ds
  1998.         jnc     $L167
  1999.         mov     __PERROR,ax
  2000.         mov     ax,00000h
  2001. $L167:  pop     di
  2002.         pop     si
  2003.         pop     bp
  2004.         ret
  2005. __POUT  endp
  2006.  
  2007. __HOME  proc    far
  2008.         push    bp
  2009.         xor     dx,dx
  2010.         mov     CurRow,dx
  2011.         mov     CurCol,dx
  2012.         call    PutCur
  2013.         pop     bp
  2014.         ret
  2015. __HOME  endp
  2016.  
  2017. __VGATST proc   near
  2018.         mov     ax,1a00h
  2019.         int     10h
  2020.         cmp     al,1ah
  2021.         je      Have_VGA
  2022.         xor     ah,ah
  2023.         mov     al,0
  2024.         jmp     VGA_RET
  2025. Have_VGA:
  2026.         xor     ah,ah
  2027.         mov     al,bl
  2028. VGA_RET:
  2029.         ret
  2030. __VGATST endp
  2031.  
  2032. __Scan200 proc   near
  2033.         push    bp
  2034.         mov     ah,12h
  2035.         mov     bl,30h
  2036.         mov     al,0
  2037.         int     10h
  2038.         pop     bp
  2039.         ret
  2040. __Scan200 endp
  2041.  
  2042. __Scan350 proc   near
  2043.         push    bp
  2044.         mov     ah,12h
  2045.         mov     bl,30h
  2046.         mov     al,1
  2047.         int     10h
  2048.         pop     bp
  2049.         ret
  2050. __Scan350 endp
  2051.  
  2052. __Scan400 proc  near
  2053.         push    bp
  2054.         mov     ah,12h
  2055.         mov     bl,30h
  2056.         mov     al,2
  2057.         int     10h
  2058.         pop     bp
  2059.         ret
  2060. __Scan400 endp
  2061.  
  2062. __BRC   proc    far
  2063.         push    bp
  2064.         mov     dh,nRows
  2065.         mov     dl,nCols
  2066.         sub     dx,0101h
  2067.         mov     byte ptr CurRow,dh
  2068.         mov     byte ptr CurCol,dl
  2069.         call    PutCur
  2070.         pop     bp
  2071.         ret
  2072. __BRC   endp
  2073.  
  2074. _SET25  proc    far
  2075.         push    bp
  2076.         call    __VGATST
  2077.         cmp     al,7
  2078.         jl      Cont_Set_25
  2079.         call    __Scan400
  2080. Cont_Set_25:
  2081.         mov     ax,1114h        ; reprogram the CRTC
  2082.         mov     bx,0
  2083.         int     10h
  2084.         call    __SINIT         ; re-do screen sizes
  2085.         pop     bp
  2086.         ret
  2087. _SET25  endp
  2088.  
  2089. _SET28  proc    far
  2090.         push    bp
  2091.         call    __VGATST
  2092.         cmp     al,7
  2093.         jl      Cont_Set_28
  2094.         call    __Scan400
  2095. Cont_Set_28:
  2096.         mov     ax,1111h        ; reprogram the CRTC
  2097.         mov     bx,0
  2098.         int     10h
  2099.         call    __SINIT         ; re-do screen sizes
  2100.         pop     bp
  2101.         ret
  2102. _SET28  endp
  2103.  
  2104. _SET43  proc    far
  2105.         push    bp
  2106.         call    __VGATST
  2107.         cmp     al,7
  2108.         jl      Cont_Set_43
  2109.         call    __Scan350
  2110. Cont_Set_43:
  2111.         mov     ax,1112h        ; reprogram the CRTC
  2112.         mov     bx,0
  2113.         int     10h
  2114.         call    __SINIT         ; re-do screen sizes
  2115.         pop     bp
  2116.         ret
  2117. _SET43  endp
  2118.  
  2119. _SET50  proc    far
  2120.         push    bp
  2121.         call    __VGATST
  2122.         cmp     al,7
  2123.         jl      Cont_Set_50
  2124.         call    __Scan400
  2125. Cont_Set_50:
  2126.         mov     ax,1112h        ; reprogram the CRTC
  2127.         mov     bx,0
  2128.         int     10h
  2129.         call    __SINIT         ; re-do screen sizes
  2130.         pop     bp
  2131.         ret
  2132. _SET50  endp
  2133.  
  2134. DRIVERS_TEXT    ENDS
  2135.  
  2136.         END
  2137.  
  2138.