What's New in Astrobe for Cortex-M0, M3, M4 and M7

ARM Oberon Development System for Windows
Version 9.0.4 Copyright © 2006-2023 CFB Software
Email: support@astrobe.com
Website: www.astrobe.com

Last Updated 19 Dec 2023
This version of Astrobe is supported on Microsoft Windows 10 and Windows 11 with the Microsoft .NET Framework 4.x.  The Installation and Uninstall executables are digitally signed to validate authenticity and integrity.

This is a summary of the latest features and changes introduced in Astrobe for Cortex-M0, M3, M4 and M7.


Code Generation

The following details are of interest if you are using the Module and Application Disassemblers:

Instruction Sets

There are two instruction sets, called Thumb-1 and Thumb-2, used in Cortex-M processors  Thumb-1 instructions are 16-bit and most can only access the low general purpose registers r0 .. r7 The equivalent 32-bit Thumb-2 instructions can be used to access additional general purpose registers r8 .. r11. In general Thumb-1 results in smaller code size and Thumb-2 results in better performance.

Most Thumb-1, but only a few Thumb-2, instructions can be used in Cortex-M0. All Thumb-1 and most Thumb-2 instructions can be used in Cortex-M3, M4 and M7.

Additional instructions are used in Cortex-M4 and M7 for the hardware floating point operations: add, multiply, divide and square root. These are implemented in software (the FPU library module) in Cortex-M0 and M3.

Register Usage

Cortex-M0:

Cortex-M3, M4 and M7: 

Frame Pointer

The frame pointer (FP = r12) is no longer required resulting in less overhead on procedure entry code. The register is reserved for future use.

Numeric Case Statements

Miscellaneous Optimisations


Built-in Procedures

CLEAR

The built-in procedure CLEAR replaces the FILL procedure of previous versions of Astrobe. CLEAR initialises every word in a record or an array variable v to zero.

CLEAR(VAR v: <record or array type>)

It is designed to be used to simplify and optimise the code required to initialise complex data structures. Its use can be seen in the Performance example and procedure InitHeader in the HCFiler library module HCDir.

ORD

The expression which is passed as a parameter to ORD can be a BYTE expression as well as a CHAR, BOOLEAN or SET.

BITS

BITS will report an error if its actual parameter is a BYTE expression. However, ORD can be used to convert the expression to an INTEGER e.g.

setvar := BITS(ORD(bytevar))


SYSTEM Procedures

SYSTEM.ALIGN

PROCEDURE ALIGN()

ALIGN can be used to ensure that the following instruction is aligned on a word boundary. It will insert a NOP instruction at the current code location if necessary.

SYSTEM.EMITH

PROCEDURE EMITH(instruction: INTEGER)

EMITH (EMIT Halfword) inserts the constant value instruction, which represents a 16-bit ARM Thumb instruction, at the current code location. A compilation error results if the value is not a valid 16-bit positive integer.

SYSTEM.VAL

The read-only restriction for SYSTEM.VAL has been removed e.g. the following (where x is a word-length variable of any type) is a valid statement :

INC(SYSTEM.VAL(INTEGER, x))

SYSTEM Variables

SYSTEM.FP is no longer supported because the frame pointer is no longer used. References to SYSTEM.SP, SYSTEM.LNK and SYSTEM.PC other than in direct assignments to and from global variables can result in unpredictable behaviour. Consequently, SYSTEM variables are now deprecated and will be removed in the next feature release in 2024. SYSTEM.LDREG and SYSTEM.REG should be used instead.


Oberon Language Extensions

ARRAY OF BYTE

An existing Oberon language extension allows a procedure with a formal parameter which is an array of bytes with a fixed size to accept actual parameters of any type, except POINTER, whose size is the same number of bytes.

The converse situation is now also catered for i.e. a procedure with a formal parameter of any type, except POINTER, can accept an actual parameter which is an array of bytes of the same size.

These extensions are primarily designed to simplify and optimise the code required for tasks such as de-serialising / serialising complex data structures for Input / Output operations. An example of its use, ByteArrays.mod, is included with the General examples supplied with Astrobe.

Dynamic Local Array Variables

Eliminating the frame pointer resulted in the removal of support for dynamic local array variables. These can be replaced by local array variables with a fixed size.


Configuration

Thumb Code is a new configuration option which directs the compiler to make more use of 16-bit Thumb-1 instructions instead of equivalent 32-bit Thumb-2 instructions when generating code. The typical result is a reduction in code size of about 30%. It is permanently checked on for Cortex-M0.

Configuration ID is a new configuration option which can be used for any purpose by the programmer. It is an INTEGER value that can be accessed within an application by reading the value of the variable LinkOptions.ConfigID.

The Line Numbers configuration option has been renamed to Stack Trace to avoid confusion with the Tools > Preferences > Line Numbers option.

The obsolete Crystal Frequency configuration option has been removed.


Project Menu

Disassemble Module

The Module Disassembler has been rewritten to disassemble the code after it has been generated not while it is being generated. The resulting disassembly is more accurate as it can show resolved internal backward and forward references.

Compile, Build and Rebuild

The summaries include the number of lines compiled and the compilation time in milliseconds for each module and totals for all modules.

Link

The options shown in the linker map for each module now include t+ or t- corresponding to whether the Thumb Code configuration option was checked on or off when that module was last compiled

Run

Astrobe Terminal displays error messages instead of exceptions in the following situations:


Preferences

The default Editor Font is Consolas, Size: 9.


Library Modules

GPIO

Additional procedures Set and Reset are more efficient substitutes for Put with a constant state parameter equal to TRUE or FALSE respectively.


Examples

Info

Info includes additional information related to the status of the various clocks and PLL.

ByteArrays

ByteArrays is a new example which shows how structured variables can be interpreted as arrays of bytes and vice versa.

Performance

Performance is a new example which uses the instruction counting feature of Cortex-M3, M4 and M7 to measure the performance of sections of code.


Supported Development Boards

Library modules, example source code and configuration files are included for use with the currently supported development boards. Support has been discontinued for the NXP LPC boards as they are no longer in production.


Problems fixed since v9.0.0