1 第六章作业
2 第九章作业(8255A):
作业提示在课件第29、30页,答案在“第九章作业答案.doc”中
作业9-5答案
code segment
assume cs:code
start: mov al,10000 010B ; 控制字82H
out 83h,al
again: in al,81h ;读B端口数据
and al,03h ;屏蔽高6位
cmp al,02h
jz s0 ;s0按下跳转
cmp al,01h
jz s1 ;s1按下跳转
cmp al,00h
jz exit ;s0,s1同时按下跳转
jmp again
s0: mov al,3fh
out 80h,al ;A口输出‘0’
jmp again
s1: mov al,06h
out 80h,al ;A口输出‘1’
jmp again
exit: mov ah,4ch
int 21h
code ends
end start
code segment
assume cs:code
start: mov al,10000 010B ; 控制字82H
out 83h,al
again: in al,81h ;读B端口数据
test al,03h ;al的最后两位若为00,则跳转
jz exit
te