Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
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?)
 

it is a relative goto : program counter goes to the current place +1, +2 or -xx
you can ask for -127 to +128 instructions before or after the current place.
 
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top