EMAC PRIMER Instruction Manual page 68

Table of Contents

Advertisement

OP CODE
IN
12h
RRC
RRC
MOV
E,A
ANI
00111111b
MOV
D,A
MOV
A,E
ANI
11000000b
MOV
E,A
:
:
:
Single step to address FF0D and you will see that the 8 bit value of the DIP switch is now the upper 8 bits of the 14 bit
number in DE. Note that the DE register pair is always 16 bits, but we refer to the number in it as a 14 bit number since
MOS service 10 ignores the upper two bits of the DE register.
DIP switches
DE register
After DE is loaded with the value of the DIP switches, the C register is loaded with 10h which is the service number and
then a CALL 1000h is made which produces the speaker frequency. After the CALL there is a JMP to the start of the
program again and it will continue to repeat indefinitely.
Press the reset button and run the program. Move the DIP switches and you will hear the speaker frequency change.
VALUES OF REGISTERS AFTER EXECUTION OF OP CODE
A
00001111b
10000111b
11000011b
11000011b
00000011b
00000011b
11000011b
11000000b
11000000b
VALUE
00001111
0000001111000000
D
E
XXXXXXXXb
XXXXXXXXb
XXXXXXXXb
XXXXXXXXb
XXXXXXXXb
XXXXXXXXb
XXXXXXXXb
11000011b
XXXXXXXXb
11000011b
00000011b
11000011b
00000011b
11000011b
00000011b
11000011b
00000011b
11000000b
68

Advertisement

Table of Contents
loading

Table of Contents