I'm programming in ARM assembly in DS-5 5.28, targetting cortex-a8 with floating point and Neon.
When expressing constants with EQU, like
M EQU 5
then I can use the constant in the rest of the program, in particular when allocating constants in data memory like e.g:
mydata DCD M
Now, if I want to allocate a floating point constant as 32-bit binary, I can do:
myfloat DCFS 5
or indifferently:
myfloat DCFS 5.0
But the following gives syntax error:
myfloat DCFS M
I've tried all sort of tricks like DCFS (M+0.0)
or M EQU 5.0
, but nothing is accepted by the assembler, and I can't find directives to cast constants, and not even an Arm forum that seems suitable. Nor I'd like to hard-code constants (that may change) more than once in the code.
EDIT 1
I've tried with macros, same error (A1194E: Bad floating-point number):
MACRO
$label FP_CONSTANT $value
$label DCFS $value
MEND
; use:
myfloat FP_CONSTANT M
I would like to check if I wrote it correctly by disassembling the result, but compilation fails so there's no object to disassemble.