Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/12/03 16:18
Read: times


 
#50551 - RE: PSW.5 (General Purpose Flag F1)
Responding to: ???'s previous message
OK the contest continues. I have also tried the F1 user flag that is at PSW.1. It also gets mashed via the Keil compiler generated code. Not inside the sprintf() call, mind you, but inside of an interrupt routine that has the USING attribute set. It seems that for performance reasons inside of the interrupt routine that in order to setup the alternate register sets they push PSW at the start of the interrupt and then do a move of immediate constant to the PSW to set the new register select bits. This is done as opposed to a more robust, albeit more instructions than this solution:


For a USING 1 interrupt....
 Keil does:
     PUSH PSW
     MOV  PSW, #08H
      ...
     POP  PSW
 As opposed to this which would preserve other flags:
     PUSH PSW
     SETB PSW.3
     CLR  PSW.4
      ...
     POP  PSW

See the chart below for reference to the PSW bits I am discussing here.



Peter has mentioned that I should stay away from the "standard" procesor registers and find a global bit elsewhere. Well it seems that I will have to. PSW is of no help at all becasue I choose to write the application program in Keil C51 as opposed to assembler language. Peter also commented that I could look to PCON for a possible bit. Unfortunatelu the Cygnal processor that I am using has just two bits in its PCON, namely the STOP and IDLE bits, both or which are not useable as a global flag of the sort that I need.

There is next the possibility of trying to use a global data variable or one of the BIT memory variables for my use. I was trying to stay away from that solution because I was attempting to make a general purpose solution for this boot loader that didn't put any DATA and IDATA rules on the C code application. To use a part of IDATA or DATA is making a rule that every application program for use in the the boot loader environment must stay away from the location that this variable is stored in.

Does anybody have any further ideas or comments?

Michael Karas


List of 16 messages in thread
TopicAuthorDate
PSW.5 (General Purpose Flag F0)            01/01/70 00:00      
   RE: PSW.5 (General Purpose Flag F0)            01/01/70 00:00      
   RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
      RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
         RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
            RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
      RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
         RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
            RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
               RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
                  RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
                     RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
                        RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
                           RE: PSW.5 (General Purpose Flag F1)            01/01/70 00:00      
   RE: PSW.5 (General Purpose Flag F0)            01/01/70 00:00      
      RE: PSW.5 (General Purpose Flag F0)            01/01/70 00:00      

Back to Subject List