When starting new uC environment the best way is to start with assembly things (my opinion). But never found asm-only example for the lm4f120h5qr Stellaris Launchpad (with Cortex M4 core) produced by CCS asm compiler directives. I got some hints from http://users.ece.utexas.edu/~valvano/index.html and with this manual http://users.ece.utexas.edu/~valvano/arm/ConvertKeilCCS.pdf produced this "nice" asm example:
;comment __stack definition in lm4f120h5qr.cmd file
.thumb ;1)
.data ;2)
.align 4 ;3)
.global M ;4)
M .field 32 ;5)
.align 2 ;6)
.text ;7)
.retain ;try compiling without these retains...
.retainrefs ;and see current warning message
;(entry point missing)
PtM .field M,32 ;8)
PORTA .field 0x400043FC,32 ;8)
BIT5 .equ 0x20 ;9)
JOKUPORT .field 0x200000F, 32
.global InputPA5 ;10)
.thumbfunc InputPA5 ;11)
InputPA5: .asmfunc ;12)
;disable all interrupts (except nmi and hard fault)
mov r0, #1
msr PRIMASK, r0
LDR R0,PORTA ;13)
;LDR R1,[R0]
AND R1,R1,#BIT5
LDR R2,PtM ;13)
LDR r8, JOKUPORT
MRS r1, IPSR
MOV r0, #1
MOV r1, #2
MOV r2, #3
PUSH {r1-r3}
POP {r1-r3}
ADD r0, r1, r2 ; r0 = 5 ; should be
;ADDNES R0, R0, R2
;Condition codes not allowed outside
;of IT blocks in Thumb.
TEQ r0, #0
TEQS r0, #0
;.W indicates 32 bit Thumb-2 instruction
;from book definitive guide to the arm cortex m3
; Read memory[R0], with R1
; updated to R1+offset
LDR.W r1, [r0], #1
Loop: B Loop
STR R1,[R2] ;do not write into memory
BX LR
.endasmfunc ;12)
.end ;14)
Same with picture :
Now i'm stucked because of there are no manuals, free books and lessons how to produce asm-only projects with Code Composer 5.3 environment. I'm using free license version of CCS 5.3.
(I manually created targetConfigs folder and copied its content from c-project)