GENERATING WIN32 APPLICATIONS WITH P32
--------------------------------------

INTRODUCTION:
-------------
This ZIP contains four sample native Win32 applications, plus units
(SYSTEM, CRT and WINDOWS) used in building these apps.

With the aid of NASM (http://www.cryogen.com/nasm) and LCC-WIN32 
(http://www.cs.virginia.edu/~lcc-win32) is possible to produce
Win32 applications from P32 Pascal programs.

With P32 we generate 32-bit assembler code that is ALMOST compatible 
with NASM.
NASM, in its turn, is capable of producing Win32 compatible OBJ files.
LCC-WIN32 comes with a linker for Win32 OBJ files (LCCLNK), libraries
for calling the Win32 API and a resource compiler (LRC).


CONTENTS:
---------
  WINSTAR3.PAS - Source and ... 
  WINSTAR3.EXE - ... executable of an adapted STARS program for Win32.
  GENERIC.PAS  - Source, ...
  GENERIC.RC   - ... resources and, ... 
  GENERIC.EXE  - ... executable of a simple and generic Win32 GUI app.
  TESTCONS.PAS - Source and ...
  TESTCONS.EXE - ... executable of a test Win32 console app.
  BFD.PAS      - Source and ...
  BFD.EXE      - ... executable of a simple binary file dumper.
  CRT.PAS      - A CRT unit for Win32 console subsystem. This unit is
                 still buggy and incomplete.
  WINDOWS.PAS  - An partial translation of windows.h. This unit contains
                 API functions, structures and constants used by sample 
                 apps and CRT unit above.
  SYSTEM.PAS   - Source of a SYSTEM unit for generating Win32 apps.
  SYSTEM.P32   - P32 symbols of above unit.
  SYSTEM.OBJ   - Win32 OBJ file of above unit.
  P32.INI      - INI file declaring a new target "Win32 Applications".
  NASM.DEF     - DEF file used when generating "Win32 Applications"
  TASM.MAC     - Macros to help P32 in producing NASM compatible asm files.
  FIXASM.PAS   - A Pascal program to post-process asm files generated by
                 P32 and make them "MORE" compatible with NASM.
  MAKEGUI.BAT  - Batch file to automatize the making (compile, fix, assemble
                 and link) of Win32 GUI apps.
  MAKECONS.BAT - Batch file to automatize the making (compile, fix, assemble
                 and link) of Win32 Console apps.
  README.TXT   - This file.


RECOMPILING THE SAMPLE APPS:
----------------------------
   Download NASM and LCC-WIN32 from their Web Sites and install them. 
Update your PATH environment variable so that it points to the paths of 
NASM and LCC executables.
   Running "MAKEGUI GENERIC" and "MAKEGUI WINSTARS" will, in turn, remake
GENERIC.EXE and WINSTARS.EXE with the version v0.4 of P32.
   Running "MAKECONS TESTCONS" and "MAKEGUI BFD" will remake TESTCONS.EXE 
and BFD.EXE with P32 v0.4.


CONSIDERATIONS:
---------------   
 - By default P32 uses the STDCALL calling convention, when we put the 
"win32api" keyword after the function/procedure declaration (see WINDOWS.PAS
for examples), it generates symbolic information compatible with LCC linker
(LCCLNK) and its libraries.
 - WINDOWS unit has only few API functions declared, if you need to use
other API functions you must declare them in WINDOWS.PAS. If you expand
WINDOWS.PAS please share it with us.
 - It isn't a good idea to recompile SYSTEM.PAS. Use SYSTEM.P32 and SYSTEM.OBJ
because if you recompile it you will have trouble when assembling. FIXASM 
cannot make a "FULL" compatible NASM assembler file, so manual alterations are 
needed.
 - Read MAKEGUI.BAT, MAKECONS.BAT to learn more about the compile/assemble/link
process. Read sample apps, WINDOWS and CRT units to learn more about creating 
Win32 apps with P32.
 - Please send questions, suggestions and like to P32 discussion list.
