Pin redefinition
Spiros
Posts: 2
· Hallo to all. I'm in the early stages of learning to program the sx28·using assembly. I've made a few programs so far but I've reached a point where I have to find out how to perform a task which I was avoiding to tackle for some time.
· In order to make a pin easier to work with you can do this:
··· led1· EQU· RA.0
··· led2· EQU· RA.1
What I would like to be able to do is to redefine it some way. For example:
··· working_pin is led1
··· working_pin is led2
I know I don't have to explain to you how this could be helpfull.
Thank you very much.
· In order to make a pin easier to work with you can do this:
··· led1· EQU· RA.0
··· led2· EQU· RA.1
What I would like to be able to do is to redefine it some way. For example:
··· working_pin is led1
··· working_pin is led2
I know I don't have to explain to you how this could be helpfull.
Thank you very much.
Comments
it is not fully clear to me if you want to re-define a port pin at run-time, or at assembly-time.
SASM accepts "EQU" and "=" for defining constants, so at the first glance,
led1 EQU RA.0 and led1 = RA.0
seem to have the same effect.
The difference is that a constant defined with an "=" can be re-assigned at another location in the source code. When you try the same with "EQU", SASM will flag an error.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
·Again thank you very much.