mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 13:10:21 +01:00
py/emitinlinethumb: Add support for MRS instruction.
Only IPSR and BASEPRI special registers supported at the moment, but easy to extend in the future.
This commit is contained in:
committed by
Damien George
parent
1f0aaece3a
commit
e242b1785f
11
tests/inlineasm/asmspecialregs.py
Normal file
11
tests/inlineasm/asmspecialregs.py
Normal file
@@ -0,0 +1,11 @@
|
||||
@micropython.asm_thumb
|
||||
def getIPSR():
|
||||
mrs(r0, IPSR)
|
||||
|
||||
@micropython.asm_thumb
|
||||
def getBASEPRI():
|
||||
mrs(r0, BASEPRI)
|
||||
|
||||
print(getBASEPRI())
|
||||
print(getIPSR())
|
||||
|
||||
2
tests/inlineasm/asmspecialregs.py.exp
Normal file
2
tests/inlineasm/asmspecialregs.py.exp
Normal file
@@ -0,0 +1,2 @@
|
||||
0
|
||||
0
|
||||
Reference in New Issue
Block a user