[comp.os.cpm] Need WordStar utility

tindle@ms.uky.edu (Ken Tindle) (12/12/90)

I'm using WordStar on an Osborne 1 along with Kermit, trying to program
a microcomputer board I built using BASIC-52 (Intel).

Files created with WordStar must contain some binary characters, which is
ruining the "raw" upload of program code to the uC board.

I need a real, flat ASCII file on disk- so is there easily available a
utility to massage WordStar output?

I suppose one could use PIP's Z option, and/or an MBASIC program- but I'll
bet this is a problem others have already beaten.  True?
 
--------------------------\ /-----------------------------------------------
INTERNET:tindle@ms.uky.edu | "Could you please continue the petty bickering?
BITNET: tindle@ukma.bitnet |  I find it most intriguing."   ---    Data, 
Ken Tindle - Lexington, KY |  Star Trek, The Next Generation, "Haven"
--------------------------/ \-----------------------------------------------

tom@afthree.as.arizona.edu (Thomas J. Trebisky) (12/13/90)

In article <16529@s.ms.uky.edu> tindle@ms.uky.edu (Ken Tindle) writes:
>
>Files created with WordStar must contain some binary characters, which is
>ruining the "raw" upload of program code to the uC board.
>I need a real, flat ASCII file on disk- so is there easily available a
>utility to massage WordStar output?

