Palmtop Application Library Assembly Language Update
Description
The Palmtop Application Library (version 1.6) is available from Gilles Kohl�s PAL page. As it was all written in C, with multi development platform support in mind, some of the functions could have been made a lot smaller by writing them directly in assembler.
Most of the low-level functions call interrupt-handler functions by using the C int86x family of functions. These work by the following method:
Put all the data into a structure for the registers.
Call the int86x function
Get the output from the output register structure.
I found that it in many cases, using the geninterupt() function and pseudo-variables (_AX, _BX) leads to much smaller code without really complicating the issue. From using these, I then progressed one stage further and rewrote some of the functions directly in 8086 Assembly Language. Sometimes I compiled the C source code into assembler by using the BCC �S command line option, and then refined the assembly code by hand..
Some Limitations:
I worked on this project with a specific goal in mind. I wanted to reduce the size of executables created by PAL, as I found that in some cases (such as PNR) I was coming up against the limitations of what could be done in the small memory model. I would not really call myself an assembly language programmer and I am sure that there are �real� assembly language programmers that could do a better job of this.
The compilers that I checked using these modifications were Turbo C++ version 1.0 (on the HPLX) and Borland C++ version 3.1 (on the desktop).
The Assemblers used were TASM v2.0 and TASM v3.0
I have built the libraries using the small and large memory models.
I used the �simplified segment directives� rather than full segment directives.
I build the PAL libraries using Borland�s I.D.E. project files, which are not included in the supplied archive. So if you want to build a makefile that will assemble and compile the libraries, it is up to you. In any case the archive provided includes only the source files.
Also I have not had time to rewrite pm (the PAL project manager) to support assembly language. Once again this could be an interesting project.
The modifications are based on the last released �official� PAL version (1.6)
Along the way I also made some minor modifications (in C) to the PAL library, and these modifications are also included.
Download the PAL Assembly Language Update v1.61 (55kb)
Download the zip file and unpack it using the command line pkzip �d. The result should be a directory tree containing some of the PAL source files. You should merge these files into your existing PAL source tree and the rest is up to you!