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

北大接口所有上机类型题目和答案(3)

2007年03月06日    来源:   字体:   打印
查分预约

  6. 8255方式0,A口输出C口输入,C口输入高2为位取反低6位不变,用键盘控制程序,有键按下返回DOS,无键按下程序继续执行

  code segment

  assume cs:code

  start: mov dx,28bh

  mov al,89h

  out dx,al

  l1: mov dx,28ah

  in al,dx

  xor al,0c0h

  mov dx,288h

  out dx,al

  mov ah,1

  int 16h

  jz l1

  mov ah,4ch

  int 21h

  code ends

  end start

  7. 8255方式0,A口输出到LED灯上,让灯按顺序从左到右移动显示,每显示一个灯延时一秒在显示下一个灯,有键按下返回DOS,无键按下继续执行。

  code segment

  assume cs:code

  start: mov dx,28bh

  mov al,80h

  out dx,al

  mov dx,288h

  mov al,01h

  l1: out dx,al

  call time

  rol al,1

  mov ah,1

  int 16h

  jz l1

  mov ah,4ch

  int 21h

  time proc near

  push cx

  mov si,0200h

  t2: mov cx,0

  t1: loop t1

  dec si

  jnz t2

  pop cx

  ret

  time endp

  code ends

  end start

  8. 8255方式0,C口输入0~Fh,A口输出在数码管上显示和计算机显示器显示相应数, 有键按下返回DOS,无键按下继续执行。

  data segment

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

  data ends

  code segment

  assume cs:code,ds:data

  start: mov dx.,28bh

  mov al,89h

  out dx,al

  lea bx,led

  l1: mov dx,28ah

  in al,dx

  and al,0fh

  call disp

  xlat

  mov dx,288h

  out dx,al

  mov ah,1

  int 16h

  jz l1

  mov ah,4ch

  int 21h

  disp proc near

  push dx

  push ax

  mov dl,al

  cmp dl,0ah

  jb d1

  add dl,7

  d1: add dl,30h

  mov ah,02

  int 21h

  mov dl,0dh

  int 21h

  mov dl,0ah

  int 21h

  pop ax

  pop dx

  disp endp

  code ends

  end start

关注添加

扫码添加学习顾问

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

扫码下载APP

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

扫码进入微信小程序

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

免费题库

新人有礼
关闭