PT630 Programming Reference Guide
Page 39 of 59
------------------------------------------------------------------------------------------------------------------
1.5.26 Get Interrupt Vector
Entry Parameter: AH = 35H
AL = interrupt number
Return Value: DS:BX = address of interrupt routine
Example
:
void TS_get_interrupt_vector(int vect,unsigned int *es,unsigned int *bx)
{
regs.h.ah= 0x35;
regs.h.al= (unsigned char)vect;
int86x(0x21,®s,®s,&segregs);
*es = segregs.es;
*bx = regs.x.bx;
}
1.5.27 Get Free Disk Cluster
Entry Parameter: AH = 36H
Return Value: AX = 1 (number of sectors per cluster)
BX = number of available clusters
CX = 1024 (number of bytes per sector)
DX = number of total clusters in RAM disk
Example:
long TS_free_disk(int drive)
{
regs.h.al = (unsigned char)drive;
regs.h.ah = 0x36;
int86(0x21,®s,®s);
return((long)regs.x.bx*(long)regs.x.cx);
}
1.5.28 File operation function
1.5.28.1 Create File with Handle
Entry Parameter: AH = 3CH
DS:DX
; pointer to file name buffer
Return Value: if success, AX = Handle and CARRY flag is cleared
if failed, AX = 3 and CARRY flag is set
Note:
If the file already exists, the function will truncate it to zero length.
Example:
int TS_create_file(char *fn)
{
regs.h.ah=0x3Ch;
segregs.ds = FP_SEG(fn);
regs.x.dx = FP_OFF(fn);
int86x(0x21,®s,®s,&segregs);
if ((regs.x.cflag & 0x01) == 1) return(-1);
else return(regs.x.ax);
}