> main: > bsf STATUS,RP0 > clrf TRISA > bcf STATUS,RP0 > > call Thesub ; call it and then fall through into it > > Thesub: > movlw 0x01 > xorwf PORTA,f > retlw 0 ; this should jump to Thesub according to your > ; description (pop keeps popping the last value) I do not see how this construct depends on the (you assume a 12-bit core? => 2-entry) stack preserving its deepest value. The call pushes 'Thesub' and jumps to it, stack is now (left is top) 'Thesub', X the PC executes the subroutine, pops 'Thesub' and returns. stack is now X, X execution continues at 'Thesub' (again), at the retlw X is popped an the PIC goes to never-never. BTW the above (calling a sub that follows the call) can be a usefull construct, I used it in the Wisp firmware (or at least it was available in my include files, I can not find an actual use of it): ; convert w to two hex values in w, high nibble first convert_w_to_hl_hex macro local same = 1 local w = 0 cblock _file_1#v($) endc local temp = _file_1#v($) local do_it movwf temp call do_it swapf temp, same do_it swapf temp, w andlw H'0F' endm ;use send_w_hl convert_w_to_hl_hex send_w ret Wouter van Ooijen Van Ooijen Technische Informatica: http://www.voti.nl Jal compiler for PIC uC's: http://www.voti.nl/jal PICs kopen? http://www.voti.nl/shop -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.