Context saving help in assembly - 16f690


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Re: Context saving help in assembly - 16f690

    Hello Darrel, if I do not have to save it, what variables I will use to restore it or how it is restored. Currently I have the following restoration code-
    Code:
    EndInt  ; restore the machine state and return from interrupts
            movf    fsave,w
            movwf   FSR             ; restore FSR
            movf    psave,w
            movwf   PCLATH          ; restore PCH
            swapf   ssave,w
            movwf   STATUS          ; restore Status
            swapf   wsave,f
            swapf   wsave,w         ; restore WREG
            retfie
    2) If PBP saves the context then, can I start straightaway by execution of my code assuming I will be in BANK0?
    Thanks

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Context saving help in assembly - 16f690

    You restore it the same way when PBP saves it.
    PBP uses the wsave, ssave and psave variables that you create.
    PBP does not save the FSR register, and you don't need to save FSR unless your ISR uses it.

    Yes, it will be in BANK0.
    DT

  3. #3
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Re: Context saving help in assembly - 16f690

    Thanks Darrel. It works.

Similar Threads

  1. Context saving in assembly - 16F72 giving problem
    By financecatalyst in forum Off Topic
    Replies: 6
    Last Post: - 3rd August 2012, 20:30
  2. PIC with Automatic Context Saving
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 29th August 2011, 16:16
  3. IDE help context ID location
    By Normnet in forum General
    Replies: 2
    Last Post: - 25th July 2010, 18:14
  4. 16F to 18F context saving differences
    By brittons in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st April 2007, 03:40
  5. I think my interrupt is not saving context properly?
    By royly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th December 2004, 17:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts