adafruit / Adafruit_CircuitPython_PIOASM

Simple assembler to convert pioasm to bytes
MIT License
27 stars 17 forks source link

doesn't report duplicate labels as an error #10

Closed jepler closed 3 years ago

jepler commented 3 years ago

This should have given an error because the "forever" label is defined twice.

blink = adafruit_pioasm.assemble("""
.program blink
    pull block    ; These two instructions take the blink duration
    out y, 32     ; and store it in y
    mov x, y
forever:
    set pins, 1   ; Turn LED on
lp1:
    jmp x-- lp1   ; Delay for (x + 1) cycles, x is a 32 bit number
    mov x, y
    set pins, 0   ; Turn LED off
lp2:
    jmp x-- lp2   ; Delay for the same number of cycles again
forever:
    jmp forever   ; Blink forever!
""")