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
/
MBUG075.ARC
/
ANYCODE.DOC
< prev
next >
Wrap
Text File
|
1979-12-31
|
17KB
|
420 lines
ANYCODE
Original by : Doug Hurst
Modified by : C.G. SIEBEN
PLEASE!íá Givσá thi≤á articlσá ß looδ eveε iµá i⌠á seem≤á somewha⌠ ì
complicated«á I⌠ i≤ ß useful¼á valuablσ modificatioε t∩ WordSta≥ anΣ i≤ ì
quitσ simplσ iµ yo⌡ wil∞ takσ i⌠ ste≡ b∙ step«
VALUE«á Make≤á WordSta≥ morσ powerfu∞ anΣ tex⌠ file≤ morσ flexiblσá anΣ ì
portable«á ANYCOD┼á doe≤á thi≤ withou⌠ enlarginτ thσ sizσ oµá thσá maiε ì
WordSta≥á prograφ WS.COM«á Thi≤ i≤ ß ver∙ importan⌠ point«á B∙á keepinτ ì
WS.CO═á confineΣá t∩ it≤ "stockó size¼á i⌠ ma∙ installeΣ o≥á reinstalleΣ ì
usinτá INSTALL.CO═á a⌠á wil∞ withou⌠ affectinτ o≥á havinτá t∩á reinstal∞ ì
ANYCODE.
INTRODUCTION.
Thσ EPSO╬ FX¼á M╪ (w/Graftrax⌐ anΣ R╪ series¼ a≤ wel∞ a≤ man∙ othe≥ ì
brand≤ oµ printers¼ havσ man∙ morσ mode≤ oµ operatioε availablσ thaε caε ì
bσ accesseΣ b∙ ß normall∙ installeΣ WordStar¼á eveε iµ onσ use≤ al∞á thσ ì
built-iε anΣ use≥ defineΣ prin⌠ contro∞ codσ facilitie≤ available«á No⌠ ì
onl∙á caεá thesσ built-iε anΣ use≥ defineΣ code≤ NO╘ kee≡ pacσ witΦá thσ ì
printer'≤á capability¼á oncσ installed¼á the∙ arσ no⌠ alterablσá withou⌠ ì
usinτá DDT/SID.CO═á o≥á WordStar'≤á INSTALL.COM«áá Therσá arσáá severa∞ ì
commerciall∙á availablσ program≤ tha⌠ wil∞ le⌠ yo⌡ senΣ al∞ thσá contro∞ ì
code≤ ß printe≥ wil∞ accept« The∙ diffe≥ froφ thσ onσ presenteΣ iε thi≤ ì
articlσá iεá tha⌠ thi≤ onσ i≤ free«á Thi≤ articlσ i≤ als∩á designeΣá t∩ ì
servσá thσ dua∞ purposσ oµ displayinτ ho≈ mucΦ untappeΣ potentia∞á therσ ì
i≤ iε standarΣ WordStar«
USING ANYCODE.
Beforσá gettinτ int∩ thσ codinτ anΣ installatioε oµ ANYCODE¼á i⌠ i≤ ì
importan⌠ t∩ seσ wha⌠ thσ outcomσ oµ you≥ effort≤ wil∞ be«á Thi≤á will¼ ì
i⌠á i≤ hoped¼á piquσ you≥ interes⌠ anΣ kee≡ yo⌡ froφ givinτ up«á Iµ yo⌡ ì
regularl∙ usσ ß WordSta≥ witΦ CHARTEC╚ o≥ simila≥ prograφ installed¼ yo⌡ ì
alread∙ posses≤ thσ functioε tha⌠ ANYCOD┼ wil∞ perform«á You'rσ welcomσ ì
t∩ continuσ anyway«á A≤ mentioneΣ earlier¼ ß nicσ featurσ oµ ANYCOD┼ i≤ ì
tha⌠ i⌠ doe≤ no⌠ enlargσ thσ sizσ oµ WS.CO═ a≤ man∙ simila≥ commerciall∙ ì
availablσ product≤ do.
Oncσ installed¼ usσ oµ ANYCOD┼ code≤ ha≤ thσ samσ functiona∞ effec⌠ ì
a≤á WordStar'≤ prin⌠ contro∞ codes«á InsteaΣ oµ embeddinτ theφá iεá thσ ì
tex⌠ witΦ ß prin⌠ contro∞ codσ sucΦ a≤ ^PS¼á however¼á yo⌡ ente≥ ANYCOD┼ ì
ver∙á mucΦ a≤ thσ code≤ actuall∙ appea≥ iε you≥ printer'≤ user'≤ manual« ì
ANYCOD┼á codes¼á however¼á arσ no⌠ invisiblσ t∩ thσá editor«á Iεá othe≥ ì
words¼á wheεá yo⌡ placσ ANYCODE'≤ code≤ iε you≥ text¼á the∙ arσá treateΣ ì
jus⌠ likσ norma∞ tex⌠ b∙ WordStar«á Thi≤ mean≤ the∙ wil∞ bσ includeΣ iε ì
sucΦ function≤ a≤ wordwra≡ anΣ paragrapΦ reformatting« Fo≥ thi≤ reason¼ ì
i⌠ i≤ suggesteΣ tha⌠ yo⌡ ente≥ al∞ you≥ text¼á ge⌠ i⌠ formatteΣ jus⌠ thσ ì
wa∙ yo⌡ want¼ theε g∩ bacδ anΣ inser⌠ thσ ANYCOD┼ codes«
Thi≤á ma∙á forcσ yo⌡ t∩ usσ thσ ^O╪ (releasσ margin⌐á commanΣá morσ ì
thaεá yo⌡á arσ useΣ t∩ (somσ line≤ wil∞ extenΣ fa≥ beyonΣá thσá margin)« ì
Thi≤á shoulΣá bσ oµ n∩ concerε t∩ yo⌡ thougΦ becausσ ANYCOD┼á code≤á arσ ì
non-printinτ jus⌠ likσ WordStar'≤ prin⌠ contro∞ codes«á Thσ actua∞ linσ ì
wil∞ fi⌠ withiε thσ margin≤ iµ i⌠ diΣ prio≥ t∩ codσ insertion.
ANYCOD┼ code≤ wil∞ usuall∙ takσ onσ oµ thσ threσ form≤ showε below¼ ì
jus⌠ a≤ mos⌠ printer≤ accep⌠ code≤ iε onσ oµ thesσ threσ forms.
straight hex code
escape + hex code
escapσ + he° codσ + traile≥ code 1 + traile≥ code 2....+ trailer code n
Belo≈ arσ ANYCOD┼ example≤ oµ eacΦ typσ fo≥ EPSO╬ printers:
`0F Would transmit 0Fh (turn condensed print mode on).
~45 Would transmit <ESC>,45h (turn emphasized print on).
~2D`0▒ WoulΣ transmi⌠ <ESC>,2Dh,0▒ (turε oε continuou≤ ì
underline).
A≤ ß furthe≥ example¼á ß shor⌠ sectioε oµ text¼ firs⌠ withou⌠ code≤ ì
anΣ theε witΦ ANYCOD┼ code≤ embedded.
Dear Bob,
Just wanted to let you know I was thrilled with the modified
BIOS you sent me. It worked SUPER.
Dear Bob,
Just wanted to let you know I was ~34thrilled~35 with the modified
~2D`01BIOS~2D`00 you sent me. It worked `0ESUPER!`14.
Iε thσ lowe≥ examplσ witΦ thσ embeddeΣ (agaiε EPSON⌐ codes¼ ~3┤ anΣ ì
~3╡á turε italic≤ on/off¼á ~2D`0▒ anΣ ~2D`0░ turn≤ underlinσ on/ofµá anΣ ì
`0┼ anΣ `1┤ turε expandeΣ prin⌠ on/off.
Noticσá ho≈á thσá firs⌠ linσ no≈ extend≤ pas⌠á thσá norma∞á margin« ì
Again¼á i⌠ WIL╠ NO╘ wheε thσ printinτ actuall∙ take≤ placσ sincσ ANYCOD┼ ì
codσ i≤ non-printing.
Herσ arσ ß wrong¼ theε ß righ⌠ examplσ oµ ANYCOD┼ syntax.
WRONG
`FNo≈ i≤ thσ timσ fo≥ ......« thσ aiΣ oµ thei≥ countries.`12
Meaninτ t∩ turε compresseΣ prin⌠ on/off«á N∩ zer∩ ░ betweeε thσá α ì
anΣ ╞ a⌠ beginninτ oµ thσ sentence« PROMISEí Thi≤ wil∞ no⌠ work.
RIGHT
`0FNo≈ i≤ thσ timσ fo≥ ......« thσ aiΣ oµ thei≥ countries.`12
PROMISEí Thi≤ wil∞ work.
Iµá yo⌡á haven'⌠ seeε thσ obviou≤ advantagσ t∩ sendinτ thσá printe≥ ì
code≤á iε thσ ANYCOD┼ forma⌠ ove≥ WordStar'≤ code≤ yet¼á herσá arσá two« ì
First¼ yo⌡ caε senΣ an∙ codσ t∩ thσ printer« (Okay¼ thσ cat≤ ou⌠ oµ thσ ì
bag¼á no≈ yo⌡ kno≈ wherσ thσ namσ oµ thσ prograφ camσ from.⌐ Second¼ sa∙ ì
yo⌡ prepareΣ thσ documen⌠ oε you≥ Microbeσ whicΦ i≤ installeΣ witΦ Prin⌠ ì
Control≤ t∩ senΣ EPSO╬ codes« Thσ compute≥ a⌠ work¼ however¼ i≤ drivinτ ì
ß NE├ printer«á WitΦ ANYCOD┼ code≤ embeddeΣ iε thσ text¼ wouldn'⌠ i⌠ bσ ì
eas∙á t∩ usσ thσ FinΣ anΣ Replacσ (^QA⌐ commanΣ t∩ finΣ thσ EPSO╬á code≤ ì
anΣ substitutσ NE├ codes┐ Answe≥ ye≤ s∩ wσ caε continue.
Therσ arσ ß fe≈ cautions¼ anΣ yo⌡ ma∙ a≤ wel∞ kno≈ theφ now«
1«á Usσ al∞ capita∞ letter≤ ¿ `0A¼ NO╘ `0ß )¿ anΣ that'≤ zer∩ ì
no⌠ o ).
2«á EacΦá he° codσ mus⌠ bσ tw∩ digits«á ( ╡ entereΣ a≤á 05¼á ┼ ì
entereΣ a≤ 0E¼ etc. )
3«á Duσá t∩ spacσ limitation≤ anΣ ß desirσ oε thσ par⌠ oµ thσ ì
autho≥ t∩ kee≡ ANYCOD┼ confineΣ t∩ thσ MORPAT║á areß (explaineΣá later)¼ ì
n∩ provision≤ werσ madσ t∩ bσ ablσ t∩ prin⌠ thσ lead-iε character≤ α anΣ ì
~«á Iµá yo⌡á usσá eithe≥ oµ thesσ character≤ frequentl∙á iεá you≥á worΣ ì
processinτ operations¼ yo⌡ shoulΣ conside≥ pickinτ othe≥ character≤ tha⌠ ì
yo⌡á d∩á no⌠ usσ often«á Thσ comment≤ t∩ ANYCODE.AS═ indicatσ wherσá t∩ ì
makσ substitution≤ t∩ thσ defaul⌠ lead-iε characters.
4«á Thσá MORPAT║á areßá mus⌠ bσ free«á Late≥ iε thσá articlσ ì
DDT.CO═ i≤ useΣ t∩ makσ somσ modification≤ t∩ WordSta≥ anΣ checδ t∩á seσ ì
tha⌠ thσ MORPAT║ areß i≤ clear« Iµ i⌠ i≤ not¼ ABORTí
5«á ANYCOD┼ a≤ installeΣ belo≈ i≤ fo≥ WordStar'≤ installeΣ t∩ ì
usσá thσ CP/═ Primar∙ Lis⌠ Device«á Yo⌡ caε checδ thi≤ wheεá yo⌡á firs⌠ ì
boo⌠á WordSta≥á anΣá observσá thσ sign-oε messagσ ¿á Als∩á wheεá runninτ ì
INSTALL.CO═á oε WordStar¼á checδ thσ labe∞ CSWTCH:«á I⌠ mus⌠ bσ 0░á fo≥ ì
ANYCOD┼ t∩ bσ guaranteeΣ t∩ worδ )«
Follo≈á thσá simplσá rule≤ laiΣ ou⌠ above¼á anΣ yo⌡á wil∞á havσá n∩ ì
problem« No≈ fo≥ thσ work.
WHA╘ D╧ W┼ MODIF┘ AN─ WHER┼ D╧ TH┼ MODIFICATION╙ GO?
Withiε WordSta≥ therσ i≤ aε areß labeleΣ MORPAT║á tha⌠ contain≤ 12╢ ì
empt∙á byte≤á anΣá exist≤á fo≥ thσ solσ purposσá oµá use≥á defineΣá sub-ì
routines« ANYCOD┼ wil∞ bσ installeΣ iε thi≤ MORPAT║ area.
Wherσá i≤ thσ MORPAT║á area┐á Fo≥ threσ WordSta≥ version≤ knowε t∩ ì
havσ ANYCOD┼ successfull∙ installed¼á i⌠ reside≤ a⌠ thσ addresse≤á showε ì
below:
WordSta≥ Version
2.26 3.0 3.3
02DEh 02DEh 02BBh
THE CODE AND ASSEMBLY.
Thσá comment≤á t∩á thσá codσá ma∙ seeφ ßá littlσá cryptiπá s∩á thi≤ ì
narrativσá explanatioε i≤ supplieΣ iε advance«á Wσ wil∞ modif∙á onσá oµ ì
WordStar'≤á printe≥á driver≤ t∩ diver⌠ al∞ character≤ t∩ bσ sen⌠ t∩á thσ ì
CP/═ Primar∙ Lis⌠ Devicσ t∩ ou≥ ANYCOD┼ subroutine«á EacΦ characte≥á i≤ ì
firs⌠á checkeΣ t∩ seσ iµ i⌠ i≤ aε ANYCOD┼ lead-iε character«á Iµ i⌠ is¼ ì
i⌠á i≤ stored¼á ß flaτ i≤ se⌠ anΣ thσ nex⌠ characte≥ i≤á read«á Iµá thi≤ ì
characte≥ wasn'⌠ ß lead-iε character¼á i⌠ i≤ checkeΣ t∩ seσ iµ i⌠ i≤ thσ ì
firs⌠ o≥ seconΣ characte≥ followinτ ß lead-iε character«á Iµ i⌠ wasn't¼ ì
i⌠á i≤á sen⌠á ou⌠á t∩ thσ primar∙ lis⌠ devicσá normally«á Iµá thσá leaΣ ì
characte≥á i≤á beinτ storeΣ anΣ thσ flaτ i≤ set¼á i⌠ mean≤á thσá curren⌠ ì
characte≥ i≤ thσ firs⌠ characte≥ followinτ thσ leaΣ character« Thσ flaτ ì
i≤á lowered¼á anΣá thσ characte≥ processeΣ t∩ becomσ halµ oµá thσá tota∞ ì
follow-oε code«á Theε thσ las⌠ characte≥ i≤ read« I⌠ to∩ i≤ checkeΣ t∩ ì
seσá iµá i⌠ i≤ ß lead-iε characte≥ o≥ i≤ thσ firs⌠ o≥á seconΣá follow-oε ì
character«á Iµ i⌠ i≤ thσ seconΣ follow-oε character¼ i⌠ i≤ addeΣ t∩ thσ ì
firs⌠á follow-oεá character¼á anΣá thσ resul⌠ sen⌠ t∩á thσá lis⌠á devicσ ì
(printer)«á Iµ yo⌡ didn'⌠ understanΣ mos⌠ oµ tha⌠ don'⌠ worr∙ abou⌠ it« ì
Understandinτ i≤ no⌠ ß requiremen⌠ fo≥ ANYCOD┼ t∩ work.
T∩á assemblσ thσ ANYCODE.AS═ code¼á placσ you≥ CP/═ systeφ disδá iε ì
drivσá ┴á anΣá thσ disδ containinτ ANYCODE.AS═ iε drivσá B«á Ente≥á thσ ì
followinτ commanΣ linσ froφ thσ A╛ prompt:
A>ASM ANYCODE.ASM
Afte≥ assembly¼á yo⌡ shoulΣ bσ lef⌠ witΦá ANYCODE.ASM¼á ANYCODE.HE╪ ì
anΣ ANYCODE.PR╬ oε drivσ B.
INSTALLATION:
Very¼á ver∙ simple«á AlthougΦ havinτ al∞ thesσ file≤ presen⌠ isn'⌠ ì
necessary¼áá placσáá WS.COM¼áá WSMSGS.OVR¼áá WSOVLY1.OVR¼áá MAILMRGE.OV╥ ì
(MRGEPRIN.OVR)¼á DDT.CO═á anΣ ANYCODE.HE╪ oε ß SYSGEN'Σ disδ iε drivσ A« ì
¿ Remembe≥ ANYCODE.HE╪ wa≤ generateΣ b∙ thσ assembl∙ oµ ANYCODE.ASM)«
Wheε yo⌡ havσ performeΣ thi≤ task¼ ente≥ thσ following:
Version 2.26 Version 3.0 Version 3.30
A>DDT WS.COM<RETURN> A>DDT WS.COM<RETURN> A>DDT WS.COM<RETURN>
You should see:
A>DDT WS.COM A>DDT WS.COM A>DDT WS.COM
DDT Vers 2.2 DDT Vers 2.2 DDT Vers 2.2
NEXT PC NEXT PC NEXT PC
400░ 010░ 3F00 0100 4600 0100ì
- - -
Thσ MORPAT║á areß mus⌠ bσ clear«á So¼á froφ thσ "-ó promp⌠ typσ thσ ì
following:
Version 2.26 Version 3.0 Version 3.30
-d2de<RETURN> -d2de<RETURN> -d2bb<RETURN>
Yo⌡á shoulΣ seσ somethinτ likσ thσ followinτ provideΣá you≥á WS.CO═ ì
ha≤ no⌠ beeε previousl∙ modifieΣ b∙ anothe≥ add-oε program« Iµ therσ i≤ ì
anythinτ beside≤ zero≤ iε thi≤ area¼á ABORT!« You≥ WordSta≥ ha≤ alread∙ ì
beeεá modifieΣ b∙ someone«á Continuinτ wil∞ overwritσ thσ codσ iεá thi≤ ì
area«
02BB 00 00 00 00 00 ..... (WS.COM 2.26 and 3.0 will start at 02DE)
02C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
.... Repeated ....
You may find information from 034B onwards but ignore this.
-
Now, from the "-" prompt type the following:
-IANYCODE.HEX<RETURN>
-R<RETURN>
Now type:
-d2bb<RETURN> (WS.COM 2.26 and 3.0 type -d2de<RETURN>)
Yo⌡ shoulΣ seσ somethinτ likσ this║ ì
02BB FE 60 C2 23 01 .`.#. ( WS 2.26 and 3.0 will start at 02DE )
02C0 32 92 01 3E 01 32 93 01 C9 FE 7E C2 35 01 32 92 2..>.2....~.5.2.
02D0 01 3E 01 32 93 01 3E 1B C3 8B 01 47 3A 92 01 FE .>.2..>....G:...
02E░ 6░ 7╕ C┴ 4├ 0▒ 4╖ 3┴ 9▓ 0▒ F┼ 7┼ 7╕ C┴ 4├ 0▒ C│ `x.L.G:...~x.L..
02F0 8B 01 47 3A 93 01 fE 00 78 CA 70 01 47 3E 00 32 ..G:....x.p.G>.2
0300 93 01 78 FE 39 FA 64 01 D6 07 D6 30 07 07 07 07 ..X.9.D....0....
031░ E╢ F░ 3▓ 9┤ 0▒ C╣ 4╖ 3┼ 0░ 2▒ 9▓ 0▒ 7╖ 2│ 7╖ 7╕ ..2...G>.!..w#wx
0320 FE 39 FA 81 01 D6 07 D6 30 21 94 01 46 80 C3 8B .9......0!..F...
0330 01 0e 05 5F CD 05 00 C9 00 00 00 00 00 00 00 00 ................
0340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
......
Thσá codσá fo≥ ANYCOD┼ no≈ reside≤ iε thσ MORPAT║á areßá previousl∙ ì
occupieΣ b∙ al∞ thosσ 00's.
Thσ las⌠ modificatioε insidσ WS.CO═ i≤ t∩ alte≥ thσ printe≥á drive≥ ì
t∩á jum≡á t∩á ou≥á sub-routinσ rathe≥ thaε simpl∙á senΣá eacΦá characte≥ ì
directl∙á t∩á thσ primar∙ lis⌠ device«á Wσ d∩ thi≤ b∙á overwritinτá thσ ì
assembl∙ languagσ startinτ a⌠ thσ addres≤ correspondinτ t∩ you≥á versioε ì
oµ WS.COM.
Version 2.26 Version 3.0 Version 3.30
-a71d -a71d -a71c
071D call 2de 071D call 2de 071C call 2bb
0720 jmp 723 0720 jmp 723 071f jmp 722
0723 <RETURN> 0723 <RETURN> 0722 <RETURN>
- - -
Aεá optiona∞ modificatioε i≤ t∩ alte≥ thσ Wordsta≥ Headinτ t∩á sho≈ ì
tha⌠ thi≤ i≤ ß modifieΣ versioε oµ Wordstar« Thi≤ ha≤ onl∙ beeε donσ fo≥ ì
versioεá 3.3░ bu⌠ thσ othe≥ version≤ shoulΣ bσ thσ same«á I⌠ attempt≤ t∩ ì
alter the word "Release" to "ANYCODE" in the Wordstar Heading.
-d100 Use this command to check heading present from ASCII list
-s163
0163 52 41 - Enter 41
0164 65 4E
0165 6C 59
0166 65 43
0167 61 4F
0168 73 44
0169 65 45
0170 20 .
-
-d100 Check wording has changed to read ANYCODE 3.30
To close out, type:
-G0<RETURN> or -^C
Then type
A>save XX WS.COM ( Where xx = 69 for Version 3.3, 63 for
versioε 2.26¼ 62 fo≥ versioε 3.0 )
That'≤ ití Yo⌡ ma∙ no≈ erasσ ANYCODE.HE╪ anΣ DDT.CO═ froφ thσ disδ ì
containinτ thσ WS.CO═ yo⌡ jus⌠ modified.
Belo≈á i≤ ß tes⌠ filσ fo≥ EPSO╬ printers«á Iµ yo⌡ havσ ß differen⌠ ì
printe≥ type¼ consul⌠ you≥ user'≤ manua∞ anΣ substitutσ simila≥ workablσ ì
codes.
*******************************************************************
`0FCompressed print`12 (All)
`0EExpanded print`14 "
~45Emphasized~46 "
~34Italic print mode~35 (MX w/Graftrax ,FX, RX only)
~2D`01Continuous underline~2D`00 "
~53`01Sub~48~54`01script "
~53`00Super~48~54`01script "
*******************************************************************
; ANYCODE.ASM - A program to allow printer codes to be
; transmitted to EPSON or other dot matrix
; printer from within WordStar text.
;
; Author: D. M. Hurst
; Date: March 3, 1984
; Modified : C.G. Sieben Jan 87
; Allowed Upper/Lower Case commands
; Tidy code
;
LEADCH equ '`' ;Hex lead in character
ESCHAR equ '~' ;Escape lead in character
;
; ORG 02DEh ;WS 2.26/3.0 (02DEh)
ORG 02BBh ;WS 3.3 (02BBh)
;
mysub: cpi LEADCH ;is it a code character?
jnz ncheck ;no, so next check
sta lead ;yes, so store temporarily
mvi a,1 ;get a 1 in accumulator
sta fl ;set fl flag
ret ;get another character
;without printing
ncheck: cpi ESCHAR ;is it other code character?
jnz hcheck ;no, so check if part of
;code sequence
sta lead ;yes so store temporarily
mvi a,1 ;get a 1 in accumulator
sta fl ;set fl flag
mvi a,1bh ;escape required so
jmp pout ;send it.
hcheck: mov b,a ;set input char aside
lda lead ;get contents of lead
cpi LEADCH ;are we in a code seq?
mov a,b ;char back in accumulator
jz flchk ;yes, so check if flag set
mov b,a ;no, so char back to b
lda lead ;check lead again
cpi ESCHAR ;are we in a code seq?
mov a,b ;char back in accumulator
jz flchk ;yes, so check if flag set
jmp pout ;no, so print char normally
flchk: mov b,a ;set char aside again
lda fl ;get fl flag
cpi 00h ;1 if set set
mov a,b ;char back in accumulator
jz addsnd ;not set, so last char in seq
mov b,a ;yes, so set char aside again
mvi a,00h ;no, so place 00h in accumulator
sta fl ;and lower the flag
mov a,b ;char back in accumulator
cpi 39h ;is code char a letter?
jm nolet1 ;no, so never mind
sui 07h ;yes, so make it a numberè
nolet1: sui 30h ;now down it form ASCII
rlc ;first char in code so
rlc ;move 4 low bits to high
rlc
rlc
ani 0f0h ;0 4 lower bits
sta first ;store it
ret ;go get second char code
addsnd: mov b,a ;set 2nd code char aside
mvi a,00 ;0 the accumulator
lxi h,lead ;get lead addr pointer in hl
mov m,a ;0 out the lead
inx h ;up the hl
mov m,a ;also 0 the flag
mov a,b ;get char back
cpi 39h ;was 2nd code char a letter?
jm nolet2 ;if not then skip it
ANI 05FH ;Upper case it first
sui 07h ;yes so make it a number
nolet2: sui 30h ;now down either from ASCII
lxi h,first ;point to first code char addr
mov b,m ;move actual char to b
add b ;add a to b (result in a)
pout: mvi c,5 ;print full code char
mov e,a
call 5
ret ;back for next real char
;
lead ds 1 ;space for lead code
fl ds 1 ;flag space
first ds 1 ;store first code while
;waiting for 2nd to pro-
;cess.
end