EMAC PRIMER Instruction Manual page 29

Table of Contents

Advertisement

LESSON 3: Loading Registers and Transferring Data Between Registers
NEW INSTRUCTIONS
MVI
A,<byte> op code = 3E
MVI
B,<byte> op code = 06
MVI
C,<byte> op code = 0E
MVI
D,<byte> op code = 16
MVI
E,<byte> op code = 1E
MVI
H,<byte> op code = 26
MVI
L,<byte> op code = 2E
Load the register that follows the MVI mnemonic with the byte value following the op code. No flags are
affected.
XCHG
Exchange the value in register D with H and the value in register E with L. No flags are affected.
MOV
A,B
Copy the B register to the A register. No flags are affected.
MOV
B,C
Copy the C register to the B register. No flags are affected.
RST
7
The address following the RST 7 instruction is pushed on the stack and then the instructions starting at
address 0038 are executed. No flags are affected.
The program below demonstrates the instructions used to load registers and the instructions used to move values between
registers.
ASSEMBLER PROGRAM
org
mvi
mvi
mvi
mvi
mvi
mvi
mvi
xchg
xchg
mov
mov
rst
end
MACHINE LANGUAGE PROGRAM
ADDRESS
FF01
FF02
FF03
FF04
FF05
FF06
FF07
FF08
FF09
FF0A
FF0B
FF0C
FF0D
FF0E
FF0F
FF10
FF11
FF12
FF13
Enter the program into memory and then press the reset button which will change the program counter to FF01. If you
op code = EB
op code = 78
op code = 41
op code = FF
0ff01h
a,1
; load A with 1
b,2
; load B with 2
c,3
; load C with 3
d,4
; load D with 4
e,5
; load E with 5
h,6
; load H with 6
l,7
; load L with 7
; exchange the value of DE with HL
; do it again
a,b
; copy B to A
b,c
; copy C to B
7
; return to MOS
DATA
INSTRUCTION
3E
MVI
01
06
MVI
02
0E
MVI
03
16
MVI
04
1E
MVI
05
26
MVI
06
2E
MVI
07
EB
XCHG
EB
XCHG
78
MOV
41
MOV
FF
RST
A,1
B,2
C,3
D,4
E,5
H,6
L,7
A,B
B,C
7
29

Advertisement

Table of Contents
loading

Table of Contents