Skip to content

Instantly share code, notes, and snippets.

@iamhunter
Created October 24, 2016 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamhunter/a7e0a64415483b38f5293717f974b209 to your computer and use it in GitHub Desktop.
Save iamhunter/a7e0a64415483b38f5293717f974b209 to your computer and use it in GitHub Desktop.
@Takes in 3 parameters, (A,B,C) and returns the result of
@(A + (B * C))
.text
.global mac
.type mac, %function
aye .req r0
bee .req r1
cee .req r2
temp .req r4
mac:
push {temp, lr}
mul temp, bee, cee @multiply B and C and bequeaths the result to temp
add aye, aye, temp @add A and temp and bequeaths the result to A
done:
pop {temp, pc}
.unreq aye
.unreq bee
.unreq cee
.unreq temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment