ReadMe for Palmtop Application Library Supplement 1.61

What is PAL?
~~~~~~~~~~~~

PAL (Palmtop Application Library) is an Application Programmer Interface for the HPLX series of palmtops which allows you to write sftware with a similar Graphics User Interface to that of the built in applications. As of this writing it is at version 1.6 and it looks as that is where it will stay!

The PAL library is available from Gilles' home page at 

http://ourworld.compuserve.com/homepages/gilles/

Follow the PAL link!


Why this archive?
~~~~~~~~~~~~~~~~~
The PAL library was written with the following criteria in mind:
1. It should be very simple to use
2. it should allow compilation using a number of compilers available at the time of writing.

The above criteria resulted in a very easy to learn and useful API, but with certain limitations. As it used "the lowest common denominator" of compiler functionality, there where some functions which could be written much more efficiently if you had a better compiler available. Also a lot of the lower level functions could be better written in assembler code thus resulting in much smaller code.

Limitations of this archive
~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have not written the files here with the intention of making the code as general as possible fo different assemblers or compilers. I wanted something which would work for me (sorry if it doesnt work for you!).

The compilers that I used are:
Turbo C++ v 1.0 (on the palmtop)
TASM v2.0 (on the palmtop)
Borland C++ v3.1 (on my desktop)
TASM v3.0 (on the desktop).

Also in writing the assembly code I did not use the standard segment directives but rather the simplified segment directives. You can see this in the file PAL.INC

Also I did not find a smooth way to build the library. I did not have the time to rewrite pm (The PAL make manager) to support assembly files, and I found that to create a makefile on my palmtop to build something the size of the PAL library was too much for Turbo C++ on the palmtop. What I did was create IDE projects in Turbo C++ and Borland C++ to build the entire library including the assembly. I do not include these files here.

Advantage of this Archive
~~~~~~~~~~~~~~~~~~~~~~~~~
Despite these limitations I hope that this archive will be useful to anyone developing PAL applications for the HPLX paltops. The resulting code using this archive is both smaller AND faster than using the "official" PAL libraries.

How it was created
~~~~~~~~~~~~~~~~~~
I never claim to be an assembly language programmer (let alone  a good one), but what I did was this:
1. Look at a low level PAL function and see how it called interrupts. Most of the PAL library used the int86 function "wrapped up" by the PAL Callint() function. I replaced this in a lot of cases using the pseudovariables _AX, _BX, _CX, _DX etc and the geninterrupt() function call provided by Turbo C. 
2. I then compiled the code to assembly language to see what it looked like and to check whether I could refine it further.
3. I then assembled my assembly language file, using that function instead of the original C function.

Todo
~~~~
There are still parts of the PAL library which I havent touched as I have yet to write an applciation which uses them!. Significantly the EMS directory and the power management functions.


David Becher
davidb@netmedia.net.il
Ramat Gan Israel
December 2000
