diff options
author | Henrik Sölver <henrik.solver@gmail.com> | 2015-11-21 22:27:54 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-12-10 17:32:54 +0000 |
commit | e242b1785f9e25b36f5d225652c679cd7cec6ec0 (patch) | |
tree | 3a715a4628f9c1965943d76e574b5160901eca98 /tests | |
parent | 1f0aaece3ab7ab578de7e227ce46c45129b6b51e (diff) | |
download | micropython-e242b1785f9e25b36f5d225652c679cd7cec6ec0.tar.gz micropython-e242b1785f9e25b36f5d225652c679cd7cec6ec0.zip |
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')
-rw-r--r-- | tests/inlineasm/asmspecialregs.py | 11 | ||||
-rw-r--r-- | tests/inlineasm/asmspecialregs.py.exp | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/inlineasm/asmspecialregs.py b/tests/inlineasm/asmspecialregs.py new file mode 100644 index 0000000000..edfe4c2bd7 --- /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 0000000000..aa47d0d46d --- /dev/null +++ b/tests/inlineasm/asmspecialregs.py.exp @@ -0,0 +1,2 @@ +0 +0 |