接口与汇编。我有如下几个简单的程序,我想是实现如图功能,8255多分支

图片说明
以下有几个小程序

  CODE SEGMENT
ASSUME CS:CODE
START:MOV AL,89H
      MOV DX,0073H
      OUT DX,AL
S:    MOV DX,0072H
      IN AL,DX
      MOV DX,0071H
      OUT DX,AL
      JMP S
      CODE ENDS
      END START
相反
CODE SEGMENT
ASSUME CS:CODE
START:MOV AL,89H
      MOV DX,0073H
      OUT DX,AL
S:    MOV DX,0072H
      IN AL,DX
      NOT AL
      MOV DX,0071H
      OUT DX,AL
      JMP S
      CODE ENDS
      END START
左
CODE SEGMENT
ASSUME CS:CODE
START:MOV AL,89H
      MOV DX,0073H
      OUT DX,AL
      MOV AL,0FEH
S:    MOV DX,0071H
      OUT DX,AL
      ROL AL,1
      MOV CX,0FFFFH
      DELAY:LOOP DELAY
      JMP S
      CODE ENDS
      END START


右
CODE SEGMENT
ASSUME CS:CODE
START:MOV AL,89H
      MOV DX,0073H
      OUT DX,AL
      MOV AL,0FEH
S:    MOV DX,0071H
      OUT DX,AL
      ROR AL,1
      MOV CX,0FFFFH
      DELAY:LOOP DELAY
      JMP S
      CODE ENDS
      END START

+1:
CODE SEGMENT
ASSUME CS:CODE
START:MOV AL,89H
      MOV DX,0073H
      OUT DX,AL
      MOV AL,0FEH
S:    MOV DX,0071H
      OUT DX,AL
      DEC AL
      MOV CX,0FFFFH
      DELAY:LOOP DELAY
      JMP S
      CODE ENDS
      END START
-1:
CODE SEGMENT
ASSUME CS:CODE
START:MOV AL,89H
      MOV DX,0073H
      OUT DX,AL
      MOV AL,0FEH
S:    MOV DX,0071H
      OUT DX,AL
      INC AL
      MOV CX,0FFFFH
      DELAY:LOOP DELAY
      JMP S
      CODE ENDS
      END START
查看全部
hong34210
hong34210
2015/06/11 11:09
  • 8255
  • 接口
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复