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