@st. Paul'S University Mr. Pius Nyaaga 1
@st. Paul'S University Mr. Pius Nyaaga 1
INTERRUPT MECHANISM
The general concept for procedure call in most of the programming languages is that on
invocation of the procedure the parameter list and the return address (which is the value if IP
register in case of near or the value of CS and IP registers in case of far procedure) is pushed
Moreover in various programming languages whenever a procedure is called its address need
to be specified by some notation i.e. in C language the name of the procedure is specified to
call a procedure which effectively can be used as its address.
However in case of interrupts the a number is used to specify the interrupt number in the call
• Int 21h
• Int 10h
• Int3
Main
Call proc1()
Call proc1()
Int 21h
Proc1()
Int 10h
Proc2()
Moreover when an interrupt is invoked three registers are pushed as the return address
i.e. the values of IP, CS and Flags in the described order which are restored on return. Also
no parameters are pushed onto the stack on invocation parameters can only be passed through
registers.
INTFF 0000:03FFH
Moreover it is important to understand the meaning of the four bytes within the
interrupt vector. Each entry within the IVT contains a far address the first two bytes (lower
word) of which is the offset and the next two bytes (higher word) is the segment address.
0000:0007
When the system has booted up and the applications can be run all these kinds of ISRs
may be provided by the system. Those provided by the ROM-BIOS would be typically
resident at any location after the address F000:0000H because this the address within
memory from where the ROM-BIOS starts, the ISRs provided by DOS would be resident in
the DOS kernel (mainly IO.SYS and MSDOS.SYS loaded in memory) and the ISR provided
by third party device drivers will be resident in the memory occupied by the device drivers.
IO.SYS
Device Driver
Command. COM
USER PROGRAM
BOF CP EOF
------------------------------ ----------------------------
-
This service is used to move the file pointer to a certain position relative to a certain
point. The value in AL specifies the point relative to which the pointer is moved. If the value
of AL = 0 then file pointer is moved relative to the BOF (begin of File) if AL=1 then it’s
moved relative to current position and if AL = 2 then its moved relative to the EOF (end of
file).
CX-DX specify the number of bytes to move a double word is needed to specify this value as
the size of file in DOS can be up to 2 GB. On return of the service DX-AX will contain the
number of bytes the file pointer is actually moved e.g. If the file pointer is moved relative to
the EOF zero bytes the DX-AX on return will contain the size of file if the file pointer was at
BOF before calling the service.