PBP and assembler mixing - weird goings-on?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2005
    Posts
    27

    Default PBP and assembler mixing - weird goings-on?

    Hi,

    I've been dabbling with mixing some asssembler with PBP and can't understand why the following is happening... Consider this code:

    ;-------------------------------
    VAR BYTE loop

    main: FOR loop = 0 to n
    TOGGLE PORTb.3
    NEXT
    ASM
    _fred
    clrw
    movwf (anywhere)
    movlw .255
    movwf (anywhere)
    goto _fred
    ENDASM

    END
    ;-------------------------------

    Sure enough, when this code is run, the loop executes for n times, then the code falls through into the assembly language section, but instead of looping infinitely to _fred, it pops back out and goes back to main: ???

    Why is it doing this?

    Giulio

  2. #2
    Join Date
    Mar 2006
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Watch Dog Timer timeout ?

    If you have the watchdog timer enabled, the processor will reset and go back to main.

  3. #3
    Join Date
    Aug 2005
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    Aha! Good tip. Wasn't aware of the PBP defaults. Will try. Thanks for the reply!

    Giulio

Similar Threads

  1. Replies: 14
    Last Post: - 4th October 2006, 05:45
  2. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30

Members who have read this thread : 1

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