From 192d536fe40010cc26d2d69d8bc6cdb30928e68d Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 13 Feb 2015 11:06:23 +0000 Subject: py: Implement clz and rbit for inline Thumb assembler. --- tests/inlineasm/asmbitops.py | 13 +++++++++++++ tests/inlineasm/asmbitops.py.exp | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 tests/inlineasm/asmbitops.py create mode 100644 tests/inlineasm/asmbitops.py.exp (limited to 'tests') diff --git a/tests/inlineasm/asmbitops.py b/tests/inlineasm/asmbitops.py new file mode 100644 index 0000000000..8cf92b301f --- /dev/null +++ b/tests/inlineasm/asmbitops.py @@ -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))) diff --git a/tests/inlineasm/asmbitops.py.exp b/tests/inlineasm/asmbitops.py.exp new file mode 100644 index 0000000000..8c560045f4 --- /dev/null +++ b/tests/inlineasm/asmbitops.py.exp @@ -0,0 +1,4 @@ +24 +16 +0xf000000 +0x10000 -- cgit v1.2.3