MWC XYBASIC disk image

193 views
Skip to first unread message

udo....@freenet.de

unread,
Aug 8, 2021, 7:45:23 AM8/8/21
to IMSAI 8080esp
I have added a disk image with Mark Williams Company XYBASIC
with CP/M versions for binary, BCD, and am9511 accelerated floating point arithmetic.
The disk image is available here:


We need more BASIC example programs, but not more Startrek and the like please ;-)
So if you implement something interesting and want it to get included on the disk
just let me know.

udo....@freenet.de

unread,
Aug 8, 2021, 1:11:13 PM8/8/21
to IMSAI 8080esp
To the MWC BASIC disk I added a program that computes the Mandelbrot set.

Then I added a disk image with Fred Weigel's APU support functions to accelerate FORTRAN-80 programs.
This has been build and tested with F-80 3.44. The z80pack repositories also have older versions of the compiler
for historical reasons, not suggests to use for something like this.

Fred Weigel

unread,
Aug 12, 2021, 1:34:27 PM8/12/21
to IMSAI 8080esp
Udo

On a lark (because it occurred to me) I wrote halfg.bas


I was thinking about the "old days" with graphics. Back in the day (pre-history, 77/78), putting Microchess on the
TRS-80 (after taking apart cassette hardware and making a "saver saver" tape -- on another piece of hardware;
there was no approved way to introduce "stand-alone" machine language cassettes for the TRS-80. And, I
recall hand-duping hundreds of them), and PET. Used character graphics back then (2x3 for the TRS-80 as I recall).

