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 / MBUG / MBUG062.ARC / PS.DOC < prev    next >
Text File  |  1979-12-31  |  7KB  |  138 lines

  1.                  PS.CO═ ║ Printe≥ Setter-upper«
  2.  
  3.                       b∙ Alaε Sheehaε B.E«
  4.  
  5. Havσá yo⌡ eve≥ beeε workinτ iε CP/═ anΣ wanteΣ t∩ lis⌠ ß filσá oε ì
  6. thσá printe≥ iε ß non-defaul⌠ characte≥ sizσ o≥ font┐á O≥ d∩á yo⌡ ì
  7. havσá ßá .CO═ filσ tha⌠ assume≤ morσ character≤ pe≥ linσá oεá thσ ì
  8. printe≥á thaε thσ defaul⌠ setting┐á Iµ so¼á thi≤á littlσá utilit∙ ì
  9. program can help.
  10.  
  11. P╙á i≤ ß standarΣ CP/═ utilit∙ t∩ allo≈ contro∞ code≤ t∩ bσá sen⌠ ì
  12. t∩á thσá LST║á device«á Thσ ideß wa≤ borε wheε listinτ ßá lo⌠á oµ ì
  13. publiπá domaiε .PR╬ files«á Man∙ oµ theφ werσ usinτ morσ thaεá 8░ ì
  14. character≤á pe≥á linσ becausσ thσ author≤ haΣ useΣ 8░á character≤ ì
  15. fo≥á thei≥ assembl∙ listings«á Thu≤ wheε thσ column≤á fo≥á memor∙ ì
  16. addresse≤á anΣ he° codσ werσ added¼á thσ .PR╬ file≤ spilleΣá ove≥ ì
  17. ont∩ thσ nex⌠ line«
  18.  
  19. Thi≤á als∩á occurreΣá witΦá somσá oµá m∙á owεá EDAS═á file≤á wheε ì
  20. assemblinτá witΦ thσ /L╨ switcΦ selected¼á causinτ thσá page≤á oµ ì
  21. listinτ t∩ var∙ iε lengtΦ anΣ thσ pagσ break≤ t∩ ge⌠ ou⌠ oµ phasσ ì
  22. witΦá thσ pape≥ joins«á Thσ onl∙ remed∙ wa≤ t∩ se⌠ thσ printe≥ u≡ ì
  23. oεá compresseΣá prin⌠á modσ beforσ hanΣ anΣ hopσá n∩á line≤á werσ ì
  24. longe≥ thaε 13▓ characters!
  25.  
  26. ╔á founΣá i⌠á annoyinτ t∩ havσ t∩ boo⌠ BASI├ jus⌠á t∩á senΣá somσ ì
  27. contro∞ code≤ t∩ thσ printer¼á anΣ it≤ no⌠ elegan⌠ t∩ wastσ 2╦ oµ ì
  28. disδá spacσá jus⌠ t∩ havσ ▓ o≥ │ byte≤ oµ contro∞ code≤á fo≥á onσ ì
  29. particula≥ printe≥ set-up« I⌠ seemeΣ ß mucΦ bette≥ propositioε t∩ ì
  30. usσ 2╦ oµ disδ spacσ fo≥ ß prograφ capablσ oµ sendinτ an∙ contro∞ ì
  31. code≤ desired.
  32.  
  33. HOW TO DRIVE IT
  34.  
  35. T∩á senΣá contro∞ code≤ t∩ thσ printe≥ froφ CP/═ jus⌠ typσ P╙á a⌠ ì
  36. thσ CP/═ systeφ prompt« Thσ titlσ anΣ ß brieµ explanatioε oµ wha⌠ ì
  37. i≤ requireΣ fo≥ inpu⌠ i≤ displayed.
  38.  
  39. Inpu⌠á shoulΣá bσá a≤ onσ continuou≤á strinτá witΦá eacΦá contro∞ ì
  40. characte≥á specifieΣ b∙ it'≤ He° code«á Code≤ shoulΣ bσ separateΣ ì
  41. b∙á spaces¼á thougΦ thi≤ i≤ no⌠ mandatory«á BotΦ uppe≥ anΣá lowe≥ ì
  42. casσ character≤ arσ acceptablσ (┴ - F¼ ß - f).
  43.  
  44. An∙á illega∞ character≤ wil∞ bσ signalleΣ b∙ aε illega∞ characte≥ ì
  45. erro≥ message.
  46.  
  47. Aε illega∞ forma⌠ erro≥ wil∞ appea≥ iµ thσ inpu⌠ i≤ no⌠ specifieΣ ì
  48. iε ▓ digi⌠ He° code« e.g.
  49. Inpu⌠ string
  50.  1┬ 4─    ;thi≤ i≤ OK.
  51.  1b4Σ     ;thi≤ i≤ O╦ too.
  52.  1Γ ┤     ;thi≤ i≤ aε illega∞ format.
  53.  1┬  0┤   ;thi≤ i≤ OK.
  54.  1╧ 7╖    ;╧ i≤ aε illega∞ characte≥ (shoulΣ bσ 0)
  55.  
  56. BotΦ erro≥ trappinτ routine≤ returε contro∞ t∩ CP/═ t∩ allo≈á thσ ì
  57. use≥á t∩á tr∙ again«á N∩ code≤ arσ sen⌠ t∩ thσ printe≥á til∞á thσ ì
  58. whole input string is correct.
  59.  
  60. Thσ inpu⌠ strinτ caε bσ u≡ t∩ 25╡ character≤ long«á An∙ numbe≥ oµ ì
  61. space≤ caε bσ useΣ betweeε code≤ bu⌠ al∞ code≤ mus⌠ bσ iε ▓ digi⌠ ìèform«á An∙ characte≥ codσ caε bσ sen⌠ t∩ thσ printe≥ (code≤ 0░ t∩ ì
  62. F╞ Hex).
  63.  
  64. HOW IT WORKS
  65.  
  66. P╙á i≤ ß standarΣ CP/═ .CO═ file¼á s∩ al∞ thσ interfacinτ betweeε ì
  67. the program and the printer, keyboard and screen is done by BDOS.
  68.  
  69. Al∞á thσ function≤ availablσ iε BDO╙ arσ selecteΣ b∙ holdinτá thσ ì
  70. functioεá numbe≥á iε thσ ├ register¼á anΣ CALLinτ thσá BDO╙á jum≡ ì
  71. vector at 0005H. The BDOS functions used by the program are:
  72.  
  73. FCN #     FUNCTION
  74. 5    send 1 character to the LST: device (printer)
  75. ╣    prin⌠ ß messagσ endinτ witΦ ß ñ sigε oε thσ consolσ (screen)
  76. 10   get an input string from console (keyboard)
  77.  
  78. S∩á al∞ contro∞ code≤ arσ sen⌠ t∩ thσ printe≥ usinτ BDO╙ functioε ì
  79. 5¼á al∞ thσ screeε message≤ b∙ functioε 9¼á anΣ al∞ thσá keyboarΣ ì
  80. input by function 10.
  81.  
  82. Oncσá al∞ thσ initia∞ message≤ arσ displayeΣ anΣ thσ strinτ inpu⌠ ì
  83. buffe≥ i≤ se⌠ u≡ (line≤ 20░ t∩ 280)¼ thσ prograφ start≤ it≤ firs⌠ ì
  84. pas≤ ove≥ thσ inpu⌠ strinτ (line≤ 33░ t∩ 500)«
  85.  
  86. Oε thσ firs⌠ pass¼ eacΦ characte≥ i≤ checkeΣ iε turε t∩ seσ iµ i⌠ ì
  87. i≤ valid¼á anΣ iµ s∩ i≤ converteΣ t∩ uppe≥ case«á Character≤á pu⌠ ì
  88. througΦá thσá routinσ t∩ conver⌠ theφ t∩ uppe≥ casσá arσá writteε ì
  89. bacδ int∩ thσ buffe≥ fo≥ subsequen⌠ passes.
  90.  
  91. Illega∞á character≤ resul⌠ iε prograφ executioε jumpinτ t∩á ERR1║ ì
  92. the routine that displays the illegal character error message.
  93.  
  94. Thσ seconΣ pas≤ ove≥ thσ strinτ i≤ conducteΣ iε line≤ 54░ t∩ 700« ì
  95. Herσ thσ forma⌠ oµ thσ inpu⌠ strinτ i≤ checked« EacΦ codσ mus⌠ bσ ì
  96. specified by 2 ascii characters.
  97.  
  98. Thσ thirΣ anΣ fina∞ pas≤ i≤ theε performeΣ knowinτ tha⌠ thσ inpu⌠ ì
  99. strinτá i≤á iε thσ correc⌠ forma⌠ anΣ n∩ illega∞á character≤á arσ ì
  100. presen⌠ (line≤ 74░ t∩ 950)«á Al∞ character≤ othe≥ thaε space≤ arσ ì
  101. processeΣá througΦá line≤ 86░ t∩ 940«á Noticσ tha⌠ thσ B├ anΣá H╠ ì
  102. registe≥ pair≤ arσ PUSHeΣ ont∩ thσ stacδ beforσ callinτ BDOS¼ anΣ ì
  103. POPpeΣ ofµ agaiε afterwards«á Iµ thi≤ wa≤ no⌠ done¼á thσá counte≥ ì
  104. anΣ strinτ pointe≥ woulΣ havσ beeε lost║á destroyeΣ b∙ BDOS«á Thσ ì
  105. value≤á iε thσ othe≥ register≤ werσ no⌠ importan⌠ enougΦ t∩á kee≡ ì
  106. s∩ the∙ werσ no⌠ saveΣ oε thσ stack.
  107.  
  108. Thσ littlσ ┤ bytσ routinσ iε line≤ 100░ anΣ 101░ i≤ actuall∙ par⌠ ì
  109. oµ thσ firs⌠ pas≤ routine«á Iµ ß characte≥ i≤ founΣ iε thσá inpu⌠ ì
  110. strinτá witΦ aε asciΘ valuσ les≤ thaε tha⌠ fo≥ thσ characte≥ '0'¼ ì
  111. thσ prograφ woulΣ havσ jumpeΣ here«á Sincσ thσ <SPACE╛á characte≥ ì
  112. fall≤ int∩ thi≤ rangσ bu⌠ i≤ no⌠ illegal¼ i⌠ i≤ necessar∙ t∩ tes⌠ ì
  113. fo≥ ß <SPACE╛ anΣ jum≡ bacδ t∩ thσ firs⌠ pas≤ routinσ iµ thσ tes⌠ ì
  114. prove≤á true«á Iµá thσ characte≥ i≤ no⌠ ßá <SPACE>¼á thσá prograφ ì
  115. simpl∙á "fall≤á throughóá t∩á thσ erro≥ messagσá fo≥á aεá illega∞ ì
  116. character.
  117.  
  118. Thσá erro≥ message≤ anΣ thσ codσ tha⌠ passe≤ theφ t∩ BDO╙á t∩á bσ ì
  119. displayeΣ arσ oε line≤ 108░ t∩ 1320« Notσ tha⌠ ß characte≥ 0D╚ i≤ ì
  120. ß carriagσ return¼á 0A╚ i≤ ß linσ feed¼á anΣ ß characte≥ ╖ i≤ thσ ì
  121. BEL╠á (o≥ "beepó iε thσ casσ oµ mos⌠ moderε micros)«á Al∞ string≤ ìèprinteΣá b∙ BDO╙ functioε ╣ mus⌠ enΣ witΦ ß ñ sigε s∩ CP/═á know≤ ì
  122. when it has reached the end of the message.
  123.  
  124. Thσá subroutinσá oεá line≤á 138░ t∩á 158░á convert≤á thσá nex⌠á ▓ ì
  125. character≤á oµ thσ inpu⌠ strinτ int∩ ß singlσ contro∞á code«á Thσ ì
  126. subroutinσá i≤á entereΣá witΦ H╠ pointinτ t∩ thσ firs⌠ oµá thσá ▓ ì
  127. characters« Oε exi⌠ oµ thσ subroutinσ thσ contro∞ characte≥ i≤ iε ì
  128. thσ ├ register¼á anΣ H╠ i≤ pointinτ t∩ thσ nex⌠ characte≥ iεá thσ ì
  129. input string.
  130.  
  131. Thσá remainde≥á oµ thσ prograφ define≤ thσ prograφ boot-u≡á titlσ ì
  132. anΣ explanator∙ text¼á anΣ set≤ asidσ spacσ fo≥ thσ inpu⌠á strinτ ì
  133. buffer.
  134. ..Note that PS.EDT is provided, not a .BRO file.
  135. ..I found CONVM80 strips all line numbers off the listing
  136. ..and as I refer to them in the text, this wasn't satisfactory.
  137. ..        Hope you can do something with this, AS.
  138.