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

F0 flag use by Keil libraries

Hello.

I have a bootloader that use F0 flag to indicate if the bootloader is executing (F0 = 1) or if the application is executing (F0 = 0).

But some Keil library functions modify this flag (float division, 32-bits signed long division, etc).

Somebody can help me with the full list of functions that modify this flag?

I cannnot modify the bootloader because the product is just in production (and sold out).

Parents
  • "Also, I notice that flag F1 is forced to 0 in the entry-code of the ISRs."

    Standard ISR entry will clear the entire PSW, to guarantee BANK0 selection for the ISR handler. You may alter this by declaring different policies for banking. You may also circumvent this by declaring a ASM entry/exit handler that does the context saving/restore, preserving the user flags of PSW on entry for the ISR to check on them. Another, more dangerous approach, is to check the value of PSW pushed into the stack, but this is very sensitive.

Reply
  • "Also, I notice that flag F1 is forced to 0 in the entry-code of the ISRs."

    Standard ISR entry will clear the entire PSW, to guarantee BANK0 selection for the ISR handler. You may alter this by declaring different policies for banking. You may also circumvent this by declaring a ASM entry/exit handler that does the context saving/restore, preserving the user flags of PSW on entry for the ISR to check on them. Another, more dangerous approach, is to check the value of PSW pushed into the stack, but this is very sensitive.

Children
No data