Skip to content

Instantly share code, notes, and snippets.

@hocarm

hocarm/counter.asm

Last active Aug 14, 2016
Embed
What would you like to do?
counterInc:
0: f240 0300 movw r3 , #: lower16:counter // r3 = &counter
4: f2c0 0300 movt r3 , #: upper16:counter
8: 6818 ldr r0 , [r3 , #0] // r0 = *r3
a: 1c42 adds r2 , r0 , #1 // r2 = r0 + 1
c: 601a str r2 , [r3 , #0] // *r3 = r2
e: 4740 bx lr // return r0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment