Professional Documents
Culture Documents
m
m
INTERRUPT
u Interrupts are used for multiple purposes on the
PC system architecture.
u Interrupts force the processor to stop its normal
execution path and, temporarily execute another
path. Once the interrupt path is completed,
execution returns to the normal path that was
interrupted.
x There are three types of interrupts.
¦ !
÷ External interrupts.
3 Internal interrupts.
"# $ %
! !&
'(¦"' m !
'("' !
)'(*"' !+,
-'("' m
"¦'(""' !,
0ENERAL HARDWARE DESI0N
u The CPU and memory sections appear much the same
to software, as long as the CPU supports the program
instructions and enough memory exists the program
can be executed.
u The Input/Output section connects the computer to
the outside world and must operate with a wide
variety of computer interfacing hardware (mice, touch
pads, NIC, video, sounds, virtual reality headsets,
gloves, etc. many not conceived when the computer
rolled of the production line.
u Software must be adaptable to changes in the
hardware attached to the system. On the PC
architecture, these hardware differences are handled
primarily by the BIOS (Basic Input/Output System
abstraction.
INT 17H (BIOS PRINTER CONTROL
u Instruction: int 17h
u BIOS Operation: Print data and test the printer
status
u Parameters: ax,dx
.code
extrn WriteString:proc
main PROC
mov ax,@data
mov ds,ax ;
mov ah,1 ; initialize printer port
mov dx,LPT1 ; printer ID
int 17h ; call BIOS
mov status,ah ; returns the status
test status,notBusy
jz quit ; ;printer is busy
; Write a string to the printer:
mov si,OSET outputString
mov cx,STRIN0 SIZE
L1: mov ah,0 ; write character to printer
mov al,[si] ; character to be written
mov dx,LPT1 ; printer ID
int 17h ; call BIOS
mov ah,÷ ; get printer status
mov dx,LPT1 ; printer ID
int 17h ; call BIOS
test status,Ioerror ; I/O error?
jnz L÷ ; yes: show error
inc si ; next character
loop L1 ; no: loop again
jmp quit
L÷: mov dx,OSET erroressage
call WriteString
quit: .exit
main ENDP
END main