CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

restart_cause()

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Torello



Joined: 29 Sep 2006
Posts: 114

View user's profile Send private message

restart_cause()
PostPosted: Sun Jan 24, 2010 6:39 am     Reply with quote

Hi,

Looking at the compiled asm (pic18lf8627) of CCS restart_cause()
function. I don't understand several instructions. Can anyone fill in?
My comment behind asm.
Why setting status bits negative and OV?
Did CCS forget the Stack reboot causes?

Kind regards,
Edwin
PCWHD 4.103 / windows 7
Code:

006F8:  MOVF   FD0,W    // get RCON
006FA:  ANDLW  0F        // Copy upper 4 bits,  not RI !
006FC:  BTFSS  FD0.4    //  test the RI (reset) flag ..
006FE:  MOVLW  00        //  and clear W if RI is set (reset instruction reboot)
00700:  BSF    FD0.0    //set BOR
00702:  BSF    FD0.1    //set POR
00704:  BSF    FD0.4    //Set RI
00706:  BSF    FD8.3    //Set Status reg bit OV (flag result overflow.. why?)
00708:  BSF    FD8.4    //Set Status reg bit N (flag result negative.. why?)
0070A:  MOVLB  1
0070C:  MOVWF  xCC
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group