Guest_imported
New member
- Jan 1, 1970
- 0
hello..i just finish writing a program but can't seems to be able to compile it because of some errors which i'm unable to solve..here's the scenario and my coding:
Problem statement:
Write a program to provide the given ON/OFF time to three lights(Green,Yellow, and Red) and 2 pedestrian signs(WALK and DON'T WALK) \. The signal lights and signs are turned on/off by the data bits of an output port shown:
Lights Data Bits On Time
1. Green D0 (0 is subscript) 15 secs
2. Yellow D2 (2 is subscript) 5 secs
3. Red D4 (4 is subscript) 20 secs
4. Walk D6 (6 is subscript) 15 secs
5. Don't Walk D7 (7 is subscript) 25 secs
The traffic and pedestrian slow are in the same direction;the pedestrian should cross road when the green light is on.
Coding:
LXI SP,XX99
Start: MVI A,41H
OUTPORT#
MVI B, 0Fh
CALL DELAY
MVI A,84H
OUTPORT#
MVI B,05
CALL DELAY
MVI A,90H
OUTPORT#
MVI B,14H
CALL DELAY
JMP START
DELAY: PUSH D
PUSG PSW
SECOND: LXI D,COUNT
Loop: DCX,D
MOV A,D
ORA E
JNZ LOOP
DCR B
JNZ SECOND
POP PSW
POP D
RET
ok..so what's the prob with this coding above...anyone can give some advice or help me solve it? Thanks..
Problem statement:
Write a program to provide the given ON/OFF time to three lights(Green,Yellow, and Red) and 2 pedestrian signs(WALK and DON'T WALK) \. The signal lights and signs are turned on/off by the data bits of an output port shown:
Lights Data Bits On Time
1. Green D0 (0 is subscript) 15 secs
2. Yellow D2 (2 is subscript) 5 secs
3. Red D4 (4 is subscript) 20 secs
4. Walk D6 (6 is subscript) 15 secs
5. Don't Walk D7 (7 is subscript) 25 secs
The traffic and pedestrian slow are in the same direction;the pedestrian should cross road when the green light is on.
Coding:
LXI SP,XX99
Start: MVI A,41H
OUTPORT#
MVI B, 0Fh
CALL DELAY
MVI A,84H
OUTPORT#
MVI B,05
CALL DELAY
MVI A,90H
OUTPORT#
MVI B,14H
CALL DELAY
JMP START
DELAY: PUSH D
PUSG PSW
SECOND: LXI D,COUNT
Loop: DCX,D
MOV A,D
ORA E
JNZ LOOP
DCR B
JNZ SECOND
POP PSW
POP D
RET
ok..so what's the prob with this coding above...anyone can give some advice or help me solve it? Thanks..