Jump to content
Sign in to follow this  
rminnig

serious compiler code generation error

Recommended Posts

There is a serious code generation error with the C2C++ compiler.  Note the generated assebly snippet:

 

...

_adresl                         equ 0x9e ;1

_adcon1                         equ 0x9f ;1

_eedata                         equ 0x10c ;1

_eeadr                          equ 0x10d ;1

_eedath                         equ 0x10e ;1

_eeadrh                         equ 0x10f ;1

_eecon1                         equ 0x18c ;1

_eecon2                         equ 0x18d ;1

_this_tick_CPWM_00             equ 0xffffffff ;2

   ORG 0

   goto start__code

 

   ORG 4

   ;;;;;;;;

   ;;;;;;;;// The 16F818 has only 1 interrupt vector

   ;;;;;;;;

   ;;;;;;;;void interrupt(void)

_interrupt

_interrupt_code

   movwf _int_save_cont_W

   swapf _int_save_cont_W, F

   swapf STATUS, W

   movwf _int_save_cont_STATUS

...

 

and when the above is manually changed to:

 

...

_adresl                         equ 0x9e ;1

_adcon1                         equ 0x9f ;1

_eedata                         equ 0x10c ;1

_eeadr                          equ 0x10d ;1

_eedath                         equ 0x10e ;1

_eeadrh                         equ 0x10f ;1

_eecon1                         equ 0x18c ;1

_eecon2                         equ 0x18d ;1

_this_tick_CPWM_00             equ 0x18e ;2

   ORG 0

   goto start_code

 

   ORG 4

   ;;;;;;;;

   ;;;;;;;;// The 16F818 has only 1 interrupt vector

   ;;;;;;;;

   ;;;;;;;;void interrupt(void)

_interrupt

_interrupt_code

   movwf _int_save_cont_W

   swapf _int_save_cont_W, F

   swapf STATUS, W

   movwf _int_save_cont_STATUS

...

 

it works.

The exact same code works for about a hundred compiles during the day, buat after some amount of time in the same project the code all of a sudden gets messed up as in the bolded lines above.  If the EXACT same code is duplicated in a new project then it compiles without error.  Any ideas on this one?  Note because of a bug in the forum some of the double underscores in the generated assembly have been trucated to singel underscores.

 

-Ryan

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...