各位大哥,小弟有一个问题搞了很久还是没有搞明白过来:
我把FLASH当做EEPROM用,在Release无法编译。在DEBUG下没有问题
报错:cost7: bad branch label 0x72,#0,EEPROM_Prog//
程序代码:
void Copy_code_ram(void)
{
#asm
/*XemulE2_ByteProg:
LD $f0,A ; Data to be programmed (00f0h) is in A
LD 0xf1,X ; High address to be programmed (00f1h) in X
LD 0xf2,Y ; Low address to be programmed (00f2h) in Y
LD X,#$0C ; Copy programming software driver
bres 0,#1 ;// TEST
*/
ld x,#0x0c;
RAM_Copy:
LD A,(RAM_Driver,X)
LD ($f3,X),A
DEC X
JRPL RAM_Copy
SIM //; Disable interrupts
JP $f3 //; Call the programming driver located in RAM
#endasm
}
#pragma section (code_ram)
void code_ram_Driver(void)
{
#asm
RAM_Driver:
BSET 0x72,#1 //; Enable Emul. EEPROM latches
LD A, 0xf0
LD [0xf1.w],A //; Set address/data to be programmed
BSET 0x72,#0//; Launch the Emul. EEPROM programming
EEPROM_Prog:
nop
nop
BTJT 0x72,#0,EEPROM_Prog//; Wait for end of programming (~5ms)
RET
#endasm
}
#pragma section() |