预览加载中,请您耐心等待几秒...
1/2
2/2

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

8255并行接口与交通灯设计 状态1:东西路口绿灯亮10s,南北路口红灯亮10s 状态2:东西路口绿灯灭,黄灯闪烁5次,期间南北路口红灯保持亮 状态3:东西路口黄灯灭,红灯亮10s,南北路口绿灯亮10s 状态4:东西路口红灯保持亮,南北路口绿灯灭,黄灯闪烁5次 CODE SEGMENT ASSUME CS:CODE START:MOV AL,10000000B MOV DX,28BH OUT DX,AL D1: MOV AL,00100100B MOV DX,288H OUT DX,AL CALL DELAY1 MOV CX,5 D2: MOV AL,00000100B MOV DX,288H OUT DX,AL CALL DELAY2 MOV AL,01000100B MOV DX,288H OUT DX,AL CALL DELAY2 LOOP D2 D3: MOV AL,10000001B MOV DX,288H OUT DX,AL CALL DELAY1 MOV CX,5 D4: MOV AL,10000000B MOV DX,288H OUT DX,AL CALL DELAY2 MOV AL,10000010B MOV DX,288H OUT DX,AL CALL DELAY2 LOOP D4 JMP D1 DELAY1 PROC NEAR PUSH CX PUSH DI MOV CX,2000 Y1: MOV DI,9000 X1: DEC DI JNZ X1 LOOP Y1 POP DI POP CX RET DELAY1ENDP DELAY2 PROC NEAR PUSH CX PUSH DI MOV CX,200 Y2: MOV DI,9000 X2: DEC DI JNZ X1 LOOP Y1 POP DI POP CX RET DELAY2ENDP CODE ENDS END START