mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 21:20:13 +01:00
py: Implement clz and rbit for inline Thumb assembler.
This commit is contained in:
13
tests/inlineasm/asmbitops.py
Normal file
13
tests/inlineasm/asmbitops.py
Normal file
@@ -0,0 +1,13 @@
|
||||
@micropython.asm_thumb
|
||||
def clz(r0):
|
||||
clz(r0, r0)
|
||||
|
||||
print(clz(0xf0))
|
||||
print(clz(0x8000))
|
||||
|
||||
@micropython.asm_thumb
|
||||
def rbit(r0):
|
||||
rbit(r0, r0)
|
||||
|
||||
print(hex(rbit(0xf0)))
|
||||
print(hex(rbit(0x8000)))
|
||||
4
tests/inlineasm/asmbitops.py.exp
Normal file
4
tests/inlineasm/asmbitops.py.exp
Normal file
@@ -0,0 +1,4 @@
|
||||
24
|
||||
16
|
||||
0xf000000
|
||||
0x10000
|
||||
Reference in New Issue
Block a user