spot_imgspot_img

Full-Blown Cross-Assembler…in A Bash Script

- Advertisement -


Have you ever ever dreamed of creating a bash script that assembles Intel 8080 machine code? [Chris Smith] did precisely that when he created xa.sh, a cross-assembler written totally in Bourne shell script.

Meeting language (just like the above) goes in, a binary comes out.

The script exists partially as a celebration of the ability inherent in an ordinary Unix shell with fairly unusual POSIX-compliant command line instruments like awk, sed, and printf. However [Chris] admits that largely he discovered the entire venture amusing.

It’s designed in a approach that including help for 6502 and 6809 machine code can be simple, assuming 8080 help isn’t already humorous sufficient by itself.

It’s not significantly environment friendly and it’s received some quirks, most of which contain syntax dealing with (hexadecimal notation ought to follow 0 or 0x prefixes as an alternative of $ to keep away from shell misinterpretations) nevertheless it works.

Need to give it a attempt? It’s a shell script, so pull a duplicate and and simply make it executable. So long as the standard command-line instruments exist (which means your system is from someday within the final thirty-odd years), it ought to run simply wonderful as-is.

An formidable bash script like this one remembers how our personal Al Williams shared methods to make higher bash scripts by treating it only a bit extra just like the full-blown programming language it qualifies as.

- Advertisement -

Related Articles

Latest Articles