The thing to do (perhaps you know this) is to run wordstar in
non-document mode - then you read and write plain old ascii files and
all is well.  A contract I have made with myself is to NEVER type
the filename to be edited on the command line (wordstar is most commonly
installed to use document mode by default - putting all those nasty binary
chars in your file (and setting the 8th bit in some others as well
as part of it's way of "marking" up your file.)  Then type N and then type
your filename --- if you mistakenly start wordstar in document mode on
your 2999 line source file DON'T SAVE IT!!! use the abort and exit command
(whatever that is, I forget), and start over.  If you did save it .........
....... you poor guy ..... try the following recipe.

Just talked to my CPM guru nextdoor and he says to write a simple
filter that does this - 
Read the file byte by byte.
Force the high bit in every byte to zero on every byte read.
Delete every byte that is < 0x20 (blank) and that is
not 0x09, 0x0a, 0x0c, 0r 0x0d  (tab,newline,formfeed,return).

A code fragment in C would be something like this:
(this has not been tested, but this is the idea)

    while ( c = getchar() ) {
	c &= 0x7f;
	if ( c < 0x20 ) {
	    if ( c == 0x09 || c == 0x0a || c == 0x00c || c == 0x0d )
		putchar(c);
	} else
	    putchar(c);
    }

ttrebisky@as.arizona.edu	(internet)

winans@sirius.mcs.anl.gov (John Winans) (12/13/90)

In article <16529@s.ms.uky.edu> tindle@ms.uky.edu (Ken Tindle) writes:
>I'm using WordStar on an Osborne 1 along with Kermit, trying to program
>a microcomputer board I built using BASIC-52 (Intel).
>
>Files created with WordStar must contain some binary characters, which is
>ruining the "raw" upload of program code to the uC board.
>
>I need a real, flat ASCII file on disk- so is there easily available a
>utility to massage WordStar output?
>
>I suppose one could use PIP's Z option, and/or an MBASIC program- but I'll
>bet this is a problem others have already beaten.  True?

Hmmm...  I have NOT used word-scar in years, but I recall that if you use it
in "document mode" by selecting "open document file" on it's mail menu, it
will set the high order bits of the first (or was it the last) character in
wach string token (ie. word in a sentence.)  You can opt for opening your 
files in "non-document" mode and this will not happen, but you will see some
other differences like fixed tab sizes and so on.  I always used non-doc mode
when in word-scar when I was using it for this exact reason.  I think it is
safe to say that in non-doc mode, word-scar is like a full screen ed.

If you do not know what I am talking about, then either wordstar is not what it
was 10 years ago, or you have never run it w/o specifying a file name as the
file to edit.  Just run it w/o any perameters and you will get a menu that
includes "open doc file" and "open non-doc file".  I think there was also some
way to set it up so that non-doc was the default mode with some setup program
that it came with.

Hope that's it.


--
! John Winans                     Advanced Computing Research Facility  !
! winans@mcs.anl.gov              Argonne National Laboratory, Illinois !
!                                                                       !
!"The large print giveth, and the small print taketh away"-- Tom Waits  !

tcs@sactoh0.SAC.CA.US (Ted C. Smith) (12/14/90)

> Files created with WordStar must contain some binary characters, which
is
> ruining the "raw" upload of program code to the uC board.
> 
Actually, I doubt that anyone created such a program for CP/M as PIP was
available to all way back in the begining.  The command to use is 
PIP B:newfile.txt=A:oldfile.ws[Z]<cr>.
 
In the DOS world, a couple of utility programs are available.  For
example, XWORD converts WordStar to a number of different formats,
including ASCII.
 
Ted Smith

donm@pnet07.cts.com (Don Maslin) (12/14/90)

There are a number of Public Domain utilities that will strip all of the
garbage out of a WordStar document file.  One that comes to mind is the FILT
set that was written by Irv Hoff.  

Most any CP/M BBS or SIMTEL20 should have them.


Keeper of the CP/M System Disk | UUCP: {nosc ucsd crash ncr-sd}!pnet07!donm
Archives for the Dino(saur)SIG | ARPA: simasd!pnet07!donm@nosc.mil
- San Diego Computer Society - | INET: donm@pnet07.cts.com

smits@ve7apu.uucp (Bob Smits - VE7EMD) (12/14/90)

Expires: 
References: <16529@s.ms.uky.edu> <4474@sactoh0.SAC.CA.US>
Sender:Robert Sts  
Reply-To: smits@ve7apu.UUCP (PUT YOUR NAME HERE)
Followup-To: 
Distribution: na
Organization: VADCG, Richmond, B.C.
Keywords: 

In article <4474@sactoh0.SAC.CA.US> tcs@sactoh0.SAC.CA.US (Ted C. Smith) writes:
>> Files created with WordStar must contain some binary characters, which
>is
>> ruining the "raw" upload of program code to the uC board.
>> 
>Actually, I doubt that anyone created such a program for CP/M as PIP was
>available to all way back in the begining.  The command to use is 
>PIP B:newfile.txt=A:oldfile.ws[Z]<cr>.
> 
>In the DOS world, a couple of utility programs are available.  For
>example, XWORD converts WordStar to a number of different formats,
>including ASCII.
> 
When I was still using my old WordStar on an 8080 S-100 CPM system, 
used Irv Hoff's "filt.com" program. It would strip all the high
order bits, etc and give you a plain ASCII file. It's probably 
available on CompuSee's CPM forum. (My version is probably buried
in the basemenon an 8" floppy....somewhere....maybe)

A similar program is available froStarFixer called FileFixer that
does a similar job for MSDOS WordStar afficionados.
Good Luck in your search.
Bob

tindle@ms.uky.edu (Ken Tindle) (12/14/90)

In article <699@organpipe.UUCP> tom@afthree.as.arizona.edu (Thomas J. Trebisky) writes:
>The thing to do (perhaps you know this) is to run wordstar in
>non-document mode - then you read and write plain old ascii files and
>all is well.  

Even in non-document mode, WordStar will set the high bit of the character
the cursor is on at the time of the disk save.  It's entirely too nervous
for my application, unless the output is filtered through an external utility.

>Just talked to my CPM guru nextdoor and he says to write a simple
>filter that does this - 
>Read the file byte by byte.
>Force the high bit in every byte to zero on every byte read.
>Delete every byte that is < 0x20 (blank) and that is
>not 0x09, 0x0a, 0x0c, 0r 0x0d  (tab,newline,formfeed,return).

Now that is good advice-

too bad the original authors of WordStar were too brain-dead re:ascii files.
There's no reason they couldn't have built this code into the program- except
nobody's perfect; I guess they didn't think of it?  I dunno, except they do
massage the file for video display, just not to disk.  Not too bright. 

--------------------------\ /-----------------------------------------------
INTERNET:tindle@ms.uky.edu | "Could you please continue the petty bickering?
BITNET: tindle@ukma.bitnet |  I find it most intriguing."   ---    Data, 
Ken Tindle - Lexington, KY |  Star Trek, The Next Generation, "Haven"
--------------------------/ \-----------------------------------------------

wieland@ea.ecn.purdue.edu (Jeffrey J Wieland) (12/15/90)

In article <699@organpipe.UUCP> tom@afthree.as.arizona.edu (Thomas J. Trebisky) writes:
>In article <16529@s.ms.uky.edu> tindle@ms.uky.edu (Ken Tindle) writes:
>>Files created with WordStar must contain some binary characters, which is
>>ruining the "raw" upload of program code to the uC board.
>>I need a real, flat ASCII file on disk- so is there easily available a
>>utility to massage WordStar output?
>
>Just talked to my CPM guru nextdoor and he says to write a simple
>filter that does this - 
>Read the file byte by byte.
>Force the high bit in every byte to zero on every byte read.
>
>ttrebisky@as.arizona.edu	(internet)

With WordStar 4.0 for CP/M, you have a couple of options.  You can force
it to open a file in non-document mode from the command line:

	ws filename.ext n

If you do accidently create a file in document mode, you can always use
good ol' pip to strip the high bits off:

	pip ascii.txt:=highbits.doc[z]

WordStar 4.0 can also strip the high bits.  Re-open the file in non-document
mode, then use ^B (I believe -- it might be ^^) to convert the file to an 
ascii file.  Use ^QQ^B, and then WordStar do its stuff.
--
			Jeff Wieland
		    wieland@acn.purdue.edu

sprague.wbst311@XEROX.COM (12/15/90)

> Even in non-document mode, WordStar will set the high bit of the character
> the cursor is on at the time of the disk save.

Hmmmm, time to play with WordStar again.  I have never had that happen to me
(in 3.3 and 4.0).  Not that I don't believe it, mind you, I just want to see it
for myself.  :-)

				~ Mike (Sprague.Wbst311@Xerox.Com)

ahm@rick.att.com (Andy Meyer) (12/19/90)

In article <16548@s.ms.uky.edu> tindle@ms.uky.edu (Ken Tindle) writes:
> In article <699@organpipe.UUCP> tom@afthree.as.arizona.edu (Thomas J. Trebisky) writes:
> >The thing to do (perhaps you know this) is to run wordstar in
> >non-document mode - then you read and write plain old ascii files and
> >all is well.  
> 
> Even in non-document mode, WordStar will set the high bit of the character

...but only if you've pressed ^B at anytime during the edit!

As someone mentioned, use PIP to filter the file:

    A>PIP NOHIBITS.TXT=HIBITS.TXT[Z]

Andy
--
 Andreas Meyer, N2FYE      > > > > > > > > >     Internet: ahm@rick.att.com
 "Ausgezeichnet!"         < < < < < < < < <          uucp:   ..att!rick!ahm

tindle@ms.uky.edu (Ken Tindle) (12/21/90)

In article <"14-Dec-90.22:29:05.EST".*.Michael_D._Sprague.wbst311@Xerox.com> sprague.wbst311@xerox.com writes:
>I wrote:
>> Even in non-document mode, WordStar will set the high bit of the character
>> the cursor is on at the time of the disk save.
>Hmmmm, time to play with WordStar again.  I have never had that happen to me
>(in 3.3 and 4.0).  Not that I don't believe it, mind you, I just want to see it
>for myself.  :-)

