MLHA - Software - Programmering - Assembler - INT

http://eprom.myetang.com/intr/int.htm   : Interrupt Jump Table
http://hdebruijn.soo.dto.tudelft.nl/newpage/interupt/INT.HTM
http://lrs.fmi.uni-passau.de/support/doc/interrupt-57/INT.HTM : Interrupt Jump Table
http://members.tripod.com/~oldboard/assembly/idx_interrupt.html
http://moon.inf.uji.es/docs/interr/ : Interrupts
http://poli.cs.vsb.cz/misc/rbint/ : Ralph Browns List of Interrupt files
http://www.clipx.net/ng/rbrown/index.php : Ralph Browns Interrupt List
http://www.hszk.bme.hu/~kr304/intlist.htm : Ralph Browns Interupt list (3.5 MB)
http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte1at0.htm
http://www.iro.umontreal.ca/~feeley/cours/ift2240/doc/assembly/interrup.html  

 

09 : BIOS keyboard handler
10 : BIOS screen services
11 : BIOS Equipment list
13 : BIOS Disk services
14 : BIOS Serial communication (RS-232) services
15 : BIOS System services
16 : BIOS Keyboard services
17 : BIOS Parallel port (printer) services
19 : Bootstrap Loader
1A : BIOS Timer services
20 : DOS Terminate
21 : DOS Functions
25 : DOS Sector Read
26 : DOS Sector Write
27 : DOS TSR
29 : DOS Quick TTL
2F : DOS Multiplex


INT 09: BIOS keyboard handler
> port 60h
> DOS6PT.112
- read 1-byte scancode at port 60h
- check for special combinations
- <ctrl-break> set bit 7 of 40:71 - put 2 0-bytes in keyboard buffer
issue INT 1Bh (some ctrl-break handler)
- <pause> suspend (loop) until any other key - discard the scan code
- <ctrl-alt-del> put 1234h ('warm boot') in reset flag at 40:72, reboot.
- <prtsc> issue INT 5
- <alt-sysreq> issue INT 15h, 85h (do nothing - for terminal emulation)
- if shift/toggle key: set 40:17-18
- else: translate into (Ascii+scan) using 40:17-18
- place byte-pair in keyboard buffer at 40:1E
- may be hooked >INT 21.25: Set Interupt Vector
 
INT 10: BIOS Screen Services
 
INT 11: Equipment List
returns bitflags in AX:
bits MEGA386SX  
0 1 =1 :one or more diskette drives exist
(see bits 7,6)
1 0 =1 :math coprocessor installed
3,2 00 old PC & PCjr: RAM on main board:
=00:16k, =01:32k, =10:48k, =11:64k
newer PCs: use INT 12 for mem info
PS/2: bit 2: =1:mouse installed
5,4 10 initial videomode:
=00:unknown adapter
=01:color txt 40*25 (uses B800)
=10:color txt 80*25 (uses B800)
=11:mono txt 80*25 (uses B000)
7,6 01 no. of installed diskette drives: (see bit 0)
=00:1, =01:2, =10:3, =11:4
8 0 =0: DMA present
11,10,9 010 (=2) no. of installed RS232 serial ports (binary no.)
12 0 =1: game I/O (joystick controller) installed
13 0 PC & XT: =1:internal modem installed
PCjr: =1:serial printer is on
15,14 01 (=1) no. of printers installed (binary no.)
 
INT 13: BIOS Disk services
uses parameter tables pointed to by INT 1E, INT 41, INT 46
Sector = LogicalSector MOD SectorsPerTrack + 1
Head =(LogicalSector \ SectorsPerTrack) MOD NumberOfHeads
Cylinder = LogicalSector \(SectorsPerTrack*NumberOfHeads)
compare DOS INT 25
 
AH=0: reset drive and controller
AL=drive
=00: first floppy drive
=80: first hard drive
AH=disk status: (hex)
= 0: no error
= 1: function invalid
= 2: sector mark not found
= 3: write attempt on write-protected floppy
= 4: sector not found
= 8: DMA overflow
= 9: DMA crossed 64k boundary
=10: read error (CRC or ECC)
=20: disk controller error
=40: track not found on seek
=80: time out - drive not responding
AH=1: get disk status AH=disk status (see above)
AH=2: read disk sectors
AL= no.of sectors
DH= side (0-1)
DL= drive (0-3)
CH= track (0-39d)
CL= start sector (1-9)
ES:BX-> buffer for info
AH=disk status
AL=no.of read sectors
Cf=0: no error
(ES changed)
AH=3: write disk sectors
AL,DX,CX,ES,BX as above
as above
AH=4: verify disk sectors
as above
as above
Cf=1: verify error
AH=5: format disk track
ES:BX-> table
see JL/HN"maskinkode.."p.130
 
 
INT 14: BIOS Serial communications (RS-232) services
 
AH=0: Initialize Serial Port
AL=initializing parameters
bit 7,6,5: Baud:
000= 110
001= 150
010= 300
011= 600
100=1200
101=2400
110=4800
111=8600
4,3: Parity:
00=none
01=odd
11=even
2: Stopbit:
0=1 bit
1=2 bit
1,0: Word Length:
10=7 bit
11=8 bit
DX=serial port
=0,1: COM1,COM2
AX=Serial Port Status
AH=1: Send Character
AL=character
DX=serial port
AH bit 7 = 0: no error
AL = character
-- or --
AH bit 7 = 1: transmission error
AL bit 0-6 : status
AH=2: Read Character
DX=serial port
AH bit 7 = 0: no error
AL = character
-- or --
AH bit 7 = 1: transmission error
AH=3: Get Serial Port Status
DX=serial port
AH = transmission status code
AL = modem status code
 
