Quick and dirty i8080 emulator in BASH!

Based on the Toledo 8080 processor emulator, it’s Peter Naszvadi’s i8080.sh!

You will need bash version 4 for this to run. So for those of you in the 1990’s you are out of luck.

And to make this fun, the 2kb basic ‘ROM’ is bootstrapped into RAM for immediate execution!

$ ./8080.sh
Quick and dirty i8080 emulator by NASZVADI Peter, 2019.
Press Ctrl+C to quit anytime!
Initializing upper memory to NOPs
Initializing register values
Starting CPU emulation


OK
>10 PRINT "HIHI"
>RUN
HIHI

OK
>

So we’ve seen emulation in javascript of all things, but now you can run 8080 instructions from bash of all things!

And for anyone even more crazy there is always BDS C: which was opened up back in 2002, a K&R for the 8080 on CP/M!

2 thoughts on “Quick and dirty i8080 emulator in BASH!

  1. $ ./configure –with-gnu-malloc –enable-array-variables && make # and then i8080.sh worked

    Downloads/ftp.gnu.org/gnu/bash/bash-2.05b$ ./bash –version && ./bash i8080.sh
    GNU bash, version 2.05b.0(1)-release (x86_64-unknown-linux-gnu)
    Copyright (C) 2002 Free Software Foundation, Inc.
    Quick and dirty i8080 emulator by NASZVADI Peter, 2019.
    Press Ctrl+C to quit anytime!
    Initializing upper memory to NOPs
    Initializing register values
    Starting CPU emulation
    OK
    >PRINT “Hi Jason!”
    Hi Jason!
    OK
    >

    ### guessing that dparen-arithmetic is a backported syntax element from newer bash versions? Also tested successfully with compat31 shell option using bash v4.x

    • Ok, so using Rhapsody 5.3, and GNU bash 2.02 it doesn’t work.
      GNU bash, version 2.02.1(1)-release (unknown)

      However I went ahead and build 2.05b and yes it runs!
      GNU bash, version 2.05b.0(1)-release (i386-apple-rhapsody5.5)

      Starting CPU emulation
      
      
      OK
      

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.