Searching \ for '[PIC]: Mplab oddities..' 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/languages.htm?key=mplab
Search entire site for: 'Mplab oddities..'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Mplab oddities..'
2002\01\07@093107 by o-8859-1?Q?K=FCbek_Tony?=

flavicon
face
Hi,
how come the code:

       MOVF    LOW(ARG_24+2),W

Does not work anymore in the latest MPLAB ??
( even trying the LOW(ARG_24)+2 does not work )

Think I'll have to go back to an previous version,
I use this syntax alot.
Anyone knows in which version this has changed ?
( ommiting the LOW causes very odd things, either warnings
or incorrect code ( using upper part of adress )or both :) )



Or how should I write this to be accepted in the lastest version ?


/Tony

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@122252 by Dwayne Reid

flavicon
face
At 03:11 PM 1/7/02 +0100, Kübek Tony wrote:
>Hi,
>how come the code:
>
>         MOVF    LOW(ARG_24+2),W
>
>Does not work anymore in the latest MPLAB ??
>( even trying the LOW(ARG_24)+2 does not work )

I'm assuming its a parsing problem.  As Andy Warren once said: "you can never have too many brackets".  Accordingly, why not try:

    movf    low((ARG_24)+2),W

dwayne



Dwayne Reid   <spam_OUTdwaynerTakeThisOuTspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 17 years of Engineering Innovation (1984 - 2001)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@133000 by Herbert Graf

flavicon
face
{Quote hidden}

       Just wondering, does anybody have a pointer to how one uses this sort of
stuff? I've seen it before but I have NO idea what it means and I feel that
I'm missing out on something very useful here! :) Thanks, TTYL

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\08@045024 by Carlos Ojea

flavicon
face
are you sure that you have the proper memory bank selected?


-----Original Message-----
From: Herbert Graf <.....mailinglistKILLspamspam.....FARCITE.NET>
To: EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU <PICLISTspamspam_OUTMITVMA.MIT.EDU>
Date: lunes 7 de enero de 2002 19:30
Subject: Re: [PIC]: Mplab oddities..


{Quote hidden}

sort of
>stuff? I've seen it before but I have NO idea what it means and I feel that
>I'm missing out on something very useful here! :) Thanks, TTYL
>
>--
>http://www.piclist.com hint: PICList Posts must start with ONE topic:
>[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
>
>

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@045035 by o-8859-1?Q?K=FCbek_Tony?=

flavicon
face
Hi,
thanks for the replies, however I also emailed Microchip
as I suspected something was broken in the assembler.
( there was an note of the latest fixes that was concerning
LOW/HIGH/UPPER and zeropadding ).

I recevied an quick reply  from them( thanks btw ) that stated this was
indeed
the case, the assembler in 5.50 is indeed broken.
I was suggested to use the 5.40 instead. Haven't tried yet but assume
everything will work a-ok after that.

Herbert Graf wrote:
>Just wondering, does anybody have a pointer to how one uses this sort of
>stuff? I've seen it before but I have NO idea what it means and I feel that
>I'm missing out on something very useful here! :) Thanks, TTYL

Yes it's magic :)
Kidding, nothing special about it really, the LOW(), HIGH() and UPPER()
is used to extract one particular byte from an possible multibyte adress
( either program, ram or constant ), so for example lets say we have this
constant:

#define BigNum 0x112233

Then:

LOW(BigNum) = 0x33
HIGH(BigNum) = 0x22
UPPER(BigNum) = 0x11

Or should I say this is how it should be, I know previous versions of the
assembler
have had issues with padding with zeros or similar.
Then the +1 or +n is used to access an particular byte of multibyte
variables
without needing to declare an pointer to each adress, for example:

My24BitNumber RES 3 ; declares an 3 byte variable ( relocatable code )
or..
My24BitNumber:3 ; declares an 3 byte variable ( absolute code ? )

Then to access the individual bytes one uses:
My24BitNumber   ; top byte
My24BitNumber+1 ; middle byte
My24BitNumber+2 ; bottom byte

/Tony

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


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