The following code doesn't compile for the AVR target (FPC 38288):
sts FPC_SRAMSIZE , r31 // macrotest.pp(5,9) Error: Unknown identifier
Is the use of macros in assembler blocks allowed?
(Compiled with: ~/fpc/3.1.1/compiler/avr/pp -Wpattiny13 -Sgm macrotest.pp)
Clearly the ifdef check passed so FPC_SRAMSIZE is defined, however when the
macro is used FPC
doesn't recognize it. If the macro reference is moved outside the asm block to
a const then it
works as expected (to some degree, there is another problem unrelated to the
use of a macro).
This code compiles as expected:
sramSize = FPC_SRAMSIZE;
sts sramSize , r31
fpc-pascal maillist - email@example.com