Results (
Thai) 2:
[Copy]Copied!
Most ISAs consist of instructions for processing data, moving data, and controlling
the execution sequence of the program. MARIE’s instruction set consists
of the instructions shown in Table 4.2.
The Load instruction allows us to move data from memory into the CPU (via
the MBR and the AC). All data (which includes anything that is not an instruction)
from memory must move first into the MBR and then into either the AC or the
ALU; there are no other options in this architecture. Notice that the Load instruction
does not have to name the AC as the final destination; this register is implicit
in the instruction. Other instructions reference the AC register in a similar fashion.
The Store instruction allows us to move data from the CPU back to memory. The
Add and Subt instructions add and subtract, respectively, the data value found at
address X to or from the value in the AC. The data located at address X is copied
into the MBR where it is held until the arithmetic operation is executed. Input and
Output allow MARIE to communicate with the outside world.
Input and output are complicated operations. In modern computers, input and
output are done using ASCII bytes. This means that if you type in the number 32
on the keyboard as input, it is actually read in as the ASCII character “3” followed
by “2.” These two characters must be converted to the numeric value 32
before they are stored in the AC. Because we are focusing on how a computer
works, we are going to assume that a value input from the keyboard is “automatically”
converted correctly. We are glossing over a very important concept: How
does the computer know whether an input/output value is to be treated as numeric
or ASCII, if everything that is input or output is actually ASCII? The answer is
Being translated, please wait..
