学历改变命运
24小时客服:4008135555/010-82335555
当前位置:首页> 历年试题 > 北大“接口技术”上机类型题目及答案(3)

北大“接口技术”上机类型题目及答案(3)

2007年01月24日    来源:   字体:   打印
成绩查询

  10. 8253通道0方式0,计数值为0Fh,手动逐个输入脉冲,从计算机显示器上显示对应的数。

  code segment

  assume cs:code

  start: mov dx,283h

  mov al,10h

  out dx,al

  mov dx,280h

  mov al,0fh

  out dx,al

  l1: mov dx,280h

  in al,dx

  call disp

  mov ah,1

  int 16h

  jz l1

  mov ah,4ch

  int 21h

  disp proc near

  push dx

  and al,0fh

  mov dl,al

  cmp dl,9

  jbe num

  add dl,7

  num: add dl,30h

  mov ah,02h

  int 21h

  mov dl,0dh

  int 21h

  mov dl,0ah

  int 21h

  pop dx

  ret

  disp endp

  code ends

  end start

  11. 8253通道0方式0,从8255C口读入计数值,手动逐个输入脉冲,从A口输出在数码管显示其值。

  code segment

  assume cs:code

  start: mov dx,28bh

  mov al,88h

  out dx,al

  mov dx,28ah

  in al,dx

  mov cl,4

  shr al,cl

  and al,0fh

  mov bl,al

  mov dx,283h

  mov al,10h

  out dx,al

  mov al,bl

  mov dx,280h

  out dx,al

  l1: mov dx,280h

  in al,dx

  mov dx,288h

  out dx,al

  mov ah,1

  int 16h

  jz l1

  mov ah,4ch

  int 21h

  code ends

  end start

  12. 8253通道1方式1(硬件可重触发),计数值0Fh,用8255A口输出在数码管显示值,有键按下返回DOS,无键按下继续执行。

  data segment

  led db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,39h,5eh,79h,71h

  data ends

  code segment

  assume cs:code,ds:data

  start: mov ax,data

  mov ds,ax

  lea bx,led

  mov dx,28bh

  mov al,80h

  out dx,al

  mov dx,283h

  mov al,52h

  out dx,al

  mov al,0fh

  mov dx,281h

  out dx,al

  l1: mov dx,281h

  in al,dx

  xlat

  mov dx,288h

  out dx,al

  push dx

  mov ah,06h

  mov dl,0ffh

  int 21h

  pop dx

  jz l1

  mov ah,4ch

  int 21h

  code ends

  end start

  13. 8253通道1方式0,计数值为0Fh,手动逐个输入脉冲,用8255C口输出在数码管显示其值,并在计算机显示器显示,但计算机上显示顺序为0~F递增。

  data segment

  led db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,39h,5eh,79h,71h

  data ends

  code segment

  assume cs:code,ds:data

  start: mov ax,data

  mov ds,ax

  lea bx,led

  mov dx,28bh

  mov al,80h

  out dx,al

  mov dx,283h

  mov al,50h

  out dx,al

  mov al,0fh

  mov dx,281h

  out dx,al

  l2: mov dx,281h

  in al,dx

  call disp

  xlat

  mov dx,28ah

  out dx,al

  mov ah,1

  int 16h

  jz l2

  mov ah,4ch

  int 21h

  disp proc near

  push dx

  push ax

  mov cl,0fh

  sub cl,al

  mov al,cl

  cmp al,0ah

  jb d1

  add al,07h

  d1: add al,30h

  mov dl,al

  mov ah,02h

  int 21h

  mov dl,0dh

  int 21h

  mov dl,0ah

  int 21h

  pop ax

  pop dx

  ret

  disp endp

  code ends

  end start

关注添加

扫码添加学习顾问

了解考试计划,进行学习规划
备战考试,获取试题及资料

扫码下载APP

海量历年试题、备考资料
免费下载领取

扫码进入微信小程序

每日练题巩固、考前模拟实战
免费体验自考365海量试题

免费题库

新人有礼
关闭