summaryrefslogtreecommitdiff
path: root/tests/inlineasm/asmspecialregs.py
diff options
context:
space:
mode:
authorHenrik Sölver <henrik.solver@gmail.com>2015-11-21 22:27:54 +0100
committerDamien George <damien.p.george@gmail.com>2015-12-10 17:32:54 +0000
commite242b1785f9e25b36f5d225652c679cd7cec6ec0 (patch)
tree3a715a4628f9c1965943d76e574b5160901eca98 /tests/inlineasm/asmspecialregs.py
parent1f0aaece3ab7ab578de7e227ce46c45129b6b51e (diff)
py/emitinlinethumb: Add support for MRS instruction.
Only IPSR and BASEPRI special registers supported at the moment, but easy to extend in the future.
Diffstat (limited to 'tests/inlineasm/asmspecialregs.py')
-rw-r--r--tests/inlineasm/asmspecialregs.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/inlineasm/asmspecialregs.py b/tests/inlineasm/asmspecialregs.py
new file mode 100644
index 000000000..edfe4c2bd
--- /dev/null
+++ b/tests/inlineasm/asmspecialregs.py
@@ -0,0 +1,11 @@
+@micropython.asm_thumb
+def getIPSR():
+ mrs(r0, IPSR)
+
+@micropython.asm_thumb
+def getBASEPRI():
+ mrs(r0, BASEPRI)
+
+print(getBASEPRI())
+print(getIPSR())
+