gnupic: gpasm - how to get address of variable ?


Previous by date: 7 Sep 2012 15:38:52 -0000 Re:gpasm - how to get address of variable ?, Joe Pfeiffer
Next by date: 7 Sep 2012 15:38:52 -0000 Re: gpasm - how to get address of variable ?, Gál Zsolt
Previous in thread: 7 Sep 2012 15:38:52 -0000 Re: gpasm - how to get address of variable ?, Borut Ražem
Next in thread: 7 Sep 2012 15:38:52 -0000 Re: gpasm - how to get address of variable ?, Gál Zsolt

Subject: Re: gpasm - how to get address of variable ?
From: Joe Pfeiffer ####@####.####
Date: 7 Sep 2012 15:38:52 -0000
Message-Id: <20554.5386.898649.263574@pfeifferfamily.net>

To elaborate just a bit more on my previous response:  cblock can be
thought of as a way to automatically define equ's.  That's not the
best way to think of it in most cases, but in this case it helps to
show why what I said before works.

Borut Ražem writes:
>Hi Vaclav,
>
>I don't think you can get the address of CBLOCK variable.
>The alternative is to use EQUs instead of CBLOCK:
>
>var1            EQU        0x20
>var_array    EQU        0x21
>
>                     movlw    var_array
>                     movwf    FSR
>
>Borut
>
>On 07. 09. 2012 09:52, Vaclav Peroutka wrote:
>> Hello,
>>
>> I want to use FSR/INDF in assembler. I have defined
>>
>>      CBLOCK    0x20
>>          var1:    1
>>          var_array:    1
>>      ENDC
>>
>> In the code, I want to use
>>     movlw address_of_var_array
>>     movwf FSR
>>
>> and then to write to var_array through INDF.
>>
>> How can I do that ? I did not find any expression in gputils manual.
>>
>> Thank you in advance,
>> Vaclav
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>

-- 
Joseph J. Pfeiffer, Jr., Ph.D.                 http://pfeifferfamily.net/
1440 Tierra del Sol Dr                         575.525.2764 (H)
Las Cruces, NM 88007                           575.496.3501 (C)

Previous by date: 7 Sep 2012 15:38:52 -0000 Re:gpasm - how to get address of variable ?, Joe Pfeiffer
Next by date: 7 Sep 2012 15:38:52 -0000 Re: gpasm - how to get address of variable ?, Gál Zsolt
Previous in thread: 7 Sep 2012 15:38:52 -0000 Re: gpasm - how to get address of variable ?, Borut Ražem
Next in thread: 7 Sep 2012 15:38:52 -0000 Re: gpasm - how to get address of variable ?, Gál Zsolt


Powered by ezmlm-browse 0.20.