急求,大家帮忙
,实现8255三个口编程从一个口输出数据再从另一个口输入数据,判断输入的数据和输出的数据是否吻合,若吻合,再反过来,从原来的输入口输出数据再从原来的输出口输入数据,若吻合,则证明这两个口是好的,否则就是有问题。
我编的程序如下:
code segment
assume cs:code
start:
mov dx,203h
mov al,90h
out dx,al
mov dx,200h
mov al,0ffh
out dx,al
mov dx,201h
in al,dx
cmp al,0ffh
jnz a;此处无论怎样都会跳转到a,是怎么回事?
mov dx,203h
mov al,82h
out dx,al
mov dx,201h
mov al,0ffh
out dx,al
mov dx,200h
in al,dx
cmp al,0ffh
jnz a
;c口第四位输入,高四位输出
mov dx,203h
mov al,81h
out dx,al
mov dx,202h
mov al,0ffh
;out dx,al
and al,0fh ;屏蔽c口高4位
mov cl,4 ;左移4位到高位
shl al,cl
out dx,al ;输出高4位
mov dx,202h
in al,dx
and al,0fh ;屏蔽c口高4位
mov cl,4 ;左移4位到高位
shl al,cl
cmp al,0f0h
jnz a
;C口高四位输入,地四位输出
mov dx,203h
mov al,88h
out dx,al
mov dx,202h
mov al,0ffh
and al,0fh ;屏蔽c口高4位
out dx,al ;输出高4位
mov dx,202h
in al,dx
and al,0f0h ;屏蔽c口低4位
mov cl,4 ;右移4位到高位
shr al,cl
cmp al,0fh
jnz a
a:mov dx,210h
mov al,0fh
out dx,al
call delay
delay proc near
push cx
mov cx,0ffh
loop $
pop cx
ret
delay endp
code ends
end start
mov ah,4ch
int 21h
我编的程序如下:
code segment
assume cs:code
start:
mov dx,203h
mov al,90h
out dx,al
mov dx,200h
mov al,0ffh
out dx,al
mov dx,201h
in al,dx
cmp al,0ffh
jnz a;此处无论怎样都会跳转到a,是怎么回事?
mov dx,203h
mov al,82h
out dx,al
mov dx,201h
mov al,0ffh
out dx,al
mov dx,200h
in al,dx
cmp al,0ffh
jnz a
;c口第四位输入,高四位输出
mov dx,203h
mov al,81h
out dx,al
mov dx,202h
mov al,0ffh
;out dx,al
and al,0fh ;屏蔽c口高4位
mov cl,4 ;左移4位到高位
shl al,cl
out dx,al ;输出高4位
mov dx,202h
in al,dx
and al,0fh ;屏蔽c口高4位
mov cl,4 ;左移4位到高位
shl al,cl
cmp al,0f0h
jnz a
;C口高四位输入,地四位输出
mov dx,203h
mov al,88h
out dx,al
mov dx,202h
mov al,0ffh
and al,0fh ;屏蔽c口高4位
out dx,al ;输出高4位
mov dx,202h
in al,dx
and al,0f0h ;屏蔽c口低4位
mov cl,4 ;右移4位到高位
shr al,cl
cmp al,0fh
jnz a
a:mov dx,210h
mov al,0fh
out dx,al
call delay
delay proc near
push cx
mov cx,0ffh
loop $
pop cx
ret
delay endp
code ends
end start
mov ah,4ch
int 21h
...全文
相关推荐
急求医疗废物管理整改报告.doc
急求医疗废物管理整改报告.doc
急求IBATIS是什么,它的核心,优点,缺点和用时要注意什么_百度知道.mht
急求IBATIS是什么,它的核心,优点,缺点和用时要注意什么_百度知道,急求IBATIS是什么,它的核心,优点,缺点和用时要注意什么_百度知道急求IBATIS是什么,它的核心,优点,缺点和用时要注意什
急求学生会监察部工作计划!.doc
急求学生会监察部工作计划!.doc
求学生会秘书处的工作计划一份急.doc
求学生会秘书处的工作计划一份急.doc
全国自考《急求护理学》试题及答案.docx
全国自学考试中的《急求护理学》试题及答案主要涵盖了急救医疗服务体系的相关知识,这是护理学中的重要领域,旨在培养护士在紧急情况下提供有效、及时的护理能力。以下是相关知识点的详细说明:1.


硬件设计
