Searching \ for '16f84 macro error' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: '16f84 macro error'.

Truncated match.
PICList Thread
'16f84 macro error'
2000\03\28@210736 by JB

flavicon
face
To read the MPASM help file, this should work:

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)
Error[108]   C:\PROGRA~1\MPLAB\SEROUT.ASM 20 : Illegal character (×)


FYI: Line 20 is the second line in the above macro.

2000\03\28@211427 by Plunkett, Dennis

flavicon
face
The term "somebyte" is to be a single character eg "i" or"j" or"k" etc

Dennis




> {Original Message removed}

2000\03\28@212643 by JB

flavicon
face
At 12:09 PM 3/29/00 +1000, you wrote:
> The term "somebyte" is to be a single character eg "i" or"j" or"k" etc

This is the help file example (which works):

cfl_jge  macro  file, con, jump_to
        movlw  con & 0xff
        subwf  file, w
        btfsc  status, carry
        goto   jump_to
        endm

I have tried (as you suggested):

s_out   macro  s
                       movlw  s
                       endm

and (to copy their examples):
s_out   macro  con
                       movlw  con
                       endm

and:
s_out   macro  con
                       movlw  con & 0xff
                       endm

and:
s_out   macro  file
                       movlw  file
                       endm

and several other variations. Exact same error. Above all of this is:


               ERRORLEVEL      -302
               Processor       16F84
               Radix           HEX
       include <p16f84.inc>
               __config  _XT_OSC & _WDT_OFF & _PWRTE_ON

       cblock  H'0c'
               AA,BB           ;looping regs
               MYBYTE,BITCNT   ;sendbyte temp
       endc

jb

>Dennis
>
>
>
>
>> {Original Message removed}

2000\03\28@221316 by Andrew Warren

face
flavicon
face
JB <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> 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)

and Plunkett, Dennis <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU> replied:

>  The term "somebyte" is to be a single character

which JB misunderstood:

> 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.

In other words, this won't work:

   s_out "hello"

but these will:

   s_out 5
   s_out 'a'
   s_out (5+3)/2

-Andy


=== Andrew Warren - fastfwdspamKILLspamix.netcom.com
=== Fast Forward Engineering - San Diego, California
=== http://www.geocities.com/SiliconValley/2499

2000\03\29@092105 by jb
flavicon
face
> but these will:
>
>     s_out 5
>     s_out 'a'
>     s_out (5+3)/2
>

Maybe on your machine :) The second example:

       s_out 'a'

is exactly what I was using to "call" it.

The actual macro (before stripping it down to nothingness for diagnostic
testing) was like so:

s_out   macro   thebyte
       movlw   thebyte
       call    sendbyte
       endm

then invoke it like this:

       s_out 'G'
       s_out 'o'
       s_out 'o'
       s_out 'd'
       s_out ' '
       s_out 'd'
       s_out 'o'
       s_out 'g'
       s_out 'g'
       s_out 'y'
       s_out H'0d'
       s_out H'0a'

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.

Thanks for the help thus far.

JB

> {Original Message removed}

2000\03\29@094732 by Phillip Vogel

flavicon
face
jb wrote:

>
> then invoke it like this:
>
>         s_out 'G'
>         s_out 'o'
>         s_out 'o'
>         s_out 'd'
>         s_out ' '
>         s_out 'd'
>         s_out 'o'
>         s_out 'g'
>         s_out 'g'
>         s_out 'y'
>         s_out H'0d'
>         s_out H'0a'
>

Try it like this - who knows, maybe it'll work :-)
        s_out 'h'
        s_out 'e'
        s_out 'l'
        s_out 'l'
        s_out 'o'
        s_out ' '
        s_out 'w'
        s_out 'o'
        s_out 'r'
        s_out 'l'
        s_out 'd'
        s_out H'0d'
        s_out H'0a'

2000\03\29@124944 by Andrew Warren

face
flavicon
face
jb <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU> wrote:

> 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

   s_out "a"

instead.

-Andy


=== Andrew Warren - EraseMEfastfwdspam_OUTspamTakeThisOuTix.netcom.com
=== Fast Forward Engineering - San Diego, California
=== http://www.geocities.com/SiliconValley/2499

2000\03\29@141210 by jb

flavicon
face
part 0 1618 bytes
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".

Build failed.



> {Original Message removed}

2000\03\29@143918 by Andrew Warren

face
flavicon
face
jb <PICLISTspamspam_OUTMITVMA.MIT.EDU> wrote:

> 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 "<<<<<<<<":

       s_out   "G"
       s_out   'o'
       s_out   'o'
       s_out   'd'
       s_out   ''      <<<<<<<<<<
       s_out   'D'
       s_out   'o'
       s_out   'g'

You need a space in there; it should read:

       s_out   ' '

-Andy


=== Andrew Warren - @spam@fastfwdKILLspamspamix.netcom.com
=== Fast Forward Engineering - San Diego, California
=== http://www.geocities.com/SiliconValley/2499

2000\03\29@144749 by Jason Harper

picon face
>         s_out   ''

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

2000\03\29@145620 by Andy Kelley

picon face
Insert a space in between the two '' next to each other.


On Wed, 29 Mar 2000 12:21:17 -0700 jb <KILLspamjbKILLspamspamCI.GLENWOOD-SPRINGS.CO.US>
writes:
{Quote hidden}

> > {Original Message removed}

2000\03\29@145623 by Rich Leggitt

picon face
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

On Wed, 29 Mar 2000, jb wrote:

{Quote hidden}

2000\03\29@151318 by jb

flavicon
face
Well, I was right about one thing - it *was* something obvious..

Frankly, I thought there was a space in there - just the way it looked at
1280/1024. Time to either drop my resolution or get glasses.

Many, many, thanks for the help! I owe somebody lunch - if you're ever
headed through Glenwood Springs, CO, drop me an e-mail.

Wow..

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...