py: Implement clz and rbit for inline Thumb assembler.

This commit is contained in:
Damien George
2015-02-13 11:06:23 +00:00
parent 32f0b7942c
commit 192d536fe4
3 changed files with 30 additions and 1 deletions

View 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)))

View File

@@ -0,0 +1,4 @@
24
16
0xf000000
0x10000