中南民族大学 微机原理实验答案 下载本文

内容发布更新时间 : 2024/11/14 13:14:26星期一 下面是文章的全部内容请认真阅读。

第三题 code segment assume cs:code con8255 equ 0ff2bh pb8255 equ 0ff29h pa8255 equ 0ff28h

org 4100h start:

mov dx,con8255 mov al,80h out dx,al mov dx,pa8255 L0: mov al,0h out dx,al call delay mov al,0ffh out dx,al call delay jmp L0 hlt

delay: push cx mov cx,005h L3: mov bx,8000h L2: dec bx jnz L2 loop L3 pop cx ret code ends end start 第四题 code segment assume cs:code con8255 equ 0ff2bh pb8255 equ 0ff29h pa8255 equ 0ff28h

org 4200h start:

mov al,80h mov dx,con8255 out dx,al mov dx,pb8255 L0: mov al,0ffh mov cx,08h L1: clc rcl al,1 out dx,al call delay loop L1 mov cx,08h L2: stc rcr al,1 out dx,al call delay loop L2 jmp L0

delay: push cx mov cx,005h L3: mov bx,8000h

L4: dec bx jnz L4 loop L3 pop cx ret

code ends end start 实验四 3

code segment assume cs:code con8255 equ 0ff2bh pb8255 equ 0ff29h pa8255 equ 0ff28h p8259com0 equ 0ff80h p8259com1 equ 0ff81h intq3 equ interrupt3

org 4400h

start:mov al,80h

mov dx,con8255 out dx,al

mov ax,offset interrupt mov ds:[002ch],ax mov ax,0000h mov ds:[002eh],ax

mov al,13h mov dx,p8259com0 out dx,al

mov al,08h mov dx,p8259com1 out dx,al

mov al,09h out dx,al

mov al,11110111B out dx,al