proteus仿真,用8个开关控制数码管显示1到8的数字,仿真电路图如图示(运行状态),代码如下,请问是出了什么问题,代码这么写有问题吗?
谢谢
- code segment
- assume cs:code
- start: mov dx,200h
- in al,dx
- mov bl,al
- cmp bl,7Fh;与对应的状态比较
- jz s1
- cmp bl,0BFh
- jz s2
- cmp bl,0DFh
- jz s3
- cmp bl,0EFh
- jz s4
- cmp bl,0F7h
- jz s5
- cmp bl,0FBh
- jz s6
- cmp bl,0FDh
- jz s7
- cmp bl,0FEh
- jz s8
- ;显示数字
- s1: mov al,06h
- out dx,al
- jmp to
- s2: mov al,5bh
- out dx,al
- jmp to
- s3: mov al,4fh
- out dx,al
- jmp to
- s4: mov al,66h
- out dx,al
- jmp to
- s5: mov al,6dh
- out dx,al
- jmp to
- s6: mov al,7dh
- out dx,al
- jmp to
- s7: mov al,07h
- out dx,al
- jmp to
- s8: mov al,7fh
- out dx,al
- jmp to
- to:jmp start
- code ends
- end start
复制代码
|