Computer Simulator - By Dr. Nicholas Duchon


To run the program:


// Sample Program
// loads chars from input stream
//  copies them to output stream
//  and memory locations starting at 50
//  until target char, ECH, encountered
// will infinite loop if
//  input stream does not
//  end with a . - period

    SETPCSTART 10
    ORG 10
    LDA ECH   // calculates 2's comp
    CMA       // 1's comp
    INC       // 2's comp
    STA ECH   // stores 2's of target
FST SKI       // look for input
    BUN FST   // no input
    CLA       // clear AC
    INP       // input to AC
    OUT       // ouput char
    STA PTR I // store char
    ISZ PTR   // inc location
    ADD ECH   // is it target?
    SZA       // quit if target
    BUN FST   // next char
END HLT       // quit
ECH HEX 2E // end character "."
PTR HEX 50 // store chars here
    END