[완료] 어디서 시작해야 될찌 모르겟네요.
Computer Systems
School of Electrical Engineering and Computer Science
Assignment #4
Due Date: Nov 1, 07
Purpose: To understand Interrupt concept for IBM PC
References: Intel 80x86 Reference Manual or Textbook
Modify your program of assignment #3 and program to display your name randomly on the monitor. The cahracter might be displayed bold, highlighted, or normal.
When you input a character from the keyboard, stop displaying your name and display the red blinking character for 5 seconds. And then return to normal counting routine.
But you type in Character "X", your have to finish your program and back to the DOS.
You have to modify the vector address of interrupt service routine. Refer to the class web site for detail information.
Submission:
1. This assignment paper
2. Algorithm and or flowchart
2. Compiled program list
3. TA Signature of the program
Grade:
Assembly program operation ............... = 20
Program operation and TA signature....... 5
Documentation .................................................. 5
------
30
1. Insert following routines in your program
1) Save the address of Interrupt Vector 9 to use to exit the program.
The present Interrupt address is for the Windows system.
mov ax, 0
mov ds, ax
mov bx, 09h * 04h; find the Int 9
mov dx, word ptr [bx]; Save it on the stack
push dx
mov dx, word ptr [bx]+2
push dx
2) Change the new address for Interrupt Vector 9 to use your program.
mov ax, 0
mov ds, ax
mov bx, 09h * 04h
cli; disable an interrupt
mov word ptr [bx], offset kbd_handler ; Load your keyboard ISR
mov word ptr [bx]+2, seg kbd_handler
sti; enable interrupts
3) Write your program to perform normal procedure.
For this lab, write code to display characters on the screen.
4) Pop the content of the stack before your program exits. If not, your keyboard is not working after it exits.
mov ax, 0
mov ds, ax
mov bx, 09h * 04h ; find Int 9 address again
cli; disable interrupt
pop dx
mov word ptr [bx], dx; back to normal address
pop dx
mov word ptr [bx]+2, dx
sti; enable interrupts
2. Define ISR routine and program as follows.
The ISR address is the sane as the step #2.
1) Save present general purpuse registers and flags such as.
push ax
push bx
................
2) Check the data ready for the keyboard status address: Port 64h.
in al, 64h
test al, 01h ; set 1 means ready for data
3) Read data from the keyboard data address : Port 60h
in al, 60h
4) Before exit, send the exit signal to Programmable Interrupt Control.
mov al, 20h
out 20h, al
5) Before exit, store back all registers you saved for interrupt.
pop bx
pop ax
................
=====================================
이런글 올리기 죄송하지만
레포트인데 해달라는건 아니고
대락적으로 멀하라는건지
설명만 좀 해주시면 안될까 해서 부탁드리는검니다.
문제에 필요한 내용은 다 나와 있는데요?
IBM PC의 Keyboard Hardware Interrupt Vector인 INT 9 Vector를 재 정의하여
Keyboard 입력을 받고 (port 64h와 port 60h를 읽어서 키 값을 읽고 port 20h
를 조작하여 PIC에 Interrupt 종료를 알려주는 방법까지 문제에 나와 있습니다)
X 키를 제외한 키 입력에 대해서는 입력한 문자를 붉은색 반짝이 속성으로 5초간
출력하고 X키를 입력하면 종료하라고 적혀 있군요. Interrupt Vector 재정의와
복원 방법 역시 문제에 나와 있습니다. (종료 전에 Interrupt Vector를 복원하지
않으면 키보드를 입력했을 때 DOS가 폭주할 수 있습니다)
문자 출력은 INT 10h를 사용하거나 VGA의 Video RAM Mapping 영역에 직접 데이터
를 입력하면 될 듯하고 DOS로 종료하는 것은 INT 21h로 해결할 수 있겠죠.
감사합니다^^
좋은 주말 보내시기 바람니다
댓글 달기