Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- Z80MC
- Messages
Search
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
For native CP/M I have a shopping list of compliers to
compare to.? For raw code development speed and
ease BDS-C is my goto.? For editors I have VEDIT and as
screen oriented editor its very good with real terminals
(most PC terminal emulators fail hard for keyboards
that do not? match real terminals).
?
Haven't played with Z88DK, just no reason to have a SmallC
on pc when I have it on native Z80.? So I skipped it.? Actually
I have two versions one for 8080/8085 and the Z80 with
peephole optization and matching libraries for both.
?
Generally C is nice with complex data structures and
other projects where some level of portability is nice.
However C on z80 has a tendancy to eat ram.
?
I can think in 8085/z80, habit and years of doing it.? ?
That and I have a nearly 5 decades of code including
a macro library for both that is optimized.? Both take
advantage of undocumented instructions that are
different for 8085 and z80.? The 10 "hidden"
instructions that all 8085 have and actually can
improve code.? For Z80 there are special cases
where the undocumented by Zilog but documented
by everyone else that makes z80s do help code
size and speed.
?
That is the difference between CP/M systems which
have resources memory, io, and storage.? Also CP/M
had basic tools supplied so it had a useful starting point.
That and I've had hard disks on CP/M since mid 1980
so the archive is larger never mind the WC-CDROM
for shear volume.??
?
On one of my Kaypros has Handyman a secondary rom
that piggybacked the z80 and added handy stuff like a
calculator, note pad editor, and calendar plus other items.
IT also operated independant of CP/M and could copy
results to CP/m applications.
?
Years back I used a flavor of Tiny basic married to the CCP
to make a scripting command line.? I was spoiled by
VAX/VMS DCL (Digital Command Line) which was a
interpreted language in itself? with explicit and implied
scripts and very powerfull.? ?This is back early 80s where
I was trying to get big iron features on a Z80 CP/M machine
and largely succeeding.? Then again I had PDP-8 and PDP11
hardware and OSs to incite and inspire.
?
As a to a calc for CP/M most assumed VT52/vt100/vt220?
all having keypad.? Many other terminals did as well as
most emulated Vt100.
?
" I wish I had now what I was used to then."
?
Allison |
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
Thanks for looking into it and sharing back! ?Your experience mirrors mine; I find the SDCC code generation to be a bit fluffy. SDCC is a labor of love of its authors, so I suspect that advancements in optimisations are catch-as-catch-come.
?
My reflection on this mini-project is that SDCC can be a project accelerator if you want to use modern C authoring on a desktop dev env and are not picky about code size. If you've got the flash/ram, might as well use it. My acid test was compiling an HP15C emulator within this toolchain. This resulted in a program that fit in the 32 KiB banked region and there was plenty of RAM for variables in the non-banked region. Could it be smaller? Doubles. Could it be faster? Surely. Did it take months to implement? No, because I already had the code on-hand, so I just had to concoct build scripts and implement main() to start the emulator.
?
(Incidentally I did not complete this PoC implementation because I realized much to my chagrin that calculators presume the presence of a button matrix, so... whoops! I did implement the screen rendering of the keyboard and LCD using VT100 codes. This was slow even at 115kbps. The stdio fprintf() layer was about half as fast as CP/M BIOS calls, but really still too slow even then to be pretty to look at. Since this was just a PoC for code size and execution speed, I didn't bother investing in completing key mapping, or thinking laterally, making a parser for a CLI version.)
?
I chasing other wild geese just now, though I still might come back to this as even just now a buddy is wanting to re-purpose some vintage z80-based spectroscope with alternative firmware. (Indeed, the genesis of this activity is because of some folks wanting to reverse-engineer an esoteric language CAI machine called the 'Cefucom'. I could glean a lot from disassembling the rom dump but eventually one has to buzz out the wires to know what PIO-A-bit-7 is electrically connected to, and whether port 20h selects U24 or U25. My suggestion was a custom firmware that tweaks the lines in a predictable way such that you can observe the chip select logic with a multimeter rather than reverse engineering all the intermediary SSI decode. So it was handy to be able to crank that out quickly irrespective of generated code quality.)
?
Thanks so much, Allison, for your insights and also your tales from the trenches of how things were. And are they materially different now? Or just more and faster? Well, I guess quantum computing seems different, or is that just the re-imagining of analog computers?
?
73, AG5TH, dave
|
Strange behavior of #8 button
I have the Z80MC with all 3 cards. Built this back in 2022.
It gets power from the USB cable when I connect it to my computer. Never tried to power it with a bench supply. When I press the #8 button, sometimes I get an 8 and sometimes a 9. Spent a bunch of hours troubleshooting. Never figured it out. I've been over every connection with a microscope. It seems to have a pattern but I don't know how to troubleshoot this. Examples: If I do E 2888, I get 2899. If I do E 7888, I get 7899. Now today, I powered it up and it's working perfectly. But I'm sure that's only because I'm writing this message. I've seen this behavior as well. It will work fine for a while. That tells me it's likely not a problem with the button itself. It would also tell me it's not a short somewhere. It functions perfectly when I connect with TeraTerm so it's not a huge deal and I just live with it. |
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
My experience with SDCC is a bit dated but I know it got a LOT better with Z88DK. There's a lot of optimization work by a whole lot of people and solid C libraries that work out of the box.
?
At the time I was comparing it to my home brew compiler on the 1802 but i was quite impressed with SDCC/Z88DK. |
Re: Micro BASIC Manual
Mitch, Can you please tell me if you are using all 3 boards? or just the Front panel with the Z80? Also, how are you powering your Z80mc??? FYI, I'm using all 3 boards and powered from a 5V, 5A bench supply. Josh
On Sunday, March 23, 2025 at 09:11:04 p.m. EDT, Mitch Smith via groups.io <kb3gkc@...> wrote:
It's funny you mention a problem with the #8 button. I have a similar problem with mine. Instead of getting 8, I get 9. Spent a bunch of hours troubleshooting. Never figured it out. Sometimes it will produce an 8. If I do E 2888, I get 2899. If I do E 7888, I get 7899. And so on. Maybe we should start a new thread... Mitch |
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
When though full install of the SDCC on my main linux machine.
Reason was to find out in the flesh if it was batter than native...
?
The answer is, not really.? While its faster, the code pushed out
is not?better in any way on z80.? I expecteding the code is on a
PC based compiler?with lots of memory and processor available
it would be somewhat optimizing.? It does not.
?
While faster than running on 4mhz z80 over all between file
movement between PC and the real thing there was no gain.
Its fine if you live in the world of sims I'd expect.? ?It would
be handy for those building their first z80 or any of the
other supported machines and need "first code".
?
Useful experiment and new tools but better?? I can't say yes.
?
Allison |
Re: Micro BASIC Manual
What a strange problem.? Not happening on my system.? I tried 2888 and 7888 10 times and got the right number every time.
On Sunday, March 23, 2025 at 09:11:04 p.m. EDT, Mitch Smith via groups.io <kb3gkc@...> wrote:
It's funny you mention a problem with the #8 button. I have a similar problem with mine. Instead of getting 8, I get 9. Spent a bunch of hours troubleshooting. Never figured it out. Sometimes it will produce an 8. If I do E 2888, I get 2899. If I do E 7888, I get 7899. And so on. Maybe we should start a new thread... Mitch |
Re: Micro BASIC Manual
It's funny you mention a problem with the #8 button. I have a similar problem with mine. Instead of getting 8, I get 9.
Spent a bunch of hours troubleshooting. Never figured it out. Sometimes it will produce an 8. If I do E 2888, I get 2899. If I do E 7888, I get 7899. And so on. Maybe we should start a new thread... Mitch |
Re: Micro BASIC Manual
Thank you Allison for the detailed and enlightening information, appreciated. I ran into some problems assembling my Z80MC. Everything was assembled, including the z80 SIO, verified several times and finally powered up. Everything seemed to be working fine except no response from button 8. To make long story short, while troubleshooting the problem (into third straight day) managed to feed 9V Vcc into Vin causing even more problems while button 8 issue remained unresolved.? At the moment, I am trying to get another kit set to get back into exploring the Z80 MC with Micro Basic. Unfortunate and expensive set back¡. At least I will have more time to read. Cheers, Kerem On Wed, Mar 19, 2025 at 9:25?AM ajparent1/kb1gmx via <kb1gmx=[email protected]> wrote:
|
Re: Micro BASIC Manual
Original Dunfield's Micro-BASIC program used a monitor also from
David Dunfield.? His site is still up but the URL is different.
Note that there are two versions of that basic one in .ASM (8080/z80)
and another in Dunfield's Micro-C (close to K&R C).? I have original
sources for both.
?
Regarding "other" BASICs that can run on Z80 based systems there are many.
The MSBASIC(microsoft) is well known, Also NABU basic , and at least three
Tiny basics and LLL (larwence livermore labs) BASIC... I"d also add Z8TBASIC?
as well.? All of those are public domain now or free for non commercial use.?
All of them can be ported to?the Z80 MC.
?
Due to the fact that Z80 can run code from prior 8080 and 8085 makes for?
large amount of program sources.? Most the port will be trivial only allowing
for what IO may be needed.
?
Other items of interest for 8080/8085/z80 system would be:
-ALPS Dunfield's Assembly Language Programming System? An editor, assembler, debugger.
? I have added this and micro-bsic to the files area.
?
-Softpack-1 Part of a large collection of software including resident editor and assembler
and other tools from?Processor Technology for the SOL system.? This also includes a BASIC.
?
Allison |
Re: Micro BASIC Manual
Here's his unmodified assembler code for Micro Basic.? You should read his comments, he's very funny. Also, here's the modified code with the extra INP and OUT commands added.
On Sunday, March 16, 2025 at 09:45:28 p.m. EDT, Kerem Kapkin via groups.io <kkapkin@...> wrote:
Hi Josh, Unfortunately my Z80MC Front Panel had an issue with an IC, so currently it is waiting for a part. In the meantime I am somewhat familiar with Micro Professor MPF-1 Tiny Basic. The system has a coder ROM. Sounds like for Z80MC, I need a separate coder to convert instructions before inputting. Some reason all the links to Dave¡¯s material giving me an unavailable URL error as if the pages have been deleted. If you can point me to Dave¡¯s Micro Basic coder, I would?appreciate it. Regards, Kerem On Sun, Mar 16, 2025 at 6:31?PM joshbensadon via <joshbensadon=[email protected]> wrote:
|
Re: Micro BASIC Manual
Hi Josh, Unfortunately my Z80MC Front Panel had an issue with an IC, so currently it is waiting for a part. In the meantime I am somewhat familiar with Micro Professor MPF-1 Tiny Basic. The system has a coder ROM. Sounds like for Z80MC, I need a separate coder to convert instructions before inputting. Some reason all the links to Dave¡¯s material giving me an unavailable URL error as if the pages have been deleted. If you can point me to Dave¡¯s Micro Basic coder, I would?appreciate it. Regards, Kerem On Sun, Mar 16, 2025 at 6:31?PM joshbensadon via <joshbensadon=[email protected]> wrote:
|
Re: Micro BASIC Manual
Kerem, I should tell you, I added 2 instructions to Micro Basic.? OUT and INP.? OUT pp,vv? works to output byte vv to port pp. And INP(pp) is a function that returns they byte at input port pp. The assembler code for Micro Basic is available and was very easy to modify to add these instructions.? Dave Dunfield is a very well organized coder. Cheers, Josh
On Sunday, March 16, 2025 at 02:10:51 p.m. EDT, Kerem Kapkin via groups.io <kkapkin@...> wrote:
Hello Josh, Thank you very much. That¡¯s what I was looking for. Excellent. Regards, Kerem On Sun, Mar 16, 2025 at 10:24?AM joshbensadon via <joshbensadon=[email protected]> wrote:
|
Re: Micro BASIC Manual
Hello Josh, Thank you very much. That¡¯s what I was looking for. Excellent. Regards, Kerem On Sun, Mar 16, 2025 at 10:24?AM joshbensadon via <joshbensadon=[email protected]> wrote:
|
Re: Micro BASIC Manual
Hi Kerem, Hmm, I wonder what happened to the website? Here's the MBasic Manual I downloaded. Cheers, Josh Bensadon
On Saturday, March 15, 2025 at 06:29:19 p.m. EDT, Kerem Kapkin via groups.io <kkapkin@...> wrote:
Hello,
I am new to the Z80MC, just completed building one and learning about the operation. However none of the links to Dave Dunfield's Micro BASIC Manual is working. If you have a new link or if you can share the pdf file of the manual I would appreciate it.
Best Regards,
Kerem
|
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
Dave,
?
I was there from the start 8008 in '73 and Altair8800 (8080) December 1974
I was early adopter bleeding edge sort.
?
Period pieces...? Yes they are old but still work as they did then..or better.? ;)
I refer to them as fully debugged.? Lots of hardware improvements and
much more software.? Once I started with BIOS building I realized
more could be done and that most were so minimal it hurt.
?
Noteable S100 crates I have are Compupro, CCS, NorthStar* (two of them)
and a base 8slot backplane with full Compupro board set.
?
Aztec-C? I have it, doesn't stand out in my mind however. Available here.
?
The early Z180 the Hitachi part HG64180 is in my SB180, that's from ways
back and still use it occasionally.? ?Mine has the SCSI board talking to a
Zybec SCSI to MFM with a 3.5" MFM 20mb drive.? ? Micromint was the
vendor of the and IT was the cover system of the 1985 September Byte.
I put it in an old IBMPC Pizza box (thin profile) using the drives and
power supply.? ?Others include a modified Z80 card with a mezzanine
board with 64180 on it.? ? ?I also have a Micromint BCC180 that was
intended for control or embedded use.? So 64180 and kin are part
of the systems list.
?
As it works out a Z80 with 64K and two serial ports (DART or SIOB)
are a good start and rounding that out is some form of mass storage.?
Generally floppies were the rule early on but had two issues, slow and
small.? CP/M starts being more useful with larger drives of at least 512K
to the 8MB limit (or much larger for P2DOS and later) .? It solves the
problem of large projects needing multiple drives.? P2dos is a BDOS
replacement with improved internal math and written in z80 rather
than 8080.? It would spawn SUPRbdos, ZSdos, Zrdos and other
CP/M improved z80 replacements.? The CCP saw?improvements
with ZCCP and ZCPR and they all worked this existing BIOS though
by then people were also improving that.? So CP/M-80 from 1979 to
1985 saw a lot of growth and improvements that enhanced its
usefulness.? By then Conix a CCP overlay was used to get unix
like facilities like pipes, redirection, alias, and utilities.
?
To me the biggest weakness in CP/M was the file system.? Its flat
and a hierarchical file system was really needed.? There are things
done with aliases, system and user spaces (A0> though A15>) to make
that?more useful.? That and it was only usable for single user.
?
I mispelled Uzi Unix, there are a few flavors of that one for the P112
a Z180 board and others.? ? It eats memory.? Base kernel uses about 32K
and then you need banked/paged memory to do applications.? ?It was
useful when a CP/M interface (API) was added so it could? load and run
CP/M programs as those for unix were scarce and mostly utilities.
?
I had the fortune to be at DEC from 1983 to 93, great place to work and?
I got to do interesting stuff and work with interesting people.? That and
I had an LSI-11 before that.? Prior to that NEC Microcomputers, Hazeltine,
Automated processes (did i8008 stuff there in '73).? The market for
engineers took a plunge mid 90s due to?DEC imploding and others in
the region (eastern MA, southern NH...)? did as well.? Lot of talent
very few jobs.
?
Lynx.. RTOS, that should be easy.? There are many that have base
platforms on Z80/180.? RT systems are fun to do.??
?
?
Allison |
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
Hey, that's awesome! ?Amazing to talk to someone who was there for all that. ?Even more amazing that you are still doing it on period pieces, with period software!
?
I hadn't heard of the tools you mention, but I did hear of "Aztec C" -- maybe because they open sourced it a few years back.
?
Interesting that you and Mark mentioned the Z180 -- my first contract job was for the Hitachi variant that preceded it. ?Came about by accident; I was a young EE and the company I worked out made EPROM programmers. ?A client needed a 'personality module' for the 647180. ?While I was present for that site visit, I served no useful function. ?The client mentioned offhandedly about having some difficulty getting the LCD working. ?While my boss and the client were working on the personality module, I asked if I might try my hand at the LCD since I knew Z80 from earlier in 80's (when I worked on TRS-80s). ?So I wrote a driver for the LCD presenting a kind of puts()-esque interface, and tricked it out with some control characters to clear the screen and do cursor stuff. ?So the client asked if I would like a job. ?And for $10 whole bucks an hour! ?My boss got jealous and shortly thereafter raised me to $10 from the $7.50 I was then making. ?I thought I was so rich.
?
I learned a lot on that job. ?First, I didn't know people got paid to do software. ?I thought software was just something you made to make the hardware run -- who pays for that? ?Second, I was surprised to find out you don't need a CS degree to do software. ?All the other folks had degrees in chemistry, physics, etc. ?And the work environment was nicer and I didn't have to wear a tie. ?Five years later I switched to software full time. ?I expected to do it for 5 years and move on to something else, but I never did.
?
Anyway, keep the stories coming, they're interesting to hear (read). ?It was interesting also to read Lee's (actual) story about his days at Polaroid. ?Coincidentally, I interviewed with them in the 90's but didn't take that job. ?(Jobs were so plentiful then and folks would fight over you. ?It was surreal.)
?
Your mention of "Usi UNIX" is interesting -- I'll have to check that out. ?I also contemplated porting Lynx for fun, which I'm pretty sure will require all the extra pages I can throw at it.
?
Cheers!
-dave |
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
Hi Dave,
?
I know SDCC is PC based but it inherent PCisms are notable.
?
Its compiler does not produce great code.? It works and runs
but you would think on a current generation PC there would
be better optimization.? Even for Z80 it does a lot of redundant
stack work and under utilizes the register set.? Actually most
do not as the assumptions of stacks and issues with addressing
modes are a handicap.
?
Code for 6502 is not terrible.? The compiler writer has to get
out of the hardware stack mentality.? ?The 6502 has a limited
hardware stack ( best used for subroutines only) but decent
selection of memory addressing modes.
?
The granddaddy of them all is PDP-11, as that was where C
as we know it originated and many of the nominal K&R pointers,
datatypes and the like are native addressing modes on that
machine. It also had a powerful MMU.? I have several PDP-11
systems.
?
Owing to the period of generation (very late 70s and early 80s)?
one has to expect K&R C is the standard.? Later C# and C++ are?
nearly a decade later.
?
As to IDEs Turbo Pascal and C were later and very good. they
migrated to DOS on PCs.? At that time a step up for PCs
and DOS languages.
?
Bank switching is easy, there is no standard mechanism
and CP/M does not support it (or prohibit it).? ?CP/M
applications?don't know to use it. So...
?
As to MMU and larger than 16 bit addresses, that were Z80
(and friends) were at a impasse.? ?The Z180 has it built in but
it adds little.? The two predominant schemes were whole
Bank switch (whole 64K pages) usually with a small common?
non-banked ram or paged with scatter gather using a
1/4/8/16/32k kb page size.? ?I have such a paged system
(1k page).? ?The real issue is CP/M based system? are flat
64K and programs do not look further.? The most common
use was to put an extended bios and maybe resident system
extensions outside normal workspace the TPA or the Transient
Program Area (from 100h to below the BIOS) and that could
be up to 63K though systems with 56K were considered large.
The other was to use the extended ram as fast disk.
?
Also tried?straight 64K ram system (about 1980) with fast
(ram disk) storage to do virtual paging.? ? Nothing to take
advantage of it and swaping overhead was high.? Worthwhile
but only got used for foreground/background operations
like printer spooling.
?
I also do hybrid...? Myz80 a full z80 system emulation in software
on the PC under linux/dosemu for when? a PC is handy but a
real system is not.? It has all the same tools as my real
hardware and can even transfer files PC space (either way).?
Turns out the PC editors are no better than VEDIT on CP/M.
?
If you want a Unix like system then Usi unix and kin are to
be looked at.? ITs big so banked memory is desirable.
?
That's 50 years of been there did a lot of that.
?
?
Allison |
Re: using SDCC and stdio to Z80MC w/ CP/M 2.2....
Mark,
?
That is the exact one I have. got it because it was small and had capability
matching some of my larger machines.? Indeed nice kit.? Still putting?
my usual work stuff on it.? Turbo Pascal and C wonderful IDEs.
?
Older machines include a much modified NorthStar* horizon.? That's S100,
10mhz z80, 256K ram with MMU, 512K ramdisk, 512K romdisk, Z-system,?
multiple smart disk controllers for Floppies and hard disk.??
?
The ones I use most are Kaypro 4/84 with Handyman, advent turbo rom
with personality card,? and 1mb Ramdisk.
?
AmplroLB+? Full z80 with 64K, SIO and SCSI to a 45mb 3.5" fujitsu
Runs P2DOS variant of CP/M.
?
Most are still being used as they are application loaded and have been in
my collection for over 4 decades.
?
Allison |
to navigate to use esc to dismiss