Other Parts Discussed in Thread: C2000WARE
Hi Guys, my F28377D is up and running. I'm an assembler programmer and LOVE the C2000 syntax.
I've connected PORTA to an external SRAMs address lines and want to auto increment the address using one instruction.
What I'm trying to do in assembler is auto increment XAR6 by one and storing it on PORTA data port which is connected to the external SRAMS address lines.
This is how I'm doing it in 2 instructions but I would like to do it in one instruction.
My code:
MOVL XAR6,#0
MOVW AL,#1
MOVW AH,#0 ; ACC = 1
MOVL XAR2,GPADAT ; ADDRESS OF PORTA DATA PORT 32BIT. GPIOA IS SET TO OUTPUT BTW.
LOOP:
MOVL *XAR2,XAR6 ; PUTS XAR6 ON TO PORTA WHICH SETS THE EXTERNAL SRAM ADDRESS.
ADDL XAR6,ACC ; INCREMENTS SRAM ADDRESS BY ONE. ACC=1. 32BIT ADD INSTRUCTION.
B LOOP,UNC. ; BRANCH BACK TO LOOP
What I'm doing is that I have PORTA 22bits connected to an SRAMS address lines and I want it auto increment the address lines by one but using only one instruction.
I tried to auto increment XAR6 with ++ but the assembler using CC9 said it's not possible to do.
I tried this MOVL*XAR2,XAR6++ ; THIS IS NOT POSSIBLE TO DO. If it would work then it would auto increment XAR6 and store it on PORTA in one instruction,
But it doesn't allow that syntax. Does anyone know how to do it on ONE instruction? It will save a lot of machine cycles doing it in one instruction.
Thanks and I hope to hear from an assembler wizard soon. :)
Pete