Searching \ for 'MPASM message' 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/language/index.htm?key=asm
Search entire site for: 'MPASM message'.

Truncated match.
PICList Thread
'MPASM message'
1995\08\27@001451 by Walter Anderson

flavicon
face
I'm getting a Message[302] in the following code and I do not
understand what I have done wrong to cause it.  Any ideas?

0023                00054 START
0023 1683           00056                 bsf     STATUS, RP0
0024 0064           00057                 clrwdt
0025 30A0           00058                 movlw   B'10100000'
0026 008B           00059                 movwf   INTCON
0027 30D4           00060                 movlw   B'11010100'
Message[302]: Argument out of range.  Least significant bits used.
0028 0081           00061                 movwf   OPTION_REG
0029 1283           00062                 bcf     STATUS, RP0

1995\08\27@011206 by Andrew Warren

face
flavicon
face
Walter Anderson <spam_OUTkhadfwTakeThisOuTspamONRAMP.NET> wrote:

>I'm getting a Message[302] in the following code and I do not
>understand what I have done wrong to cause it.  Any ideas?
>
>0023                00054 START
>0023 1683           00056                 bsf     STATUS, RP0
>0024 0064           00057                 clrwdt
>0025 30A0           00058                 movlw   B'10100000'
>0026 008B           00059                 movwf   INTCON
>0027 30D4           00060                 movlw   B'11010100'
>Message[302]: Argument out of range.  Least significant bits used.
>0028 0081           00061                 movwf   OPTION_REG
>0029 1283           00062                 bcf     STATUS, RP0

Walter:

You haven't done anything wrong; the PIC's opcodes are only wide enough
to hold 7-bit addresses, which is why the "RP0" bit need to be set
before accessing registers with addresses greater than 7F.

The message refers to the "movwf OPTION_REG" instruction.  OPTION_REG
is at address 81 (too large to fit in the instruction), so MPASM uses
the least-significant 7 bits of the address (01).  If you examine the
generated machine-code ("0081"), you'll see that "movwf 81" actually
assembled to "movwf 01".

Your code will work just fine.  If you want to avoid this message in
the future, change the instruction to "movwf OPTION_REG ^ 0x80", or
change the OPTION_REG equate to "OPTION_REG EQU 0x81 ^ 0x80".

Or you could just leave it alone... I would, since the next version of
MPASM will allow messages, warnings, and errors to be individually
suppressed.

-Andy

--
Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
Fast Forward Engineering, Vista, California

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