3C
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);
}
3D
Open File with Handle
Entry Parameter:
AH = 3DH
AL = 0
; read only
1
; write only
2
; read and write
DS:DX
; pointer to file name buffer
Return Value: if success, AX = Handle and CARRY flag is cleared
if failed , AX = 2 and CARRY flag is set
Example:
int TS_open_file(char *fn,int mode)
{
regs.h.ah=0x3Dh;
regs.h.al=(unsigned char)mode;
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);
}
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...