This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Re:Re code does not execute properly

the following code is an IAP routine in assembly being called from a c source :
The return path is not found by the assembly function.

#include <REG51F.H>
extern void led_wr(unsigned char x);
extern void bit_op(void);
extern char ADSCAL_COMM;
extern void boot1();
extern void bit_op(void);
extern void started();

unsigned int i;
void main()
{
started();
boot1();//This function calls assembly boot routine.
while(1){
bit_op();
led_wr(0xff);
}
}

;//assembly function:


PGM_MTP EQU 0XFFF0
CCAPM4 EQU 0XDE
CCAP4l EQU 0XEE
CCAP4H EQU 0XFE
CMOD EQU 0XD9

mov 0XA2,#0x01
clr A
mov P3,A
mov P1,A
setb P1^6;CEX3

mov a,0xa2
orl a,#0x20
mov 0xa2,a ;boot enable

; Erase
mov r0,#0x0b ;Quick Erase: 0x00
mov r0,#0x00
mov r1,#0x01 ;bLOCK ERASE:0X0b
mov dptr,#0x8000
lcall PGM_MTP
clr P1^6
setb EA
end

0