I imagine how easy it would be for you guys to translate from one to the other, but my experience with Assembly is very limited -just did a few subroutines 20 years ago for an 8088 and practically forgot everything-, and with my current knowledge of PIC programming I wouldn't be able to; probably not even a one liner like that one...You don't need to change to assembler. Access to hardware registers is the same as in C.
Compare:
Rich (BB code):bsf LATA, 2Rich (BB code):LATABits.LATA2 = 1;
much less something like this that I just saw on the datasheet:
Rich (BB code):
EXAMPLE 7-2: READING A 16-BIT FREE RUNNING TIMER
; All interrupts are disabled
MOVF TMR1H, W ; Read high byte
MOVWF TMPH
MOVF TMR1L, W ; Read low byte
MOVWF TMPL
MOVF TMR1H, W ; Read high byte
SUBWF TMPH, W ; Sub 1st read with 2nd read
BTFSC STATUS, Z ; Is result = 0
GOTO CONTINUE ; Good 16-bit read
; TMR1L may have rolled over between the read of the high and low bytes.
; Reading the high and low bytes now will read a good value.
MOVF TMR1H, W ; Read high byte
MOVWF TMPH
MOVF TMR1L, W ; Read low byte
MOVWF TMPL ; Re-enable the Interrupt (if required)
CONTINUE ; Continue with your code
Last edited: