AVR - Assembler routines for 8, 16 & 32 bit unsigned div (code contribution)
Original Reporter info from Mantis: ccrause @ccrause
-
Reporter name: Christo Crause
Original Reporter info from Mantis: ccrause @ccrause
- Reporter name: Christo Crause
Description:
When including a div operation in a calculation the generated code size increases dramatically (in terms of memory generally available on an embedded target). It appears that the compiler uses generic software math routines from the rtl/inc folder (generic.inc and int64.inc). These routines includes an error check (HandleErrorAddrFrameInd) which pulls in a bunch of code (get_caller_frame, pushexceptionobject, dounhandledexception, raiseexception etc.).
I've adapted Atmel's application note AVR200 div routines to fpc, see attached unit.
Additional information:
http://forum.lazarus-ide.org/index.php/topic,37408.0.html
AVR200 application note: http://www.atmel.com/Images/doc0936.pdf
Mantis conversion info:
- Mantis ID: 32103
- Platform: Embedded
- Version: 3.1.1
- Fixed in version: 3.3.1
- Fixed in revision: 42162 (#dee01978)
- Monitored by: » dioannidis (Dimitrios Chr. Ioannidis)
- Target version: 3.2.0