This is the WS that came with the Osborne 1- v 2.26.  It *does* funky things,
even in non-doc mode.  Trust me! :-)

I am most assuredly not hell-bent on WS, it's just what I have.  I can try
PIP [z], printing to disk, another editor, or a utility.  One of those ought
to do it!

I wish I'd said I knew about non-doc mode in my original letter- oh well.
 
--------------------------\ /-----------------------------------------------
INTERNET:tindle@ms.uky.edu | "Could you please continue the petty bickering?
BITNET: tindle@ukma.bitnet |  I find it most intriguing."   ---    Data, 
Ken Tindle - Lexington, KY |  Star Trek, The Next Generation, "Haven"
--------------------------/ \-----------------------------------------------

wilker@gauss.math.purdue.edu (Clarence Wilkerson) (12/27/90)

 Aha! Some versions of WordStar supported direct write to screen
memory on the (few) machines that had screen memory as part of
system RAM. I suspect that setting the high bit is the way the
Osborne knew to highlight the current character.

bandy@catnip.berkeley.ca.us (Gun Control is Hitting Your Target) (01/08/91)

wilker@gauss.math.purdue.edu (Clarence Wilkerson) writes:


> Aha! Some versions of WordStar supported direct write to screen
>memory on the (few) machines that had screen memory as part of
>system RAM. I suspect that setting the high bit is the way the
>Osborne knew to highlight the current character.

