Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/Stack/ARM-Assembly/stack-1.arm
Normal file
3
Task/Stack/ARM-Assembly/stack-1.arm
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
STMFD sp!,{r0-r12,lr} ;push r0 thru r12 and the link register
|
||||
LDMFD sp!,{r0-r12,pc} ;pop r0 thru r12, and the value that was in the link register is put into the program counter.
|
||||
;This acts as a pop and return command all-in-one. (Most programs use bx lr to return.)
|
||||
1
Task/Stack/ARM-Assembly/stack-2.arm
Normal file
1
Task/Stack/ARM-Assembly/stack-2.arm
Normal file
|
|
@ -0,0 +1 @@
|
|||
LDR r0,[sp] ;load the top of the stack into r0
|
||||
9
Task/Stack/ARM-Assembly/stack-3.arm
Normal file
9
Task/Stack/ARM-Assembly/stack-3.arm
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
;this example uses VASM syntax which considers a "word" to be 16-bit regardless of the architecture
|
||||
InitStackPointer: .long 0x3FFFFFFF ;other assemblers would call this a "word"
|
||||
|
||||
MOV R1,#InitStackPointer
|
||||
LDR SP,[R1] ;set up the stack pointer
|
||||
LDR R2,[R1] ;also load it into R2
|
||||
;There's no point in checking since we haven't pushed/popped anything but just for demonstration purposes we'll check now
|
||||
CMP SP,R2
|
||||
BEQ StackIsEmpty
|
||||
Loading…
Add table
Add a link
Reference in a new issue