Entry Parameter:
AH = 40H
BX = Handle of file
CX = number of bytes to write
DS:DX
; pointer to data buffer
Returned Value:
if success, AX = number of written bytes and
CARRY flag is cleared
if failed,
AX = 6 and CARRY flag is set
Example:
int TS_write_file(int hdl,int cnt,char *str)
{
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
regs.h.ah=0x40;
regs.x.bx=hdl;
regs.x.cx=cnt;
int86x(0x21,®s,®s,&segregs);
if ((regs.x.cflag & 0x01) == 0) return(regs.x.ax);
else return(-1);
}
41
Delete File
Entry Parameter:
AH = 41H
DS:DX
; pointer to file name buffer
Return Value: if success, CARRY flag is cleared
if failed, AX = 2 and CARRY flag is set
Example
:
int TS_delete_file(char *fn)
{
TD_intdos_O(0x41,0,fn);
if ((regs.x.cflag & 0x01) == 0) return(1);
else return(-1);
}
42
Move File Pointer
Entry Parameter:
AH = 42H
AL = 0
; offset from beginning
1
; offset from current
2
; offset from end
Содержание PT600
Страница 1: ...PT600 Portable Terminal Programming Reference Guide Document number 3506000120...
Страница 7: ......
Страница 16: ......
Страница 20: ...regs h bh 5 regs h al unsigned char type regs h bl unsigned char status int86 0x21 regs regs...
Страница 57: ......
Страница 66: ...Host Command STX ESC CMD parameters CS1 CS2 ADDR Acknowledgement ACK Negative ACK NAK...