Does anyone know how to prevent MCPP outputing a newline for a #if, #ifdef, #ifndef and #endif line where the condition is satisfied? For example, here's a section of my source file:
; Couplers.
#ifdef SS4
ss4 EQU SS4
#endif
#ifdef SS16
ss16 EQU SS16
#endif
#ifdef SS8
ss8 EQU SS8
#endif
#ifdef CC4
cc4 EQU CC4
#endif
#ifdef CC16
cc16 EQU CC16
#endif
#ifdef CC8
cc8 EQU CC8
#endif
#ifdef SR8
sr8 EQU SR8
#endif
#ifdef GR8
gr8 EQU GR8
#endif
#ifdef CR8
cr8 EQU CR8
#endif
#ifdef GP8
gp8 EQU GP8
#endif
#ifdef SP8
sp8 EQU SP8
#endif
#ifdef SP4
sp4 EQU SP4
#endif
#ifdef CP8
cp8 EQU CP8
#endif
And here's the output generated by MCPP:
; Couplers.
ss4 EQU 12
ss16 EQU 13
gp8 EQU 60
sp8 EQU 61
sp4 EQU 62
cp8 EQU 59
This would be much better:
; Couplers.
ss4 EQU 12
ss16 EQU 13
gp8 EQU 60
sp8 EQU 61
sp4 EQU 62
cp8 EQU 59
How can I get it to do this? As far as I can see, the newlines terminating the #if and #endif are mandatory, but I can't find a way of stopping them being copied to the output. This seems illogical and restrictive…
Thanks - Rowan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does anyone know how to prevent MCPP outputing a newline for a #if, #ifdef, #ifndef and #endif line where the condition is satisfied? For example, here's a section of my source file:
; Couplers.
#ifdef SS4
ss4 EQU SS4
#endif
#ifdef SS16
ss16 EQU SS16
#endif
#ifdef SS8
ss8 EQU SS8
#endif
#ifdef CC4
cc4 EQU CC4
#endif
#ifdef CC16
cc16 EQU CC16
#endif
#ifdef CC8
cc8 EQU CC8
#endif
#ifdef SR8
sr8 EQU SR8
#endif
#ifdef GR8
gr8 EQU GR8
#endif
#ifdef CR8
cr8 EQU CR8
#endif
#ifdef GP8
gp8 EQU GP8
#endif
#ifdef SP8
sp8 EQU SP8
#endif
#ifdef SP4
sp4 EQU SP4
#endif
#ifdef CP8
cp8 EQU CP8
#endif
And here's the output generated by MCPP:
; Couplers.
ss4 EQU 12
ss16 EQU 13
gp8 EQU 60
sp8 EQU 61
sp4 EQU 62
cp8 EQU 59
This would be much better:
; Couplers.
ss4 EQU 12
ss16 EQU 13
gp8 EQU 60
sp8 EQU 61
sp4 EQU 62
cp8 EQU 59
How can I get it to do this? As far as I can see, the newlines terminating the #if and #endif are mandatory, but I can't find a way of stopping them being copied to the output. This seems illogical and restrictive…
Thanks - Rowan