[comp.sys.ibm.pc] format of BLOAD files

jkg@gitpyr.UUCP (03/13/87)

In article <936@aicchi.UUCP> klotz@aicchi.UUCP (Klotzbach) writes:
>Pc-Paint uses the IBM BASIC BLOAD format. That is, it contains a 2-integer
>address, 1 Integer size and 16K bytes of color information as described for

Since I recently went through all kinds of machinations to determine the
format of a BLOAD file, I thought I'd post this for the benefit of all.

A BSAVEd file has a header which contains information allowing BASIC to
load the file at an absolute address in memory. The address is given by
the standard segment:offset notation of the 80x86.

The BLOAD format consists of a 7 byte header, followed by some data. The
format of the header is as follows:

   byte 1: 
      an ID byte - an example in one of the IBM manuals (don't remember 
      which) uses FD hex for the ID. I don't know what is magic about 
      this number, but it worked OK for me.

   bytes 2 and 3: 
      the segment of the absolute address to load the file (byte 2 is 
      LSByte, byte 3 is MSByte).

   bytes 4 and 5: 
      the offset of the absolute address to load the file (byte 4 is 
      LSByte, byte 5 is MSByte).

   bytes 6 and 7: 
      the length of the data which follows (byte 6 is LSByte, byte 7 
      is MSByte). This is the length of the file less the header size
      (7 bytes).

Hope you folks find this information useful.

						Jim Greenlee
-- 
The Shadow...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!jkg

Jryy, abj lbh'ir tbar naq qbar vg! Whfg unq gb xrrc svqqyvat jvgu vg hagvy lbh
oebxr vg, qvqa'g lbh?!