EMAC PRIMER Instruction Manual page 44

Table of Contents

Advertisement

leds
equ
dips
equ
org
loop:
in
ani
ori
xri
out
jmp
end
ADDRESS
FF01
FF02
FF03
FF04
FF05
FF06
FF07
FF08
FF09
FF0A
FF0B
FF0C
FF0D
Load the above program into memory then press reset and run it. You will see that the LEDs will light up according to the
following rules:
LED NUMBER STATUS
7
6
5
4
3
2
1
0
NOTE: If you are facing the PRIMER, the DIP switches are numbered 7-0 from left to right. Also, a DIP switch in the on
position will produce a logic 0 input and in the off position will produce a logic 1 input.
11h
12h
0ff01h
dips
; get the input port DIP switch values
00111111b
; make bits 6 and 7, zero
00110000b
; make bits 5 and 4, one
00000110b
; toggle bits 2 and 1
leds
; display A on discrete LEDs
loop
; jump to loop
DATA
INSTRUCTION
DB
IN
12
E6
ANI
3F
F6
ORI
30
EE
XRI
06
D3
OUT
11
C3
JMP
01
FF
on
on
off
off
off if DIP switch #3 is off or on if the switch is on
on if DIP switch #2 is off or off if the switch is on
on if DIP switch #1 is off or off if the switch is on
off if DIP switch #0 is off or on if the switch is on
12
3F
30
06
11
FF01
44

Advertisement

Table of Contents
loading

Table of Contents