没学汇编,选了课,帮忙编两个简单的菜鸟问题,不胜感激!!!
1.利用8250自测试系统功能,实现键盘每输入一个字符,显示器显示该字符.2.利用8259自测试IRQ1,实现键盘每输入一个字符,显示器显示该字符.
中断自程序的编写.转载.
不是单片机阿
老师给了我们第一个程序:
stack segment para stack 'stack'
db 256 dup(0)
stack ends
code segment para public 'code'
start proc far
assume cs:code
push ds
mov ax,0
push ax
mov dx,3fbh
mov al,80h
out dx,al
mov dx,3f8h
mov al,60h
out dx,al
mov dx,3f9h
mov al,0
out dx,al
mov dx,3fbh
mov al,0ah
out dx,al
mov dx,3fch
mov al,13h
out dx,al
mov dx,3f9h
mov al,0
out dx,al
fore:mov dx,3fdh
in al,dx
test al,1eh
jnz error
test al,01h
jnz rece
test al,20h
jz fore
mov ah,1
int 16h
jz fore
mov ah,0
int 16h
mov dx,3f8h
out dx,al
jmp fore
rece:mov dx,3f8h
in al,dx
and al,7fh
push ax
mov bx,0
mov ah,14
int 10h
pop ax
cmp al,0dh
jnz fore
mov al,0ah
mov bx,0
mov ah,14
int 10h
jmp fore
error:mov dx,3f8h
in al,dx
mov al,'?'
mov bx,0
mov ah,14
int 10h
jmp fore
start endp
code ends
end start