嗨,在XC8(1.40免费或1.33Pro版本)中,在具有堆栈类型配置作为可重入的PIC18F26J50项目中,FSR1中的数据堆栈从0x4F4开始。该项目具有以下功能:void ObjRomArray_read(const char*psrc,uint8_t idx,char*pdest,uint8_t objDestSize);函数ObjRomArray_read立即调用,数据堆栈是0x4FE,局部变量的地址被复制到“pdest”参数指针,指针pdest的值指向不正确的值0x5FB而不是0x4FB。----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ObjRomArray_read(tableRef,i,&剂量,尺寸(剂量));0x3DFE:0x3DFE:MOVLW0x30x30x3E00:MOVWPOS
tiNC1,ACCESS0x3E02:MOVLW0xFC0xFC0x0x3E0x3E04:ADDWF FSR1,W,ACCESS0x0x0x3E06:ACCESS0x3E08:MOVWWW0xFF0xFF0x3E0A:ADDWFC FSR1H,W,ACCESS0x0x3x3X3X3X3E04:ADDWFC FSR1,W,ACCESS0x3X3X3X3X3X3E04 E0C:MOVWF POSTINC1,ACCESS0x3E0E:MOVLW 0xF90x3E10:MOVF PLUSW1,W,ACCESS0x3E12:MOVWF POSTINC1,ACCESS0x3E14:MOVFF this_dosTable_objRomRefL,POSTINC10x3E16:NOP0x3E18:NOP0x3E18:MOVC10x3E18:MOVX85POSTINC10x3E1A:NOPC10x3E1A:NOP 0x747A:CALL 0x747A,00x3E1E:NOP--------------------------------------------------------------------------------------------------------------------------------------------函数,数据堆栈(FSR1)从0x504开始,当PC=0x477E时,数据堆栈(FSR1)的值是0x506,而“pdest”指针是0x5FB,而不是0x4FB。void ObjRomArray_read(const char*psrc,uint8_t idx,char*pdest,uint8_t objDestSize){0x747A:MOVF POSTINC1,F,ACCESS0x747C:MOVF POSTINC1,F,ACCESS!恒焦*objSrc=psrc;0x747E:MOVLW0xFC0x74747E: MOVLW 0xFC0x7480: MOVLW 0xFC0x7480: MOVFPLUSW1, 0x510x747482: NOP0x510x510x747482: NOP0x7474747484: MOVLW0xFD0x747486: MOVVLW0x7486: MOVX7486PLUSW1, wtemp10emp10x7488: NOP0x748A: NOP0x748A: NOP0x0x748A: MOVLW0xFF0xFF0xFF0x748C: MOVLW0x748C: MOVVLW0xFF有谁已经有这个问题了?
0