您的位置:自考365 > 复习指导 > 历年试题 > 北大“接口技术”上机类型题目及答案(3)

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

2007-01-24 15:58   【 】【我要纠错

  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

本文转载链接:北大“接口技术”上机类型题目及答案(3)

分享到:
  • 站内搜索
  • 课程搜索
  • 试题搜索

热门搜索:教材 报名 查分 免考 考试计划