Close

Assembler

A project log for BREDSAC

Electronic Dynamic Storage Breadboard Computer

gregewinggreg.ewing 07/10/2020 at 12:220 Comments

I wanted to write a combined test program to exercise all the instructions, so I can tell whether I've broken something when I make a change. It quickly became apparent that writing any sizeable program with the tools I had so far would be a very tedious exercise.

So, I wrote an assembler. Yes, this is cheating slightly, since the builders of the original EDSAC had no such luxury available, but I figure I've already served my time doing hand assembly during my 8-bit era, and I want to finish this project some time during my life.

Here's a sample program:

#
#   Hello World
#
        A i_out F       # Initialise the Output instruction
        T out F
        A msg_len F     # Initialise the char counter
        T count F
loop:   A count F       # Decrement the char counter
        A k_m1 F
        G stop F        # End of the message?
        T count F
out:    O F             # This instruction is modified to address succcessive chars
        A out F         # Increment the address in the Output instruction
        A k_2 F
        T out F
        F loop F        # Go back for next char
stop:   Z F             # Finished

i_out:  O msg F         # Initial value of Output instruction
k_m1:   -1 F            # Constants
k_2:    2 F
count:  0 F             # Char counter
msg_len: 12 F           # Length of message
msg:    'aHELLO WORLD'  # Message to print ('a' is Letters Shift)

Discussions