gnupic: gpasm - how to get address of variable ?
Subject:
Re: gpasm - how to get address of variable ?
From:
Borut ####@####.####
Date:
8 Sep 2012 06:57:24 -0000
Message-Id: <504AEC50.2080109@gmail.com>
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
>