March 2018
Beginner
744 pages
26h 5m
English
We now present a simple program written for MARIE. In Section 4.12, we present several additional examples to illustrate the power of this minimal architecture. It can even be used to run programs with procedures, various looping constructs, and different selection options.
Our first program adds two numbers together (both of which are found in main memory), storing the sum in memory. (We forgo I/O for now.)
Table 4.3 lists an assembly language program to do this, along with its corresponding machine language program. The list of instructions under the Instruction column constitutes the actual assembly language program. We know that the fetch–decode–execute cycle starts by fetching the first instruction of the program, ...