> s_out macro somebyte
> movlw somebyte
> endm
>
> Given that macro, can someone tell me why I get this error:
>
> Error[124] C:\PROGRA~1\MPLAB\SEROUT.ASM 20 : Illegal argument
> (expected single character)
> I have tried (as you suggested):
>
> s_out macro s
> movlw s
> endm
JB:
What Dennis meant is that when you USE the macro, you have to give it
a single character. It doesn't matter whether the macro variable is
called "s" or "somebyte"; the important thing is that DOWN BELOW,
when you say "s_out x", the "x" has to be a single character.
If I follow what you're saying, then it works for you, but not for me. I'm
using MPLAB 4.12 - could that be a problem here?
It's sure a mystery, but if it doesn't work, then so be it. It's not a big
deal - just frustrating that something I've used for years (in other
assembly languages) doesn't work as expected and especially maddening that
the help file doesn't...help. My instincts tell me it's one of those really
obvious things that I'm missing, but I just don't see it. No doubt it'll
hit me one day when I least expect it.
> s_out 'a'
>
> is exactly what I was using to "call" it.
JB:
Uh... Are you SURE? As I recall, one of the error messages that you
said that MPASM generated was "Illegal Character 'x'"... Might you
have been trying to do something like "s_out 0x0D"?
If so, try representing that carriage-return as 00DH or H'0D' and see
if that works.
Also... There was an issue with single- and double-quotes in some
versions of MPASM; if you WERE just doing "s_out 'a'", try
Command line: "C:\PROGRA~1\MPLAB\MPASMWIN.EXE /e+ /l+ /c+ /p16F84 /q
SEROUT.ASM"
Warning[224] C:\PROGRA~1\MPLAB\SEROUT.ASM 28 : Use of this instruction is
not recommended.
Warning[224] C:\PROGRA~1\MPLAB\SEROUT.ASM 30 : Use of this instruction is
not recommended.
Error[124] C:\PROGRA~1\MPLAB\SEROUT.ASM 14 : Illegal argument (expected
single character)
Error[108] C:\PROGRA~1\MPLAB\SEROUT.ASM 14 : Illegal character (×)
> Okay, I've now tried this at two computers, both with 4.12, both give
> me the same errors. File attached if anyone feels like running it
> through. I tried as Andrew suggested, using the double-quotes, but it
> didn't make a difference.
JB:
Glad you finally attached the file. Your problem is in the line
marked with a "<<<<<<<<":
That seems to be the problem line. What exactly do you expect the macro
expansion of
movlw ''
to generate? Try putting a space between those quotes.
Jason Harper
> Okay, I've now tried this at two computers, both with 4.12, both give
> me
> the same errors. File attached if anyone feels like running it
> through. I
> tried as Andrew suggested, using the double-quotes, but it didn't
> make a
> difference.
>
> Again, This is what I get:
>
> Building SEROUT.ASM...
>
> Command line: "C:\PROGRA~1\MPLAB\MPASMWIN.EXE /e+ /l+ /c+ /p16F84
> /q
> SEROUT.ASM"
> Warning[224] C:\PROGRA~1\MPLAB\SEROUT.ASM 28 : Use of this
> instruction is
> not recommended.
> Warning[224] C:\PROGRA~1\MPLAB\SEROUT.ASM 30 : Use of this
> instruction is
> not recommended.
> Error[124] C:\PROGRA~1\MPLAB\SEROUT.ASM 14 : Illegal argument
> (expected
> single character)
> Error[108] C:\PROGRA~1\MPLAB\SEROUT.ASM 14 : Illegal character (W)
>
> MPLAB is unable to find output file "SEROUT.hex".
>
> Build failed.
>
>
>
When in doubt, look in the .lst file. In this case, you will see that the
error appears immediately after the line that caused it. However, I will
guess that it is your use of '' rather than ' ' for a space. -- Rich
> Date: Wed, 29 Mar 2000 12:21:17 -0700
> From: jb <RemoveMEjbTakeThisOuTCI.GLENWOOD-SPRINGS.CO.US>
> Reply-To: pic microcontroller discussion list <spamBeGonePICLISTspamBeGoneMITVMA.MIT.EDU>
> To: TakeThisOuTPICLISTEraseMEspam_OUTMITVMA.MIT.EDU
> Subject: Re: 16f84 macro error
>
> Okay, I've now tried this at two computers, both with 4.12, both give me
> the same errors. File attached if anyone feels like running it through. I
> tried as Andrew suggested, using the double-quotes, but it didn't make a
> difference.
>
> Again, This is what I get:
>
> Building SEROUT.ASM...
>
> Command line: "C:\PROGRA~1\MPLAB\MPASMWIN.EXE /e+ /l+ /c+ /p16F84 /q
> SEROUT.ASM"
> Warning[224] C:\PROGRA~1\MPLAB\SEROUT.ASM 28 : Use of this instruction is
> not recommended.
> Warning[224] C:\PROGRA~1\MPLAB\SEROUT.ASM 30 : Use of this instruction is
> not recommended.
> Error[124] C:\PROGRA~1\MPLAB\SEROUT.ASM 14 : Illegal argument (expected
> single character)
> Error[108] C:\PROGRA~1\MPLAB\SEROUT.ASM 14 : Illegal character (×)
>
> MPLAB is unable to find output file "SEROUT.hex".