SPRU513Z August 2001 – October 2023 SM320F28335-EP
Initialize Single- and Double-Precision Floating-Point Values
.float value[, ... , valuen]
.xfloat value[, ... , valuen]
.xldouble value[, ... , valuen]
The .float and .xfloat directives place the IEEE single-precision floating-point representation of a single floating-point constant into a word in the current section. The value must be an absolute constant expression with an arithmetic type or a symbol equated to an absolute constant expression with an arithmetic type. Each constant is converted to a floating-point value in IEEE single-precision 32-bit format.
The .float directive aligns the floating-point constants on the long-word boundary, while the .xfloat directive does not.
The 32-bit value is stored exponent byte first, least significant word of fraction second, and most significant word of fraction third, in the format shown in Figure 5-6.
The .xldouble directive places the IEEE double-precision floating-point representation of a double floating-point constant into two words in the current section. The value must be an absolute constant expression with an arithmetic type or a symbol equated to an absolute constant expression with an arithmetic type. Each constant is converted to a floating-point double value in IEEE double-precision 64-bit format. The 64-bit value is stored exponent byte first, least significant word of fraction second, and most significant word of fraction third.
When you use .float in a .struct/.endstruct sequence, .float defines a member's size; it does not initialize memory. For more information, see the .struct/.endstruct/.tag topic.
Following are examples of the .float and .xfloat directives:
1 00000000 5951 .float -1.0e25
00000001 E904
2 00000002 0010 .byte 0x10
3 00000003 0000 .xfloat 123.0 ; not on long-word boundary
00000004 42F6
4 00000006 0000 .float 3 ; aligns on long-word boundary
00000007 4040