Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Array

Status
Not open for further replies.
Nigel Goodwin said:
Here's a clue - "indexed addressing".

Okay... I searched through the datasheet, the keyword was "Indirect Addressing"...I was looking for instructions like those in 8085....

Is it possible to use arrays in Assembler variables? The help file does not say anything about it... :(
 
lord loh. said:
Okay... I searched through the datasheet, the keyword was "Indirect Addressing"...I was looking for instructions like those in 8085....

Sorry :rolleyes: just working from memory!.

Is it possible to use arrays in Assembler variables? The help file does not say anything about it... :(

There's really no such thing as an 'array', it's just how you deal with a section of memory, normally RAM, but in a PIC GPR's. I don't think there's any such thing as an 'assembler variable', as far as programming goes, it's just a variable the assembler can use, and has no relation to the PIC at all.

Just allocate a sequential block of GPR's and use indirect addressing from the start address.
 
Oh no.... I was familiar with the 8085. So I was looking for some instructions like MOV M and INX H and STAX type... It did not occur to me to look for Indirect Addressing.

And I wanted to make an array of variables that are defined by SET or Variable assembler directives..
 
lord loh. said:
And I wanted to make an array of variables that are defined by SET or Variable assembler directives..

As far as I'm aware, those are only assembler directives - they don't produce any code at all, and have nothing to do with actual PIC code. Generally assembler variables are used to produce code for different processors based on a variable for the processor type, or for different clock speeds - but in each case you have to write each section of code, the assembler variable just allows you to select a particular section of code at assembly time, based on the value of the variable.

It's a common mistake to assume they produce PIC code, I get many emails from people doing just that - my usual response is to get them to look at the resulting code, and there isn't any!.
 
I am aware that SET and Variable does not produce any code....

But I have a piece of code that can be iterated using indirect addressing but I need several literals that have been defined by SET and Variable directives...

So I was seeing if there was a way to include different literals during different iterations...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top