gnupic: gpasm - how to get address of variable ?


Previous by date: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Borut Ražem
Next by date: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Tamas Rudnai
Previous in thread: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Borut Ražem
Next in thread: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Tamas Rudnai

Subject: Re: gpasm - how to get address of variable ?
From: Gál ####@####.####
Date: 8 Sep 2012 15:51:23 -0000
Message-Id: <CAFKtu37XCKDCW-mjEsG4gTTLJjMSOdvjAMikyD=p9nr0gfGLKA@mail.gmail.com>

Is that right? Good joke...

2012/9/8 Borut Ražem ####@####.####
> I was totally wrong: the cblock "variables" actually hold the address. I was
> wrongly thinking about cblocks as C structures...
>
> Obviously I have no idea how the assembler works :-[
>
> My apologies,
> Borut
>
>
> On 07. 09. 2012 10:15, Borut Ražem wrote:
>>
>> 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: ####@####.####
>



-- 
~~~~~~~~~~~~~~~~
http://galzsolt.zzl.org

Previous by date: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Borut Ražem
Next by date: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Tamas Rudnai
Previous in thread: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Borut Ražem
Next in thread: 8 Sep 2012 15:51:23 -0000 Re: gpasm - how to get address of variable ?, Tamas Rudnai


Powered by ezmlm-browse 0.20.