Showing posts with label dosbox. Show all posts
Showing posts with label dosbox. Show all posts

Saturday, July 8, 2017

Building a 68000 Single Board Computer - The Quelo 68000 Cross-Assembler

In the book 68000 Microcomputer Experiments by Alan D. Wilcox that I recently mentioned in a blog post, there is a chapter that covers using a cross-assembler to build 68000 code and upload it to the Motorola ECB. The assembler used for the examples is the Quelo 68000 cross-assembler.

A couple FORTH implementations for the 68000 that I came across mentioned that they were written for the Quelo assembler as well.

Quelo was a company based in Seattle, WA that offered a commercial cross-assembler for the 68000 that ran on CP/M and MS-DOS, around 1984. A Google search located a copy of the Quelo assembler for MS-DOS as well as a manual.


I was able to run the assembler under Linux using the dosbox MS-DOS emulator program (It likely runs under Windows 10 as well, but in my experience dosbox is often even more compatible with MS-DOS than recent versions of Windows are).

I used the small program example that was in the Wilcox book and was able to assemble it, generate an S record file, and upload and run it on my TS2 computer.

Assembling my larger calculator program generated some errors which looked trivial to fix (e.g. the syntax for PC relative addressing was different).

It looks like quite a sophisticated cross-assembler which includes macro support and a separate linker as well as some utilities like a cross-reference tool and utility for splitting files into odd and even ROMs.

All of the files I used as well as building instructions can be found here:
https://github.com/jefftranter/68000/tree/master/quelo.


A Google search for Quelo found a number of references to CP/M and Motorola 68K software including the ad above from the November 1983 issue of PC Magazine. The manual says it was licensed for a single user. One source referred to the CP/M version as being public domain; possibly they made the CP/M version of the assembler free when MS-DOS became more popular, but as far as I can tell the source code is not available anywhere and is likely lost.

It was fun to be able to run a program from 1983 on a modern computer, but for most of my 68000 cross-assembler needs I think I will stick to the VASM assembler which runs natively on Linux and is still being actively maintained.

Friday, November 25, 2016

Building a 68000 Single Board Computer - Software

While waiting for the remaining parts, I spent some time getting the software for the board ready.

The Teeside TS2 used a monitor program which is listed in source code form in the book and on the included CD-ROM. The CD-ROM also includes a number of tools including a 68000 cross-assembler and simulator.

The programs are from the late 1980s and were written for MS-DOS (predating Windows). I was able to run the cross-assembler and the simulator under Windows 10 (it needs to be run as Administrator). I was able to run the small version of the monitor called minimon under the simulator. I was also able to run the programs under the Linux program dosbox (an MS-DOS emulator).


I normally use Linux and wanted a native cross-compiler for the 68000 that I could run there. The GNU assembler supports the Motorola 68K family. It is quite easy to build a 68000 cross-assembler under Linux. I followed some instructions I found here. These were the basic steps I followed:

  1. Get GNU binutils, which includes the assembler, by downloading it from http://ftp.gnu.org/gnu/binutils/
  2. Untar the source archive somewhere.
  3. Configure it using ./configure --target=m68k-elf
  4. Build it using make -j4
  5. Install it using sudo make install

The assembler binary is called m68-elf-as.

You can also build the GNU C compiler if you want to do high-level language programming. Quite a bit of code should fit in the RAM and ROM available. The basic steps I followed to do this are (based on http://daveho.github.io/2012/10/26/m68k-elf-cross-compiler.html):

  1. Get the code ftp://ftp.gnu.org/pub/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.gz
  2. Untar it.
  3. You will need some development tool packages which vary depending on your Linux distribution.
  4. Configure, build, and install it using:

mkdir objdir
cd objdir
../gcc-5.4.0/configure --target=m68k-elf --enable-languages=c --disable-libssp
make -j4
sudo make install

The C compiler binary is m68k-elf-gcc. Many other tools also get built.

I was able to port the TS2 monitor to assemble under the GNU assembler and was able to generate binaries that match the original from the Teesside assembler. The port can be found here on github.

I also wrote some simple code that plan to use when I start to bring up the board - a simple ROM that will do only a little more than freerun mode, like a simple loop or writing to the serial port. This can be found here, but is still a work in progress and untested.

Future projects, if and when the board is up and running, could include trying to get the TUTOR software from Motorola's ECB board running (the TS2 should be compatible with it). It is a little more advanced than the TS2 monitor and includes an assembler than runs on the board, for example.

There are some free implementations of BASIC for the 68000 that could possibly be ported including http://members.shaw.ca/gbrandly/68ktinyb.html and http://www.easy68k.com/applications.htm