Improving the usability of the TE text editor

413 views
Skip to first unread message

ladislau szilagyi

unread,
Mar 25, 2023, 6:45:25 AM3/25/23
to RC2014-Z80
Hi all,

I just published on GitHub ( https://github.com/Laci1953/RC2014-CPM/tree/main/te ) new versions of the TE text editor, configured to be used on Z80 systems provided with 128KB or 512KB RAM.

I made some improvements mainly related to the usability of the tool.

1. First, I opted to display a small help message, in the case when RE is executed without parameters;  the message is showing all the available options.

-------------
D>te
TE text editor
Copyright (c) 2015-2021 Miguel Garcia / FloppySoftware
Adapted for 128KB RAM by Ladislau Szilagyi

Use: >TE [options] [filename]

where options (lowercase or uppercase) are:
 -Tn (n = 4 or 8) sets the tabs to n spaces, default is 8
 -Hnn sets the screen height (up to 99, default is 24)
 -Wnnn sets the screen width (up to 200, default is 80)

Continue? (N/n = quit) :
------------

You can press N/n to quit to CP/M, or any other key to continue TE,  being presented with an empty screen, ready for text input...

2. Tabs can be used freely in the text; you have two options related to  TAB's alignment ( 4 or 8 ); the default is 8.
You can change-it to 4 using  the option -T in the command line.
It important to mention that the use of TABs does not increase the size  of the text file, nor the size of buffers allocated in memory to store the text;
 this is because TABs are inflated/deflated to/from blanks only when needed, (e.g.) when displayed on screen.

3. When reading/writing files, a line containing a counter of the lines being processed is displayed, to offer to the user a clue related to the status of the I/O operation.

4. The number of columns/lines can now be selected directly in the command line, using the -W or -H options; default values are 24 for lines, and 80 for columns.


I opted to unify the two versions of source code (128/512), now there is a single set of source files for both 128KB and 512KB TE versions.

As a reminder, the TE128 can edit files with sizes up to 70KB, and TE512 up to 400KB.  

Ladislau

Edgar Salgado

unread,
Mar 26, 2023, 3:01:19 PM3/26/23
to RC2014-Z80
Hello Ladislau,

I have downloaded the Hi-Tech C compiler from here:

I have executed "submit makete", and it compiles a lot, until it arrives here, where it does not find z80as:
19:44 I0>z80as -j dynm
Z80AS ?
19:44 I0>z80as -j tabs
Z80AS ?
19:44 I0>z80as -j mycrtcpm
Z80AS ?

if I try to run "zas -j dynm", it throws this:

20:02 I0>zas -j dynm
Can't open file DYNM

So, I am not sure how to compile this!

Sorry, I had to learn how to extract .lbr files, then how to run .sub files... this already has been a great ride :)

Thanks,
Edgar

ladislau szilagyi

unread,
Mar 27, 2023, 2:23:54 AM3/27/23
to RC2014-Z80
Hi Edgar,

you can download Z80AS here: https://github.com/Laci1953/Z80AS , take the file Z80AS.HEX and LOAD it in CP/M.

Z80AS is fully compatible with ZAS, with some extra facilities, and can handle huge source files ( which ZAS fails to process... )

