Results (
Thai) 2:
[Copy]Copied!
that the computer knows through the context of how the value is used. In
MARIE, we assume numeric input and output only. We also allow values to be
input as decimal and assume there is a “magic conversion” to the actual binary
values that are stored. In reality, these are issues that must be addressed if a computer
is to work properly.
The Halt command causes the current program execution to terminate. The
Skipcond instruction allows us to perform conditional branching (as is done with
“while” loops or “if” statements). When the Skipcond instruction is executed, the
value stored in the AC must be inspected. Two of the address bits (let’s assume
we always use the two address bits closest to the opcode field, bits 10 and 11)
specify the condition to be tested. If the two address bits are 00, this translates to
“skip if the AC is negative.” If the two address bits are 01 (bit eleven is 0 and bit
ten is 1), this translates to “skip if the AC is equal to 0.” Finally, if the two
address bits are 10 (or 2), this translates to “skip if the AC is greater than 0.” By
“skip” we simply mean jump over the next instruction. This is accomplished by
incrementing the PC by 1, essentially ignoring the following instruction, which is
never fetched. The Jump instruction, an unconditional branch, also affects the PC.
This instruction causes the contents of the PC to be replaced with the value of X,
which is the address of the next instruction to fetch.
We wish to keep the architecture and the instruction set as simple as possible
and yet convey the information necessary to understand how a computer works.
Therefore, we have omitted several useful instructions. However, you will see
shortly that this instruction set is still quite powerful. Once you gain familiarity
with how the machine works, we will extend the instruction set to make programming
easier.
Let’s examine the instruction format used in MARIE. Suppose we have the
following 16-bit instruction:
Being translated, please wait..
