Compile errors within macro....


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Also after checking my code, it won't work... MPASM IF ... ENDIF don't work like that... sorry.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    forgie's Avatar
    forgie Guest


    Did you find this post helpful? Yes | No

    Smile

    Thanks Darrel,
    I will change the structure of the macro to eliminate this problem, but in the meantime, can you be a bit more specific about the labelling problem? I can't be content with a problem until I understand it!

    And mister_e, I think your example would end up comparing the address of Dist_To_Print with 200, not the variable itself.... the macro assembly stage can't make decisions based on realtime variables

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Talking

    The following
    Code:
    IF A<20 THEN A=0
    will compile something like this
    Code:
    CMPGE?BCL	_A, 014h, L00001
    MOVE?CB	000h, _A
    LABEL?L	L00001
    It call CMPGE?BCL =>Compare Greater/Equal a Byte Against a constant and jump to L00001 if False

    As previously said, when you call a macro it duplicate the whole code. Something like
    Code:
    CMPGE?BCL	_A, 014h, L00001
    MOVE?CB	000h, _A
    LABEL?L	L00001	
    '/////////////////// blah blah blah here \\\\\\\\\\\\\\\\\\\\\\\\\\\\
    CMPGE?BCL	_A, 014h, L00001
    MOVE?CB	000h, _A
    LABEL?L	L00001
    You have two L00001 generated and unfortunately we/you have no control on that.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Unable to pass a variable to LCDOUT without getting compile errors
    By Ferroto Baggins in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th February 2010, 17:43
  2. USB PBPL Compile errors
    By Rob in forum USB
    Replies: 11
    Last Post: - 7th April 2008, 09:18
  3. USB Mpasm Compile errors
    By JBrannan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st December 2007, 19:13
  4. Try to Compile 18F4550 Macro missing
    By Denicou in forum USB
    Replies: 7
    Last Post: - 28th January 2007, 23:24
  5. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th December 2005, 00:30

Members who have read this thread : 0

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