home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / printer / okiset.arc / OKISET.ASM next >
Assembly Source File  |  1984-04-11  |  14KB  |  459 lines

  1.     TITLE    Set_Oki    Printer    Modes
  2.     PAGE    80,132
  3.  
  4. ; This program sends control characters    to an OkiData Microline    92
  5. ; printer connected as LPT1.
  6. ;
  7. ; The user is presented    with a menu of 20 items. Any number of
  8. ; control functions may    be performed.
  9. ;
  10. ; DOS 2.00 with    ANSI.SYS is required.
  11.  
  12. Cseg    Segment    Para Public 'CODE'
  13.     Org    100h
  14.  
  15. Set_Oki    Proc    Far
  16.     Assume    CS:Cseg,DS:Cseg,ES:Cseg
  17. Set:    Push    DS
  18.     Xor    AX,AX        ;Set return code
  19.     Push    AX
  20.     Push    CS        ;Set Data Seg
  21.     Pop    DS
  22.     Jmp    Start        ;Damn assembler
  23.     Page
  24.  
  25. ;        C O N S    T A N T    S
  26.  
  27. Titles    Db    27,'[2J',27,'[=2h',27,'[0m'
  28. Version    Db    'Set OKIDATA Printer - Version 2.0'
  29.     Db    27,'[1;41H (c) 1984 Vernon D. Buerg'
  30. ;       Each    entry must be the same sizes and in number sequence
  31. Text    Db    27,'[0m',27,'[3;1H0 = Six (6) lpi        ';2754
  32. Text_ln    Equ    This Byte - Text
  33.     Db    27,'[0m',27,'[4;1H1 = Pica 10 cpi        ';3000
  34.     Db    27,'[0m',27,'[5;1H2 = Elite 12 cpi        ';2800
  35.     Db    27,'[0m',27,'[6;1H3 = Condensed    17 cpi        ';2900
  36.     Db    27,'[0m',27,'[7;1H4 = Data processing quality    ';2748
  37.     Db    27,'[0m',27,'[8;1H5 = Emphasized Print        ';2784
  38.     Db    27,'[0m',27,'[9;1H6 = Enhanced print        ';2772
  39.     Db    27,'[0m',27,'[10;1H7 = Underlined        ';2767
  40.     Db    27,'[0m',27,'[11;1H8 = Form feed        ';1200
  41.     Db    27,'[0m',27,'[12;1H9 = Line feed        ';1310
  42.     Db    27,'[0m',27,'[3;41HA = Eight (8) lpi        ';2756
  43.     Db    27,'[0m',27,'[4;41HB = Double Pica, 5 cpi    ';3031
  44.     Db    27,'[0m',27,'[5;41HC = Double Elite, 6 cpi    ';2831
  45.     Db    27,'[0m',27,'[6;41HD = Double Condensed, 8.5cpi    ';2931
  46.     Db    27,'[0m',27,'[7;41HE = Correspondence quality    ';2749
  47.     Db    27,'[0m',27,'[8;41HF = Stop Emphasized print    ';2773
  48.     Db    27,'[0m',27,'[9;41HG = Stop Enhanced print    ';2773
  49.     Db    27,'[0m',27,'[10;41HH =    Stop Underlining    ';2768
  50.     Db    27,'[0m',27,'[11;41HI =    ITALIC characters    ';dlcg
  51.     Db    27,'[0m',27,'[12;41HJ =    SCRIPT characters    ';dlcg
  52.  
  53. Msg    Db    27,'[17;18HESCape to exit'
  54.     Db    27,'[14;18HEnter selection => ',27,'[K$'
  55.  
  56. Answer    Db    27,'[0m',27,'[15;18H'
  57. What    Db    0,' has    been processed$'
  58.  
  59. S_Title    Db    27,'[0m',27,'[15;18HLoading SCRIPT character set.$'
  60. I_Title    Db    27,'[0m',27,'[15;18HLoading ITALIC character set.$'
  61. S_Msg    Db    27,'[0m',27,'[15;18HSCRIPT characters now loaded.$'
  62. I_Msg    Db    27,'[0m',27,'[15;18HITALIC characters now loaded.$'
  63.  
  64. Err_Msg    Db    07,27,'[1m',27,'[15;18HInvalid entry',27,'[K'
  65. Cursor    Db    27,'[0m',27,'[14;37H',27,'[K $'
  66. InCase    Db    27,'[0m',27,'[20;1H',27,'[K$'
  67.  
  68. End_Msg    Db    27,'[19;20H',27,'[1m ALL SET',27,'[0m$'
  69.  
  70. Text_Size Db    Text_ln
  71. Count    Dw    0
  72.  
  73. Cmds    Db    27,54 ;0 6lpi    Two byte DECIMAL codes
  74.     Db    30,00 ;1 pica    Refer to User's    Manual
  75.     Db    28,00 ;2 elite
  76.     Db    29,00 ;3 condensed
  77.     Db    27,48 ;4 data quality
  78.     Db    27,84 ;5 emphasized
  79.     Db    27,72 ;6 enhanced
  80.     Db    27,67 ;7 underlined
  81.     Db    12,00 ;8 form feed
  82.     Db    13,10 ;9 line feed
  83.     Db    27,56 ;A 8 lpi
  84.     Db    30,31 ;B dbl-pica
  85.     Db    28,31 ;C dbl-elite
  86.     Db    29,31 ;D dbl-condensed
  87.     Db    27,49 ;E corres. quality
  88.     Db    27,73 ;F stop emphasized
  89.     Db    27,73 ;G stop enhanced
  90.     Db    27,68 ;H stop underlined
  91.     Db    00,00 ;I Italic
  92.     Db    00,00 ;J Script
  93.     Page
  94.  
  95.  
  96. ;        S C    R I P T      Characters
  97.  
  98.  
  99. Script    Equ    This Byte
  100.     DB    'A0',48,104,84,66,8,33,21,9,7,2,0     ;Numbers
  101.     DB    'A1',0,64,64,64,96,80,10,6,2,1,0
  102.     DB    'A2',64,64,96,64,82,65,73,1,5,3,0
  103.     DB    'A3',0,32,64,64,72,65,45,17,3,1,1
  104.     DB    'A4',0,16,24,20,82,48,16,24,20,2,1
  105.     DB    'A5',32,64,64,68,70,69,41,17,1,1,1
  106.     DB    'A6',0,96,80,72,76,74,40,17,1,1,2
  107.     DB    'A7',0,96,0,17,1,9,1,5,1,3,1
  108.     DB    'A8',0,0,32,80,68,74,72,41,17,5,2
  109.     DB    'A9',32,64,68,74,8,41,25,9,5,3,0
  110. ;
  111.     DB    'AA',0,60,66,1,64,1,64,57,70,2,65     ;Upper    case
  112.     DB    'AB',0,112,12,67,8,65,8,70,48,64,64
  113.     DB    'AC',0,28,34,0,65,0,65,0,65,2,64
  114.     DB    'AD',0,112,12,67,0,65,0,65,32,94,64
  115.     DB    'AE',0,0,54,0,73,0,73,0,65,2,64
  116.     DB    'AF',0,1,0,66,40,18,8,5,10,1,0
  117.     DB    'AG',0,0,14,80,1,80,33,16,9,2,0
  118.     DB    'AH',0,98,24,7,8,0,8,32,88,7,64
  119.     DB    'AI',0,0,0,0,102,9,64,63,0,0,0
  120.     DB    'AJ',0,0,34,80,1,64,63,0,1,0,1
  121.     DB    'AK',0,64,32,24,7,8,4,16,34,1,64
  122.     DB    'AL',0,32,80,0,80,47,16,33,66,0,64
  123.     DB    'AM',64,62,1,1,0,6,0,1,1,62,64
  124.     DB    'AN',1,0,126,0,1,0,1,0,62,0,64
  125.     DB    'AO',0,28,34,0,65,0,65,0,34,92,64
  126.     DB    'AP',0,66,48,15,0,9,0,9,0,6,0
  127.     DB    'AQ',32,82,0,81,0,49,0,25,38,0,64
  128.     DB    'AR',64,50,12,3,8,1,8,17,40,6,64
  129.     DB    'AS',32,0,16,32,72,3,68,1,74,0,48
  130.     DB    'AT',50,65,16,65,0,65,62,1,0,1,0
  131.     DB    'AU',48,12,67,0,64,0,48,12,67,0,64
  132.     DB    'AV',4,2,31,32,64,0,32,16,40,7,64
  133.     DB    'AW',63,64,64,0,48,0,64,64,63,0,64
  134.     DB    'AX',64,1,32,18,12,0,12,18,32,1,64
  135.     DB    'AY',0,7,32,72,0,72,0,56,71,0,64
  136.     DB    'AZ',0,2,64,33,80,9,68,1,66,1,64
  137. ;
  138.     DB    'Aa',64,64,56,32,68,0,68,0,56,4,64     ;Lower    case
  139.     DB    'Ab',64,0,32,0,22,41,69,66,48,16,64
  140.     DB    'Ac',64,64,48,8,68,0,68,0,68,8,64
  141.     DB    'Ad',64,64,56,64,4,64,4,64,63,0,64
  142.     DB    'Ae',64,64,48,8,100,0,84,0,68,8,64
  143.     DB    'Af',32,0,16,15,112,13,2,8,0,0,0
  144.     DB    'Dg',0,0,6,96,9,96,25,0,22,0,16
  145.     DB    'Ah',64,33,30,0,0,4,0,4,56,0,64
  146.     DB    'Ai',64,0,32,0,29,32,0,64,64,0,64
  147.     DB    'Dj',16,0,8,96,20,66,61,0,16,0,16
  148.     DB    'Ak',64,32,16,15,24,4,16,4,40,0,64
  149.     DB    'Al',64,0,38,9,16,9,38,0,64,0,64
  150.     DB    'Am',64,56,4,0,4,24,4,0,4,56,64
  151.     DB    'An',64,32,16,108,0,0,4,0,4,56,64
  152.     DB    'Ao',64,56,0,68,0,68,0,60,0,4,4
  153.     DB    'Dp',16,64,56,4,18,1,16,1,8,6,16
  154.     DB    'Dq',16,0,14,0,17,0,81,32,94,0,80
  155.     DB    'Ar',64,32,16,8,116,8,0,4,0,4,8
  156.     DB    'As',64,0,32,0,48,64,8,64,12,80,32
  157.     DB    'At',64,0,32,16,15,48,68,0,68,0,64
  158.     DB    'Au',64,0,60,0,64,0,64,0,124,0,64
  159.     DB    'Av',68,40,16,32,64,0,32,16,72,4,64
  160.     DB    'Aw',64,60,64,0,64,48,64,0,64,60,64
  161.     DB    'Ax',64,4,32,8,16,0,40,0,68,0,64
  162.     DB    'Dy',16,0,15,0,16,64,16,96,63,0,16
  163.     DB    'Dz',16,8,4,18,0,89,0,85,32,19,0
  164. ;
  165.     DB    'A',33,0,0,0,64,0,28,24,14,10,7,0    ;exclamation
  166.     DB    'A',34,4,6,1,2,1,4,6,1,2,1,0        ;dbl-quote
  167.     DB    'A',35,16,32,20,8,20,34,20,8,20,2,4    ;pound
  168.     DB    'A',36,0,0,80,32,100,42,50,3,6,1,0    ;dollar
  169.     DB    'A',37,32,0,18,1,10,33,20,32,18,0,1    ;percent
  170.     DB    'A',38,0,32,64,80,64,68,74,72,53,17,107    ;ampersand
  171.     DB    'A',39,0,0,8,0,4,2,1,2,1,0,0        ;right-quote
  172.     DB    'A',40,0,0,56,68,0,2,0,1,0,0,0        ;left-paren
  173.     DB    'A',41,0,0,0,64,0,32,16,9,6,0,0        ;right-paren
  174.     DB    'A',42,32,8,0,58,16,28,4,46,0,8,2    ;asterisk
  175.     DB    'A',43,0,0,8,40,24,8,12,10,8,0,0    ;plus
  176.     DB    'D',44,0,32,16,8,16,8,0,0,0,0,0        ;comma
  177.     DB    'A',45,0,0,8,8,8,8,8,8,8,0,0        ;minus
  178.     DB    'A',46,0,0,64,32,64,32,0,0,0,0,0    ;period
  179.     DB    'A',47,64,32,0,16,0,8,0,4,0,2,1        ;slash
  180.     DB    'A',58,0,64,32,64,40,4,8,4,0,0,0    ;colon
  181.     DB    'D',59,64,32,0,48,0,20,2,4,2,0,0    ;semi-colon
  182.     DB    'A',60,0,0,0,8,16,36,64,2,0,1,0        ;less-than
  183.     DB    'A',61,0,32,40,40,40,40,40,40,8,0,0    ;equals
  184.     DB    'A',62,64,0,32,1,18,4,8,0,0,0,0        ;greater-than
  185.     DB    'A',63,0,0,0,64,2,17,9,1,5,3,0        ;question
  186.     DB    'A',64,28,32,74,20,17,117,73,69,33,18,12 ;at
  187.     DB    'A',91,64,96,80,72,68,2,1,1,1,1,1    ;left-bracket
  188.     DB    'A',92,0,0,0,1,2,4,8,16,32,64,0        ;int-divide
  189.     DB    'A',93,64,64,64,64,64,33,17,9,5,3,1    ;right-bracket
  190.     DB    'A',94,0,0,4,0,2,0,1,2,4,0,0        ;caret
  191.     DB    'D',95,64,64,64,64,64,64,64,64,64,64,64    ;under-score
  192.     DB    'A',96,0,0,0,0,0,2,1,6,9,0,0        ;left-quote
  193.     DB    'A',123,0,8,64,104,80,68,2,1,1,1,1    ;left-brace
  194.     DB    'A',124,64,32,80,32,20,2,5,2,1,0,0    ;concat
  195.     DB    'A',125,64,64,64,64,32,16,1,13,3,9,0    ;right-brace
  196.     DB    'A',126,0,4,2,1,0,7,0,4,2,1,0        ;tilde
  197.     DB    'A',127,127,127,127,127,127,127,127,127,127,127,127 ;del
  198.  
  199. SCount    Dw    (This Byte - Script) / 13
  200.     Page
  201.  
  202.  
  203. ;        I T    A L I C      Characters
  204.  
  205.  
  206. Italics    Equ    This Byte
  207.     DB    'A0',48,104,84,66,8,33,21,9,7,2,0    ;Numbers
  208.     DB    'A1',0,64,64,64,96,80,10,6,2,1,0
  209.     DB    'A2',64,64,96,64,82,65,73,1,5,3,0
  210.     DB    'A3',0,32,64,64,72,65,45,17,3,1,1
  211.     DB    'A4',0,16,24,20,82,48,16,24,20,2,1
  212.     DB    'A5',32,64,64,68,70,69,41,17,1,1,1
  213.     DB    'A6',0,96,80,72,76,74,40,17,1,1,2
  214.     DB    'A7',0,96,0,17,1,9,1,5,1,3,1
  215.     DB    'A8',0,0,32,80,68,74,72,41,17,5,2
  216.     DB    'A9',32,64,68,74,8,41,25,9,5,3,0
  217. ;
  218.     DB    'AA',96,16,8,4,10,64,41,17,9,6,0    ;Upper case
  219.     DB    'AB',0,64,32,80,8,76,10,73,9,65,54
  220.     DB    'AC',32,80,72,68,66,64,65,33,1,1,2
  221.     DB    'AD',64,96,16,72,4,66,1,33,17,9,6
  222.     DB    'AE',64,96,80,72,76,74,73,9,1,1,1
  223.     DB    'AF',64,32,16,8,12,10,9,9,1,1,1
  224.     DB    'AG',32,80,72,68,66,80,49,17,17,17,2
  225.     DB    'AH',64,32,16,8,68,42,17,8,4,2,1
  226.     DB    'AI',64,64,64,96,80,8,5,3,1,1,1
  227.     DB    'AJ',112,0,64,32,17,8,5,2,1,0,1
  228.     DB    'AK',64,32,16,8,4,10,113,4,0,2,1
  229.     DB    'AL',64,96,80,72,68,66,65,64,0,0,0
  230.     DB    'AM',96,16,8,4,2,15,64,36,18,8,7
  231.     DB    'AN',96,16,8,4,2,95,32,16,8,4,3
  232.     DB    'AO',112,72,68,66,64,1,33,17,9,7,0
  233.     DB    'AP',64,32,16,8,12,10,9,9,9,9,7
  234.     DB    'AQ',56,68,66,64,81,1,33,17,78,0,0
  235.     DB    'AR',64,32,16,8,4,10,17,104,9,5,2
  236.     DB    'AS',48,0,64,0,64,6,40,17,0,1,2
  237.     DB    'AT',64,32,17,9,5,3,1,1,1,1,1
  238.     DB    'AU',32,80,72,68,2,33,16,8,4,2,1
  239.     DB    'AV',0,112,72,36,2,17,0,8,4,2,1
  240.     DB    'AW',112,8,36,18,33,64,48,8,4,2,1
  241.     DB    'AX',64,32,16,0,9,2,4,24,98,0,1
  242.     DB    'AY',0,64,33,18,12,0,4,0,2,0,1
  243.     DB    'AZ',64,96,64,80,65,73,69,1,3,1,1
  244. ;
  245.     DB    'Aa',0,48,72,0,68,0,4,100,24,72,4    ;Lower case
  246.     DB    'Ab',64,96,16,72,4,66,5,32,20,8,0
  247.     DB    'Ac',32,80,72,64,68,68,4,36,8,0,0
  248.     DB    'Ad',112,8,68,0,68,32,20,8,4,2,1
  249.     DB    'Ae',32,80,88,80,84,84,20,20,12,0,0
  250.     DB    'Af',64,32,16,8,12,10,8,9,1,1,2
  251.     DB    'Dg',0,72,20,66,16,33,16,9,5,2,1
  252.     DB    'Ah',64,32,16,8,4,2,69,32,20,8,0
  253.     DB    'Ai',0,0,64,32,16,8,4,0,1,0,0
  254.     DB    'Dj',64,0,64,0,32,16,8,5,2,1,0
  255.     DB    'Ak',64,32,16,8,28,34,73,8,4,0,0
  256.     DB    'Al',64,32,16,8,4,2,1,0,0,0,0
  257.     DB    'Am',64,32,16,12,4,24,0,72,32,28,4
  258.     DB    'An',64,32,16,8,4,0,68,36,20,8,0
  259.     DB    'Ao',32,80,8,64,4,32,20,8,0,0,0
  260.     DB    'Dp',64,32,16,24,20,18,17,1,9,5,2
  261.     DB    'Dq',0,8,20,82,112,81,9,37,3,1,0
  262.     DB    'Ar',64,32,16,8,4,0,4,4,4,8,0
  263.     DB    'As',0,0,32,64,64,64,72,52,4,4,8
  264.     DB    'At',0,0,32,16,72,4,66,5,32,4,0
  265.     DB    'Au',32,80,72,68,0,32,16,8,4,0,0
  266.     DB    'Av',64,96,80,8,36,0,16,0,8,0,4
  267.     DB    'Aw',32,80,8,36,48,64,0,32,16,8,4
  268.     DB    'Ax',0,0,64,0,32,20,8,16,40,68,0
  269.     DB    'Dy',0,64,72,84,18,33,16,8,4,2,1
  270.     DB    'Az',0,0,64,64,96,68,84,68,12,4,4
  271. ;
  272.     DB    'A',33,0,0,0,64,0,28,24,14,10,7,0    ;exclamation
  273.     DB    'A',34,0,0,0,0,0,2,1,0,2,1,0        ;double-quote
  274.     DB    'A',35,16,32,20,8,20,34,20,8,20,2,4    ;pound
  275.     DB    'A',36,0,0,80,32,100,42,50,3,6,1,0    ;dollar
  276.     DB    'A',37,32,0,18,1,10,33,20,32,18,0,1    ;percent
  277.     DB    'A',38,0,32,64,80,64,68,74,72,53,17,107    ;ampersand
  278.     DB    'A',39,0,8,0,4,2,1,2,1,0,0,0        ;quote
  279.     DB    'A',40,0,0,56,68,0,2,0,1,0,0,0        ;left-paren
  280.     DB    'A',41,0,0,0,64,0,32,16,9,6,0,0        ;right-paren
  281.     DB    'A',42,32,8,0,58,16,28,4,46,0,8,2    ;asterisk
  282.     DB    'A',43,0,0,8,40,24,8,12,10,8,0,0    ;plus
  283.     DB    'D',44,0,32,16,8,16,8,0,0,0,0,0        ;comma
  284.     DB    'A',45,0,0,8,8,8,8,8,8,8,0,0        ;dash
  285.     DB    'A',46,0,0,64,32,64,32,0,0,0,0,0    ;period
  286.     DB    'A',47,64,32,0,16,0,8,0,4,0,2,1        ;slash
  287.     DB    'A',58,0,64,32,64,40,4,8,4,0,0,0    ;colon
  288.     DB    'D',59,64,32,0,48,0,20,2,4,2,0,0    ;semi-colon
  289.     DB    'A',60,0,0,0,8,16,36,64,2,0,1,0        ;less-than
  290.     DB    'A',61,0,32,40,40,40,40,40,40,8,0,0    ;equals
  291.     DB    'A',62,64,0,32,1,18,4,8,0,0,0,0        ;greater-than
  292.     DB    'A',63,0,0,0,64,2,17,9,1,5,3,0        ;question
  293.     DB    'A',64,28,32,74,20,17,117,73,69,33,18,12 ;at
  294.     DB    'A',91,64,96,80,72,68,2,1,1,1,1,1    ;left-bracket?
  295.     DB    'A',92,0,0,0,1,2,4,8,16,32,64,0        ;back-slash
  296.     DB    'A',93,64,64,64,64,64,33,17,9,5,3,1    ;right-bracket
  297.     DB    'A',94,0,0,4,0,2,0,1,2,4,0,0        ;caret
  298.     DB    'D',95,64,64,64,64,64,64,64,64,64,64,64    ;under-score
  299.     DB    'A',96,0,0,0,0,0,2,1,6,9,0,0        ;left-quote
  300.     DB    'A',123,0,8,64,104,80,68,2,1,1,1,1    ;left-brace
  301.     DB    'A',124,64,32,80,32,20,2,5,2,1,0,0    ;concat
  302.     DB    'A',125,64,64,64,64,32,16,1,13,3,9,0    ;right-brace
  303.     DB    'A',126,0,4,2,1,0,7,0,4,2,1,0        ;tilde
  304.     DB    'A',127,127,127,127,127,127,127,127,127,127,127,127 ;del
  305.  
  306. Icount    Dw    (This Byte - Italics) /    13
  307.     Page
  308.  
  309. Start:    Mov    DX,Offset Titles      ;Start-up    message
  310.     Mov    AH,9
  311.     Int    21h
  312.  
  313. Prompt:    Mov    AH,8        ;Get char in AL, no echo
  314.     Int    21h        ; call DOS to do it
  315.     Cmp    AL,0        ;Extended code?
  316.     Jne    ChkEsc
  317.     Jmp    Ext        ;Yes, invalid
  318. ChkEsc:    Cmp    AL,27        ; or ESCape?
  319.     Jne    ChkLtr
  320.     Jmp    Done        ;Yes, close up
  321.  
  322. ChkLtr:    Mov    What,AL
  323.     Cmp    AL,65        ;Is it a letter?
  324.     Jl    Number        ; no, assume number
  325.     And    AL,0DFh        ;Make upper case
  326.     Mov    What,AL
  327.     Sub    AL,65        ;Get offset
  328.     Add    AL,10
  329.     Jmp    Letter
  330.  
  331. Number:    Cmp    AL,57        ;Valid number?
  332.     Ja    Error        ; nope
  333.     Sub    AL,48        ;To binary value
  334.     Js    Error        ;if less than zero
  335. Letter:    Mov    SI,AX        ;Save binary code
  336.     Cmp    AL,19        ;Exceeded menu list?
  337.     Ja    Error        ;Yes, oops
  338.     Add    AL,AL        ;Times 2 for indexing
  339.     Mov    BL,AL        ;Copy offset
  340.     Sub    BH,BH        ;Clear hi-byte
  341.     Mov    CX,Word    Ptr Cmds[BX]
  342.  
  343.     Mov    AX,SI        ;Get code back
  344.     Mul    Text_Size
  345.     Mov    BX,AX        ; as index to attribute
  346.     Mov    Text+2[BX],'1'    ; and hi-lite chosen text
  347.     Mov    Text+39[BX],'$'    ; add print stopper
  348.     Mov    DX,Offset InCase
  349.     Mov    AH,9        ;In case printer is off
  350.     Int    21h
  351.  
  352.     Cmp    What,'I'    ;Want italics?
  353.     Jne    ChkS
  354.     Jmp    Load_I        ;Yes, invoke DLCG
  355.  
  356. ChkS:    Cmp    What,'J'    ;Want Script?
  357.     Jne    Send
  358.     Jmp    Load_S        ;Yes, invoke DLCG
  359.  
  360. Send:    Mov    DL,CL
  361.     Mov    AH,5        ;Print char in DL
  362.     Int    21H
  363.  
  364.     Mov    DL,CH
  365.     Mov    AH,5        ;Print char in DL
  366.     Int    21H
  367.  
  368.     Mov    CX,Offset Answer
  369. HiLite:    Mov    DX,Offset Word Ptr Text
  370.     Add    DX,BX        ;Hi-lite selected option
  371.     Mov    AH,9
  372.     Int    21h
  373.  
  374.     Mov    DX,CX        ;Appropriate message
  375.     Mov    AH,9        ;Confirm selection
  376.     Int    21H
  377.     Mov    DX,Offset Cursor
  378.     Mov    AH,9        ;Reset cursor
  379.     Int    21h
  380.     Jmp    Prompt        ;Get another selection
  381.  
  382. Done:    Mov    AH,9
  383.     Mov    DX,Offset End_Msg    ;All Set
  384.     Int    21h
  385.     Ret        ;Return    to DOS
  386.  
  387. Ext:    Mov    AH,8        ;Get extended char
  388.     Int    21h
  389. Error:    Mov    AH,9
  390.     Mov    DX,Offset Err_Msg    ;Invalid entry
  391.     Int    21h
  392.     Jmp    Prompt
  393.  
  394. Load_I:    Mov    CX,ICount        ;Number    of Italic chars
  395.     Lea    DI,Italics        ;Addr of table
  396.     Mov    DX,Offset I_Title    ;Addr of title
  397.     Call    Dlcg            ;Load character    generator
  398.     Mov    CX,Offset I_Msg
  399.     Jmp    HiLite
  400.  
  401. Load_S:    Mov    CX,SCount        ;Number    of Script chars
  402.     Lea    DI,Script        ;Addr of table
  403.     Mov    DX,Offset S_Title    ;Addr of title
  404.     Call    Dlcg            ;Load character    generator
  405.     Mov    CX,Offset S_Msg
  406.     Jmp    HiLite
  407.     Page
  408. ; Subroutine for Downline Loadable Character Generator
  409.  
  410.  
  411. Dlcg    Proc    Near
  412.     Push    AX        ;Save registers
  413.     Push    BX
  414.     Push    CX        ;Number    of entries
  415.     Push    DI        ;Addr of table
  416.     Push    DX        ;Offset    to title
  417.  
  418.     Mov    Count,CX    ;Number    of characters
  419.     Mov    AH,9        ;Indicate loading DLCG
  420.     Int    21h
  421.  
  422.     Xor    BX,BX        ;Index into table
  423. Next1:    Mov    CX,13        ;For 'A' or 'D', letter, and 11    rows
  424.     Mov    DL,27        ;First an ESCape
  425.     Mov    AH,5
  426.     Int    21h
  427.     Mov    DL,37        ;Then DLCG command
  428.     Mov    AH,5
  429.     Int    21h
  430.  
  431. Rows:    Mov    DL,[DI][BX]    ;Get a character
  432.     Mov    AH,5        ;Print char in DL
  433.     Int    21H
  434.     Inc    BX        ;Next row
  435.     Loop    Rows
  436.     Dec    Count
  437.     Jz    Loaded
  438.     Jmp    Next1
  439.  
  440. Loaded:    Mov    DL,27        ;Ending    ESCape
  441.     Mov    AH,5
  442.     Int    21h
  443.     Mov    DL,'2'        ;Set DLCG char set
  444.     Mov    AH,5
  445.     Int    21h
  446.  
  447.     Pop    DX        ;Restore registers
  448.     Pop    DI
  449.     Pop    CX
  450.     Pop    BX
  451.     Pop    AX
  452.     Ret            ;Return    to caller
  453. Dlcg    Endp
  454.  
  455. Set_Oki    Endp
  456.  
  457. Cseg    Ends
  458.     End    Set
  459.