'===========================================================================
' Subject: Create PIF file                    Date: 12-22-02 (  :  )       
'  Author: Fred Buffington                    Code: QB,PDS,PB              
'  Origin: oasys@sbcglobal.net              Packet: DISK.ABC
'===========================================================================
'Fred Buffington
'Create PIF file
'QB,PDS,QBASIC

'Make a Pif file for a dos program link 
'author:Fred Buffington 
'for QB,PBdos 
'10/03/2002 
'below is a list of offsets from pif.txt from Wotsit.org 
'OFFSET              Count TYPE   Description 
'0000h                   1 byte   reserved 
'0001h                   1 byte   Checksum 
'0002h                  30 char   Title for the window 
'0020h                   1 word   Maximum memory reserved for program 
'0022h                   1 word   Minimum memory reserved for program 
'0024h                  63 char   Path and filename of the program 
'0063h                   1 byte   0 - Do not close window on exit 
'                                 other - Close window on exit 
'0064h                   1 byte   Default drive (0=A: ??) 
'0065h                  64 char   Default startup directory 
'00A5h                  64 char   Parameters for program 
'00E5h                   1 byte   Initial screen mode, 0 equals mode 3 ? 
'00E6h                   1 byte   Text pages to reserve for program 
'00E7h                   1 byte   First interrupt used by program 
'00E8h                   1 byte   Last interrupt used by program 
'00E9h                   1 byte   Rows on screen 
'00EAh                   1 byte   Columns on screen 
'00EBh                   1 byte   X position of window 
'00ECh                   1 byte   Y position of window 
'00EDh                   1 word   System memory ?? whatever 
'00EFh                  64 char   ?? Shared program path 
'012Fh                  64 char   ?? Shared program data file 
'016Fh                   1 word   Program flags 
' 
OPEN "qbtest.pif" FOR OUTPUT AS #1 
PRINT #1, CHR$(0); CHR$(0); 'reserved and checksum 
PRINT #1, "testing pif" + SPACE$(19); 'Title 
PRINT #1, CHR$(0); CHR$(184); 'B800 46k 'max mem 
PRINT #1, CHR$(0); CHR$(0); 'min mem 
PRINT #1, "C:\QB45\QB.EXE" + SPACE$(49);    'path and program name 
PRINT #1, "1"; 'close window 
PRINT #1, "2"; 'drive 
PRINT #1, "c:\qb45" + SPACE$(57); 'startup dir 
PRINT #1, SPACE$(64); 'parameters 
PRINT #1, "0"; 'screen mode 
PRINT #1, "4"; 'pages 
PRINT #1, CHR$(0); CHR$(0); 'first interrupt last interrupt 
PRINT #1, CHR$(25); 'rows 
PRINT #1, CHR$(80); 'columns 
PRINT #1, CHR$(0); 'x position of window 
PRINT #1, CHR$(0); 'y position of window 
PRINT #1, CHR$(0); 'CHR$(0); 'system memory looks like should be another chr 
'but another chr$(0) causes it to not find it. 
PRINT #1, SPACE$(64); 'shared path 
PRINT #1, SPACE$(64); 'shared data file 
PRINT #1, CHR$(0) 'flags 
CLOSE #1 
