Exact match. Not showing close matches.
PICList
Thread
'[PIC]: Label in macro problem. What's wrong?'
2001\07\05@174902
by
Thomas N
|
Hi everyone,
I saw many people's code uses label in their macro. But when I try to use
it, MPLAB gives me this error: "Error[116] C:\TEMP\MACRO.ASM 5 : Address
label duplicated or different in second pass (here)"
What's wrong with my code? What do I have to do to get around this
"problem"?
Thank you in advance!
Thomas
; in my main.asm file
list p=16F877
errorlevel -302
org 0x00
goto start
org 0x04
goto start
include p16f877.inc
include "macro.asm"
start
call_test function1
call_test function2
loop
goto loop
;----------------------------------------------
function1
nop
return
;----------------------------------------------
function2
nop
return
end
=============================================
; in my macro.asm file
call_test macro label
goto here
nop
here
call label
endm
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuT
mitvma.mit.edu
2001\07\05@180612
by
Nick Veys
2001\07\05@182103
by
myke predko
Hi Thomas,
The problem is that the labels within the macro are not being declared as
"local". "Local" is a directive which tells the macro assembler that this
label within the macro is only local to this macro and references to any
other labels with the same string should be ignored.
Using "local" try out this version of the macro:
call_test macro label
local here ; <-- "here" is now specific to inside macro
goto here
nop
here
call label
endm
{Original Message removed}
2001\07\05@210601
by
Olin Lathrop
More... (looser matching)
- Last day of these posts
- In 2001
, 2002 only
- Today
- New search...