BX = file handle
CX = block length in bytes
Return Value: 1) If the function is successful:
Carry flag = clear
DX:AX = pointer to current file position (not changed)
2) If the function fails:
Carry flag = set
DX:AX = pointer to current file position (not changed)
Note:
For insertion, the content of the inserted data block is
undefined.
48
Allocate Memory
Entry Parameter:
AH = 48H
BX = block size in paragraphs (16 bytes) to be allocated
Return Value: if success, CARRY flag is cleared
AX = segment address of block allocated
if failed , CARRY flag is set
AX = error code
BX = largest available memory block in paragraphs
Example
:
int TS_alloc_mem(unsigned int size,unsigned char far *str,int *free)
{
unsigned long aa;
regs.h.ah=0x48;
regs.x.bx=size;
int86(0x21,®s,®s);
*free = regs.x.bx;
aa = (unsigned long)regs.x.ax * 10000L;
str = (unsigned char far *)aa;
if ((regs.x.cflag & 0x01) == 0) return(1);
else return(-1);
}
49
Free Allocated Memory
Entry Parameter:
AH = 49H
ES = segment address of block to be freed
Return Value: if success , CARRY flag is cleared
if failed , CARRY flag is set
AX = error code
Summary of Contents for PT600
Page 1: ...PT600 Portable Terminal Programming Reference Guide Document number 3506000120...
Page 7: ......
Page 16: ......
Page 20: ...regs h bh 5 regs h al unsigned char type regs h bl unsigned char status int86 0x21 regs regs...
Page 57: ......
Page 66: ...Host Command STX ESC CMD parameters CS1 CS2 ADDR Acknowledgement ACK Negative ACK NAK...