2007-01-10 08:05 AM
2007-01-08 02:09 PM
Hi,
The datasheet for st72325 states that under certain conditions the interrupt controller will not recognize the source of an interrupt and that to solve the problem, QUOTE '' Workaround To solve this issue, a “POP CC� instruction must always be preceded by a “SIM� instruction. '' END QUOTE I am using C and a COSMIC compiler to write the code. Does the COSMIC compiler insert a ''SIM '' instruction before a ''POP CC'' instruction? And generally, for all similar issues for which the solution is in software, does the compiler do it for me, i.e. are the COSMIC people aware of all these issues and do they include them in code generation? Thanks, zsavov2007-01-09 04:50 AM
Hi,
Thank you for your interest. Frommy experience, i don't see any conditions were a C code can generate a POP CC instruction. So, I don't think you should get this limitation. Best regards Laurent2007-01-09 05:53 PM
Hi,
QUOTE Frommy experience, i don't see any conditions were a C code can generate a POP CC instruction END QUOTE Are you saying that the C compiler will never generate a POP CC instruction? It seems to me POP is a very general operation so not using it when generating the assembly code would be impossible! Thank you2007-01-09 08:55 PM
I would agree with Laurent, the core will always save/restore all regsiters except Y as part of the interrupt call, so unless you are writing a kernel nearly all application would never need to perform a pop CC.
Regards sjo2007-01-09 10:11 PM
2007-01-10 08:05 AM
In order to avoid whichever problem, in all my ST7 applications, I prefer to implement all used interrupt, handelrs routines in pure ST7 assembler using #asm #endasm directives.
In this way I have the complete stack and CC control and I have not never found problems in the interrupt management. Of course this is one nostalgic consequence of my old experience in the assembler programming. Sixtus