Tuesday, 25 May 2021

Loading files onto RC2014 from Mac


Background: the RC2014 is a Z80-based homebrew computer. I love programming 8-bit computers in Forth, Assembly, sometimes even BASIC.

The ROM I use allows me to select basic/monitor/cpm at startup, I almost always use CP/M. There's a CF card there in the middle of the computer.

Getting files onto that card is the issue. My computer won't read that card natively. There are tools for mounting the card, and for sending a file to the RC2014 via the terminal but I've not been able to get anything working on my Mac yet.

The methods that I've used from the start involve pasting an IHX file in using Hexload or SCM, which load the file into the computer's memory, or a PKG file together with the DOWNLOAD utility which stores the file in the current drive on the CF card.

This requires an easy way to convert the source file to IHX or PKG. Fortunately this isn't too difficult. Those formats just encode the data as hex characters (along with some checksumming / formatting etc).

Here's my little utility. The Open button allows you to choose your source file via a file browser. 

When I develop for the RC2014, I'm obviously changing my source file frequently (ie my built binary, .COM or .BIN, or as here, a forth source with extension .F) so the reload button allows me to simply reload the same file with a single click.

In these screenshots, I'm choosing to convert to PKG, which begins with the DOWNLOAD instruction. It's obviously important to have DOWNLOAD in A: on your storage device (This may not work with RC2014 ZED computers). The button labelled 'Out Ext' simply chooses the extension that the file will have when saved. (When I build assembly source, it ends up with .bin extension, but I need it to be .COM when transferred over to the RC2014).

So having chosen the right options and 'Open'ed the file, the converted file is displayed in a text field ready to be copied and pasted. For pasting over to the RC2014, make sure that the terminal is set to make a small delay between characters (as always when pasting). And switch to the drive where you want to save the file. Here's that file being 'pasted' into my F: drive on the RC2014:

Here's the same file, with IHX chosen as the conversion format. This type of file is suitable for loading directly into memory using the Hexload utility on the RC2014, or the SCM (small computer monitor).
This time the 'Start' memory address comes into play. With CP/M this will always be $100. 

My utility is not very polished, as is the way with things that you make for yourself. But if this will help you, I've signed and notarized it and you can download it here. It's built to run on MacOS 10.14 upwards. 

Let me know if this is useful to you, or if you have any comments / suggestions.

shiela@peacockmedia.software  or leave a comment below.