CSE 109 Spring 2008 Specifications of the Simpletron Machine (taken from Deitel & Deitel, C++: How to program). Memory: 1000 locations, each containing a word consisting of a signed five digit integer A single Accumulator When a word is interpreted as an instruction, it must be positive, the first two digits must be one of the operations below, and the third, fourth, and fifth digits give the memory location to which the operation refers. Operations: 10 Read from "input" to given memory location 11 Write to "output" from given memory location 20 Load data from given memory location into accumulator 21 Store contents of accumulator into given memory location 30 Add contents of given memory location to accumulator 31 Subtract contents of given memory location from accumulator 32 Divide accumulator by contents of given memory location 33 Multiply accumulator by contents of given memory location 40 Branch to given memory location 41 Branch to given memory location if accumulator is negative 42 Branch to given memory location if accumulator is zero 43 Halt execution USING MY EMULATOR OF THE SIMPLETRON The emulator is located in the file: /proj/csc109/bin/sml The call to the file takes the form sml [-v] where is the input file, is the output file containing the results of running sml, and -v is an optional command that leads to more verbose output, both to the screen and to the output file. The input file for sml should consist of lines of code, followed by END, followed, possibly, by lines of input data. Each line of code or data should contain an integer of up to 5 digits. Anything on a line after the integer is ignored. Here is a very simple program (it reads and displays 6). 10005 11005 43000 END 6