This chapter also got scratched. Just didn't work right. But I want to keep it around for my own reference.
- Look here for getting a simulator for 6800/6809.
- Look here for running code on 6800/6809.
- Look here for 6801.
- Look here for 68000.
Getting Simulators for the
6800, 6801, 6809, and 68000
Okay, so we've introduced assembly language by talking a little about adding small integers. But if we want to understand what's going on, we really need some way to watch what the processor does when it executes the code.
If I had more time and money, I would design my own hardware and build my own
simulator software, and offer the hardware for sale and put the software up
for download and all that, and it would all be real easy to use.
(Of COURSE!)
Fortunately, there are useful simulators (software-based emulators) already
available, as I have mentioned.
What I will use for 6800 and 6809 code, especially in the first part of this, will be Joe. H. Allen's EXORciser simulator, EXORsim. For the 6801, it will be my hack on EXORsim, exorsim6801.
For the 68000, I will be using the Atari ST (and beyond) simulator,
Hatari.
I am choosing these because they seem to me to be the most generally available
and accessible.
There are other options, such as XRoar for the 6809 and 6801, which simulates the Dragon, the Tandy Color Computers 1, 2, and 3, and the Radio Shack MC-10, and the original Matra Alice 4K. If Ciaran doesn't beat me to it, I may try (again) to add hosted debugging to XRoar, but you can always run a self-hosted debugger (such as Disk EDTASM) on the emulated computer.
Now, Ciaran and his friends do provide an on-line emulator, and you can download Disk EDTASM and run it on the on-line simulator, but I don't want to be encouraging lots of people to put a heavy load on Ciaran's server. (I'll explain getting XRoar and building it locally on your own hardware later. It's a pretty steep start-up for a topic that already has a steep learning curve.)
Similarly,
VCC for MSWindows
requires compiling (if I read the website right), and only emulates the Color
Computer 3 (6809). I think I have heard that it supports direct debugging
fairly well, but cannot vouch for that. It might be an option if you're
running MSWindows.
You may find you need to build Hatari, but, if you are running a Linux OS, there are probably packages for it in your OS's repository. So you aren't necessarily faced with gathering all the dependent libraries yourself and all that.
For Mac OS, you can get it pre-built from the project website, if you haven't yet got a package manager running on your Mac.
For MSWindows, there is a 3rd party project, that the Hatari project links to, providing Hatari pre-built -- if you really have to use MSWindows.
There are other options for the 68000, as well, but Hatari seems to be the easiest to get, and to get started working on. And it seems to have the least in the way of advanced OS capabilities to get in the way of introductory-level practice.
(I really should figure out Musashi, but I want to get this tutorial written. That will come later. Also, Amiga under emulation is cool, but you want to know what you're doing before you dig into writing code on Amiga. Likewise classic Macintosh.)
MAME, of course, is an option. It does everything, and supports direct
debugging pretty well (I hear), but it's huge, and a bit daunting to get
started with.
But! (OS and Compiling)
For any of these, you'll need something to run the simulators on, both hardware (PC/workstation) and software (support in the operating system). And you'll need compilers to build anything that needs to be built.
Compilers are definitely one thing you'll need anyway, as we go along. There are more tools we want to use, and you'll need to compile some of them.
If you can run a Linux OS, or Mac OS, or freeBSD or netBSD, getting the compiler and other tools is really straightforward. They can usually just be selected during the install process, or installed later through some sort of package manager.
If you absolutely must run MSWIndows --
Cygwin
Microsoft's compiler toolchain (VS) has one not-small problem. Pretty much anything you try to do with it will try to drag you off into Microsoft solutions, and if Microsoft solutions were sufficient, you wouldn't be reading this blog.
If you must use MSWindows, the first tool you need to download is
Cygwin. (LSW with a full
Linux OS install might work, but I've never tried it. And LSW is Microsoft. I
have tried Cygwin.)
Make sure you're accessing the real https://cygwin.com/ site, and check the checksum after you download it.
For MSWindows 10, the command-line command for checking checksums was
certutil -hashfile <TYPE>
search the web for how to specify the type of checksum, etc.
Once Cygwin is installed, open up the installer again and get either the gnu C
compiler or the Clang compiler. Either should work. And you'll need the ANSI
and Posix libraries. While you're at it, get bc, too. (I think it's in the
repositories.)
Also, if you don't already have a favorite text editor, get either gedit or kate, or maybe Geany. Vim or EMacs will also work, if you already know them.
At which point I'm going to repeat myself.
Ubuntu or
Debian or
Devuan or
Mint OS, ...
There are lots of Linux OSses to choose from, they are mostly easy to install
on older hardware you might have lying around -- or on inexpensive ARM
hardware like
Raspberry Pi, and
they all have great compiler toolchains and other tools and repositories that
are easy to install from. You can also dual boot, but, really, if you don't
have a ten-year old PC in a closet somewhere that you're no longer using, a Pi
or something similar is pretty inexpensive.
FreeBSD or
NetBSD should work
pretty well, too.
OpenBSD, on the other
hand, is so security oriented that I'm not sure compiling EXORsim will be very
easy.
All of these have install instructions on their websites, and are easy to install. (Almost too easy. Do be careful to save any important data before wiping an old computer clean.)
Make sure you choose a minimal developer's install, with either the gnu or
clang compilers, and the basic set of libraries. And, as I mentioned for those
using Cygwin, install a programmer's text editor, as well -- kate, gedit,
geany, vim, emacs, or whatever.
Or if you're inclined toward Mac,
Doing this under Mac OS will also be pretty straightforward, and you don't
have to worry about installing the OS. You will need to install the BSD
developer tools subsystem (cough), well, I mean,
XCode, which
has the compiler toolchain. But that's straightforward, too. All the libraries
and bc should just come with XCode. And XCode has its own integrated editor,
so you don't need to choose a text editor. (But there are lots of great 3rd
party text editors available, too.)
Yeah, that's a lot of stuff, just to get started, isn't it? But it's tools
that you need anyway, if you are interested in assembly level programming
and/or retro computing.
Once you have your system and toolchain ready to work with,
- Start with downloading and compiling EXORsim6801.
- Then download and compile the most recent EXORsim.
- And then install Hatari.
Well, you can install Hatari first, but please compile EXORsim6801 before compiling EXORsim, and I should explain why.
EXORsim6801
No comments:
Post a Comment