Viewing And Changing Register Contents; Address/Register Pair Displays - EMAC PRIMER Instruction Manual

Table of Contents

Advertisement

ADDRESS
FF01
FF02
FF03
FF04
FF05
FF06
FF07
Before entering a program into memory, press the reset button. This resets the general purpose registers and flag register
to zero and sets the stack pointer to FFD4 and the program counter to FF01. Look at the program data table above. In
order for a machine language program to be loaded into memory properly, the addresses under the column marked
"ADDRESS" must contain the data to the right of them in the column marked "DATA" after you have completed loading the
data. The column marked "instruction" just tells what instruction the data stands for, so this can be ignored. Since the PC
value is FF01, type DB, which is the data from the table that belongs in that address, and press "enter". The PC is now
FF02 so type 12 and press enter. Continue typing the data which belongs in the current PC address and pressing enter
until all the addresses listed in the table have been loaded. Now press the "dec." key and verify that the data at the current
PC address is the same as the data in the program data table. If the data is not the same, just type the correct number and
press enter and then continue pressing the "dec." key and verifying data until the program counter is FF01 again. Once
you become comfortable with entering programs into memory you may want to skip the verification process. Don't be
alarmed if you type a program incorrectly and it doesn't work, because it is impossible for a program to damage the
PRIMER. The worst thing that can happen is that you would have to press the reset button, or if the program was
corrupted you may have to enter the program into memory again.

VIEWING AND CHANGING REGISTER CONTENTS

It is a good learning aid to be able to examine the values of the 8085's registers. To view the contents of a register you
must first press the "func." key (which will cause the display to show "Func.") and then the key corresponding to the register
you want to examine. When the "func." key is pressed, the next key pressed will invoke the alternate function of the key.
The keys that have alternate functions have the standard function followed by a slash "/" and the alternate function. For
example the "8/B.P." key's standard function is digit 8 and after the "func." key is pressed the alternate function "B.P." will
be invoked.
Each line in the table below shows the key that should be pressed after pressing the "func." key and the data that will be
shown in the "ADDRESS/REGISTER PAIR DISPLAYS" as a result.

ADDRESS/REGISTER PAIR DISPLAYS

KEY
A.F.
B.C.
D.E.
H.L.
S.P.
P.C.
Pressing one of the above keys after the "func." key is pressed will cause the value in the registers to be shown in the
displays marked "ADDRESS/REGISTER PAIR" and the register name to be shown in the display marked "DATA/OP".
After this, pressing any key other than the numeric keys (0-F) will cause the PRIMER to return to the data entry mode.
If you want to change the value of the A register, press the "func." key and then the "A.F." key and as a result the displays
show "0000 A.F.". To change the value of the A register to 1F hex without changing the flag register, press the following
keys in order: "1","F","0","0","enter". After pressing the "enter" key the display will no longer show the A register and flag
register, instead it will return to the data entry mode. View the PSW (the A register and flag register) again by typing the
"func." key, then the "A.F." key. You will see that the values that were entered before are still in the registers. Notice that
in order not to change the value of the flag register, it was necessary to enter its value again (00). If the flag register had
been 40 and you wanted to change the A register to 2B without changing the flag register you would have to press the
following keys (don't do this, this is just an example): "2", "B", "4", "0", "enter".
Now we will change the value of the flag register and we will assume that it
doesn't matter what the value of the A register is. To make the flag register
41 hex type "4", "1". Notice that after pressing these two keys, the two
zeros have been shifted to the A register display. Now press "enter", then
DATA
INSTRUCTION
DB
IN
12
12
D3
OUT
11
11
C3
JMP FF01
01
FF
DATA DISPLAYED ON
DS1 (LEFT DISPLAY)
= A register
= B register
= D register
= H register
= High order byte of SP
= High order byte of PC
DATA DISPLAYED ON
DS2 (RIGHT DISPLAY)
flag register
C register
E register
L register
Low order byte of SP
Low order byte of PC
view the A register and flag register
again and you will see the new value
(0041 hex) that was just entered.
25

Advertisement

Table of Contents
loading

Table of Contents