Also, be warned that, if you want to use the 128KB version of TE, you MUST use my version of CP/M ( from https://github.com/Laci1953/RC2014-CPM/tree/main/PutSys ).

That's because the "official" CP/M being distributed with RC2014 does not allow the use of the "shadow" routines that will move bytes from/to the two 64KB RAM banks.

It does not allow because its BIOS "eats" all the available RAM up to 0FFFFH (the shadow routines must reside at exactly the same address in both 64KB RAM banks, at top addresses...)

For TE 512KB version, this issue does not exists, TE will work on any kind of CP/M implementation...

I hope these details will help all of you who want to try to use TE or my enhanced HiTech C compiler, who has the same requirements as TE, for the CP/M.

So, to use 128KB version of TE or HiTech C compiler, please install my "customized" CP/M ( it is the "classic" CP/M but with a smaller BIOS...).

On 512KB systems, you will have not this constraint. 

regards,
Ladislau

Edgar Salgado

unread,
Mar 27, 2023, 1:14:25 PM3/27/23
to RC2014-Z80
Thanks Ladislau,

I have downloaded TE512.hex and LOADed into TE512.com, it works but the first lines of the files are strange:

I create this file:

te: -                               --- | Lin:0009/0009/8189 Col:063/075 Len:062
     !.......!.......!.......!.......!.......!.......!.......!.......!.......!..
   1|Hello this is a test
   2|some lines will become garbage
   3|after I save and reopen this file
   4|I do not know how to solve,
   5|I have downloaded te512.hex and
   6|dit "LOAD te512.hex", which created te512.com
   7|It seems each time I save the file,
   8|it creates garbage?
   9|I tried redownloading again, but the same behavior is repeated
--------------------------------------------------------------------------------
^Z  = menu

When I open the ^Z menu and close the menu, it becomes this:

te: -                               --- | Lin:0020/0020/8189 Col:026/075 Len:025
     !.......!.......!.......!.......!.......!.......!.......!.......!.......!..
   1|MOzI#!
   2|MOzI#!
   3|MOzI#!
   4|MOzI#!
   5|MOzI#!
   6|MOzI#!
   7|MOzI#!
   8|MOzI#!
   9|MOzI#!
  10|MOzI#!
  11|
  12|
  13|
  14|
  15|
  16|
  17|
  18|
  19|
  20|-------------------------
--------------------------------------------------------------------------------
^Z  = menu

This happens also when I open a file, the first lines are this MOzl#!

This happens in CP/M 2.2, 3.0, in every version of the disk systems under RomWBW. 

I am not runing an RC2014, I am under an SC126.

Then, I have tried building it, it builds fine with "SUBMIT makete", but when I run "SUBMIT linkte" to create the executable, it goes on an endless loop of "(xsub active)" lines that never ends.

Thanks,

ladislau szilagyi

unread,
Mar 27, 2023, 1:53:57 PM3/27/23
to RC2014-Z80
Hi Edgar,

I think the problem is that your CP/M is executed under RomWBW.

My CP/M on my RC2014 with 512KB RAM boots directly at start-up...so, it's the simple-plain CP/M (my small "boot" code is here: https://github.com/Laci1953/RC2014-CPM/tree/main/BOOT

It seems that my 512KB memory management routines interact with RomWBW... in fact, I think I'm storing the edited text "over" RomWBW code , and that goes in getting garbage on screen.

Ladislau

ladislau szilagyi

unread,
Apr 3, 2023, 1:59:19 PM4/3/23
to RC2014-Z80
Hi all,

I adapted TE for Bill Shen's Z80ALL, just finished the final tests...

It handles text files with sizes up to 64KB; the screen size (64 chars x 48 lines) is good enough for most of my source files...

The Z80ALL's 128KB RAM structure is different from other 128KB RAM machines, it's a 4 x 32KB RAM , and this made difficult the TE "customization".
Another unusual factor was the video interface (yes, Z80ALL works with a real VGA monitor and a real keyboard :) , but I managed to use it's 4KB I/O space...

Z80ALL is a superb Z80 machine; it's faster (25MHz) compared to my RC2014's , so I will probably use-it frequently while developing my projects...

I'm starting now to "customize" also the HiTech C compiler for Z80ALL...

Thanks Bill for this wonderful Z80 computer!

regards,
Ladislau

Fred Weigel

unread,
Apr 3, 2023, 11:10:26 PM4/3/23
to RC2014-Z80
Ladislau

You may want to have a look at the TED editor


I am curious as to what you think.

Bill Shen

unread,
Apr 4, 2023, 12:08:47 AM4/4/23
to RC2014-Z80
Ladislau,
Tried your TE on my Z80all.  It is very responsive and a pleasure to use.  I'm excited about having capable editor, assembler, and C compiler on Z80all making it a self-hosting computer.

I'm delighted to work closely with a capable programmer like you!
  Bill

ladislau szilagyi

unread,
Apr 4, 2023, 12:47:12 AM4/4/23
to RC2014-Z80
Hi Fred,

I looked at TED. 
I found not the executable and when I tried to build-it, using ZXCC, I got errors:

zxcc ../Tools/cpm/zsm4.com -"=main.mac"
zxcc: Cannot locate ../Tools/cpm/zsm4.com, ../Tools/cpm/zsm4.com.com, ../Tools/cpm/zsm4.com.COM, ../Tools/cpm/zsm4.com.cpm _or_ ../Tools/cpm/zsm4.com.CPM

make: *** [Makefile:26: main.rel] Error 1

...and I then I understood that I must use ZSM4 as assembler.

I have not the ZSM4.

Ok, let's solve the problem... I edited the Makefile, trying to use zxas, but got a lot of syntax errors.

At this stage, I took a serious look at the sources and discovered that they must be heavily edited in order to align them to the ZAS syntax.

Did you do this work?

If yes, please publish these sources.
If no, I wonder how could you use TED...

Now, I must confess that I used TED back in 1978, when working on PDP-11 with RSX-11M.
It was a decent editor.

Ladislau

ladislau szilagyi

unread,
Apr 4, 2023, 3:30:09 AM4/4/23
to RC2014-Z80
Hi Edgar,

I found that I had a bug in my com2hex program, so that I published again the TE128.HEX & TE512.HEX files.

Please try the new 512 version, perhaps it will work now...

regards,
Ladislau

Fred Weigel

unread,
Apr 4, 2023, 7:41:16 AM4/4/23
to RC2014-Z80
I use zxcc...

first, I have a script called m80

#!/bin/bash
p=`echo $@ | tr a-z A-Z`
cpm `basename $0` -$p

Next, l80 is linked to the same script and both are on the path. i then have microsoft m80.com and l80.com
in /usr/local/lib/cpm/bin80

cpm is on the path, and is a link to /usr/local/bin/zxcc

Now I can build ted with
m80 =main
m80 =termdef
m80 =fileio
m80 =scrn
m80 =cmds
m80 =cpmio
l80 termdef,main,fileio,scrn,cmds,cpmio,ted/n/e

: fred@llana TED-master $; cpm ted
IA&E Text Editor - VT100 Terminal

Free core: 53248 bytes
TED>

Since it uses virtual memory, the core figure is for buffers.
Find ted.hex attached (LOAD to convert to com -- google not liking COM files )


ted.hex

ladislau szilagyi

unread,
Apr 4, 2023, 9:35:04 AM4/4/23
to RC2014-Z80
Thanks Fred,

it's indeed a very good editor; it reminds me of the times when I was working on PDP-11, 45 years ago...

I will keep it at hand...

Ladislau

Edgar Salgado

unread,
Apr 4, 2023, 12:58:26 PM4/4/23
to RC2014-Z80
Hi Ladislau,

I tested it, and still behaves erratically, sorry to report this :(

Best regards,
Edgar

ladislau szilagyi

unread,
Apr 4, 2023, 2:54:08 PM4/4/23
to RC2014-Z80
Hi Edgar,

well, I was almost certain that the erratical behavior was not related to the bug in my com2hex program,
but I really needed to be sure, that's why I asked from you this extra test... thank you for your effort.

Another thing got my attention... you mentioned that when trying to build TE, 
the "submit linkte" results in an endless loop of "xsub active" lines being displayed.

That's not ok, and it has absolutely no connection with the TE editor.
It seems that your XSUB.COM is corrupted ... or it interacts badly with your CP/M.
This must be carefully investigated...

Now, the real problem related with TE behavior is that I access the 16KB banks 
of the 512KB RAM module in a way that seems to conflict with RomWBW.
Practically, I store the edited text in those 16KB RAM banks, and I know from the RomWBW System Guide
that RomWBW uses these RAM banks to store its HBIOS and its RAM disk.  
So, what happens is that I "overwrite" some basic components (code and/or data) of RomWBW while trying to store the edited text,
and this can have only some very bad results, including CP/M crash...

My tests of TE running on 512KB RAM were made in the following scenario:
I have in the EPROM a small "CP/M booter", so at power-up CP/M is automatically booted.
The full 512KB RAM space is available for whatever CP/M program wants to store there something.
And TE is running without any problem, I was able to edit, save & load back some very large files (~300 KB).

Ladislau

ladislau szilagyi

unread,
Apr 9, 2023, 3:24:59 PM4/9/23
to RC2014-Z80
Hi all,

I attached 2 pictures of the TE editor, working on Z80ALL.

This new version solves the issue of "long" text lines... they are not any more "truncated", as in the previous version.

Instead, the editor accepts now files with lines of up to 145 characters for 80 column screens, and up to 115 characters for 64 column screens (as Z80ALL, who has the VGA monitor configured for 48 rows x 64 columns).

For lines of text that do not "fit" in the physical size of the screen, you must just move the cursor past the right "edge" of the screen, and the editor will display that part of the text. 
Of course, you can freely move trough the text with the usual cursor movement keys, or next-word, previous-word, or search text, regardless of the "part" of the text being displayed.

You may see in the pictures that I use the "Wordstar way" to show the difference between "short" lines and "long" lines.

It's a real pleasure to work with TE on Z80ALL... it loads a big file in few seconds, and you can move trough the text very quickly (text is stored in 64KB RAM of the total Z80ALL's 128KB RAM).

Thanks again, Bill, you have designed a great retro Z80 computer...

 Ladislau

TE1.jpg
TE2.jpg

Bill Shen

unread,
Apr 9, 2023, 6:33:15 PM4/9/23
to RC2014-Z80
Wow, this is an excellent solution.  The direct-addressable video RAM is relatively small and 25MHz Z80 is fast so software scrolling in the vertical direction can be done quickly, but I've not thought about software scrolling in the horizontal direction to overcome the 64-column limitation.  Now you've done it, I felt silly for not thought of it.  In fact, hardware vertical scrolling can be implemented relatively easily in CPLD (not in Z80all because its CPLD is already fully utilized) and hardware horizontal scrolling can also be implemented in CPLD.  In VGARC, I implemented the hardware vertical scrolling but not the horizontal scrolling because I can't see the advantage of horizontal scrolling, but I see it now.  

Thank you, This is a conceptual breakthrough that I need to let it soak in...

Z80all has the video and PS2 functions all integrated in one CPLD in addition to address decode and bank registers so the CPLD is fully utilized.  VGARC is a RC2014-compatible card that implemented just the video and PS2 functions so it has room for more feature such as hardware scrolling.  RC2014+VGARC should have the same video and keyboard functions as Z80all,  so your work with TE should ported to other RC2014 hardware.

Z80all rev1 still has jumper wires and patched PS2 interface.  Your success have motivate me to clean up the pc board design for a production version of Z80all.
  Bill

ladislau szilagyi

unread,
Apr 10, 2023, 3:04:38 AM4/10/23
to RC2014-Z80
Hi all,

I just published here ( https://github.com/Laci1953/RC2014-CPM/tree/main/te ) the last version of TE text editor, for the following hardware:
- Z80 computers provided with 64KB RAM (including RC2014's) - Z80 computers provided with SC108, SC114, SC118, SC150, SC152 or the Phillip Stevens memory module (128 KB RAM), - Z80 computers provided with the 512KB RAM + 512KB ROM module
- Bill Shen's Z80ALL (25MHz Z80, 4 x 32KB RAM, VGA 48x64, keyboard, KIO)

As a reminder, TE was written by Miguel Garcia, it edits the text in the internal RAM (it's fast...),
and I adapted TE for all these hardware platforms mentioned above, to allow handling larger text files.

I added smart TAB handling, command line options (setting screen size & TAB spacing), and the major improvement
of this TE version is that it now can handle any file with lines up to 145 characters, without truncating these lines.

I included the 64K version just for coverage, you can play with it but it can handle only text files up to 20K;
the real power of TE comes with the 128K version ( can edit files up to 70K ) and of course, the best is the 512K version,
which can edit files up to 350K.

Ladislau

Greg Holdren

unread,
Apr 10, 2023, 12:40:25 PM4/10/23
to RC2014-Z80
Any chance for SC126 / SC131 support? I think many would appreciate this as these are very popular SC models.

Tnx,
Greg

karlab

unread,
Apr 10, 2023, 3:21:05 PM4/10/23
to RC2014-Z80
Hi Lad
It's been a while since I've played with the RC, have forgotten a lot.
I was going to try the TE editor. Can you please provide TE as binary or as *.dpg files?
Karl

Phil G

unread,
Apr 10, 2023, 5:30:20 PM4/10/23
to RC2014-Z80
Hi Ladislau, I tried the 64k version from https://github.com/Laci1953/RC2014-CPM/tree/main/te and it appears to be TED, and doesnt look like your photos?
Cheers
Phil

Phil G

unread,
Apr 10, 2023, 5:41:39 PM4/10/23
to RC2014-Z80
Sorry looks like my SD is corrupted, I'm getting all sorts of mixed directory contents.  Definitely a problem this end, not yours!

Phil G

unread,
Apr 10, 2023, 7:23:39 PM4/10/23
to RC2014-Z80
Rebuilt SD and all is fine again, the 64k version of TE running perfectly:

te64k.jpg

karlab

unread,
Apr 11, 2023, 12:50:11 PM4/11/23
to RC2014-Z80
Thanks Ladislau
It works perfectly on my Z80, Z180 and Z280 systems, 
but it want report free memory on Z180 and Z280 with linear memory. 
Is it because I am using ROMWBW ?
Karl

ladislau szilagyi

unread,
Apr 11, 2023, 2:04:14 PM4/11/23
to RC2014-Z80
Hi Karl,

the "free memory" function was intended for the following Z80 systems provided with more than 64KB RAM :  SC108, SC114, SC118, SC150, SC152 or the Phillip Stevens memory module, or the 512KB RAM + 512KB ROM module, Z80ALL.

Therefore, it reports how much RAM is still free from the memory being used to allocate buffers, in:
- the extra 64KB RAM in the case of the 2 x 64KB RAM systems,
- the 28 x 16KB RAM banks of the 512KB RAM systems,
- the 2 x 32KB RAM banks of Z80ALL 

It does not work for other hardware platforms ( it will return 0 ).

Ladislau

Bill Shen

unread,
Apr 12, 2023, 8:30:54 AM4/12/23
to RC2014-Z80
TE on Z80all is really cool!  It is an responsive and very usable editor.  I can see myself doing significant software development works on Z80all with the suite of editor/assembler/C-compiler.
  Bill
Reply all
Reply to author
Forward
0 new messages