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

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

2007年03月06日    来源:   字体:   打印
成绩查询

  3.8255方式0,C口低4位输入数据取反,在8255的C口高4位输出,有键按下返回DOS,无键按下继续执行。

  code segment

  assume cs:code

  start: mov dx,28bh

  mov al,81h

  out dx,al

  l1: mov dx,28ah

  in al,dx

  mov cl,4

  shl al,cl

  xor al,0f0h

  mov dx,28ah

  out dx,al

  mov ah,1

  int 16h

  jz l1

  mov ah,4ch

  int 21h

  code ends

  4. 8255方式0,A口输入,C口输出。如果A口输入的数大于等于128,从C口输出80H;否则将输入的数高4位不变低4位取反从C口输出,有键按下返回DOS,无键按下继续执行。

  code segment

  assume cs:code

  start: mov dx,28bh

  mov al,90h

  out dx,al

  l3: mov dx,288h

  in al,dx

  cmp al,80h

  jae l1

  xor al,0fh

  mov dx,28ah

  out dx,al

  l2: mov ah,1

  int 16h

  jz l3

  mov ah,4ch

  int 21h

  l1: mov al,80h

  mov dx,28ah

  out dx,al

  jmp l2

  code ends

  end start

  5.8255方式0,A口输入C口输出,如果A口的PA7输入为0,则L5、L2灯亮,PA7 为1,则L7、L0灯亮,有键按下返回DOS,无键按下继续执行。

  code segment

  assume cs:code

  start: mov dx,28bh

  mov al,90h

  out dx,al

  l3: mov dx,288h

  in al,dx

  test al,80h

  jz l1

  mov al,81h

  mov dx,28ah

  out dx,al

  l2: mov ah,1

  int 16h

  jz l3

  mov ah,4ch

  int 21h

  l1: mov dx,28ah

  mov al,24h

  out dx,al

  jmp l2

  code ends

  end start

关注添加

扫码添加学习顾问

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

扫码下载APP

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

扫码进入微信小程序

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

免费题库

新人有礼
关闭