From: Kustaa N. <Kus...@pl...> - 2015-02-18 05:23:16
|
Hi, it looks to me that the source code line numbers in the .asm file for PIC16 port do match. Lines are missing and the code generated does not correspond to the referred to lines. Is this a known issue? Any workarounds? Worth reporting as bug? br Kusti Below is an example, starting from C-source code line 135: int32_t get_position(uint8_t i) { uint8_t stp; uint8_t dlt; uint32_t pos; uint8_t dir; do { stp = g_low_pri_isr_guard; dlt = g_stepper_states[i].last_steps - g_stepper_states[i].steps; pos = g_stepper_states[i].position; dir = g_stepper_states[i].last_dir; } while (stp != g_low_pri_isr_guard); if (dir) pos += dlt; else pos -= dlt; return pos; } This gets compiled to: ; ; Starting pCode block S_main__get_position code _get_position: ; .line 135; main.c stp = g_low_pri_isr_guard; MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVFF r0x02, POSTDEC1 MOVFF r0x03, POSTDEC1 MOVFF r0x04, POSTDEC1 MOVFF r0x05, POSTDEC1 MOVFF r0x06, POSTDEC1 MOVFF r0x07, POSTDEC1 MOVFF r0x08, POSTDEC1 MOVFF r0x09, POSTDEC1 MOVFF r0x0a, POSTDEC1 MOVFF r0x0b, POSTDEC1 MOVFF r0x0c, POSTDEC1 MOVFF r0x0d, POSTDEC1 MOVFF r0x0e, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 ; ;multiply lit val:0x11 by variable r0x00 and store in r0x00 ; .line 140; main.c if (dir) MOVF r0x00, W MULLW 0x11 MOVF PRODH, W MOVWF r0x01 MOVFF PRODL, r0x00 MOVLW LOW(_g_stepper_states) ADDWF r0x00, F MOVLW HIGH(_g_stepper_states) ADDWFC r0x01, F MOVF r0x00, W ADDLW 0x08 MOVWF r0x02 MOVLW 0x00 ADDWFC r0x01, W MOVWF r0x03 MOVF r0x00, W ADDLW 0x06 MOVWF r0x04 MOVLW 0x00 ADDWFC r0x01, W MOVWF r0x05 MOVF r0x00, W ADDLW 0x0d MOVWF r0x06 MOVLW 0x00 ADDWFC r0x01, W MOVWF r0x07 MOVLW 0x09 ADDWF r0x00, F BTFSC STATUS, 0 INCF r0x01, F _00117_DS_: ; .line 141; main.c pos += dlt; MOVFF _g_low_pri_isr_guard, r0x08 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. |