Embedded strings in code mpasm error


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Wout doesn't get defined as a variable. It's an argument passed to the macro at the time the macro is invoked.

    Example: @ GetAddress _String1, _Addr

    The address of String1 gets passed to the macro as the Label argument. The address of your word variable Addr gets passed to the macro as the Wout argument.

    You most likely have wout somewhere VS Wout and have case sensitivity turned ON in MPASM. Start MPASMWIN.EXE and uncheck the case sensitivity option.

    The error from the library file is where the CHK?RP macro can't find Wout either.

    Your code as posted above compiles fine here.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Jul 2010
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Found the problem. Also sorry for the confusion and appreciate all your help. The cause of the problem was bad commenting in the inline assembly. It is not apparent in my posted code as I copied that from my backup code. Seems I was sticking to the PBP way of commenting even in inline assembly.

    Here is why it wouldn't compile.

    Code:
    Bad Code
    
    ASM
    GetAddress macro Label, Wout       'Returns the Address of a Label as a Word
        CHK?RP Wout
        movlw low Label
        movwf Wout
        movlw High Label
        movwf Wout + 1
        endm
    ENDASM
    
    Good Code
    
    ASM
    GetAddress macro Label, Wout       ;Returns the Address of a Label as a Word
        CHK?RP Wout
        movlw low Label
        movwf Wout
        movlw High Label
        movwf Wout + 1
        endm
    ENDASM
    Once again thanks for for help. Didn't catch this to easily as it looked normal to me to use a ' instead of a ;
    Maybe something for others to watch out for too.
    Thanks,
    Bryan

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