home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug016.arc / WORDBEE1.WSF < prev    next >
Text File  |  1979-12-31  |  5KB  |  178 lines

  1. ;    WORDBEE  MODIFICATIONS
  2. ;
  3. ;  Listing 1 which implements additional dot commands for
  4. ;  printing enhancements using Alpha-80 or similar.
  5. ;
  6.     DEFR    16
  7. LINE    EQU    0CC6EH    ;  Line space, Left margin, etc
  8. HEAD    EQU    0CCE1H    ;  Page header
  9. PAGE    EQU    0CCA9H    ;  Page number, length, gap
  10. CRLF    EQU    0CD04H    ;  Line feed suppression (.ZN)
  11. ES    EQU    0CD14H    ;  .ES 
  12.     ORG    0CBDCH    ;  Where the existing test routine                           is located
  13. CJUST    CP    'J'    ;  .JY ?
  14.     JR    Z,JUST
  15. CNEW    CP    'N'    ;  .NP ?
  16.     JR    Z,NEW
  17. CLINE    CP    'L'    ;  .LS#xx, .LM#xx, .LL#xx ?
  18.     JP    Z,LINE
  19. ;   To add a .LH letterhead, amend line 210 to read                    JP    Z,LHEAD - refer text
  20. CHEAD    CP    'H'    ;  .HE ?
  21.     JP    Z,HEAD
  22. CPAGE    CP    'P'    ;  .PN#xx ?
  23.     JP    Z,PAGE
  24. CCRLF    CP    'Z'    ;  .ZN ?
  25.     JP    Z,CRLF
  26. CUNDR    CP    'U'    ;  Underline ?
  27.     JR    Z,UNDR
  28. CITAL    CP    'I'    ;  Italics ?
  29.     JR    Z,ITAL
  30. CEMPH    CP    'M'    ;  eMphasised ?
  31.     JR    Z,EMPH
  32. CDUBL    CP    'D'    ;  Double strike ?
  33.     JR    Z,DUBL
  34. ;
  35.     JP    CFORM    ;  Tests are continued at another                           location ( C039 )
  36. ;
  37.     NOP        ;  a few spare bytes
  38.     NOP
  39.     NOP
  40. CONTIN    POP    HL    ;  an unchanged part of the                                 original program @ CC0E
  41.     LD    (0521H),IY  ; put back pointer
  42.     RET        ; to the normal printing routine
  43. ;
  44. JUST    LD    A,(IY+2)    ;  Get the next char
  45.     CP    'Y'        ; is it .JY ?
  46.     JR    Z,JY        ; if yes
  47.     XOR    A        ; else it must be .JN
  48. JY      LD    (0512H),A   ; flag for Justify ( 0 if no )
  49.     RET
  50. ; The justify routine has been shortened by deleting the                  test for .JN assuming it must be, if it was not a .JY
  51. ;
  52. NEW    LD    A,(IY+2)  ; Get next char
  53.     CP    'P'      ; .NP ?
  54.     JR    NZ,CONTIN ; if no then the test failed
  55.     JP    0CA0EH    ; the .NP routine has not changed
  56. ;
  57. ITAL    LD    A,(IY+2)  ; Get next char
  58.     LD    B,34H      ; ESC 34 turns italics on
  59. ;
  60. ; The following short OUT routine sends ESC and the
  61. ; contents of B to the print routine if YES or else
  62. ; the B register is increased by 1 before sending
  63. SOUT    CP    'Y'      ; is char 'Y' in register A ?
  64.     JR    Z,PRINT   ; if yes
  65.     INC    B      ; else increase B register
  66.     JR    PRINT      ; and then send it
  67. ;
  68. EMPH    LD    A,(IY+2)  ; Get next char
  69.     LD    B,45H      ; eMphasised on is ESC 45
  70.     JR    SOUT      ; use same routine as italics
  71. ;
  72. DUBL    LD    A,(IY+2)  ; Get next char
  73.     LD    B,47H       ; Double on is ESC 47
  74.     JR    SOUT      ; as above, increases B for no
  75. ;
  76. PRINT    LD    A,1BH      ; the ESC char
  77.     CALL    0CD54H      ; actually send it to printer
  78.     LD    A,B      ; ready to send contents of B
  79. PRINT2    CALL    0CD54H      ; send that to printer too
  80.     RET  ; printer codes have now been sent, continue
  81. PRINT3    LD    B,C      ; if there are more codes to go
  82.     JR    PRINT      ; send them too
  83. ;
  84. BIG    LD    A,(IY+2)  ; Get next char
  85.     LD    BC,5701H  ; ESC 57 1 for on, ESC 57 0 off
  86.     JR    LOUT      ; a longer OUT routine below
  87. ;
  88. UNDR    LD    A,(IY+2)  ; Get next char
  89.     LD    BC,2D01H  ; ESC 2D 1 - on, ESC 2D 0 - off
  90. ;
  91. ; This longer OUT routine sends (if yes) ESC, contents
  92. ; of B, contents of C.   If no, C is decreased by 1.
  93. ;
  94. LOUT    CP    'Y'      ; is it yes ?
  95.     JR    Z,LPRINT  ; if yes, print ESC, (B), (C)
  96.     DEC    C      ; must be no, decrease C
  97. LPRINT    CALL    PRINT      ; print ESC, (B)
  98.     LD    A,C      ; ready with next code
  99.     JR    PRINT2      ; now print that too
  100. ;
  101.     NOP
  102.     NOP
  103.     NOP
  104.     NOP
  105. ;
  106. ;
  107.     ORG    0C017    ; The start of 'Checking . . .
  108. ;
  109.     CALL    0C1C8    ; switches on parallel port
  110.     LD    A,2    ; but is no longer required
  111.     LD    (00E3),A ; as parallel is now default.
  112. ;
  113. ; The next part is just a copy of C057 - C068 which has
  114. ; in effect been moved to C01F
  115. ;
  116.     LD    HL,0500
  117.     LD    A,(HL)
  118.     CP    55
  119.     JP    Z,0C1D5    ; Top of file
  120.     LD    (HL),55
  121.     LD    B,0E1
  122. AGAIN    INC    HL
  123.     LD    (HL),0
  124.     DJNZ    AGAIN
  125.     JP    0C069    ; which used to follow this
  126. ; a few NOPs to fill a hole
  127.     NOP
  128.     NOP
  129.     NOP
  130.     NOP
  131.     NOP
  132. ;
  133. CFORM    CP    'F'    ; Form feed ?
  134.     JR    NZ,CCOND
  135.     LD    A,0CH    ; FF character
  136.     CALL    0CD54    ; send it to printer
  137.     RET        ; finished
  138. ;
  139. CCOND    CP    'C'    ; Condensed ?
  140.     JR    Z,COND
  141. CSUBP    CP    'S'    ; Subscript or Superscript ?
  142.     JP    Z,SUBP
  143. CES    CP    'E'    ; .ES command ?
  144.     JP    Z,ES
  145. CBIG    CP    'B'    ; Big (enlarged) ?
  146.     JP    Z,BIG
  147. ; No more tests, so must have been a wrong command.
  148.     JP    CONTIN    ; Continue on with printing
  149. ;
  150. COND    LD    A,(IY+2)  ; Get next char
  151.     CP    'Y'      ; is it .CY ?
  152.     LD    A,0FH      ; it may be
  153.     JR    Z,CONOUT  ; if it was
  154.     LD    A,12      ; must be no
  155. CONOUT    JP    0CD54 ; send char 0F for yes or 12 for no
  156.     NOP
  157.     NOP        ; a few more gaps
  158. ;
  159. ; Out of space so jump to another hole
  160. ;
  161.     ORG    0C138    ; Where 'Are you sure' used to be
  162. ;
  163. SUBP    LD    A,(IY+2)  ; Get next char
  164.     LD    BC,5301      ; Subscript perhaps
  165.     CP    'B'      ; is it ?
  166.     JR    Z,SUB      ; if so
  167.     CP    'P'      ; suPerscript ?
  168.     JR    Z,SUPER      ; if correct
  169.     LD    BC,4854      ; must be a cancellation
  170.     CALL    PRINT      ; to send ESC (B)
  171.     JP    PRINT3      ; to send ESC (C)
  172. SUPER    DEC    C      ; change BC to 5300
  173. SUB    JP    LPRINT      ; which sends ESC (B) (C)
  174. ; Note how the contents of BC vary for each condition.
  175. ;
  176.     END          ; of listing 1
  177.