4. PROBLEM 1)
1. Assume I/O addresses of PA, PB, PC & CWR are 80H-83H
respectively. Write an ALP to configure port A and port CL as
output ports and port B and port CU as input ports in mode 0.
2. Read switch positions connected to port A and turn on the
respective LEDs of port B.
5. Statement:
1. Assume I/O addresses of PA, PB, PC & CWR are 80H-83H
respectively. Write an ALP to configure port A as Input port and
port B as Output port in mode 0. Read 8-bit Port A status and
send on to Port B continuously.
6. Flow Chart
Start
Get CWR I/O Mode format into Acc
Read Port A status
Send on to Port B
Send to CWR
7. Address Label Instruction Opcode
6700, 1 MVI A, 90H 3E, 90
2, 3 OUT CWR D3, 83
4, 5 IN PA DB, 80
6, 7 OUT PB D3, 81
8, 9, A JMP UP C3, 04, 67
B RST1 CF
UP:
8.
9. Statement:
1. Assume I/O addresses of PA, PB, PC & CWR are 80H-83H
respectively. Write an ALP to SET PC2 & PC5 bit of Port C.
10. Flow Chart Start
Get I/O Mode format to make all ports as
output into Acc.
Get BSR Mode format to SET PC2 into Acc.
Send to CWR
Send to CWR
Get BSR Mode format to SET PC5 into Acc.
Send to CWR
Stop
11. Address Label Instruction Opcode
6700, 1 MVI A, 80H 3E, 80
2, 3 OUT CWR D3, 83
4, 5 MVI A, 05H 3E, 05
6, 7 OUT PB D3, 83
8, 9 MVI A, 0BH 3E, 0B
A, B OUT PB D3, 83
C RST1 CF