2012年自考微型计算机及接口技术题九_第2页
来源:
考试网 [ 2012年2月29日 ] 【大 中 小】
in al,dx ;读入A口状态
cmp al,81h
jz input ;如果A7是0就跳转接着读入
mov al,81h
mov dx,28ah ;如果A7是1就向C口输出指示灯L7,L0亮的数据
out dx,al
mov ah,4ch
int 21h
code ends
end start
w_4题目:把一个1mhz的脉冲通过两次分频转换成1hz的方波。(通道0、通道1、通道2、控制字地址分别为280h,281h,282h,283h)
参考答案:
code segment
assume cs:code
start:mov dx,283h
out dx,00110111b ;选中通道0,工作在3方式下,对bcd码自减
mov dx,280h
mov al,0h
out dx,al
mov al,10h
out dx,al
mov dx,283h
out dx,01110111b ;选中通道1,工作在3方式下,对bcd码自减
mov dx,281h
mov al,0h
out dx,al
mov al,10h
out dx,al
code segment
end start
注:连线:clk0-1mhz
gate0-"1"
out0-clk1
gate1-"1"
责编:snrvge