Commit Graph

7 Commits

Author SHA1 Message Date
Patrick Plenefisch
6f1fc56833
pioasm: python output incorrectly rendered mov x, ~x as nop() (#1053)
This affects all move operations where source and destination are the same
but with an operation applied, ex: mov y, ::y, mov osr, ~osr, etc
2022-10-09 12:59:52 -05:00
Michael Olson
d831eff5a2
fix pioasm python output (#694) (#695)
Issue:
    irq wait 0
    irq 0
are translated as:
    irq(wait, 0)                          # 0
    irq(nowait, 0)                        # 1
wait/nowait are incorrect, should be block or ommited (alt: noblock).

After change:
    irq(block, 0)                         # 0
    irq(0)                                # 1
2022-01-08 13:55:23 -06:00
Uri Shaked
4328b2c75f
fix pioasm python output (#479)
While working on the [online pioasm](https://wokwi.com/tools/pioasm), I found several PIO instructions that result in invalid python code. Here is a small program that demonstrate the issue:

```
.program python_issue

    push block
    wait 0 irq 1 rel
    irq clear 1 rel
```

And the resulting Python program:

```python
# -------------------------------------------------- #
# This file is autogenerated by pioasm; do not edit! #
# -------------------------------------------------- #

import rp2
from machine import Pin
# ----------- #
# python_test #
# ----------- #

@rp2.asm_pio()
def python_test():
    wrap_target()
    push(, block)                         # 0
    wait(0, irq, 1 rel)                   # 1
    irq(clear 1 rel)                      # 2
    wrap()
```

After this fix, the above program compiles to a valid python syntax:

```python
# -------------------------------------------------- #
# This file is autogenerated by pioasm; do not edit! #
# -------------------------------------------------- #

import rp2
from machine import Pin
# ----------- #
# python_test #
# ----------- #

@rp2.asm_pio()
def python_test():
    wrap_target()
    push(block)                           # 0
    wait(0, irq, rel(1))                  # 1
    irq(clear, rel(1))                    # 2
    wrap()
```
2021-06-07 22:02:04 -05:00
Luke Wren
df3e9c9536 Missing comma in pioasm python wait output 2021-03-04 21:22:48 -06:00
Graham Sanderson
0828178561 fixup not/reverse for pioasm python output (#146) 2021-03-04 21:22:48 -06:00
graham sanderson
d131919a09 Fix python output of IN instruction in pioasm 2021-02-01 14:46:45 -06:00
graham sanderson
26653ea81e Initial Release 2021-01-20 10:44:27 -06:00