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