EMAC PRIMER Instruction Manual page 80

Table of Contents

Advertisement

FF0C
FF0D
FF0E
FF0F
FF10
FF11
FF12
FF13
FF14
FF15
FF16
FF17
FF18
FF19
FF1A
FF1B
FF1C
FF1D
To find the values to fill in for "Adr" in the jump instructions listed above, you must determine the values of the labels used
by the instructions. The label "start" points to the first instruction in the program at address FF01, the label "rdkey" points to
the second instruction of the program at address FF04 and the label "dsplay" points to the instruction at address FF16. Fill
in the addresses for each label and you will have the following completed listing:
ADDRESS
FF01
FF02
FF03
FF04
FF05
FF06
FF07
FF08
FF09
FF0A
FF0B
FF0C
FF0D
FF0E
FF0F
FF10
FF11
FF12
FF13
FF14
FF15
FF16
FF17
FF18
FF19
FF1A
FF1B
FF1C
FF1D
Load the program into memory and press the reset button and run it. Press one or a combination of hex keys and they will
be added together (the keys are not displayed as you type them). The current data on the display will continue to show
until you press a non-digit key and then the total will be displayed. When you first run the program "Func." will be displayed
until you press a non-digit key.
Be aware of the memory limitations when you are writing a program. If you do not have one of the PRIMER Upgrade
Options, the available memory is from FF01 to FFD3 (211 bytes). If you are using the stack in your program, remember
that 2 bytes are used with each PUSH or CALL and when an interrupt occurs. This further reduces the amount of available
memory.
After you become more skilled in writing programs you may be able to skip the pseudo-code stage, or even the assembly
language stage without making many mistakes. When you write your own program, don't be discouraged if it doesn't work,
the first version of a program rarely works. You may need to use single stepping to find out why the program isn't working
DA
JC
26
MVI
00
19
DAD
EB
XCHG
C3
JMP
0E
MVI
12
CD
CALL
00
10
C3
JMP
DATA
INSTRUCTION
11
LXI
00
00
0E
MVI
0B
CD
CALL
00
10
3E
MVI
0F
BD
CMP
DA
JC
16
FF
26
MVI
00
19
DAD
EB
XCHG
C3
JMP
04
FF
0E
MVI
12
CD
CALL
00
10
C3
JMP
01
FF
H,0
D
C,12
1000
D,0
C,0B
1000
A,0F
L
FF16
H,0
D
FF04
C,12
1000
FF01
80

Advertisement

Table of Contents
loading

Table of Contents