Dear PIC enthusiasts, I just stumbled across this snippet of code for (16 bit instruction set) 17c PICs.
;*************************************************************** ;* Macro LONGC ;Long Call ;by Walter Quitt ; for 17c PICs ; http://piclist.org/techref/microchip/17inst.htm ;*************************************************************** LONGC MACRO SUBROUTINE bsf CPUSTA,GLINTD ;interrupts off movlw HIGH (SUBROUTINE) movfp WREG,PCLATH ;Z unaffected bcf CPUSTA,GLINTD ;interrupts on lcall LOW (SUBROUTINE) ; (a single instruction on the 17c7xx, not the 3 instruction macro on 14 bit cores). ENDMUm... I fail to see the point. Is there ever any reason to use that rather than this shorter, faster, less interrupt-latency-inducing code:
;*************************************************************** ;* Macro LONGC ;Long Call ;originally by Walter Quitt ; for 17c PICs ; 2001-06-16:DAV: removed extraneous (?) instructions ; http://piclist.org/techref/microchip/17inst.htm ;*************************************************************** LONGC MACRO SUBROUTINE movlw HIGH (SUBROUTINE) movwf PCLATH ;Z unaffected lcall LOW (SUBROUTINE) ; (a single instruction on the 17c7xx, not the 3 instruction macro on 14 bit cores). ENDM? Am I overlooking something obvious in the datasheet http://www.microchip.com/0/lit/pline/picmicro/ or the errata http://www.microchip.com/0/lit/suppdoc/errata/index.htm ? -- David Cary -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.