$-2 ????


Closed Thread
Results 1 to 3 of 3

Thread: $-2 ????

  1. #1
    Join Date
    Dec 2005
    Posts
    21

    Default $-2 ????

    Hi,
    the third line of the code I have not met her/it yet, that means?

    movf TMRO, f
    btfss STATUS,Z
    goto $- 2

    thx

    by
    chip15

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The $ represents the CURRENT Program Counter value in MPASM assembler. When this instruction is encountered, the MCU will jump forward (+) or back (-) the given number of memory locations.

    goto $-2

    Jump back two memory locations and continue execution from that point.

    goto $+1

    Continue execution from the NEXT memory location. This example is a neat way of saving codespace instead of using two sequential NOP statements.

  3. #3
    Join Date
    Dec 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Thx!

    THX Melanie. Smack!

Similar Threads

  1. How to drive the Vinculum VDIP1 in UART mode
    By BrianT in forum Code Examples
    Replies: 41
    Last Post: - 23rd May 2013, 12:34
  2. Replies: 4
    Last Post: - 15th April 2009, 01:54
  3. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts