CPE108L E01 Experiment2
CPE108L E01 Experiment2
CPE108L E01 Experiment2
EXPERIMENT NO. 2
Leader:
Member/s:
Course/Section: CPE108L/E01
Group No.: 3
ORG 0000H
MAIN:
CLR A
MOV A, #34H
MOV B, #36H
AGAIN: DEC A
DJNZ B, AGAIN
ADD A, B
ADD A, B
MOV P1, A
END
Q3. Illustrate the final output in LEDs.
Q4. To make the output faster, what line of the new program
should be changed?
change to a 1.
PART TWO: I/O PORT INTERFACE WITH TIME DELAY
Without RET
Q5. What is the correct flowchart of the program encoded in
part II, #2? Use the space provided below.
START
INITIALIZING ADDRESS
ORG 0000H
CLEAR ACCUMULATOR
A
CALL DELAY
NO
IS
REGISTER 0
EQUAL TO
0
YES
STORE SWITCH
INPUT TO
ACCUMULATOR
COMPLEMENT THE
CONTENT REGISTER
DISPLAY ACCUMULATOR
REGISTER’S CONTENT TO
PORT 1
ROTATE
REGISTER
ACCUMULATOR
STOP