Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Got Problem with coding for assembly lang. (TASM)

Status
Not open for further replies.

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..
 
hi,
this is more a PC orientated forum but heres my 10p worth :)

you need a technical manual for the microcontroller that you are using.

you need a manual for the assembler that you are using to program the microcontroller.

try searching using keywords like the microcontroller serial number ie 80x86 or manufacturer name ie mitsubishi etc

find out a traffic lights contractor via your local council contact the contractor and explain you are doing a college project on traffic lights and they may give you the info you require.
"People who have nothing to say, say it too loud and have little knowledge. It's the quiet ones you need to worry about!"
 
Some uC's cannot call code that have higher adress. You maybe must move the sub routine to top?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top