0RG 0000H
AJMP MAIN
ORG 0003H
RL A
ACALL DELAY
RETI
MAIN:MOV A,#80H
SETB EX0
SETB EA
WAIT:JB ACC.0,JOB1
JB ACC.1,JOB2
JB ACC.2,JOB3
AJMP WAIT
JOB1: CLR P1.0 ;亮紅燈
HERE: AJMP HERE
JOB2: CPL P1.0 ;亮/滅
ACALL DELAY ;延時(shí)1秒
AJMP JOB2 ;重復(fù)
JOB3: CLR P1.1 ;亮綠燈
REDO: SETB P1.3
CHECK:JNB P1.3,CHECK
LOOP: ………… ;報(bào)警!
AJMP REDO ;再檢測
end |