The FPC-AVR port is currently experimental and non working. It uses the GCC AVR tool chain and will be compatible with GCC regarding calling conventions etc.
FPC considers AVR being a 16 bit CPU. So the type tregister actually describes a register pair being the second register implicitly named.
Building Cross compiler
There are some requirements, you should know about
- You should use the latest Free Pascal sources as there is the most recent support for more controllers.
- Binutils for avr target
- Latest stable Free Pascal Compiler
Then you can build your cross compiler. Please choose SUBARCH according to your Arduino board / AVR microprocessor.
make buildbase installbase CPU_TARGET=avr OS_TARGET=embedded SUBARCH=avr5 CROSSINSTALL=1 INSTALL_PREFIX=~/fpc NOGDB=1 PP=/usr/bin/fpc CROSSBINDIR=/usr/avr/bin
The operating system target embedded requires you to specify a aubarchicture when building a cross compiler. The subarchitectures are compatible to the ones used by gcc.
There is a list at: http://www.nongnu.org/avr-libc/user-manual/using_tools.html
- General information: http://en.wikipedia.org/wiki/Atmel_AVR
- Atmel site: http://www.atmel.com/products/microcontrollers/avr/default.aspx
- Calling conventions: http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_reg_usage
- Discussion on: http://www.lazarusforum.de/viewtopic.php?f=9&t=5444&start=30 (German)