home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / PROGRAMS / WSTAR / NECWSOVR.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  19KB  |  641 lines

  1. ; This is an overlay for WordStar 3.0 running on a
  2. ;  NEC PC-8001A with a NEC PC-8023A-C dot matrix printer.
  3. ;
  4. ; Written by   : Ferd S. Brundick
  5. ; Net address  : fsbrn@brl-voc.arpa
  6. ; Date written : 26 January 1984
  7. ; Modification :  4 April 1984
  8. ; Refinements  : 29 August 1984
  9. ;
  10. ;  1. The opening WordStar display has been changed to read:
  11. ;
  12. ;   NEC Color WordStar
  13. ;   NEC PC-8023A-C Printer
  14. ;   No communications protocol    <-- this line left unchanged
  15. ;   Light print version        -or-    Enhanced print version
  16. ;
  17. ;    "Color" and "Light" appear in Cyan, all else is Yellow.
  18. ;
  19. ;  2. The CRT is put into color mode with the Special Function labels
  20. ;      ON.  Since this robs the display of one line, the screen length
  21. ;      is changed to 24.  The screen width has been reduced to 79.
  22. ;
  23. ;  3. The normal color is Cyan (5).  The highlight color is Yellow (6).
  24. ;
  25. ;  4. All delay times have been reduced. 
  26. ;
  27. ;  5. The default help setting has been lowered and the help level
  28. ;      message will be displayed.
  29. ;
  30. ;  6. The name of the program has been changed to:
  31. ;
  32. ;    WS.COM  for light    print version
  33. ;    WSE.COM    for enhanced print version
  34. ;
  35. ;  7. The following remapping of WordStar control keys has been made:
  36. ;
  37. ;      DEL replaced with ^H  ( delete char left )
  38. ;     ^QDEL changed to ^Q^H  ( delete to beginning of line )
  39. ;      ^H  replaced with ^B  ( move cursor left )
  40. ;      ^B  replaced with ^^  ( reform paragraph )
  41. ;
  42. ;     The DEL key is no longer used, but the keyboard doesn't have
  43. ;      one anyway.  (^_ works the same as ^H or the original DEL)
  44. ;     You may want to change the file WSMSGS.OVR to reflect the new
  45. ;      key definitions.  I used the public domain disk utility DU.
  46. ;
  47. ;  8. The following printer characteristics have been defined:
  48. ;
  49. ;    Overstrike method is CR
  50. ;    Bold printing uses 3 strikes
  51. ;    Alternate character width (^A) is Elite (12-pitch)
  52. ;    Normal    character width (^N) is Pica  (10-pitch)
  53. ;    Underscore character is 080H which is a graphics char.
  54. ;
  55. ;  9. The ribbon change sequence is defined for underlining.
  56. ;      The first use of ^Y turns on 9th-dot underlining, and
  57. ;      the second use of ^Y turns it off.
  58. ;
  59. ;     NOTE: underlining may be performed by 2 methods:
  60. ;         1. WordStar's ^S will overprint certain characters
  61. ;         (see manual for details) with the graphics
  62. ;         underscore character.  This looks slightly better
  63. ;         than the ASCII underscore character.
  64. ;         2. The printer's continuous underline mode may be
  65. ;         used with ^Y.  This looks very good, but under-
  66. ;         lining will continue between words and from line
  67. ;         to line, even in the left margin.  Be Careful!!
  68. ;
  69. ; 10. Super- and sub-scripts are supported.  The ROLUP and ROLDOW
  70. ;      sequences are far too short for the 8023, so the "sequences"
  71. ;      have been defined as 8-bit characters (M-^ [0DEH] and M-v [0F6H]).
  72. ;      The subroutine LISEND has been rewritten to call PRINTC in the
  73. ;      MORPAT area.  When WordStar sends a character to LISEND to
  74. ;      be printed, PRINTC checks if it is ROLUPCH or ROLDOWCH.  If
  75. ;      it is, then the proper sequence is sent to the printer, else
  76. ;      the current character is simply printed.  It would be very easy
  77. ;      to modify PRINTC to recognize other characters as well.
  78. ;
  79. ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  80. ; *   NOTE: the use of super- or sub-scripts (^T and ^V) will put the    *
  81. ; *         printer in incremental mode instead of logic-seeking mode.    *
  82. ; *         The character ^R may be used to restore logic-seeking    *
  83. ; *         (bidirectional) mode, but there is a hitch.  When the    *
  84. ; *         printer switches to l-s mode, the current partial line    *
  85. ; *         is lost (the printer manual does not mention this).    *
  86. ; *         This means if a line starts with ^R, the text will begin    *
  87. ; *         flush with the left edge of the paper; ie, the left margin    *
  88. ; *         will be lost.  There are 2 ways to avoid this:        *
  89. ; *        1. if you have an entirely blank line, put the ^R on it    *
  90. ; *        2. put the ^R on a line by itself, then overprint the    *
  91. ; *            next line like this:                *
  92. ; *            This is the end of a paragraph.<CR>        *
  93. ; *            control-P control-R control-P <CR>        *
  94. ; *            This is the first line of a new paragraph....    *
  95. ; *         Of course, you can ignore this explanation if you promise    *
  96. ; *         never to use super- or sub-scripts.            *
  97. ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  98. ;
  99. ; 11. Greek and mathematical symbols and half-height superscript chars
  100. ;      (do not confuse this with ^T and ^V) may be printed.  User function
  101. ;      three (^E) acts as a toggle character turning "Greek mode" on
  102. ;      and off.  Any character in the set '!' thru '_' will be replaced
  103. ;      AT PRINT TIME by a char in the Greek/superscript/math set;
  104. ;      characters which are not in the set will print normally.
  105. ;      This routine is based on an article on page 70 of the July 83
  106. ;      issue of Microsystems magazine.  The Greek chars are in "Greek
  107. ;      alphabetical order"; there are 24 lower case Greek letters
  108. ;      followed by 4 upper case Greek letters.
  109. ;      To see how the character remapping is currently defined, create
  110. ;      and print a file containing the following lines:
  111. ;    ^E                    begin Greek mode
  112. ;    !"#$%&'()*+,-./0123456789:;<=>?@    math and superscripts
  113. ;    ABCDEFGHIJKLMNOPQRSTUVWX        Greek lower case
  114. ;    YZ[\                    Greek upper case
  115. ;    ]^_                    math chars
  116. ;    ^E                    end Greek mode
  117. ;
  118. ; 12. The following user functions have been defined:
  119. ;
  120. ;    USR1 (^Q) -- line spacing is 8 lines per inch
  121. ;    USR2 (^W) -- line spacing is 6 lines per inch
  122. ;    USR3 (^E) -- toggle Greek mode
  123. ;    USR4 (^R) -- turn on logic-seeking (bidirectional) mode
  124. ;
  125. ; 13. The printer initialization sequence performs the following:
  126. ;
  127. ;    Set pitch to 10 cpi (Pica)
  128. ;    Set line spacing to 6 lpi
  129. ;    Turn on alphanumeric output
  130. ;    Turn on logic-seeking mode
  131. ;    Turn underlining off
  132. ;    Turn enhanced printing off (or on, depending on version)
  133. ;    Move print head to left margin (send a CR)
  134. ;
  135. ; 14. The printer de-initialization sequence restores the printer
  136. ;      to normal settings in case any changes have been made.  The
  137. ;      standard settings are the same as in note 12 above, but with
  138. ;      enhanced printing turned off.
  139. ;
  140. ; 15. The following miscellaneous codes are defined:
  141. ;
  142. ;    CSwtch = 0  (CP/M LST device is used)
  143. ;    HavBsy = 0  (Printer has no "busy flag")
  144. ;
  145. ; * * * * * * * * * * * * * * * * * * *
  146. ; *    HOW TO INSTALL THIS PATCH     *
  147. ; * * * * * * * * * * * * * * * * * * *
  148. ;
  149. ; 1. Install WordStar by running INSTALL.COM on WSU.COM as described
  150. ;     in section 3 of the WordStar Installation Manual.
  151. ;    For the equipment assumed by this patch, choose terminal "K"
  152. ;     (Soroc IQ-120), printer type "C" (teletype that can backspace),
  153. ;     communication protocol "N" (none), and driver "L" (CP/M LST:
  154. ;     device).
  155. ; 2. Make a backup copy of WS.COM in case the patch doesn't work.
  156. ; 3. Modify this patch file for your particular system.
  157. ; 4. Assemble patch file with ASM or MAC.
  158. ; 5. Use DDT or SID to write the patch file on top of WordStar:
  159. ;
  160. ;    A>DDT WS.COM        invoke DDT with WordStar binary
  161. ;    DDT VERS 2.2
  162. ;    NEXT  PC
  163. ;    4000 0100
  164. ;    -INECWSOVR.HEX        prepare to read overlay
  165. ;    -R            read it
  166. ;    NEXT  PC
  167. ;    4000 0100        size has not changed
  168. ;    -G0            exit from DDT
  169. ;    A>SAVE 63 WS.COM    save new WordStar binary
  170. ;
  171. ; 6. Run new version of WordStar on a test file and make sure the new
  172. :     features work.
  173. ;
  174. ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  175. ;
  176. ; *** system equates ***
  177. ;
  178. TRUE    EQU    0FFH
  179. FALSE    EQU    NOT TRUE
  180. BDOS    EQU    0005H
  181. LISTF    EQU    5    ;BDOS function 5
  182. SHOWSTR EQU    9    ;BDOS function 9
  183. ;
  184. ; *****************************************
  185. ; ***                    ***
  186. ; ***  SET FLAG FOR LIGHT PRINT VERSION ***
  187. ; ***                    ***
  188. ; *****************************************
  189. ;
  190. LIGHT    EQU    TRUE    ;Set equ FALSE for enhanced print
  191. ;
  192. ; *** character equates ***
  193. ;
  194. CTRL$B    EQU    'B' - 40H
  195. CTRL$H  EQU    'H' - 40H
  196. CTRL$Q    EQU    'Q' - 40H
  197. LF    EQU    0AH        ;Line Feed
  198. CR    EQU    0DH        ;Carriage Return
  199. ESC    EQU    1BH        ;Escape
  200. EOS    EQU    '$'        ;End Of String character
  201. EOC    EQU    'Y' - 40H    ;End Of Control sequence char
  202. ;
  203. ; *** WordStar special character equates ***
  204. ;
  205. FORM$PARA   EQU    '^' - 40H    ;Reformat paragraph
  206. GRK$TOGGLE  EQU    ']' - 40H    ;Greek char set toggle char
  207. ROLUPCH     EQU    '^' + 80H    ;Reverse half-line code char
  208. ROLDOWCH    EQU    'v' + 80H    ;Forward half-line code char
  209. ;
  210. ; *** WordStar patch point equates ***
  211. ;
  212. ; USER1 area
  213. ;
  214. DISLINE1  EQU    018FH    ;Address of first line of opening display
  215. DISLINE2  EQU    01B3H    ;Address of second line
  216. DISLINE3  EQU    01D7H    ;Address of third line (unused)
  217. DISLINE4  EQU    01FBH    ;Address of fourth line
  218. SCRNHT    EQU    0248H    ;Address of screen height
  219. SCRNWD    EQU    0249H    ;Address of screen width
  220. IVON    EQU    0284H    ;Address of inverse on
  221. IVOFF    EQU    028BH    ;Address of inverse off
  222. INISUB    EQU    02A4H    ;Address of initialization sbr
  223. UNISUB    EQU    02A7H    ;Address of un-initialization sbr
  224. DELCUS    EQU    02AEH    ;Address of cursor movement delay
  225. DELMIS    EQU    02AFH    ;Address of special function delay
  226. DEL1    EQU    02CFH    ;Address of short delay
  227. DEL2    EQU    02D0H    ;Address of medium-short delay
  228. DEL3    EQU    02D1H    ;Address of medium-long delay
  229. DEL4    EQU    02D2H    ;Address of long delay
  230. DEL5    EQU    02D3H    ;Address of horizontal scroll refresh delay
  231. MORPAT    EQU    02E0H    ;Start of user patch area
  232. ;
  233. ; USER 2 area
  234. ;
  235. ITHELP    EQU    0360H    ;Address of initial help setting flag
  236. NITHLF    EQU    0361H    ;Address of maximum help flag
  237. FNWSCM    EQU    03E7H    ;Address of name of WS program
  238. BSPADR    EQU    0499H    ;Address of "backspace char"
  239. DELADR    EQU    0529H    ;Address of "delete char left"
  240. DBLADR    EQU    0539H    ;Address of "delete to beginning of line"
  241. PARADR    EQU    054DH    ;Address of "reformat paragraph"
  242. ;
  243. ; USER3 area
  244. ;
  245. ;    No changes made in USER3 area
  246. ;
  247. ; USER4 area
  248. ;
  249. POSMTH    EQU    0690H    ;Address of printer overstrike method
  250. BLDSTR    EQU    0691H    ;Address of number of strikes for bold
  251. PALT    EQU    06B5H    ;Address of alternate char width sequence
  252. PSTD    EQU    06BAH    ;Address of standard char width sequence
  253. ROLUP    EQU    06BFH    ;Address of reverse half-line sequence
  254. ROLDOW    EQU    06C4H    ;Address of forward half-line sequence
  255. USR1    EQU    06C9H    ;Address of user-defined function 1
  256. USR2    EQU    06CEH    ;Address of user-defined function 2
  257. USR3    EQU    06D3H    ;Address of user-defined function 3
  258. USR4    EQU    06D8H    ;Address of user-defined function 4
  259. RIBBON    EQU    06DDH    ;Address of ribbon change
  260. RIBOFF    EQU    06E2H    ;Address of normal ribbon
  261. PSINIT    EQU    06E7H    ;Address of printer initialization string
  262. PSFINI    EQU    06F8H    ;Address of printer de-initialization string
  263. ULCHR    EQU    070CH    ;Address of underscore character
  264. CSWTCH    EQU    0717H    ;Address of "where to send output char"
  265. HAVBSY    EQU    0718H    ;Address of "does printer have a busy test?"
  266. LISEND    EQU    071DH    ;Address of character to list device sbr
  267. ALTPRTR EQU    0728H    ;Address of alternate printer drivers
  268. ;
  269. ; USER1 area
  270. ;
  271. ; *** Install new opening display ***
  272. ;
  273.     ORG    DISLINE1
  274.     DB    ' NEC '
  275.     DB    'C' + 80H    ;Set MSB for Cyan display
  276.     DB    'o' + 80H
  277.     DB    'l' + 80H
  278.     DB    'o' + 80H
  279.     DB    'r' + 80H
  280.     DB    ' WordStar'
  281.     DB    '               '    ;15 blanks
  282.     DB    0FH, 0
  283. ;
  284.     ORG    DISLINE2
  285.     DB    ' NEC PC-8023A-C Printer'
  286.     DB    '           '        ;11 blanks
  287.     DB    0FH, 0
  288. ;
  289.     ORG    DISLINE4
  290.     DB    ' '
  291.     IF    LIGHT        ;Install light print header
  292.     DB    'L' + 80H    ;Set MSB for Cyan display
  293.     DB    'i' + 80H
  294.     DB    'g' + 80H
  295.     DB    'h' + 80H
  296.     DB    't' + 80H
  297.     DB    ' print version'
  298.     DB    '              '    ;14 blanks
  299.     ENDIF
  300. ;
  301.     IF    NOT LIGHT    ;Install enhanced print header
  302.     DB    'E' + 80H    ;Set MSB for Cyan display
  303.     DB    'n' + 80H
  304.     DB    'h' + 80H
  305.     DB    'a' + 80H
  306.     DB    'n' + 80H
  307.     DB    'c' + 80H
  308.     DB    'e' + 80H
  309.     DB    'd' + 80H
  310.     DB    ' print version'
  311.     DB    '           '        ;11 blanks
  312.     ENDIF
  313. ;
  314.     DB    0FH, 0
  315. ;
  316. ; *** Change screen dimensions ***
  317. ;
  318.     ORG    SCRNHT
  319.     DB    24    ;Screen height
  320. ;
  321.     ORG    SCRNWD
  322.     DB    79    ;Screen width
  323. ;
  324. ; *** Define inverse on/off sequences ***
  325. ;
  326.     ORG    IVON
  327.     DB    4        ;Length of sequence
  328.     DB    ESC, 'C6', EOC    ;Color 6 (Yellow)
  329. ;
  330.     ORG    IVOFF
  331.     DB    4        ;Length of sequence
  332.     DB    ESC, 'C5', EOC    ;Color 5 (Cyan)
  333. ;
  334. ; *** Install jump vectors to init/un-init sbrs ***
  335. ;
  336.     ORG    INISUB
  337.     JMP    INIT$TERM
  338. ;
  339.     ORG    UNISUB
  340.     JMP    DENIT$TERM
  341. ;
  342. ; *** Change delay times ***
  343. ;
  344.     ORG    DELCUS
  345.     DB    1
  346. ;
  347.     ORG    DELMIS
  348.     DB    1
  349. ;
  350.     ORG    DEL1
  351.     DB    2
  352. ;
  353.     ORG    DEL2
  354.     DB    4
  355. ;
  356.     ORG    DEL3
  357.     DB    8
  358. ;
  359.     ORG    DEL4
  360.     DB    16
  361. ;
  362.     ORG    DEL5
  363.     DB    4
  364. ;
  365. ; *** Install custom user routines ***
  366. ;
  367.     ORG    MORPAT        ;Start of user patch area
  368. ;
  369. ; *** Initialize/de-initialize CRT ***
  370. ;
  371. INIT$TERM:
  372.     LXI    D,INIT$CRT    ;Load start of sequence
  373.     JMP    STR$OUT        ;and display it
  374. ;
  375. DENIT$TERM:
  376.     LXI    D,DENIT$CRT    ;Load start of sequence
  377. ;
  378. STR$OUT:
  379.     MVI    C,SHOWSTR    ;Display string on console
  380.     JMP    BDOS
  381. ;
  382. ; *** Install custom character print routine ***
  383. ;
  384. PRINTC:
  385.     MOV    C,A        ;Save character
  386.     CPI    ROLUPCH        ;Check for reverse half-line code char
  387.     JZ    MOVE$UP
  388.     CPI    ROLDOWCH    ;Check for forward half-line code char
  389.     JZ    MOVE$DOWN
  390.     CPI    GRK$TOGGLE    ;Check for Greek toggle char
  391.     LDA    GRK$FLAG    ;Get Greek flag
  392.     JZ    SET$GREEK    ;Set/reset Greek flag
  393.     ANA    A        ;Is Greek flag set ??
  394.     JZ    PUT$CHAR    ;Print normal character
  395.     LXI    H,GREEK$TABLE    ;Load base of Greek table
  396.     MOV    A,C        ;Restore character
  397.     CPI    '_' + 1        ;Last char in alternate set + 1
  398.     JNC    PUT$CHAR    ;Print normal character
  399.     SUI    '!'        ;First char in alternate set
  400.     JC    PUT$CHAR    ;Print normal character
  401.     ADD    L        ;Calculate address of Greek char
  402.     MOV    L,A        ;Set address of char
  403.     MOV    C,M        ;Get Greek character
  404. ;
  405. PUT$CHAR:
  406.     MOV    E,C        ;Print character
  407.     MVI    C,LISTF
  408.     JMP    BDOS
  409. ;
  410. MOVE$UP:
  411.     MVI    B,13        ;13 characters in sequence
  412.     LXI    H,UP$SEQ    ;Load start address into HL
  413.     JMP    PRT$STR        ;Print string
  414. ;
  415. MOVE$DOWN:
  416.     MVI    B,9        ;9 characters in sequence
  417.     LXI    H,DOWN$SEQ    ;Load start address into HL
  418. ;
  419. PRT$STR:
  420.     MOV    E,M        ;Load character into E
  421.     MVI    C,LISTF        ;and print it
  422.     INX    H        ;Advance to next char
  423.     PUSH    H        ;Save registers
  424.     PUSH    B
  425.     CALL    BDOS        ;Print character
  426.     POP    B        ;Restore registers
  427.     POP    H
  428.     DCR    B        ;Decrement counter
  429.     JNZ    PRT$STR        ;Print next char
  430.     RET
  431. ;
  432. SET$GREEK:
  433.     CMA            ;00H <==> FFH
  434.     STA    GRK$FLAG    ;Set or reset flag
  435.     RET
  436. ;
  437. INIT$CRT:
  438.     DB    ESC, 'V0,24,1,1', EOC    ;24 lines, color mode
  439.     DB    ESC, 'C6', EOC        ;Color 6 (Yellow)
  440.     DB    EOS
  441. ;
  442. DENIT$CRT:
  443.     DB    ESC, 'V,25', EOC    ;25 lines, color mode
  444.     DB    ESC, 'C5', EOC        ;Color 5 (Cyan)
  445.     DB    ESC, '*'        ;Clear screen
  446.     DB    EOS
  447. ;
  448. ; USER2 area
  449. ;
  450. ; *** Define new default help values ***
  451. ;
  452.     ORG    ITHELP        ;Initial help level
  453.     DB    2
  454. ;
  455.     ORG    NITHLF        ;Initial help flag
  456.     DB    0        ;Display maximum help message
  457. ;
  458. ; *** Change name of WS program ***
  459. ;
  460.     ORG    FNWSCM        ;WordStar program name
  461.     IF    LIGHT
  462.     DB    'WS      COM'    ;Name for light    print version
  463.     ENDIF
  464.     IF    NOT LIGHT
  465.     DB    'WSE     COM'    ;Name for enhanced print version
  466.     ENDIF
  467. ;
  468. ; *** Redefine control keys ***
  469. ;
  470.     ORG    BSPADR        ;Backspace (non-destructive)
  471.     DB    CTRL$B
  472. ;
  473.     ORG    DELADR        ;Delete char left (destructive BSP)
  474.     DB    CTRL$H
  475. ;
  476.     ORG    DBLADR        ;Delete to beginning of line
  477.     DB    CTRL$Q, CTRL$H
  478. ;
  479.     ORG    PARADR        ;Reformat paragraph
  480.     DB    FORM$PARA
  481. ;
  482. ; USER3 area
  483. ;
  484. ;    No changes made in USER3 area
  485. ;
  486. ; USER4 area
  487. ;
  488. ; *** Printer characteristics ***
  489. ;
  490. ; *** Define overstrike method code ***
  491. ;
  492.     ORG    POSMTH        ;Overstrike method is CR
  493.     DB    0FFH
  494. ;
  495. ; *** Set BOLD print repetition count ***
  496. ;
  497.     ORG    BLDSTR        ;Number of strikes for bold
  498.     DB    3
  499. ;
  500. ; *** Define character width sequences ***
  501. ;
  502.     ORG    PALT        ;Alternate char width (12 pitch)
  503.     DB    2        ;Length of sequence
  504.     DB    ESC, 'E'    ;Elite
  505. ;
  506.     ORG    PSTD        ;Standard char width (10 pitch)
  507.     DB    2        ;Length of sequence
  508.     DB    ESC, 'N'    ;Normal
  509. ;
  510. ; *** Define reverse and forward half-line sequences ***
  511. ;
  512.     ORG    ROLUP        ;Reverse half-line
  513.     DB    1        ;Length of sequence
  514.     DB    ROLUPCH        ;Coded char (see LISEND)
  515. ;
  516.     ORG    ROLDOW        ;Reverse half-line
  517.     DB    1        ;Length of sequence
  518.     DB    ROLDOWCH    ;Coded char (see LISEND)
  519. ;
  520. ; *** User-defined functions ***
  521. ;
  522.     ORG    USR1        ;Function 1 (^Q)
  523.     DB    2        ;Length of sequence
  524.     DB    ESC, 'B'    ;8 lines per inch
  525. ;
  526.     ORG    USR2        ;Function 2 (^W)
  527.     DB    2        ;Length of sequence
  528.     DB    ESC, 'A'    ;6 lines per inch
  529. ;
  530.     ORG    USR3        ;Function 3 (^E)
  531.     DB    1        ;Length of sequence
  532.     DB    GRK$TOGGLE    ;Alternate character set
  533. ;
  534.     ORG    USR4        ;Function 4 (^R)
  535.     DB    2        ;Length of sequence
  536.     DB    ESC, ']'    ;Logic seeking mode
  537. ;
  538. ; *** Ribbon change sequences used for 9-th dot underlining ***
  539. ;
  540.     ORG    RIBBON        ;Alternate ribbon color
  541.     DB    2        ;Length of sequence
  542.     DB    ESC, 'X'    ;Underline On
  543. ;
  544.     ORG    RIBOFF        ;Normal ribbon color
  545.     DB    2        ;Length of sequence
  546.     DB    ESC, 'Y'    ;Underline Off
  547. ;
  548. ; *** Printer initialization/de-initialization sequences ***
  549. ;
  550.     ORG    PSINIT
  551.     DB    13        ;Length of sequence
  552.     DB    ESC, 'N'    ;10 chars per inch
  553.     DB    ESC, 'A'    ;6 lines per inch
  554.     DB    ESC, '$'    ;Alphanumeric output
  555.     DB    ESC, ']'    ;Logic-seeking mode
  556.     DB    ESC, 'Y'    ;Underline off
  557.     IF    LIGHT
  558.     DB    ESC, '"'    ;Enhanced print off
  559.     ENDIF
  560.     IF    NOT LIGHT
  561.     DB    ESC, '!'    ;Enhanced print on
  562.     ENDIF
  563.     DB    CR        ;Move print head to left
  564. ;
  565.     ORG    PSFINI
  566.     DB    13        ;Length of sequence
  567.     DB    ESC, 'N'    ;10 chars per inch
  568.     DB    ESC, 'A'    ;6 lines per inch
  569.     DB    ESC, '$'    ;Alphanumeric output
  570.     DB    ESC, ']'    ;Logic-seeking mode
  571.     DB    ESC, 'Y'    ;Underline off
  572.     DB    ESC, '"'    ;Enhanced print off
  573.     DB    CR        ;Move print head to left
  574. ;
  575. ; *** Define underscore character ***
  576. ;
  577.     ORG    ULCHR
  578.     DB    80H        ;Graphics underscore
  579. ;
  580. ; *** Define "where to send output" code ***
  581. ;
  582.     ORG    CSWTCH
  583.     DB    0        ;CP/M list device
  584. ;
  585. ; *** Define "printer has no busy flag" code ***
  586. ;
  587.     ORG    HAVBSY
  588.     DB    0        ;No flag
  589. ;
  590. ; *** Install LISEND patch to check for special character ***
  591. ;
  592.     ORG    LISEND
  593.     CALL    PRINTC
  594.     ORA    A        ;Clear CY flag
  595.     RET
  596. ;
  597. ; *** Install user strings over alternate printer drivers ***
  598. ;
  599.     ORG    ALTPRTR
  600. ;
  601. UP$SEQ:
  602.     DB    ESC, '['    ;Incremental mode
  603.     DB    ESC, 'r'    ;Line feed direction is Reverse
  604.     DB    ESC, 'T09'    ;Line spacing = 9/144
  605.     DB    LF        ;Perform reverse line feed
  606.     DB    ESC, 'f'    ;Line feed direction is Forward
  607.     DB    ESC, 'A'    ;6 lines per inch
  608. ;
  609. DOWN$SEQ:
  610.     DB    ESC, '['    ;Incremental mode
  611.     DB    ESC, 'T09'    ;Line spacing = 9/144
  612.     DB    LF        ;Perform forward line feed
  613.     DB    ESC, 'A'    ;6 lines per inch
  614. ;
  615. ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  616. ; *   NOTE: address of all bytes in list must have same high-order byte *
  617. ; *         so that 8-bit addition may be used to compute address.     *
  618. ; *        be careful if you move this table                *
  619. ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  620. ;
  621. GREEK$TABLE:
  622.     DB    0EDH,0ECH,0D9H,0D0H,0A8H,0AFH,0A6H,0ADH
  623.     DB    0AEH,0A3H,0ACH,0CDH,0CEH,0A2H,0A5H,0DCH
  624.     DB    0C7H,0CCH,0B1H,0B3H,0B4H,0B5H,0D4H,0D5H
  625.     DB    0D6H,0A7H,0A9H,0A4H,0D2H,0A1H,0AAH,0ABH
  626.     DB    0C0H,0C3H,0B2H,0BDH,0B6H,0DDH,0C5H,0C6H
  627.     DB    0D7H,0BEH,0DEH,0DFH,0C1H,0C4H,0BCH,0CAH
  628.     DB    0B7H,0B8H,0CFH,0C9H,0D8H,0DAH,0B9H,0BAH
  629.     DB    0C2H,0BFH,0BBH,0D1H,0B0H,0CBH,0C8H
  630. ;
  631. GRK$FLAG:
  632.     DB    0        ;00H => off  FFH => on
  633. ;
  634. ; ********************************************
  635. ; ***                       ***
  636. ; ***  GRK$FLAG *MUST* BE LESS THAN 0783H  ***
  637. ; ***                       ***
  638. ; ********************************************
  639. ;
  640.     END
  641.