Now, years later, you took Peter Jennings Microchess and put it into dazzler graphics. But, I was thinking standard
CP/M machines -- with terminals. The thought came that terminal emulators typically support UTF-8, and there
you go! UTF-8 does support 2x2 graphics (2x3 as well, but my fonts don't have that!). So, got the old
Scopewriter font from Poptronics, keyed in an MBASIC program that would display "HELLO" in the Scopewriter
font, using 2x2 UTF-8 graphics characters - satisfying combination of old-school/modern.

The halfg.bas program actually reads the font from DATA statements, and builds the binary->UTF-8 map the
same way. This means it is quite slow on MBASIC on my 2Mhz equiv Altair-Duino.

But... could be converted to XYBASIC fairly easily. And, the way it is written, is an excellent test of BASIC interpreter
performance (very heavy on interpretation and line lookup -- the nastiest is at line 6790 which is a GOTO 6770.
If the interpreter does a linear search for lines, it needs to plow through all DATA lines to fine 6790).

I imagine this would  be a "fun" BASIC program for a new programmer to port, and improve (it is easy to make it
an order of magnitude more efficient and much faster).

I don't assign BASIC to my interns/students anymore -- these days it is all JavaScript/HTML/CSS. But, as
an intro to retro -- things like mandelbrot rule! This may qualify... I'll leave that decision to you.

And -- as a PS. The binary notation used in XYBASIC would make the font DATA much more compact, and
would improve font loading around 7 times. Sometimes notation does count!

Fred Weigel

udo....@freenet.de

unread,
Aug 12, 2021, 2:39:53 PM8/12/21
to IMSAI 8080esp
fridtjof.ma...@gmail.com schrieb am Donnerstag, 12. August 2021 um 19:34:27 UTC+2:
Udo

On a lark (because it occurred to me) I wrote halfg.bas


Interesting program, I was going to try it, but the upload in github seems to be corrupt starting at line 606. 

I was thinking about the "old days" with graphics. Back in the day (pre-history, 77/78), putting Microchess on the
TRS-80 (after taking apart cassette hardware and making a "saver saver" tape -- on another piece of hardware;
there was no approved way to introduce "stand-alone" machine language cassettes for the TRS-80. And, I
recall hand-duping hundreds of them), and PET. Used character graphics back then (2x3 for the TRS-80 as I recall).

Yep, I have messed with these pseudo graphics as we used to call it on the PET, Apple and such machines also.
The calculations for addressing the dots in a cell in BASIC was slow, so this part was converted into
assembler and the assembler program poked from DATA statements somewhere into unused memory.
Besides Microchess also Sargon was implemented with pseudo graphics on all kind of machines. One
should implement it again for the Dazzler, and also the IMSAI VIO has such a character set which even
allows a higher resolution than the Dazzler can do.
 
Now, years later, you took Peter Jennings Microchess and put it into dazzler graphics. But, I was thinking standard

This originally was done by Cromemco guys, one of their demos for what can be done with the Dazzler.
While Microchess was written for the 8080 Cromemco of course used Z80 instructions, so I took
this apart and rewrote this part in 8080, so that the program can be used on any 8080/8085/Z80 system
with a Dazzler.
 
CP/M machines -- with terminals. The thought came that terminal emulators typically support UTF-8, and there
you go! UTF-8 does support 2x2 graphics (2x3 as well, but my fonts don't have that!). So, got the old
Scopewriter font from Poptronics, keyed in an MBASIC program that would display "HELLO" in the Scopewriter
font, using 2x2 UTF-8 graphics characters - satisfying combination of old-school/modern.

The halfg.bas program actually reads the font from DATA statements, and builds the binary->UTF-8 map the
same way. This means it is quite slow on MBASIC on my 2Mhz equiv Altair-Duino.

That will be quite slow on the 2-4 MHz machines, but good demonstration what can be done. And it could
be fastened with assembler subroutines.
 
But... could be converted to XYBASIC fairly easily. And, the way it is written, is an excellent test of BASIC interpreter
performance (very heavy on interpretation and line lookup -- the nastiest is at line 6790 which is a GOTO 6770.
If the interpreter does a linear search for lines, it needs to plow through all DATA lines to fine 6790).

I imagine this would  be a "fun" BASIC program for a new programmer to port, and improve (it is easy to make it
an order of magnitude more efficient and much faster).

Sure is, if you can provide a fixed source I can include it on the BASIC disks for the machines.

I don't assign BASIC to my interns/students anymore -- these days it is all JavaScript/HTML/CSS. But, as
an intro to retro -- things like mandelbrot rule! This may qualify... I'll leave that decision to you.

Guess that is so everywhere, no one seems to teach BASIC anymore. 

Fred Weigel

unread,
Aug 12, 2021, 3:43:07 PM8/12/21
to udo....@freenet.de, IMSAI 8080esp
Udo

At line 606 (BASIC line number 7040) there is a control-z (CP/M eof, followed  by some junk
The actual last line is 7040 WHILE INKEY$ = "" : WEND
I saved it with SAVE "HALFG.BAS",A -- just checked, it is ok!

FredW

udo....@freenet.de

unread,
Aug 12, 2021, 5:13:14 PM8/12/21
to IMSAI 8080esp
Ah ok, thanks, I missed that, though it would be plain text. 

udo....@freenet.de

unread,
Aug 12, 2021, 5:50:20 PM8/12/21
to IMSAI 8080esp
If anyone is trying the program on the IMSAI 8080, some hints.
The program needs a lot of memory and will abort on the default 54KB system,
you need to sysgen the OS for 60KB at least.

Then for the UTF-8 output an 8bit clean console is required, so in system.conf you need:

# SIO 1 Channel A, Ports 2/3 connected to terminal

sio1a_upper_case        0

sio1a_strip_parity      0

sio1a_drop_nulls        1

sio1a_baud_rate         9600 


On my OSX system it won't work with xterm, that version seems to be missing the UTF-8 support, on the terminal
application it works.



TheHighNibble

unread,
Aug 12, 2021, 8:52:20 PM8/12/21
to IMSAI 8080esp
Also, if you use the XYBASIC built with AM9511 support for floating point (xycpm95.com) you will get 2.4K of extra RAM for your BASIC program, because the XYBASIC interpreter is smaller without all the floating point routines linked in.

I haven't looked at the code above, but if it only uses integer and doesn't need floating point, then an integer version of XYBASIC could be linked and give even more RAM.

Fred Weigel

unread,
Aug 14, 2021, 1:28:36 PM8/14/21
to IMSAI 8080esp
Been having more fun -- ported halfg.bas to xybasic. Did it in small steps: xy1.bas, xy2.bas and xy3.bas
Each runs, and is progressively better! xy3.bas is close to being usable in other projects (and now takes
up lots less memory).

: fred@tara halfg $; cpm xycpmfp

XYBASIC CP/M DISK EDIT REV 2.14
COPYRIGHT 1978, 1979, 1980, 1981 BY MARK WILLIAMS COMPANY, CHICAGO
WIDTH? 255
END OF MEMORY? 
48105 BYTES FREE

OK
LOADING XY3     

OK
 
▌ ▌▛▀▘▌ ▌ ▞▀▖
▙▄▌▙▄ ▌ ▌ ▌ ▌
▌ ▌▌ ▌ ▌ ▌ ▌
▘ ▘▀▀▘▀▀▘▀▀▘▝▀

(needs to be monospace)


xterm wil need the "-u8" option to support utf-8

Fred
Reply all
Reply to author
Forward
0 new messages