import array
screen=array.array('B',(0b1010_1111,0b0000_1100,0,0))
chunk=array.array('H',range(20))
@micropython.asm_thumb
def test(r0,r1,r2,r3): # from, to, #bytes, color
label(LOOP)
ldrb(r4,[r0,0])
mov(r6,8)
label(BYTE)
asr(r4,r4,1)
bcs(ONE)
mov(r5,0)
b(NEXT)
label(ONE)
mov(r5,r3)
label(NEXT)
strh(r5,[r1,0])
add(r1,r1,2)
sub(r6,r6,1)
bne(BYTE)
add(r0,r0,1)
sub(r2,r2,1)
bne(LOOP)
label(EXIT)
print(test(screen,chunk,2,0xffff))
print(screen)
print(chunk)