资源描述:
《单片机设计有急救车通过的交通灯》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、CSEGAT0000HLJMPSTARTCSEGAT0003HLJMPCHECSEGAT000BHLJMPDET0CSEGAT001BHLJMPDET1CSEGAT4100HSTART:MOVSP,#60HSETBIT0SETBPX0SETBEASETBEX0SETBET0SETBET1MOVDPTR,#0CFA3HMOVA,#80HMOVX@DPTR,AMOVTMOD,#52HMOVTH0,#06HMOVTL0,#06HMOVTH1,#0FFHMOVTL1,#0FFHMOVR2,#06HMOVDPTR,#0CFA0HMOVA,#03HMOVX@DPTR,AMOVR7,A
2、SETBTR0SETBTR1HERE:AJMPHERECHE:PUSHPSWPUSHACCPUSHDPHPUSHDPLPUSH07HPUSHTH0PUSHTL0PUSHTH1PUSHTL1CLRTR0CLRTR1MOVA,#03HMOVDPTR,#0CFA0HMOVX@DPTR,ALCALLDELAY10SPOPTL1POPTH1POPTL0POPTH0POP07HMOVA,R7MOVX@DPTR,APOPDPLPOPDPHPOPACCSETBTR0SETBTR1POPPSWRETIDET0:PUSHPSWPUSHACCPUSH02HCPLP1.1POP02HPOPACC
3、POPPSWRETIDET1:PUSHPSWPUSHACCPUSHDPHPUSHDPLMOVA,R2RLAMOVDPTR,#ZHUANJMP@A+DPTRZHUAN:AJMPS1AJMPS2AJMPS3AJMPS4AJMPS5AJMPS6AJMPS7S1:INCR2MOVDPTR,#0CFA0HMOVA,#12HMOVX@DPTR,AMOVR7,AMOVTL1,#0C0HMOVTH1,#63HLJMPOUTS2:INCR2MOVR6,#05HSHAN0:MOVA,#06HMOVDPTR,#0CFA0HMOVX@DPTR,AMOVR7,ALCALLDELAY1SMOVA,#
4、02HMOVX@DPTR,AMOVR7,ALCALLDELAY1SDJNZR6,SHAN0MOVTH1,#0FFHMOVTL1,#0FFHLJMPOUTS3:INCR2MOVA,#03HMOVDPTR,#0CFA0HMOVX@DPTR,AMOVR7,ALCALLDELAY1SMOVTH1,#0FFHMOVTL1,#0FFHLJMPO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