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
/
JSAGE
/
ZSUS
/
PROGPACK
/
TXT2DB10.LBR
/
TEXT2DB.HZT
/
TEXT2DB.HST
Wrap
Text File
|
2000-06-30
|
13KB
|
289 lines
Al,
Here's the framework, but much of the shell still needs to be
built - things like dcb's, init, etc. Things that might be
more "fun" are proc and its associated routines. I have taken
a very simpleminded approach to these that you could doubtless
do in a more elegant manner. At any rate, the structure is
there and there shouldn't be any "surprises" buried several
levels deep. Most routines save any registers that aren't used
in passing values back to the caller.
As I'm sure you will notice, some of the init code is boilerplate
that I developed to cut down the drudgery. Much can probably be
deleted. Do we want to limit ourselves to only those routines
that can be used on vanilla CP/M systems?
(aeh reply) NO. Those who use this program are programmers,
and can be expected to have zcpr3, at least???
At any rate, have some fun with it and let's see what we can
come up with. I'll hold off on playing with it while you have
some fun!
- Cam
6/18/89 - added routine(s) TPOWR
aeh - boilerplate in configuration area. The DS at the end
of the cnfg area can be removed after options are stable.
- filled in buffer allocation
- filled in file open routines
- filled in synlbl routine
- routines marked this way need something <=========
The only place screen drivers would be used is for the help screen
and error messages, I think. Do we need that?
....
6/19/89 - added fslbot flag to eliminate conflicts with synthetic
cwc label request flag fslbl.
- synthetic label numbers start at user 0 rather than one.
- changed buffer calc to use z3lib gzmtop call so extended
env calcs would be correct (note: this REQUIRES a z system).
- proc loop logic now complete(?). output file will always be
terminated if at least one ^Z read from input stream.
- added calls to retud and logud.
- added cfg entry for output file type default.
Noted possible limitation of FXx routines is that no DU is associated
with the DCB, forcing all DCB's to refer to same DU. The net result
of this is we must force the output file to the same DU as the source
file (which probably isn't all that bad).
Parse and help remain...
....
6/21/89 - added parse and help
aeh - srcdu (and dstdu) determined in parse
- HELP is a parse function
- FSpecs & options are processed in parse
- slabel, header in config area now used only to
initialize a working copy in data area.
If we choose to ignore vanilla CP/M, then the DU2BC routine gets
simplified.
DSTDU, though present, is unused. I agree that processing src and dst
in the same directory is Ok, and users would seldom want otherwise.
Option processing looks reasonably flexible. Any suggestions for
making it a little more idiot-proof?
The HELP screen (an include file) remains. Should we let it generate
its own screen? After fumigaton, that is...
....
6/23/89 - First round of fumigation. Key bugs found and killed:
cwc - Register saves in several routines weren't right.
- Added logic in QUOTE to issue a closing comma if needed.
- DU2BC now returns drive correctly if none speced on cl.
- Open of input and output file now cause abort if error.
- Moved CR to list of chars that DO NOT cause a line wrap
in the output file.
- Fixed logic state reversal in line TSTNL.
- Fixed improper table address sent to procn1.
- Fixed normal exit from TSTNL.
- Added "dummy" help message. Agree that first test for
program is generation of its own help screen.
Not tested yet is synthetic label generation, operation from a
specified DU, specing options or two file names. Thought I would
let you have some fun as well.
I think we can go ahead and assume a Z system. We already trap
non-Z and exit if there's no env. Once we get things sorted out,
I think we need to provide a little feedback to the user to reassure
him that nothing crashed and also make the error messages a bit
more informative. Perhaps we should control these added messages
with the ZCPR quiet flag as well as a patchable quiet flag (or them).
....
06/24/89- Re-arranged proc so synthetic label processed before
cwc comma output.
- Fixed DU2BC for proper drive values.
The command line option for synthetic labels needs fixing. Currently
any attempt at options gives help.
....
06/26/89- Fixed FIRSTLBL so option(s) work. EVAL10 was returning Cy set,
aeh and MA3DC just passed it on (or set cy itself!).
- Added 8080 test routine at pgm start (pgm abort on 8080)
- commented out some CP/M 2.2 code in DU2BC. If you agree, please
erase it.
- Modified Synthetic label number processing to use the Configured
default (which might be 000) when not given in the command line
switch. I think this is what you referred to on the phone, and
I was being a little dense!
- Converted DSEG area to all DS statements, since all are
initialized as needed during startup (and restart, I hope!)
- Removed dummy Help to an included file, ready for rework.
06/27/89- Revised configuration data for compatibility with ZCNFG,
aeh added routines in PARSE initialization to translate space
terminated strings to null terminated ones. New routines
REFORM, CPYSTR. White space around 'db' string and the
string itself are labeled. The labels are for reference, and
are used as offset values in the .CFG file. (The table of
offsets is extracted and edited from a PRN listing)
- Added error messages for faulty open & close of I/O files.
- Added initialization of the output FCB FN,FT fields so that
default logic works properly. The default logic could have been
modified, but would then not work properly on re-execution with
'GO'.
- My editor (PMATE) can enter a null in the text, but internally
the null is used to mark the end of text! Further, control
characters are displayed during edit (01h displayes ^A); nothing
qualifies as 'non-printing' to the editor! I suspect many other
editors will behave similarly. So the trigger character must
definitely be configurable!
06/28/89- Used TEXT2DB to make the screen for its own .cfg file.
- Modified the configuration block and its use - made a binary
toggle selection for the delimiter (space or tab) around the
'DB' in the header. The configured default label is done in
ASCII text mode, which means that someone could put text in
the number field (the text2db program will either barf or
produce strange labels). These changes result only from
limitations of ZCNFG. TEXT2DB now seems to be operational.
- Fixed error in CHRPUT - the JR Z,<tab present> occurred before
HL was pointed to LCHCNT with the result that the TAB char in
the header string (to which HL points) was being replace with
the next tab stop position. Switching the two instructions got
it working right.
06/29/89
(aeh) The configuration file is done and working. You might want to
reword the configuration help, or the menus, etc.
Note that the default trigger character is an accent mark (60h) which
you will probably want to change with ZCNFG (or reassembly) before using
on your own files. The ACCENT is used in the menu screen source.
All that remains is the main HELP screen (T2DBHELP.DB) and any
final clean up of the source code. Perhaps now is the time to use
VPRINT and dress up the displays a bit.
The program is strictly I/O bound, as it should be. Fast and easy.
My nomination for a name is evident, but not cast in concrete. Got
another candidate?
......
7/8/89
cwc - Added help screen (generation by TEXT2DB), cleaned up
formatting of source code and added comments. Opted
to not use standout and other VLIB functions to keep it
simple. I don't have any strong opinion in this, but
I don't think we need the extra code.
......
7/17/89
from jw
Some modest changes to my taste.. JWW 15 July 89
LINK COMMANDS: (Generate TEXT2DB.SYM)
ZMACLNK TEXT2DB /M
SLRNKP TEXT2DB/N,/A:100/J,TEXT2DB,TEXT2DB/M,/E
LINK TEXT2DB
1. Removed default input file type check. There is no good
reason to force a blank type to TXT or anything else.
(As you can tell, I normally use blank types.)
(aeh) I recommend restoring this. The default can be set to a
a blank field or whatever the user wishes.
2. Apostrophes (Quotes) appearing in the text are now
treated as normal characters and 'doubled' when
encountered within our own Quotes. We might consider
making QUOT a configurable option, either '"' or "'". (?)
(aeh) That could be done, but I don't see the point. The '"'/"'"
is primarily a convenience for *manual* programming....
3. We now keep track of the previous character and so wrap at
right margin is AFTER a space (TSTNL:).
4. FXO$OPEN does not, and should not, delete an existing file.
Added call to F$DELETE before FXO$OPEN for our purposes.
5. Exit directly from PROC0: on End of File without extraneous
CR/LF pair to outfile that FORCN0: provides.
6. Error return from FX$GET indicates zero-length input file or
that the last record was exactly full. As we can't tell the
difference, we now read the first character from the Input file
immediately after opening it (saved in CURCHR). Error here
means Zero-length. In PROC0:, an error means Physical End
of File. We simply supply a 1Ah character and continue.
7. Changed TSTNL: again to force new line after 75 characters
whether Controls, Space or not so as not to wrap the screen
with an otherwise interminable string of ascii characters.
(aeh) Since the object of this program is to produce a file for the
Assembler (human readability is lower priority), I'm not sure
I agree with this. What if the user *wants* 96 char lines?
If there IS an absolute maximum, then I suppose it should be
configurable. Might some assemblers gag on a string that's
too long?
8. Allow SLCODE as first character of a line.
9. LBLCNT was cleared at PROC: which over-rode the /S option. (?)
(aeh) Right. A left-over from before the option..
10. Changed INCLUDE statements to treat .LIB rather than .DB files.
for wider (M80) compatibility. Still compatible with ZMAC,
Z80ASM, etc. INCLUDE and MACLIB are not exactly interchangeable.
INCLUDE files should hold code or data statements to be included
in the assembly. INCLUDE files are read on both passes of a
of a two-pass assembly. MACLIB should be used for Macros and
Equates (not code or data) and need only be read on the first
pass of the assembler (Z80ASM). Both should be of type .LIB
for M80 compatibility.
There are a number of minor changes to various routines just
because I couldn't help myself. Nature of the beast. In any
case, I hope you will find these contributions worthwhile.
.......
(aeh) - V0.9 - 7/23/89
JWW#1 - The check on the input file type was restored, since the default
is configurable.
JWW#2 - The character TEXT2DB uses for quoting is now configurable (Qchar)
JWW#3 - Line break before/after a space is now a T/F byte in the
configuration area. The code HAS NOT been installed to use this
byte within TEXT2DB, but the CFG file will maintain it.
JWW#7 - Absolute Maximum line length in the output file is now a config
option. CFG permits values from 30 to 255. The lower value is to
guard against a rediculous value like 0 for the line length.
The trigger character can now quote itself as a result of code called
from the CLASSIFY routine. This function, and the need for special
treatment at the first file position for a synthetic label, prompted
a review of the program flow. A number of changes were made (all
consistent with the original design, I think) which result in the
newline, label, and header functions being located in one section of
the main PROC loop, controlled by flags that can be reset as required
by the trigger quote. This also made it possible to allow for the
initial (boundary) condition. A side effect was to trade the INITIAL
for a FINAL special case! A CRLF call at the end is now required to
complete the last line.
Configuration logic was modified for the DELIMT string; the user now
puts in any legal byte argument for a DB statement. Previously, only
the '0' would work!
A new CFG file accompanies this version.
YET TO BE DONE - Logic/code to implement terminal space location during
line fold. (Joe's item 3)
......
(cwc) - V0.a - 24 July 89
Added logic for space during line fold. Prior logic was in error
due to failure to save the character type for the prior char.
This could result in some "funny" decisions being made. State now
saved when prior char saved.
Added some additional commenting in PROC and PGMINIT.
......
(aeh) -V1.0 - 25 July 89
Looking good! NEAT'd the source file, installed version number. This is
the Release Version, ready for BETA test. Target for release to PD should
be about 30 days, I think, to give BETA testers a chance to respond.
......