INT 15: BIOS System services
PC: Cassette/ AT: virtual memory
 
AH=85: SysReq - see INT 9h  
AH=86  
AH=87: Protected mode Data Move  
AH=88: Get Extended Memory Size  
AH=C0: >DOS6PT.23 CF set: no success - ignore
ES:BX -> configuration table
byte 5: bit 2: 1: EBDA is present
AH=C1: >DOS6PT.23 CF set: no success - ignore
ES = segment of EBDA
 
INT 16: BIOS Keyboard services
 
AH=0: read (wait for) key
AL=0
remove 2 bytes from buffer
AH=scan code
AL=ASCII code
note: will not read F11,F12 - use AH=10?
AH=0: read (wait for) key
AL<>0
AH=extended IBM keycode (?)
AH=1: preview char
bytes are not removed
Zf=1: no codes in key buffer
Zf=0: codes in buffer:
AH=scan code
AL=ASCII code
AH=2: report keyboard status bits AL=bits at 0417h:
0=1: <right shift> pressed
1=1: <left shift> pressed
2=1: <ctrl> pressed
3=1: <alt> pressed
4=1: <scroll lock> on
5=1: <num lock> on
6=1: <caps lock> on
7=1: <Insert> on
AH=10?:
reads F11,F12 (see AH=0)
 
 
INT 17: BIOS Parallel Port (Printer) services
 
AH=0: Write Character
AL=character
DX=printer no.
=0: LPT1
=1: LPT2
=2: LPT3
=3: (LPT4)
AH= printer status: - see port 379h
0=1: time out error
1,2: not used
3=1: I/O error (off line / out of paper)
4=1: selected (on line)
=0: off line
5=1: out of paper
6=1: acknowledge - data received, ready for more
7=1: printer not busy (on line)
=0: busy (printing) or off line
AH=1: initialize printer
DX=printer no.
AH= printer status - see above
AH=2: report printer status
DX=printer no.
AH= printer status - see above
 
INT 1A: BIOS time services
clock number is 4 bytes, each count = 1 tick (18.2/sec)
automatically reset at midnight (18.2*60*60 = 65520)
 
AH=0: read clock CX=hi bits: incremented approx. each hour
DX=lo bits: incremented each 55 ms (1/18.2 sec)
AH=1: set clock
CX,DX: new value
 
 
INT 19: Bootstrap Loader
Reads track 0, sector 1 into 0000:7C00 - then jumps to this address
 
INT 20: DOS Terminate
CS must point to PSP - used in .COM programs - same as INT 21,0
restore INT 22,23,24 vectors from old values stored in PSP.
does not close open files.
 
INT 21: DOS Services
 
INT 25: DOS sector read
- using logical drives (remapped by ASSIGN)
- using Logical Sectors 0..
LogicalSector = BIOSSector - 1 +
SectorsPerTrack*(Head + NumberOfHeads*Cylinder)
compare BIOS INT 13,2
 
AL= disk drive (A:0, B:1, C:2,..)
CX= no. of sectors to read
DX= starting sector nr.
DS:BX->buffer(DTA)
NB - after return: old flag-register on stack -
remove with ADD SP,2 or POP (>PCPB.249)
CF=0/1: no error/error
AL=error codes based on DOS INT 24 codes
=00: write-protect error
=01: unknown unit, invalid drive number
=02: drive not ready
=04: CRC error, parity error
=06: seek error
=07: unknown media
=08: sector not found
=0A: write error
=0B: read error
=0C: general, nonspecific error
=0F: invalid disk change
AH=error codes based on BIOS INT 13 codes
=01: bad command
=02: bad address (sector ID) mark
=03: write-protect error
=04: sector error, sector not on disk
=08: DirectMemoryAccess error
=10: CRC error, parity error
=20: disk drive controller error
=40: seek error
=80: time-out (no response from drive)
 
INT 26: DOS sector write
 
as INT 25
CX= no. of sectors to write
NB - after return: old flag-register on stack -
remove with ADD SP,2 or POP (>PCPB.249)
as INT 25
 
INT 27: DOS TSR
max 64K resident (DX)
recommended alternative: INT 21,31
 
CS->PSP
CS:DX=offset EndOfResidentPart
(first non-resident byte)
restore INT 22,23,24 vectors
from old values stored in PSP.
 
INT 29: DOS Quick TTL
(undocumented) - Somerson DOSPT.476
 
AL= char  moves cursor 
 
INT 2F: DOS Multiplex
used to communicate with memory resident programs (TSR)
used by PRINT spooler - ID (in AH) 1
>PCProgBible.250..
>PC'ere under lup s.130..
 
AH=01: PRINT
AL=00: Get Installed Status
AL=0: spooler not installed - ok to install
=1: spooler not installed - not ok to install
=FF: spooler installed
AH=01: PRINT
AL=01: Submit (add) File to Print
DS:DX->5-byte area:
1 : niveau code (?)
2-5: seg:offs pointer to
ASCIIZ-path\filename
CF=0: ok
CF=1: error:
AX=error code
AH=01: PRINT
AL=02: Remove File from Queue
DS:DX->ASCIIZ-path\filename
CF=0: ok
CF=1: error:
AX=error code
AH=01: PRINT
AL=03: Cancel all Files in Queue
CF=0: ok
CF=1: error:
AX=error code
AH=01: PRINT
AL=04: Hold (show) Queue
CF=0: ok:
DS:SI->Queue (list of filenames)
CF=1: error:
AX=error code
DX=number of errors (?)
AH=01: PRINT
AL=05: Release Queue
(functions 0-3 also release queue)
CF=0: ok
CF=1: error:
AX=error code
AH=01: PRINT
AL=06: Get Printer's Header