RosettaCodeData/Task/Stack/ARM-Assembly/stack-3.arm

10 lines
432 B
Plaintext

;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