home *** CD-ROM | disk | FTP | other *** search
- ANYCODE
-
- Doug Hurst
-
- IMPORTANT NOTE: The documentation for ANYCODE is based on an article
- submitted to the newly revived "Portable Companion" magazine for
- Osborne Computer Owners. The reference are Osborne oriented. In
- reality, the program is more WordStar than Osborne oriented, and is up
- and running on Heath and Zorba machines and is adaptable to all
- WordStars, Versions 2.26, 3.0X and 3.3X. Be absolutely certain that
- you carefully make ALL substitutions for your version of WordStar.
- There are several throughout. Questions, comments and bugs should be
- reported to me at 6808 Estrella Ave., Twentynine Palms, CA 92277,
- evening (619) 367-1090 (evenings).
-
- PLEASE!! Give this article a look even if it seems somewhat
- complicated. It is a useful, valuable modification to WordStar and is
- quite simple if you will take it step by step.
-
- VALUE. Makes WordStar more powerful and text files more flexible and
- portable. ANYCODE does this without enlarging the size of the main
- WordStar program WS.COM. This is a very important point. By keeping
- WS.COM confined to its "stock" size, it may installed or reinstalled
- using INSTALL.COM at will without affecting or having to reinstall
- ANYCODE.
-
- INTRODUCTION.
-
- The EPSON FX, MX (w/Graftrax) and RX series, as well as many
- other brands of printers, have many more modes of operation available
- than can be accessed by a normally installed WordStar, even if one
- uses all the built-in and user defined print control code facilities
- available. Not only can these built-in and user defined codes NOT
- keep pace with the printer's capability, once installed, they are not
- alterable without using DDT/SID.COM or WordStar's INSTALL.COM. There
- are several commercially available programs that will let you send all
- the control codes a printer will accept. They differ from the one
- presented in this article in that this one is free. This article is
- also designed to serve the dual purpose of displaying how much
- untapped potential there is in standard WordStar.
-
- USING ANYCODE.
-
- Before getting into the coding and installation of ANYCODE, it is
- important to see what the outcome of your efforts will be. This will,
- it is hoped, pique your interest and keep you from giving up. If you
- regularly use a WordStar with CHARTECH or similar program installed,
- you already possess the function that ANYCODE will perform. You're
- welcome to continue anyway. As mentioned earlier, a nice feature of
- ANYCODE is that it does not enlarge the size of WS.COM as many similar
- commercially available products do.
-
- Once installed, use of ANYCODE codes has the same functional
- effect as WordStar's print control codes. Instead of embedding them
- in the text with a print control code such as ^PS, however, you enter
- ANYCODE very much as the codes actually appear in your printer's
- user's manual. ANYCODE codes, however, are not invisible to the
- editor. In other words, when you place ANYCODE's codes in your text,
- they are treated just like normal text by WordStar. This means they
- will be included in such functions as wordwrap and paragraph
- reformatting. For this reason, it is suggested that you enter all
- your text, get it formatted just the way you want, then go back and
- insert the ANYCODE codes. This may force you to use the ^OX (release
- margin) command more than you are used to (some lines will extend far
- beyond the margin). This should be of no concern to you though
- because ANYCODE codes are non-printing just like WordStar's print
- control codes. The actual line will fit within the margins if it did
- prior to code insertion.
-
- ANYCODE codes will usually take one of the three forms shown
- below, just as most printers accept codes in one of these three forms.
-
- straight hex code
- escape + hex code
- escape + hex code + trailer code 1 + trailer code 2....+ trailer code n
-
- Below are ANYCODE examples of each type for EPSON printers:
-
- `0F Would transmit 0Fh (turn condensed print mode on).
- ~45 Would transmit <ESC>,45h (turn emphasized print on).
- ~2D`01 Would transmit <ESC>,2Dh,01 (turn on continuous
- 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.
-
- In the lower example with the embedded (again EPSON) codes, ~34 and
- ~35 turn italics on/off, ~2D`01 and ~2D`00 turns underline on/off and
- `0E and `14 turn expanded print on/off.
-
- Notice how the first line now extends past the normal margin.
- Again, it WILL NOT when the printing actually takes place since
- ANYCODE code is non-printing. The two lead characters for ANYCODE
- code were picked especially for the Osborne computer. You will not
- find them on your keyboard. To make a "~", type ^+ (control +). To
- place a "`" on the screen, type a ^? (control ?).
-
- If you haven't seen the obvious advantage to sending the printer
- codes in the ANYCODE format over WordStar's codes yet, here are two.
- First, you can send any code to the printer. (Okay, the cats out of
- the bag, now you know where the name of the program came from.)
- Second, say you take WordStar and a document disk with you somewhere
- (like from home to work) and want/need to print a file using another
- computer (obviously another Osborne or Osborne disk format
- compatible). You prepared the document on your Osborne which is
- installed with Print Controls to send EPSON codes. The computer at
- work, however, is driving a NEC printer. With ANYCODE codes embedded
- in the text, wouldn't it be easy to use the Find and Replace (^QA)
- command to find the EPSON codes and substitute NEC codes? Answer yes
- so we can continue.
-
-
- There are a few cautions, and you may as well know them now.
-
- 1. Use all capital letters (`0A, NOT `0a)(and that's zero
- not o).
- 2. Each hex code must be two digits. (5 entered as 05,
- E entered as 0E, etc.)
- 3. Due to space limitations and a desire on the part of the
- author to keep ANYCODE confined to the MORPAT: area (explained later),
- no provisions were made to be able to print the lead-in characters `
- and ~. If you use either of these characters frequently in your word
- processing operations, you should consider picking other characters
- that you do not use often. The comments to ANYCODE.ASM below indicate
- where to make substitutions to the default lead-in characters.
- 4. The MORPAT: area must be free. Later in the article
- DDT.COM is used to make some modifications to WordStar and check to
- see that the MORPAT: area is clear. If it is not, ABORT!
- 5. ANYCODE as installed below is for WordStar's installed
- to use the CP/M Primary List Device. You can check this when you
- first boot WordStar and observe the sign-on message (Also when running
- INSTALL.COM on WordStar, check the label CSWTCH:. It must be 00 for
- ANYCODE to be guaranteed to work).
-
- Here are a wrong, then a right example of ANYCODE syntax.
-
- WRONG
-
- `FNow is the time for ....... the aid of their countries.`12
-
- Meaning to turn compressed print on/off. No zero 0 between the ` and
- F at beginning of the sentence. PROMISE! This will not work.
-
- RIGHT
-
- `0FNow is the time for ....... the aid of their countries.`12
-
- PROMISE! This will work.
-
- Follow the simple rules laid out above, and you will have no
- problem. Now for the work.
-
-
- WHAT DO WE MODIFY AND WHERE DO THE MODIFICATIONS GO?
-
- MicroPro and/or Osborne, in their infinite wisdom, decided to
- include INSTALL.COM with WordStar, but not to include the complete
- terminal and printer patch areas. (Early Osborne 1 user's did receive
- this treat before Osborne converted to the "improved" reference
- manuals). Luckily, the author was able to find a complete manual for
- WordStar 3.0. At any rate, there is an area within WordStar, labeled
- MORPAT: that contains 126 empty bytes and exists for the sole purpose
- of user defined sub-routines. ANYCODE will be installed in this
- MORPAT: area. (By enlarging the size of WS.COM, even more area can be
- made available for user supplied code. Stand-by to use some of it in a
- later article.)
-
- Where is the MORPAT: area? For three WordStar versions
- known to have ANYCODE successfully installed, it resides at the
- addresses shown below:
-
- WordStar Version
-
- 2.26 3.0 3.3
-
- 02DEh 02DEh 02BBh
-
-
- THE CODE AND ASSEMBLY.
-
- The comments to the code may seem a little cryptic so this
- narrative explanation is supplied in advance. We will modify one of
- WordStar's printer drivers to divert all characters to be sent to the
- CP/M Primary List Device to our ANYCODE subroutine. Each character is
- first checked to see if it is an ANYCODE lead-in character. If it is,
- it is stored, a flag is set and the next character is read. If this
- character wasn't a lead-in character, it is checked to see if it is
- the first or second character following a lead-in character. If it
- wasn't, it is sent out to the primary list device normally. If the
- lead character is being stored and the flag is set, it means the
- current character is the first character following the lead character.
- The flag is lowered, and the character processed to become half of the
- total follow-on code. Then the last character is read. It too is
- checked to see if it is a lead-in character or is the first or second
- follow-on character. If it is the second follow-on character, it is
- added to the first follow-on character, and the result sent to the
- list device (printer). If you didn't understand most of that don't
- worry about it. Understanding is not a requirement for ANYCODE to
- work. Here is the code. Be sure to use the "N" non-document mode if
- you use 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
-
- Having entered ANYCODE.ASM above, it must be assembled. Place your
- CP/M system disk in drive A and the disk containing ANYCODE.ASM in
- drive B. Enter the following command line from the A> prompt:
-
- A>ASM ANYCODE.BBB
-
- If there are no errors, another step complete. The author has
- successfully assembled this code exactly as it appears in this
- article. In fact, the code was read into the article from ANYCODE.ASM
- using WordStar's ^KR command. If there are errors in assembly, go
- back and check your typing. If it did assemble without error, you
- should be left with ANYCODE.ASM, ANYCODE.HEX and ANYCODE.PRN on drive
- B. Do not use LOAD.COM and attempt to load ANYCODE.HEX into a .COM
- file. This is not necessary and would serve no useful purpose.
-
- INSTALLATION:
-
- Very, very simple. Although having all these files present isn't
- necessary, place WS.COM, WSMSGS.OVR, WSOVLY1.OVR, MAILMRGE.OVR
- (MRGEPRIN.OVR), DDT.COM and ANYCODE.HEX on a SYSGEN'd disk in drive A.
- (Single density user's leave the three .OVR programs off for now and
- add them after the installation of ANYCODE and the deletion of DDT.COM
- and ANYCODE.HEX) (Remember ANYCODE.HEX was generated during the
- assembly of ANYCODE.ASM). When you have performed this task, enter
- the 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
- 4000 0100 3F00 0100 4600 0100
- - - -
-
- The MORPAT: area must be clear. So, from the "-" prompt type the
- following:
-
- Version 2.26 Version 3.0 Version 3.30
-
- -d2de<RETURN> -d2de<RETURN> -d2bb<RETURN>
-
- You should see something like the following provided your WS.COM has
- not been previously modified by another add-on program. If there is
- anything besides zeros in this area, ABORT!. Your WordStar has
- already been modified by someone. Continuing will overwrite the code
- in this 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<RETURN>
- -R<RETURN>
-
- Now type:
-
- -d2bb<RETURN> (WS.COM 2.26 and 3.0 type -d2de<RETURN>)
-
- You should see something like this: (WS.COM 2.26 and 3.0 will start at
- -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:...
- 02E0 60 78 CA 4C 01 47 3A 92 01 FE 7E 78 CA 4C 01 C3 `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....
- 0310 E6 F0 32 94 01 C9 47 3E 00 21 92 01 77 23 77 78 ..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 ................
- -
-
- The code for ANYCODE now resides in the MORPAT: area previously
- occupied by all those 00's.
-
- The last modification inside WS.COM is to alter the printer driver to
- jump to our sub-routine rather than simply send each character
- directly to the primary list device. We do this by overwriting the
- assembly language starting at the address corresponding to your
- version of 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>
- - - -
-
-
- To close out, type:
-
- -G0<RETURN> or -^C
-
- Then type
-
- A>save XX WS.COM (Where XX is 63 for version 2.26, 62 for
- version 3.0 and 69 for version 3.30)
-
- That's it! You may now erase ANYCODE.HEX and DDT.COM from the disk
- containing the WS.COM you just modified. (Single density user's
- should PIP WSMSGS.OVR, WSOVLY1.OVR and MAILMRGE.OVR (MRGEPRIN.OVR)
- back onto the disk containing the modified WS.COM.
-
- Below is a test file for EPSON printers. If you have a different
- printer type, consult your user's manual and substitute similar
- workable 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)
- **********
-
- Doug Hurst
- Hi-Deser