01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CX<br />

BX:SI<br />

ES:DI<br />

Must be 0x28.<br />

File attribute<br />

Null terminated file specification<br />

Pointer to filefind structure<br />

Return Value<br />

Comments<br />

AL= 1 DX=0: Success<br />

AL= 0 DX=0: No file found<br />

DX= -1: Findfirst already active<br />

The three filefind functions (0x28 - 0x30) provide a faster Findfirst/next access than the DOS compatible functions at INT 21h. They<br />

work in a manner similar to the INT 21h Findfirst/next functions. You must first call Findfirst (0x28). After that call, you can call<br />

Findnext (0x29) as much as you need. To get the entire directory call repeatedly until Findnext returns an error. The directory<br />

being searched will be locked for exclusive access by the calling task. To unlock the directory you have to call Finddone (0x30).<br />

Note: Only a successful call of this function (file found) must be later terminated by a call of the Fast Finddone function!<br />

These functions (0x28 - 0x30) are not reentrant, do not call findfirst/findnext sequences from different tasks without semaphore<br />

protection.<br />

The filefind structure is defined as follows:<br />

typedef struct filefind<br />

{<br />

char filename[12]; // Null terminated filename<br />

char fileext[4]; // and extension<br />

unsigned short int fileattr; // MS-DOS file attributes<br />

short int reserved; // Reserved<br />

struct tag_filetimestamp<br />

{<br />

unsigned short int filedate; // Date = ((year - 80) shl 9) or (month shl 5)) or day<br />

unsigned short int filetime; // Time = (hour shl 11) or (min shl 5)) or (sec / 2)<br />

} filetimestamp; // Time & date last modified<br />

unsigned long filesize; // File size<br />

char private_field[180]; // Reserved, used internal<br />

}<br />

Related Topics<br />

Top of list<br />

Index page<br />

Fast Findnext<br />

Fast Finddone must be called at end of the search<br />

Interrupt 0xA0 service 0x29: Fast Findnext<br />

Parameters<br />

AH<br />

ES:DI<br />

Continues a search which was started by Fast Findfirst (0x28)<br />

Must be 0x29.<br />

Pointer to filefind structure<br />

Page 94 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!