This page presents an updated ARMSchembler and a compiler for ARMPit Scheme (both preliminary, but working). Both programs can run either on-chip (for boards with sufficient RAM) or off-chip (in guile 1.7 or 1.8). The resulting code can contain references to internal ARMPit Scheme symbols (primitives) and these references are resolved by a linker prior to installing the resulting machine code above the heap or in a FLASH library (where available, i.e. for MCUs with on-chip FLASH).
The ARMSchembler of previous versions (snapshots) was modified to produce code in packed bytevector format. The compiler was updated to allow primitives to be treated as immutable which avoids doing a lookup in the environment (see *immutable-primitives* at top of common compiler source file). For ARMSchembly, the following files are needed: 1) the common code; 2) either the ARM sub-component or the Thumb2 sub-component, based on the desired target (ARM7TDMI-ARM920T-Cortex-A8 or Cortex-M3); 3) either the ARM or the Thumb2 constants definition file; 4) either the linker and OnChip functions or the guile compatibility file, depending on whether ARMSchembly is done on-chip, or in guile (off-chip), respectively. For compilation, the following files are needed, in addition to the ARMSchembler: 1) the main compiler code, and; 2) the compiler utility file, if compiling on-chip and it is desired to compile existing lambdas (to above-heap RAM or to the FLASH library).
The files are designed such that loading them (except armpit_0225_guile_compat.scm) into Armpit Scheme or guile will produce files with suffix -0225 that can then be loaded in to provide the needed ARMSchembly and compilation primitives (eg. assemble and escompile). The code below can be used to load the resulting -0225-suffixed files (and armpit_0225_guile_compat.scm, if needed):
;
; ARM (on-chip)
;
(for-each
load
'("assembler-common-0225"
"assembler-ARM-0225"
"assembler-nonlib-0225"
"linker-0225"
"compiler-common-0225"
"compiler-utility-0225"))
;
; Thumb-2 (on-chip)
;
(for-each
load
'("assembler-common-0225"
"assembler-T2-0225"
"assembler-nonlib-T2-0225"
"linker-0225"
"compiler-common-0225"
"compiler-utility-0225"))
;
; ARM (guile)
;
(load "armpit_0225_guile_compat.scm")
(for-each
load
'("assembler-common-0225"
"assembler-ARM-0225"
"assembler-nonlib-0225"
"compiler-common-0225"))
;
; Thumb-2 (guile)
;
(load "armpit_0225_guile_compat.scm")
(for-each
load
'("assembler-common-0225"
"assembler-T2-0225"
"assembler-nonlib-T2-0225"
"compiler-common-0225"))
Note that, on guile, the output of the ARMSchembler will be a scheme vector (i.e. prefixed by #) but its format corresponds to that of bytevectors used on-chip and hence its prefix can simply be changed manually to #vu8 when transferring it to Armpit Scheme.