what is $+1 or $-1 succeeded by goto instruction in PIC???

Status
Not open for further replies.

ashwini jayaraman

Member level 2
Joined
Jan 17, 2013
Messages
49
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,601
Hello members,

I found out how to calculate instruction cycles for PIC..now I m wondering what that $+1 or $+2 etc actually mean..is that denotes no of instruction cycles to be added or subtracted from the goto ins cycle??? (always 2 right?)
 

I want to learn the pic programming which method of programming is more easy ; "BASIC" or "C" ?
also please suggest basic pic programming guide for starting PIC programing.
 

I want to learn the pic programming which method of programming is more easy ; "BASIC" or "C" ?
also please suggest basic pic programming guide for starting PIC programing.

If you are going to use PICs I strongly suggest you use C
There is a great downloadable book with illustrations (or there was) on the mikro web site
Their C compiler is also free to download that works with it.
 

Hi,

The previous answers should have explained the use of the $ instruction, though it is often seen as not good programming practice to use it.

If you migrate the code to other chips like the Pic18F range then those values are invalid.

Much better to replace the $+ with simple labels

Code:
decfsz d1, f
      goto $+2
      decfsz d2, f
       goto $+2
       decfsz d3, f
        goto Delay_0

decfsz d1, f
      goto jump1
        decfsz d2, f
 jump1  goto jump2
           decfsz d3, f
 jump2    goto Delay_0
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…