The LazyBoy Library Manual - FileSeek

Part of the File group.

%imacro FileSeek 2
Prefers: BX, DX:AX

Change the current position for a file handle. If successful CF will be clear and the position will be changed. On error, the CF will be set and IO_ERROR will be updated.

This function may also be used with the Text Writer when writing to a memory buffer to determine the set the position in the buffer. The Text Writer must be assigned to the same output requested by FileSeek or an error will be returned. Nor can a Seek exceed the buffer limit. Sequential character writing devices (like wdCONSOLE) always return an error.

  • %1 is File Handle
  • %2 is Register Pair or Memory Reference

Examples:

    FileSeek bx, dx:ax      ; new 32-bit file position as register pair.
    FilePos bx, [di]        ; new 32-bit file position from [DS:DI]
    FilePos wdMEMORY, dx:ax ; new position in Text Writer buffer.

See also FilePos, FileSize and IO_ERROR.