The contributor centre is in English only.
AS004: Memory layout for the bytecode
This specification describes the layout for the memory space of the bytecode, as generated by the Aseba compiler.
- Status
- Current implementation since commit cd634bbc.
- Design by
- Stéphane Magnenat and Philippe Rétornaz
- Written by
- Florian Vaussard
The bytecode is generated by the compiler, based on the Aseba text language and the target's description. A summary of the program memory space is shown below (click on it to enlarge).
The program is composed of a number of segments. The initialization segment has the special event ID ASEBA_EVENT_INIT. The address of the corresponding bytecode is pushed at address 0x0000 (reset vector). If other event handlers are implemented, both for local and global events, their ID and address are put in the events vector, and corresponding bytecodes for the handlers are pushed after the one of ASEBA_EVENT_INIT. The events vector is used to resolve the bytecode address when an event is received by the target.
FInally, the bytecodes for subroutines are pushed at the end of the program memory. The jump address is statically resolved by the compiler at link time.
References
- ASEBA Meets D-Bus: From the Depths of a Low-Level Event-Based Architecture into the Middleware Realm The architecture was first described here.
- The figure is available in the Aseba Git repository here.