Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2243 PIC14 for loop i declared as unsigned int will loop only once

open
nobody
None
PIC14
5
2014-01-31
2014-01-21
Athena Chuang
No

SDCC : 3.3.1 #8894 (Nov 9 2013) (Linux)

unsigned int i;
for (i = 0; i < 8; i++)

The loop will run only once, seems because "0000e6 3000 movlw 0" should be
"0000e6 3008 movlw 8"

Here is the section of lst file.

                                       ;; >>> gen.c:3265:pic14_mov2w_regOrLit

0000e6 3000 movlw 0 MOVLW 0x00
;; >>> gen.c:3432:genCmp
;; 1109 rIdx = r0x1049
0000e7 022d subwf 0x2d, w SUBWF r0x1001,W
;; >>> gen.c:3477:genCmp
0000e8 1d03 btfss 0x3, 0x2 BTFSS STATUS,2

1 Attachments

Discussion

  • Maarten Brock
    Maarten Brock
    2014-01-31

    • Category: other --> PIC14