mirror of
https://github.com/micropython/micropython.git
synced 2025-07-21 21:11:12 +02:00
This commit adds support for writing inline assembler functions when targeting a RV32IMC processor. Given that this takes up a bit of rodata space due to its large instruction decoding table and its extensive error messages, it is enabled by default only on offline targets such as mpy-cross and the qemu port. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
14 lines
369 B
Python
14 lines
369 B
Python
try:
|
|
import frozen_asm_thumb as frozen_asm
|
|
except ImportError:
|
|
try:
|
|
import frozen_asm_rv32 as frozen_asm
|
|
except ImportError:
|
|
raise ImportError
|
|
|
|
print(frozen_asm.asm_add(1, 2))
|
|
print(frozen_asm.asm_add1(3))
|
|
print(frozen_asm.asm_cast_bool(0), frozen_asm.asm_cast_bool(3))
|
|
print(frozen_asm.asm_shift_int(4))
|
|
print(frozen_asm.asm_shift_uint(4))
|