CLA Assembly Addressing Modes
Two addressing modes: Direct and Indirect
Both modes can access the lower 64Kx16 of memory only:
All of the CLA data space
Both message RAMs
Shared peripheral registers
Direct – Populates opcode field with 16-bit address of the variable
example 1: MMOV32 MR1, @_VarA
example 2:
MMOV32 MR1, @_EPwm1Regs.CMPA.all
Indirect – Uses the address in MAR0 or MAR1 to access memory;
after the read or write MAR0/MAR1 is incremented by a
16-bit signed value
example 1:
MMOV32 MR0, *MAR0[2]++
example 2: MMOV32 MR1, *MAR1[-2]++
CLA Task Assembly Code Example
.cdecls "Lab.h"
.sect "Cla1Prog"
_Cla1Task1: ; FIR filter
MUI16TOF32 MR2, @_AdcaResultRegs.ADCRESULT0
MMPYF32 MR2, MR1, MR0
MADDF32 MR3, MR3, MR2
MF32TOUI16 MR2, MR3
MMOV16 @_ClaFilteredOutput, MR2
MSTOP ; End of task
;-------------------------------------
_Cla1Task2:
MSTOP
;-------------------------------------
_Cla1Task3:
MSTOP
ClaTasks.asm
.cdecls directive used
to include the C
header file in the CLA
assembly file
.sect directive used to
place CLA assembly
code in its own
section
C Peripheral Register
Header File references
can be used in CLA
assembly code
MSTOP instruction
used at the end of the
task