Tech Note 29: NS Basic/Palm Goes Native!
December 22, 2003
© 2022 NSB Corporation. All rights reserved.
The Palm OS was originally written for the Motorola 68000 processor, often referred to as the 68K. With Palm OS 5, the operating system moved to the StrongARM processor, available from a number of manufacturers. The new processor has a number of features that make it much, much faster than the 68K chip could ever be.
To maintain compatibility with the huge base of software for the Palm OS, PalmSource created a 68k emulator that could run on the StrongARM processors, called PACE ("Palm Application Compatibility Environment"). The result is that apps written for the 68K could run, without modification, on the new devices. The speed of the new processors was so good that software (including programs written in NS Basic/Palm) ran faster on the new device even while emulating a 68K.
This left an opportunity to get some dramatic speed improvements if the 68K emulation could be eliminated. NS Basic/Palm 4.1 is fully ARM Native, meaning that programs written in NS Basic will run in native ARM code and not in PACE.
The speed improvement is dramatic - up to 25 times faster. NS Basic is now practical to use for all kinds of applications that would have been too slow before.
Speed is not the only benefit. There is a corresponding savings in battery usage, making NS Basic much more efficient in that respect as well.
Any NS Basic/Palm program that works in 68K mode will work in ARM Native mode, with no changes to your code. The only difference is which version of the Runtime you use. You'll have to compile your program using NS Basic/Palm 4.0 or later, otherwise the program will only run in 68K mode.
You can control which runtime is used by installing the appropriate one on your device, or by selecting which version to include as a Fat App in Tools...Options...Compile/Download in the NS Basic/Palm IDE.
ARM Native code is larger than 68k code. Instructions are 32 bit instead of 16, and alignment must be on 4 byte boundaries. The result is that the ARM Native Runtime is substantially larger. NS Basic programs themselves remain the same size.
There are 2 options you can choose from: