Hacker News new | past | comments | ask | show | jobs | submit login
CP/M Source Code (z80.de)
106 points by kristopolous on Dec 12, 2021 | hide | past | favorite | 32 comments



This isn't just CP/M by far. I suggest the title be changed to "Digital Research Source Code", since that's what's inside the <title> tags.


It is also pretty ancient, going back to 2002 or earlier for everything except the Basic/E program. Post title should reflect this.

The source code I'd really like to see is Turbo Pascal 1.x or its CP/M predecessor, but I don't think that was ever released.



Maybe I missed something but I see some Turbo Pascal related tools there, and some binaries of TP, and some code written in TP, but not anything that looks like the source code to TP itself. I don't think that was ever released. A well-commented disassembly would be interesting and could possibly be created by devotees, of course.

I never actually used TP myself but it sounded great. These two articles made me interested in it:

* https://prog21.dadgum.com/116.html

* https://prog21.dadgum.com/47.html


Here is a disassembly of TP3 for CP/M-Z80, which seems well commented (I've just checked the compiler): https://web.archive.org/web/20131119042246/http://www.cirsov...

And here is a disassembly for the versions 1,2,3 apparently: https://www.memotech.franken.de/CPM80/


Nice! Are the early msdos versions basically the same?

Added: the comments in those files are better than nothing but they don't really say what the program is doing the way the original source code hopefully would. The labels are still the ones generated by the disassembler, so not very informative. Still, it's nice that someone did this and it's a good starting point for further study by anyone sufficiently motivated.

If of any interest, the source code to the BDS C compiler of the same era was released here: https://www.bdsoft.com/resources/bdsc.html


Will add this here in case anyone comes across this thread: https://pcengines.ch/tp3.htm

It discusses TP 3.0's operation, supposedly based on a disassembly. It's less interesting than it sounds (it's mostly a high level overview of how a small compiler works, rather than a real study of TP internals), but it helps.

Long TP discussion thread with dead link here: https://news.ycombinator.com/item?id=10202299


You might also be interested by what appears to be a perfect decompilation (leaked source code?) of the IDE of Turbo Pascal 6.0 written in itself using Turbo Vision and the internal compiler/assembler/debugger : go to http://www.exmortis.narod.ru/index_eng.html in the "Compilers" section and search for "tpascal.zip"


Look a systems programming language for 8 bit CPUs with safe strings and arrays. /s


Um... PL/M is not safe, and does not have "safe strings and arrays". It doesn't have strings... It has bytes and addresses.

I hope /s means "sarcastic".


I was being sarcastic, but not in relation to PL/M.

It has subscripted variables with LENGTH() to check its size (aka arrays), and an array of bytes is a string.

You can even create structures of subscripted variables.

PL/M manuals have a couple of examples with string utility functions by the way.


That is indeed what /s means


What else would /s mean?


Digital Research was the Microsoft we needed.


Blame it on how the whole deal with IBM ended up.


Wasn’t that because Bill’s mom had a friend on the IBM board?




I programmed in CP/M as a teen, and it was a different world then.. Byte Magazine was the way to find out about products and development; machines were connected to each other with a serial cable; a modem was used to send bits over a phone line.

Its annoying to see the comment about 'string safety' .. how about you do what you want with your own computer, which is not logged, watched, billed or updated without your consent. This code relates to a machine that you, as an individual, own. An individual person can do what they want with it, without a spy-OS within the CPU itself, for example.

Its clear (to me) that there has to be a serious fork in CPU development, which will need OS software, maybe back to Z80'ish 8 bits even.. This setup wont display JPG at multiple images per second rate from some centralized media servers, but you know, maybe that is a feature.

"free" as in "freedom"


Surprise by comments; 2002 is very new to me. Use it around 1970s/80s latest. And turbo pascal (I am still playing their turbo bridge) is of 1980s.


The original maintainer died in 2001. Maybe they mean new as in a section that was added by someone else. If that's the case here, it's totally acceptable to always have it be called new


They just mean that it wasn't posted very recently and want it reflected in the title that this is not a new discovery.


Actually the most recent comment is dated 02/07/2020 -- which I think is pretty good for an operating system that is 40 years old about.


It would be good to port this to Game consoles that use the Z80 CPU and hack together a keyboard and SDCard drive. Make them useful. MOst of the CP/M stuff is on the Internet and some is public domain by now.


> MOst of the CP/M stuff is on the Internet and some is public domain by now.

Sure? AFAIK something can only be considered public domain in one of the following conditions:

  - author explicitly uses public domain as a license,

  - 120 after publication,

  - 120 after registration,

  - 95 years after publication if it is corporate work or

  - 75 years after the death of the author; whatever comes first.


Is copyright law dating uniform at this point? I wouldn't be surprised if it is...

one thing I remember reading On The Internet a while back was a theory (from a lawyer I believe?) that stated that you can't just say you put something in the public domain, and have it then be in the public domain.

Like, you can choose to explicitly grant rights of usage, but simply writing "I am putting this work in the public domain" doesn't actually do anything, and is functionally very close to being the same as "all rights reserved".

I don't know if it's true though. I suppose we're fortunate that "nobody around to care" helps in practice for these kinds of conservation efforts that are victimless crimes at best.


This is correct. Public Domain is a concept unknown to the EU. You can never waive your copyright, only give permission to use to everybody.

It's one of the reasons why SQLite sells licenses even though it's released as Public Domain.

https://sqlite.org/purchase/license


But why not CC0? That basically just grants an indefinite royalty-free license if public domain isn’t an option.


Retro games consoles are already useful, as games consoles. People collect and play them still. If anything, modding them into an ultra low powered z80 PC would have less usefulness.

As it happens, there already are a number of z80 micro computers out there. Most of which will already have a CP/M port.


Indeed, Amstrad CPC 6128, a home computer which booted to Basic, just like C64 and ZX Spectrum, came with CP/M too.


Not just the 6128, the earlier and lower powered 464 did too.


CP/M has a BIOS interface for such customization. I’ve written more than several. Knock yourself out. NOTE: Digital Research used the term BIOS to describe its device driver interface long before IBM appropriated it for the IBM PC. It’s definitely not the same thing.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: