3

Maybe it's a newbie CP/M question, but anyway ... Is it possible to relocate CP/M BDOS? I have a hardware I've written BIOS for, to be able to use with CPM 2.2. However that BDOS (seen by disassembling it) uses fixed addresses. Since I don't know CP/M to well, I have no idea how to place CP/M BDOS to another start address. The only (somewhat ugly!) solution I could figure out: I found a CP/M disassembly list, so I've simply modified the "ORG" directive and I re-assembled it. Is there any other way, eg some CP/M utilty? And if so, how it can do that, since BDOS uses JP, CALL etc opcodes (sorry I am just familiar with Z80, not so much with original 8080 assembly) so it's not simply PC independent. Thanks!

3
  • Wow - +1 for reviving 40+ year old technology - is this for a computer museum or something ?
    – Paul R
    Jun 27, 2014 at 19:19
  • 1
    We can say (one person museum, for myself only), retro-computing :) Since my work is about "modern" computer technology, where people wants Gbytes for a simple task was done only in 64K in the good old day, it's my hobby to write programs for old hardwares, "playing" with old OSes and even building my own 8 bit hardwares (well or sometimes just trying, hehe). It really helps to learn not wasting resources in our modern world either :)
    – LGB
    Jun 27, 2014 at 19:22
  • Cool - good luck with that - I used to work with Z80s and CP/M around 30+ years ago - Wordstar was a very cool word processor/text editor in its day, and I used to used to cross-develop for Z80 embedded stuff.
    – Paul R
    Jun 27, 2014 at 19:27

1 Answer 1

1

No need for a disassembly; the original CP/M source code is available (and, yes, BDOS and everything else resident is assembly, not PL/M). Within the "CP/M 2.2 ORIGINAL SOURCE" offered there you should find both OS3BDOS.ASM and OS3BDOS1.ASM. These are both different released versions of the CP/M 2.2 BDOS source (see README.TXT); you should be able to adjust the org and rebuild either of them, using the assembler also provided in the archive.

Alternatively you can use the MOVCPM tool (also included in the archive). It's intended to relocate the BDOS and the supplied BIOS but there's nothing to stop you replacing the BIOS after the fact.

Possibly of interest to you if you'd prefer to write a cross-relocator: from a quick bit of research, the interesting bit is this from the BDOS source:

if  test
org 0dc00h
else
org 0800h
endif

Why would the BDOS ever be at 0800 on any useful machine? Why is dc00 a 'test' address? Because the relocation is handled very trivially: BDOS is built once at 0800 and once at dc00. Through a binary compare of those two builds any differences must be where correct addresses need to be inserted, and the difference from the original org value tells you how to calculate the value to insert.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.