Home News About ArtWorks FreeWare Ordering

MW Software - 32-bit porting support


Page index:





Quick Links:

ArtWorks 2

AWViewer download (free ArtWorks viewer)

32BitLib and armc - 32-bit porting support

32BitLib - assembler macros for the BASIC assembler

Name 32BitLib
Requires RISC OS 4 or higher
Version 1.04 (03-Sep-03)
Status FreeWare
Price free

32BitLib is a library of assembler macros that can be used to create 32-bit safe software with the BBC BASIC assembler (under RISC OS 4 or higher only because support for the MSR/MRS instructions are needed in the assembler). The idea is that subroutines are generally assumed to be non-flag-preserving, so the return and exit macros do not attempt to restore the flags at all (except for the swiReturn... and swiExit... macros that can be used to create SWI exit code that restores the flags in 26-bit mode).

The library is loosely based on the Pace macros as supplied with the 26/32-bit AcornC/C++ tools. Main features are:

  • Build either 26-bit (ARM 2 to StrongARM) or 32-bit (ARM 6 or higher) versions of your software from the same sources using build switches.
  • Macros to return from subroutines via r14 (return, returnVC, returnVS, returnCC, returnVCCC,...) or via a return address on the stack (pull_and_return, pull_and_returnVC, ...) and to set or clear processor flags (setV, clearV, setC, ...) - all with support for condition codes (e.g., returnVS(eq) returns with V set via r14 if EQ holds)
  • Push/Pull macros that use STR/LDR if the register list only contains a single register, which is more efficient on some processors
  • Entry/Exit macros minimize errors with routine entry/exit code: The exit macros (with support for condition codes) unstack the same set of registers as listed in the preceding entry macro (e.g., entry("r3,r5-r8") defines an entry point where r3,r5-r8 and lr are stacked and exitVC(eq) unstacks the entry registers and returns with V clear if EQ holds)
  • Special macros for SWI exit code where NZC flags have to be restored from r14 in 26-bit mode but can be ignored in 32-bit mode (swiReturnVC, swiReturnVS, swiExitVC, swiExitVS, ...)

The library can be copied freely and using it to assemble code does not affect the copyright status of that code.

The library has been used successfully to assemble ArtWorks 2. Feedback and enhancements are welcome!

armc - Perl script to aid the 32-bit conversion

Name armc
Requires Perl interpreter
Version 1.06 (20-Sep-03)
Status FreeWare
Price free

The armc Perl script converts 26-bit assembler code (BASIC assembler format only) to partly 32-bit safe code. This is only a first step in a semi-automated process. This script does not (and cannot) do the full job. However, in addition to doing most of the tedious search-and-replace work, it also directs you to most places where manual post-processing is necessary by telling you where flag preservation over BL and SWI calls might have been assumed by the original code.

Please note that I have written this script for my own use, it has not been engineered for general use, but it is a quick-and-dirty job that works for the specific way in which I (and Computer Concepts engineers) write source files. You are welcome to use it, but I cannot guarantee any support whatsoever.

If you have downloaded version 1.05, please make sure you upgrade to version 1.06 - 1.05 was seriously broken.

Download section

archive icon Download 32BitLib 1.04   archive icon Download armc 1.06

32BitLib History

Release 1.04 (03-Sep-03):
  • certain conditional use of FNreturnV[CS]C[CS] was broken in earlier versions, fixed now
  • FNreturnC[CS]EQ and FNreturnC[CS]NE were broken in earlier versions, fixed now

To top

For further information contact Webmaster address or use the contact form: Contact
Last modified: 24-Sep-04