<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Re:Re code does not execute properly</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14522/re-re-code-does-not-execute-properly</link><description> 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 &amp;lt;REG51F.H&amp;gt; 
extern void led_wr(unsigned char x); 
extern void bit_op(void); 
extern char ADSCAL_COMM;</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Re:Re code does not execute properly</title><link>https://community.arm.com/thread/37863?ContentTypeID=1</link><pubDate>Tue, 11 Sep 2001 03:18:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1a8588e9-74e6-4a9a-b425-8b2ae5a47cae</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;You seem to have started a new thread, instead of adding your reply to the existing thread.&lt;br /&gt;
&lt;br /&gt;
when posting code, don&amp;#39;t forget to use the &lt;b&gt;&amp;amp;ltpre&amp;amp;gt&lt;/b&gt; and &lt;b&gt;&amp;amp;lt/pre&amp;amp;gt&lt;/b&gt; tags - see the &amp;#39;Tips for Posting Messages&amp;#39; on the left; &lt;i&gt;eg,&lt;/i&gt;&lt;pre&gt;unsigned int i;
void main()
{
   started();
   boot1(); // This function calls assembly boot routine.
   while(1)
   {
      bit_op();
      led_wr(0xff);
   }
}&lt;/pre&gt;
&lt;br /&gt;
Your assembler function doesn&amp;#39;t seem to have a &lt;b&gt;RET&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Re:Re code does not execute properly</title><link>https://community.arm.com/thread/37858?ContentTypeID=1</link><pubDate>Tue, 11 Sep 2001 02:07:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:340c547d-0651-49e5-91d1-dbaae5041f41</guid><dc:creator>Sven Petersen</dc:creator><description>&lt;p&gt;Hi!&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
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
&lt;/pre&gt;
&lt;br /&gt;
are you sure that PGM_MTP returns? To me it looks like that might cause the problem. Maybe try to check Your Portpin P1^6 with a scope.&lt;br /&gt;
&lt;br /&gt;
You set PGM_MTP tp a fix address, but what routine do you have there? Can you be sure that it is always in that location?&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>