The Registers Section of SimHYMN


SimHYMN Registers SectionThe registers section represents the main registers in the Central Processing Unit for the SimHYMN simulator as well as the two flags used in some jump instructions.

The PC is the Program Counter and contains 5 bits as well as a display of the value of those bits. The 5 bits are shown here as 5 zeros in blue with yellow background to the right of PC. As with all registers (or memory words) you can change the PC by either clicking on bits (which will change them to the opposite value) or by entering a value in the text box to the right of the bits. In the case of the PC, the values you enter in the text box right of the bits must be 1 or 2 digit hexadecimal numbers. (At the moment, 00 indicates the value of the PC in hex.) The PC is used by the simulated PC to hold the memory address of the next instruction to be executed.

The IR is the Instruction Register. When an instruction is fetched from memory it is placed into the IR and, then, executed. You would never wish to edit the IR value. It will always be changed as soon as the simulator starts.

The AC is the Accumulator. All of the "action" takes place there. When a data value is "loaded" from memory, it is placed into the AC. When a value is stored to memory, it is the value in the ACwhich is stored. Addition and Subtraction are done with the accumulator and a value from memory and the result is placed in the AC - replacing the old value that was there. When the AC value changes, it resets the Zero Flag and the Positive Flag to proper values. For example, if the value loaded into the AC were 00011011, a positive number, the Positive Flag would become true and the Zero Flag would become false. If the value loaded into the AC were 11101110, a negative 2's complement number, the Zero Flag and Positive Flag would both be set false. (As you can see, the Zero Flag is currently true, indicating that the AC contains 0. Similarly, the Positive Flag is currently false since 0 is not positive.)

Thus, the Zero Flag and the Positive Flag are intimately connected with the value in the AC.

Back to Top of Help