3E
Close File with Handle
Entry Parameter:
AH = 3EH
BX = Handle of file
Return Value: if success, CARRY flag is cleared
if failed, CARRY flag is set
Example:
void TS_close_file(int hdl)
{
regs.h.ah= 0x3e;
regs.x.bx= hdl;
int86(0x21,®s,®s);
if ((regs.x.cflag & 0x01) == 1) return(-1);
else return(1);
}
3F
Read File with Handle
Entry Parameter:
AH = 3FH
BX = Handle of file
CX = number of bytes to read
DS:DX
; pointer to data buffer
Return Value: if success, AX =
number of bytes read and CARRY
flag is cleared,
data in buffer
if failed, AX = 6 and CARRY flag is set
Example:
int TS_read_file(int hdl,int cnt,char *str)
{
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
regs.h.ah=0x3f;
regs.x.cx=cnt;
regs.x.bx=hdl;
int86x(0x21,®s,®s,&segregs);
if ((regs.x.cflag & 0x01) == 0) return(regs.x.ax);
else return(-1);
}
40
Write File with Handle
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...