Introduction: V20-mbc How to Build a Custom Cp/m-2.2 BIOS Windows Version

If you find yourself in a position where you need to re-compile the CP/M bios (2.2) for your V20-MBC - then this is how you do it.

In my case I wanted to remove the “WARM BOOT” message every time a program existed or when you did a ctrl-c. You can, for example add code to the bios to support a PRN device, maybe via the GPIO. Whatever your idea before you can add code to the BIOS you need to be able to re-compile it.

Supplies

A windows machine to run the compiler on. I used a windows 10 virtual machine as i don't use windows and wanted it out the way when not in use.

The TASM 3.2 z80 compiler, search for this on google, you should end up at https://www.ticalc.org/archives/files/fileinfo/25...

A copy of the SD zip file from the v20-mbc home page, at the time of writing it was

https://cdn.hackaday.io/files/1709247312812416/SD-...

Step 1: Preparing Your Machine - Adding the Software Required

Once you have got your windows machine up and running, copy or download the files mentioned in the “supplies” section above.

Create a working directory on your machine, I suggest (to avoid a lot of typing and typo’s) you create a directory on drive C, for example c:\v20 . I strongly recommend that you avoid spaces in the names and long directory paths. Keep it simple.

Create a folder inside this directory for the TASM files to go in, c:\tasm Create a folder for the SD card image to go in, c:\v20\SD

Right click on each of the files and extract the contents to the directories you created above. Make sure you extract tasm.zip to c:\tasm and the SD Card zip file to c:\v20\SD

Step 2: Setting Up the Environment

Open the properties menu by right clicking on the “This PC” item from an explorer window.

Click on “Advanced system settings”, this will open a window called “System Properties”

(You can also get to system properties in other ways, but I don’t use windows very much so this is my way!)

Click on “Environment Variables”

When you have the Environment Variables window on screen you need to do two things;

Add a new variable In the top part of the windows, under "user variables for ..."

Click New, then or the Name type in TASMTABS for the Value type in c:\tasm

Modify the PATH variable In the bottom part of the window, under "System Variables" choose (highlight) Path, then click Edit

Click the New button and add in c:\tasm

Step 3: Testing TASM

After you reboot your windows machine.

Open a CMD prompt;

Click the Windows icon, type cmd. When it appears as an App at the top of the search box, double click it or click open.

Change Directory to the source code directory

Type: cd c:\v20\src\cpm22_8080

If you do a directory of this folder you should get:

C:\Users\admin>cd c:\v20\src\cpm22_8080

c:\v20\src\cpm22_8080>dir
 Volume in drive C has no label.
 Volume Serial Number is 0CCF-BD5F

 Directory of c:\v20\src\cpm22_8080

21/01/2021  15:01    <DIR>          .
21/01/2021  15:01    <DIR>          ..
16/01/2021  13:37            52,888 BIOS CPM22 - S140520.asm
16/01/2021  13:42           109,604 CPM22-8080.ASM
               2 File(s)        162,492 bytes
               2 Dir(s)  27,132,178,432 bytes free

c:\v20\src\cpm22_8080>

Set the build type.

Before you do a test compile you will need to exit the CPM22-8080.ASM file to configure it to produce a file suitable for booting from. Use your favourite editor (in this case write.exe !) to open the file:

write CPM22-8080.ASM

Scroll down about 70-75 lines until you find a section like this (you can also search for iLoadMode):

; NOTE:
; Translated from the Z80-MBC2 (HW ref. A040618) version. I left the original
; Z80 code in the comments.
;-----------------------------------------------------------------------
iLoadMode   .equ    0       ; set to 0 for track 0 image generation,
                            ; Set to 1 for iLoad-80 mode (for testing),
                            ; set to 2 for cpm22.bin binary file generation
;-----------------------------------------------------------------------

You need to change the value of "0" for iLoadMode to "2", as the comment says. Save the file.

Running the compiler.

Having save the file above, you can now run:

tasm -85 -b CPM22-8080.ASM -o cpm22.bin

and you should get something like this:

c:\v20\src\cpm22_8080>tasm -85 CPM22-8080.ASM -o cpm22.bin
TASM 8085 Assembler.      Version 3.2 September, 2001.
 Copyright (C) 2001 Squak Valley Software
tasm: pass 1 complete.
tasm: pass 2 complete.
tasm: Number of errors = 0

c:\v20\src\cpm22_8080>dir
 Volume in drive C has no label.
 Volume Serial Number is 0CCF-BD5F

 Directory of c:\v20\src\cpm22_8080

21/01/2021  15:23    <DIR>          .
21/01/2021  15:23    <DIR>          ..
16/01/2021  13:37            52,888 BIOS CPM22 - S140520.asm
16/01/2021  13:42           109,604 CPM22-8080.ASM
21/01/2021  15:23           282,166 CPM22-8080.lst
21/01/2021  15:23            17,535 cpm22.bin
               4 File(s)        462,193 bytes
               2 Dir(s)  27,139,579,904 bytes free

c:\v20\src\cpm22_8080>You may have noticed we are using the 8085 table and not 8080, the 8085 has a compatable instruction set with the 8080 and works fine.

Your ready to go, just copy the cpm22.bin file to the root directory of you SD card, and boot cpm-2.2 (don't forget to make a backup of the old cpm22.bin file before you copy the new one, just in case)

Remember this will boot into cp/m 2.2 with exactly the same setup as you all ready have, it's just a test!

Step 4: Edit the Code for Your Needs

At this point you can use your favourite text editor to make changes as required, for example I removed the WARM BOOT message every time you exit a program of pressed ctrl-C

It's beyond the scope of this tutorial to go through a programming course, so i hope you know what you want!

To compile follow the previous step. Don't forget to always make copies of files before you overnight them, it's by far the safest way to be able to get back to a working system.

Have fun.