I could, yes.
But that would be just one user asking for a seldom used compiler extention, imho...
I'll do with what i have.
I've been looking at these library functions from rtshc08.c:
#pragma NO_EXITvoid _PUSH_CC(void) {/* DESC: push condition code without affecting any other register IN: CC OUT: WRITTEN: */ asm { PSHA ; // save A TPA ; // save CC on stack PSHA LDA 4,SP ; // push return address PSHA LDA 4,SP PSHA LDA 4,SP ; // reload A RTS ! {H+X+A}, {SR} }}#pragma NO_EXITvoid _POP_CC(void) {/* DESC: pop condition code without affecting any other register IN: OUT: CC WRITTEN: */ asm { STA 4,SP ; // save A PULA ; // move return address to the place of '_PUSH_CC' STA 4,SP PULA STA 4,SP PULA ; // restore CC TAP PULA ; // restore A RTS ! {H+X+A+SR}, {} }}
Here the compiler clearly knows about CC aka SR.
Looking at generated code: the compiler uses the above functions quite often.
Could you (or someone else) explain what these do, please ? :
RTS ! {H+X+A}, {SR}
RTS ! {H+X+A+SR}, {}
I have been reading the help about "In & Gen Sets" but i still dont understand it quite...
Message Edited by MrBean on 2009-05-12 16:56 04:56 PM