ANYCODE Doug Hurst IMPORTAN NOTE Th documentatio fo ANYCOD i base o a articl submitte t th newl revive "Portabl Companion magazin fo Osborn Compute Owners Th referenc ar Osborn oriented I reality th progra i mor WordSta tha Osborn oriented an i u an runnin o Heat an Zorb machine an i adaptabl t al WordStars Version 2.26 3.0 an 3.3X B absolutel certai tha yo carefull mak AL substitution fo you versio o WordStar Ther ar severa throughout Questions comment an bug shoul b reporte t m a 680 Estrell Ave. Twentynin Palms C 92277 evening (619) 367-1090 (evenings). 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 more flexibl an portable ANYCODE doe thi withou enlargin th siz o th mai WordSta progra WS.COM Thi i ver importan point B keeping 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 it is 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 use of 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 appear 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 ,45h (turn emphasized print on). ~2D`0 Woul transmi ,2Dh,0 (tur o continuou underline). As a further example, a short section of text, first without codes and then with ANYCODE codes 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 Th tw lea character fo ANYCOD cod wer picke especiall fo th Osborn computer Yo wil no fin the o you keyboard T mak "~" typ ^ (contro +) T plac "` o th screen typ ^ (contro ?) 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 tak WordSta an documen dis wit yo somewher (lik fro hom t work an want/nee t prin fil usin anothe compute (obviousl anothe Osborn o Osborn dis forma compatible) Yo prepare th documen o you Osborn 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 so we can continue. Ther ar fe cautions an yo ma a wel kno the now 1 Us al capita letter (`0A NO `0a)(an that' zer not 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 belo 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 work) 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. 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? MicroPr and/o Osborne i thei infinit wisdom decide t includ INSTALL.CO wit WordStar bu no t includ th complet termina an printe patc areas (Earl Osborn user' di receiv thi trea befor Osborn converte t th "improved referenc manuals) Luckily th autho wa abl t fin complet manua fo WordSta 3.0 A an rate ther i a are withi WordStar 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 (B enlargin th siz o WS.COM eve mor are ca b mad availabl fo use supplie code Stand-b t us som o i i late article. 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 Her i th code B sur t us th "N non-documen mod i yo us WordStar. ; 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: April 23, 1984 ; ORG XXXXh ;Where XXXX is 02DEh for WS 2.26/3.0 ;and 02BBh for WS 3.3 mysub: cpi '`' ;is it a code character? ;you may substitute another ;character if you use the ;" ` " often in your text 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 '~' ;is it a code character? ;you may substitute another ;character if you use the ;" ~ " often in your text 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 ;~ means escape required so jmp pout ;send it. hcheck: mov b,a ;set input char aside lda lead ;get contents of lead cpi '`' ;are we in a code seq? ;NOTE: if you changed this code ;above, change it here too. 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 '~' ;are we in a code seq? ;NOTE: if you changed this code ;above, change it here too. ;char back in accumulator 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 ;so so skip it 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 Havin entere ANYCODE.AS above i mus b assembled 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.BBB I ther ar n errors anothe ste complete Th autho ha successfull assemble thi cod exactl a i appear i thi article I fact th cod wa rea int th articl fro ANYCODE.AS usin WordStar' ^K command I ther ar error i assembly g bac an chec you typing I i di assembl withou error yo shoul b lef wit ANYCODE.ASM ANYCODE.HE an ANYCODE.PR o driv B D no us LOAD.CO an attemp t loa ANYCODE.HE int .CO file Thi i no necessar an woul serv n usefu purpose. 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 . (Singl densit user' leav th thre .OV program of fo no an ad the afte th installatio o ANYCOD an th deletio o DDT.CO an ANYCODE.HEX (Remembe ANYCODE.HE wa generate durin 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 A>DDT WS.COM A>DDT WS.COM 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 -d2de -d2bb 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 ................ 02F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0330 00 00 00 00 00 00 00 00 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 ................ 0350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - Now, from the "-" prompt type the following: -IANYCODE.HEX -R Now type: -d2bb (WS.COM 2.26 and 3.0 type -d2de) Yo shoul se somethin lik this (WS.CO 2.2 an 3. wil star a -d2de) 02BB FE 60 C2 23 01 .`.#. 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 ................ 0350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0360 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 occupied by all those 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 0723 0722 - - - To close out, type: -G0 or -^C Then type A>save XX WS.COM (Wher X i 63 fo versio 2.26 62 fo versio 3.0 an 69 fo versio 3.30) That' it Yo ma no eras ANYCODE.HE an DDT.CO fro th dis containin th WS.CO yo jus modified (Singl densit user' shoul PI WSMSGS.OVR WSOVLY1.OV an MAILMRGE.OV (MRGEPRIN.OVR bac ont th dis containin th modifie WS.COM. 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 " ******************************************************************* Doug Hurst Hi-Desert Osborne Group (HOGS) 6808 Estrella Ave. 29 Palms, CA 92277 (619) 367-1090 (evenings)  .