home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug062.arc
/
PS.DOC
< prev
next >
Wrap
Text File
|
1979-12-31
|
7KB
|
138 lines
PS.CO═ ║ Printe≥ Setter-upper«
b∙ Alaε Sheehaε B.E«
Havσá yo⌡ eve≥ beeε workinτ iε CP/═ anΣ wanteΣ t∩ lis⌠ ß filσá oε ì
thσá printe≥ iε ß non-defaul⌠ characte≥ sizσ o≥ font┐á O≥ d∩á yo⌡ ì
havσá ßá .CO═ filσ tha⌠ assume≤ morσ character≤ pe≥ linσá oεá thσ ì
printe≥á thaε thσ defaul⌠ setting┐á Iµ so¼á thi≤á littlσá utilit∙ ì
program can help.
P╙á i≤ ß standarΣ CP/═ utilit∙ t∩ allo≈ contro∞ code≤ t∩ bσá sen⌠ ì
t∩á thσá LST║á device«á Thσ ideß wa≤ borε wheε listinτ ßá lo⌠á oµ ì
publiπá domaiε .PR╬ files«á Man∙ oµ theφ werσ usinτ morσ thaεá 8░ ì
character≤á pe≥á linσ becausσ thσ author≤ haΣ useΣ 8░á character≤ ì
fo≥á thei≥ assembl∙ listings«á Thu≤ wheε thσ column≤á fo≥á memor∙ ì
addresse≤á anΣ he° codσ werσ added¼á thσ .PR╬ file≤ spilleΣá ove≥ ì
ont∩ thσ nex⌠ line«
Thi≤á als∩á occurreΣá witΦá somσá oµá m∙á owεá EDAS═á file≤á wheε ì
assemblinτá witΦ thσ /L╨ switcΦ selected¼á causinτ thσá page≤á oµ ì
listinτ t∩ var∙ iε lengtΦ anΣ thσ pagσ break≤ t∩ ge⌠ ou⌠ oµ phasσ ì
witΦá thσ pape≥ joins«á Thσ onl∙ remed∙ wa≤ t∩ se⌠ thσ printe≥ u≡ ì
oεá compresseΣá prin⌠á modσ beforσ hanΣ anΣ hopσá n∩á line≤á werσ ì
longe≥ thaε 13▓ characters!
╔á founΣá i⌠á annoyinτ t∩ havσ t∩ boo⌠ BASI├ jus⌠á t∩á senΣá somσ ì
contro∞ code≤ t∩ thσ printer¼á anΣ it≤ no⌠ elegan⌠ t∩ wastσ 2╦ oµ ì
disδá spacσá jus⌠ t∩ havσ ▓ o≥ │ byte≤ oµ contro∞ code≤á fo≥á onσ ì
particula≥ printe≥ set-up« I⌠ seemeΣ ß mucΦ bette≥ propositioε t∩ ì
usσ 2╦ oµ disδ spacσ fo≥ ß prograφ capablσ oµ sendinτ an∙ contro∞ ì
code≤ desired.
HOW TO DRIVE IT
T∩á senΣá contro∞ code≤ t∩ thσ printe≥ froφ CP/═ jus⌠ typσ P╙á a⌠ ì
thσ CP/═ systeφ prompt« Thσ titlσ anΣ ß brieµ explanatioε oµ wha⌠ ì
i≤ requireΣ fo≥ inpu⌠ i≤ displayed.
Inpu⌠á shoulΣá bσá a≤ onσ continuou≤á strinτá witΦá eacΦá contro∞ ì
characte≥á specifieΣ b∙ it'≤ He° code«á Code≤ shoulΣ bσ separateΣ ì
b∙á spaces¼á thougΦ thi≤ i≤ no⌠ mandatory«á BotΦ uppe≥ anΣá lowe≥ ì
casσ character≤ arσ acceptablσ (┴ - F¼ ß - f).
An∙á illega∞ character≤ wil∞ bσ signalleΣ b∙ aε illega∞ characte≥ ì
erro≥ message.
Aε illega∞ forma⌠ erro≥ wil∞ appea≥ iµ thσ inpu⌠ i≤ no⌠ specifieΣ ì
iε ▓ digi⌠ He° code« e.g.
Inpu⌠ string
1┬ 4─ ;thi≤ i≤ OK.
1b4Σ ;thi≤ i≤ O╦ too.
1Γ ┤ ;thi≤ i≤ aε illega∞ format.
1┬ 0┤ ;thi≤ i≤ OK.
1╧ 7╖ ;╧ i≤ aε illega∞ characte≥ (shoulΣ bσ 0)
BotΦ erro≥ trappinτ routine≤ returε contro∞ t∩ CP/═ t∩ allo≈á thσ ì
use≥á t∩á tr∙ again«á N∩ code≤ arσ sen⌠ t∩ thσ printe≥á til∞á thσ ì
whole input string is correct.
Thσ inpu⌠ strinτ caε bσ u≡ t∩ 25╡ character≤ long«á An∙ numbe≥ oµ ì
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∩ ì
F╞ Hex).
HOW IT WORKS
P╙á i≤ ß standarΣ CP/═ .CO═ file¼á s∩ al∞ thσ interfacinτ betweeε ì
the program and the printer, keyboard and screen is done by BDOS.
Al∞á thσ function≤ availablσ iε BDO╙ arσ selecteΣ b∙ holdinτá thσ ì
functioεá numbe≥á iε thσ ├ register¼á anΣ CALLinτ thσá BDO╙á jum≡ ì
vector at 0005H. The BDOS functions used by the program are:
FCN # FUNCTION
5 send 1 character to the LST: device (printer)
╣ prin⌠ ß messagσ endinτ witΦ ß ñ sigε oε thσ consolσ (screen)
10 get an input string from console (keyboard)
S∩á al∞ contro∞ code≤ arσ sen⌠ t∩ thσ printe≥ usinτ BDO╙ functioε ì
5¼á al∞ thσ screeε message≤ b∙ functioε 9¼á anΣ al∞ thσá keyboarΣ ì
input by function 10.
Oncσá al∞ thσ initia∞ message≤ arσ displayeΣ anΣ thσ strinτ inpu⌠ ì
buffe≥ i≤ se⌠ u≡ (line≤ 20░ t∩ 280)¼ thσ prograφ start≤ it≤ firs⌠ ì
pas≤ ove≥ thσ inpu⌠ strinτ (line≤ 33░ t∩ 500)«
Oε thσ firs⌠ pass¼ eacΦ characte≥ i≤ checkeΣ iε turε t∩ seσ iµ i⌠ ì
i≤ valid¼á anΣ iµ s∩ i≤ converteΣ t∩ uppe≥ case«á Character≤á pu⌠ ì
througΦá thσá routinσ t∩ conver⌠ theφ t∩ uppe≥ casσá arσá writteε ì
bacδ int∩ thσ buffe≥ fo≥ subsequen⌠ passes.
Illega∞á character≤ resul⌠ iε prograφ executioε jumpinτ t∩á ERR1║ ì
the routine that displays the illegal character error message.
Thσ seconΣ pas≤ ove≥ thσ strinτ i≤ conducteΣ iε line≤ 54░ t∩ 700« ì
Herσ thσ forma⌠ oµ thσ inpu⌠ strinτ i≤ checked« EacΦ codσ mus⌠ bσ ì
specified by 2 ascii characters.
Thσ thirΣ anΣ fina∞ pas≤ i≤ theε performeΣ knowinτ tha⌠ thσ inpu⌠ ì
strinτá i≤á iε thσ correc⌠ forma⌠ anΣ n∩ illega∞á character≤á arσ ì
presen⌠ (line≤ 74░ t∩ 950)«á Al∞ character≤ othe≥ thaε space≤ arσ ì
processeΣá througΦá line≤ 86░ t∩ 940«á Noticσ tha⌠ thσ B├ anΣá H╠ ì
registe≥ pair≤ arσ PUSHeΣ ont∩ thσ stacδ beforσ callinτ BDOS¼ anΣ ì
POPpeΣ ofµ agaiε afterwards«á Iµ thi≤ wa≤ no⌠ done¼á thσá counte≥ ì
anΣ strinτ pointe≥ woulΣ havσ beeε lost║á destroyeΣ b∙ BDOS«á Thσ ì
value≤á iε thσ othe≥ register≤ werσ no⌠ importan⌠ enougΦ t∩á kee≡ ì
s∩ the∙ werσ no⌠ saveΣ oε thσ stack.
Thσ littlσ ┤ bytσ routinσ iε line≤ 100░ anΣ 101░ i≤ actuall∙ par⌠ ì
oµ thσ firs⌠ pas≤ routine«á Iµ ß characte≥ i≤ founΣ iε thσá inpu⌠ ì
strinτá witΦ aε asciΘ valuσ les≤ thaε tha⌠ fo≥ thσ characte≥ '0'¼ ì
thσ prograφ woulΣ havσ jumpeΣ here«á Sincσ thσ <SPACE╛á characte≥ ì
fall≤ int∩ thi≤ rangσ bu⌠ i≤ no⌠ illegal¼ i⌠ i≤ necessar∙ t∩ tes⌠ ì
fo≥ ß <SPACE╛ anΣ jum≡ bacδ t∩ thσ firs⌠ pas≤ routinσ iµ thσ tes⌠ ì
prove≤á true«á Iµá thσ characte≥ i≤ no⌠ ßá <SPACE>¼á thσá prograφ ì
simpl∙á "fall≤á throughóá t∩á thσ erro≥ messagσá fo≥á aεá illega∞ ì
character.
Thσá erro≥ message≤ anΣ thσ codσ tha⌠ passe≤ theφ t∩ BDO╙á t∩á bσ ì
displayeΣ arσ oε line≤ 108░ t∩ 1320« Notσ tha⌠ ß characte≥ 0D╚ i≤ ì
ß carriagσ return¼á 0A╚ i≤ ß linσ feed¼á anΣ ß characte≥ ╖ i≤ thσ ì
BEL╠á (o≥ "beepó iε thσ casσ oµ mos⌠ moderε micros)«á Al∞ string≤ ìèprinteΣá b∙ BDO╙ functioε ╣ mus⌠ enΣ witΦ ß ñ sigε s∩ CP/═á know≤ ì
when it has reached the end of the message.
Thσá subroutinσá oεá line≤á 138░ t∩á 158░á convert≤á thσá nex⌠á ▓ ì
character≤á oµ thσ inpu⌠ strinτ int∩ ß singlσ contro∞á code«á Thσ ì
subroutinσá i≤á entereΣá witΦ H╠ pointinτ t∩ thσ firs⌠ oµá thσá ▓ ì
characters« Oε exi⌠ oµ thσ subroutinσ thσ contro∞ characte≥ i≤ iε ì
thσ ├ register¼á anΣ H╠ i≤ pointinτ t∩ thσ nex⌠ characte≥ iεá thσ ì
input string.
Thσá remainde≥á oµ thσ prograφ define≤ thσ prograφ boot-u≡á titlσ ì
anΣ explanator∙ text¼á anΣ set≤ asidσ spacσ fo≥ thσ inpu⌠á strinτ ì
buffer.
..Note that PS.EDT is provided, not a .BRO file.
..I found CONVM80 strips all line numbers off the listing
..and as I refer to them in the text, this wasn't satisfactory.
.. Hope you can do something with this, AS.