Hi,
I've got this statement in main.c: //------------------------------------ hid_tx_buffer.uint8[35] = g_stepper_state[0].position.uint8[3]; //------------------------------------ and it compiles to: //------------------------------------ 0000DA C??? F??? 00630 MOVFF (_g_stepper_state + 3), (_g_stepper_state + 3) 0000DE 51?? 00631 MOVF (_g_stepper_state + 3), W, B 00632 ; removed redundant BANKSEL 0000E0 6F?? 00633 MOVWF (_hid_tx_buffer + 35), B //------------------------------------ Now my question is why is there this MOVFF which looks like totally superfluous? I'm not an expert in PIC assembly so maybe I'm missing something... The declarations for the data structures are as follows. In a header file included in main.c //------------------------------------ typedef union { uint8_t uint8[4]; uint16_t uint16[2]; uint32_t uint32; } uint32_t_multi_view; typedef struct { uint32_t_multi_view position; } stepper_status_t; extern volatile stepper_status_t g_stepper_state[]; //------------------------------------ and in an other header file also included in main.c //------------------------------------ typedef struct { union { uint8_t uint8[64]; uint16_t uint16[32]; uint32_t uint32[16]; int8_t int8[64]; int16_t int16[32]; int32_t int32[16]; }; } hid_buffer_t; extern volatile hid_buffer_t hid_tx_buffer; //------------------------------------ and oh yeah, this is my SDCC on Mac OS X Yosemite: //------------------------------------ /Users/nyholku/sdcc-3.4.0/bin/sdcc -v SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.4.0 #8981 (Apr 5 2014) (Mac OS X i386) published under GNU General Public License (GPL) //------------------------------------ wbr Kusti This e-mail may contain confidential or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. We will not be liable for direct, indirect, special or consequential damages arising from alteration of the contents of this message by a third party or as a result of any virus being passed on or as of transmission of this e-mail in general. ------------------------------------------------------------------------------ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user