[fpc-pascal] Cannot reference macro identifier in assembler code
christo.crause at gmail.com
Mon Feb 19 17:35:33 CET 2018
The following code doesn't compile for the AVR target (FPC 38288):
sts FPC_SRAMSIZE , r31 // macrotest.pp(5,9) Error: Unknown identifier "FPC_SRAMSIZE"
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
More information about the fpc-pascal