PT630 Programming Reference Guide
Page 46 of 59
------------------------------------------------------------------------------------------------------------------
1.5.31 Modify Allocated Memory Block
Entry Parameter: AH = 4AH
ES = segment address of the block to resize
BX = new block size in paragraphs (16 bytes)
Returned Value:
if success , CARRY flag is cleared
if
failed
,
CARRY
flag
is
set
AX = error code
Example
:
int TS_modify_alloc_mem(unsigned int size,unsigned char far *str,int *free)
{
unsigned long aa;
regs.h.ah=0x4a;
regs.x.bx=size;
segregs.ds = FP_SEG(str);
int86(0x21,®s,®s);
*free = regs.x.bx;
if ((regs.x.cflag & 0x01) == 0) return(1);
else return(-1);
}
1.5.32 Run specified program
Entry Parameter: AH = 4BH
AL = 3
DS:DX
;
pointer
toprogram
name
Return Value: if success, AX = Handle and CARRY flag is cleared
if failed , AX = 2 and CARRY flag is set
void TS_Run(char far *str)
{
regs.h.ah=0x4b;
regs.h.al=3;
segregs.ds=FP_SEG(str);
segregs.x.dx=FP_OFF(str);
int86x(0x21, ®s, ®s, &segregs);
}
1.5.33 End Program
Entry Parameter: AH = 4CH
AL = program-defined return value
Return
Value:
None
Example
:
void
TS_end_program(int
ret_code)
{
regs.h.ah=
0x4C;
regs.h.al=
(unsigned
char)ret_code;
int86(0x21,®s,®s);
}