Yes and no.  

No, WordStar for the Osborne 1 did not come configured for memory mapped
video - I don't know why - it's orders of magnitude faster than going through
a jillion layers of software.

Yes, you could set the underline attribute by or'ing with 0x80.
-- 
real address: bandy@catnip.berkeley.ca.us
last choice:  lll-winken!catnip.berkeley.ca.us!bandy

jfoster@axion.bt.co.uk (John Foster) (01/08/91)

From article <972@catnip.berkeley.ca.us>, by bandy@catnip.berkeley.ca.us (Gun Control is Hitting Your Target):
> wilker@gauss.math.purdue.edu (Clarence Wilkerson) writes:
> 
> 
>> Aha! Some versions of WordStar supported direct write to screen
>>memory on the (few) machines that had screen memory as part of
>>system RAM. I suspect that setting the high bit is the way the
>>Osborne knew to highlight the current character.
> 
> Yes and no.  
> 
> No, WordStar for the Osborne 1 did not come configured for memory mapped
> video - I don't know why - it's orders of magnitude faster than going through
> a jillion layers of software.
> 
> Yes, you could set the underline attribute by or'ing with 0x80.
> -- 
> real address: bandy@catnip.berkeley.ca.us
> last choice:  lll-winken!catnip.berkeley.ca.us!bandy

Actually, WordStar on the Osborne 1 didn't come configured for any
of the features of the machine; it was just shipped as plain vanilla,
as far as I could ever tell. For example, the arrow keys on the machine
were set up to deliver CP/M codes, and you had to do a messy setup
operation to switch back and forth between those and the codes that
WordStar expected.

I found it much easier to use after I dug into the customisation
info, and set the screen help delays etc to what I thought were
sensible values. I also found and published a patch for the arrow keys
problem, but that's a longer story ...


| John Foster, DNR3.14, Room G44C, SSTF, British Telecom Research Labs, |
|                           Martlesham Heath, Ipswich, IP5 7RE, UK.    |
| Phone:  +44 473 646019      Fax:  +44 473 643019      Telex: 987137  |

fzsitvay@techbook.com (Frank Zsitvay) (01/08/91)

In article <972@catnip.berkeley.ca.us> bandy@catnip.berkeley.ca.us (Gun Control is Hitting Your Target) writes:
>wilker@gauss.math.purdue.edu (Clarence Wilkerson) writes:
>
>
>> Aha! Some versions of WordStar supported direct write to screen
>>memory on the (few) machines that had screen memory as part of
>>system RAM. I suspect that setting the high bit is the way the
>>Osborne knew to highlight the current character.
>
>Yes and no.  
>
>No, WordStar for the Osborne 1 did not come configured for memory mapped
>video - I don't know why - it's orders of magnitude faster than going through
>a jillion layers of software.

   the memory mapped video on the osborne is somewhat strangely laid out,
and micropro never bothered to adapt the memory mapped version of wordstar.

   but soon pd text editors began showing up for the ozzy, such as vdo and
its successor, vde.  for a machine like a stock osborne, thay are actually
much better than wordstar.
 
   download them from a bbs near you.  vde ended at 2.66 (eric meyer still
does work on his PC version of vde, which is (INHO) the best text editor
available for msdos machines.  (it even runs on a dec rainbow))  but is
very stable and has no major bugs.

-- 
fzsitvay@techbook.COM - but don't quote me on that....

American Oil Company motto - Bend over, We'll pump!!!

roadhog@austex (Lindsay Haisley) (01/16/91)

fzsitvay@techbook.com (Frank Zsitvay) writes:

>  
>    download them from a bbs near you.  vde ended at 2.66 (eric meyer still
> does work on his PC version of vde, which is (INHO) the best text editor
> available for msdos machines.  (it even runs on a dec rainbow))  but is
> very stable and has no major bugs.
> 
VDE is still supported by Carson Wilson as ZDE (for ZCPR3).  Check his 
Lilliput Znode (I think) in the Midwest.  The number is on any Znode list.


"Everything works if you let it!"
 ---  Travis J. Redfish
 +++++++++++++++++++++++++++
uucp: austex!roadhog@emx.utexas.edu  OR  roadhog%austex.uucp@emx.utexas.edu
 BBS: (512) 259-1261 (Z-Node 77 - aka - Kaypro Club of Austin)