Shell scripting is an often forgotten programming environment, relegated to simple automation tasks and little else. In fact, it’s possible to achieve much more complex tasks in the shell. As an example, here’s [calebccf] with an emulated 6502 system in a busybox ash shell script.
What’s in the emulator? A simple 6502 system with RAM, ROM, and an emulated serial port on STDIO. It comes with the wozmon Apple 1 monitor and BASIC, making for a very mid-1970s experience. There’s even a built-in monitor and debugger, which from our memories of debugging hand-assembled 8-bit code back in the day, should be extremely useful.
Although the default machine has a generous 32k of RAM and 16k ROM, you can easily adjust these limits by editing machine.sh. In addition, you can get a log of execution via a socket if you like. Don’t expect it to run too fast, and we did have to adjust the #! line to get it to run on our system (we pointed it to bash, but your results may vary).
What you use this for is up to you, but we’re sure you’ll all agree it’s an impressive feat in the shell. It’s not the first time we’ve seen some impressive feats there, though. Our Linux Fu column does a lot with the shell if you want further inspiration.
I can fell a tree using 7lbs sledgehammer or e-tool, but it doesn’t mean they are the right tools for the job.
This may not be the BEST tool for the job, but it will do in a pinch.
Until you can find / buy something better.
I’m looking at the 68hc12 range, from Motorola/Freescale/NXP.
With some tweaks, this could probably help me.
I did a major project circa ’85 with 68HC11.(Presumably the predecessor to the hc12?)
It was a big step up from the 6502, which I was my first “real” computer (https://en.m.wikipedia.org/wiki/KIM-1).
As I vaguely recall though, the 6502 had a handy indeed branch which allowed, in retrospect, modular approaches that the later Motorola chipset still didn’t sport (patent rights?)
Regardless, the HC11 was awesome, and in most GM cars, even back then.
Good hobby you’ve chosen, citizen; enjoy!
You’re more right than you know.
If it were the right tool for the job it’d hardly be a hack, would it?
Should have named it “Ghost”. Ghost in the shell….
Truly amazing. Can’t wait for the 6502 emulator written in 6502 machine language.
Back in the 1980s we had the Merlin Debugger which did just that.