From e242b1785f9e25b36f5d225652c679cd7cec6ec0 Mon Sep 17 00:00:00 2001 From: Henrik Sölver Date: Sat, 21 Nov 2015 22:27:54 +0100 Subject: py/emitinlinethumb: Add support for MRS instruction. Only IPSR and BASEPRI special registers supported at the moment, but easy to extend in the future. --- tests/inlineasm/asmspecialregs.py | 11 +++++++++++ tests/inlineasm/asmspecialregs.py.exp | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 tests/inlineasm/asmspecialregs.py create mode 100644 tests/inlineasm/asmspecialregs.py.exp (limited to 'tests/inlineasm') 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()) + diff --git a/tests/inlineasm/asmspecialregs.py.exp b/tests/inlineasm/asmspecialregs.py.exp new file mode 100644 index 000000000..aa47d0d46 --- /dev/null +++ b/tests/inlineasm/asmspecialregs.py.exp @@ -0,0 +1,2 @@ +0 +0 -- cgit v1.2.3