[fpc-devel] Code generator issue for Cortex-M0 chips in trunk

Michael Ring mail at michael-ring.org
Fri Aug 8 10:28:50 CEST 2014

There seems to be a bug in the codegenerator for armv6m thumb code.

tst r0,#-2147483648

is not valid armv6m assembler code, documentation says that tst only can 
use registers:

TST Rn, Rm

Rn Is the register holding the first operand. Rm The register to test 

Cortex-M0+ Devices Generic User Guide


In these instructions, Rn and Rm must only specify R0-R7.

Cortex-M0+ Devices Generic User Guide
Could somebody please fix?

Thank you,


/Users/ring/devel/fpc-arm/compiler/ppcrossarm -Cparmv6m @rtl.cfg -Ur 
-Tembedded -Parm -XParm-none-eabi- -Xr -Ur -Xs -O2 -n -Fi../inc 
-Fi../arm -FE. -FU/Users/ring/devel/fpc-arm/rtl/units/arm-embedded -darm 
-dRELEASE -O- -gw2 -Us -Sg system.pp
/Users/ring/devel/fpc-arm/rtl/units/arm-embedded/system.s: Assembler 
/Users/ring/devel/fpc-arm/rtl/units/arm-embedded/system.s:342: Error: 
unshifted register required -- `tst r0,#-2147483648'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140808/bf1a6c11/attachment.html>

More information about the fpc-devel mailing list