From: SourceForge.net <no...@so...> - 2006-05-24 05:29:42
|
Bugs item #1494019, was opened at 2006-05-24 05:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1494019&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pic16 target Group: None Status: Open Resolution: None Priority: 5 Submitted By: Vern98 (vern98) Assigned to: Nobody/Anonymous (nobody) Summary: functions do not grab arguments from data memory correctly Initial Comment: In my attached zip file, I have code that breaks and code that works. The "broken" code will produce assembly that looks like this: ; .line 32; test.c void LCD_Cursor (unsigned char row, unsigned char column) MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 MOVLW 0x03 MOVFF PLUSW2, r0x00 The "working" produces assembly like this: ; .line 32; test.c void LCD_Cursor (unsigned char row, unsigned char column) MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 MOVLW 0x03 MOVFF PLUSW2, r0x01 As you can see, the "broken" code uses r0x00 for both variables "row" and "column". Included in the zip file are 2 examples of how to "fix" the broken code. 1) comment out: "delay10ktcy(time);" 2) Move the LCD_Cursor function to the top of the file. (instead of having a function prototype and defining the function at the end of the file). The command I am using is: sdcc -mpic16 -p18f452 -Wl -m test.c (the makefile is included in the zip file) sdcc -v SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.5.6 # (May 19 2006) (MINGW32) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1494019&group_id=599 |