pioasm: allow optional target for .wrap #2163
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#2163
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Update: see also proposed doc changes in #2484
It could sometimes be convenient (and possibly allow more descriptive source code) if
.wrapwould optionally accept the same target expressions asjmp(with.wrap_targetas the default):E.g.
would be equivalent to
Perhaps even allow
.wrap <target>at the end of an instruction (likeside).It would also be convenient to have e.g.
.return the current location. Thencould be written as
and
as
or as an (extreme) example (alternative ringing cadence generator):
Maybe moving
WORD valuefromdirective:tobase_instruction:inparser.yycould also be convenient (the.worddirective basically is an instruction). Could be useful for things like:Suggestion for above (except for allowing
.wrapat the end of an instruction):I really like the idea of the optional target for ".wrap", but I think adding it to the end of an instruction with "side" and "delay" is too much:
Could be written as:
But I really find this one cleaner:
Having labels in ".wrap" directives allows for:
I'm also all in for the "current location" syntax, it avoids unneeded labels for the typical delays.
But I really prefer the "$" symbol instead of the ".", it is way more popular and makes it more "visible":
Even better if expressions can be used:
I will soon publish a VSCode extension for PIO ASM syntax (including new RP2350 syntax).
I will add support for these features if they are finally accepted.
That really depends on where you're coming from (Unix, PC, minicomputer, home computer, etc.).
gasuses.(see e. g..macro case), and$is sometimes either allowed in (local) symbols/labels or for starting comments:The GNU Assembler: The Special Dot Symbol
Some others use
*instead…It's not a small change in the parser; that's why it's omitted in above patch (but it could more closely reflect how it's actually working: it's applied after an instruction is executed; not as an own instruction or before an instruction is executed).
Another relatively simple change would be to have an optional second argument to
.wrap, like.wrap WRAP_BOTTOM WRAP_TOP, which could be placed anywhere in the program and refers to 2 labels (or expressions); but I'm not sure how useful it would actually be (except for explaining it in the docs; but more to type as well).Well, how about having it optionally return an
expression(I'm not really serious here):Most of above proposed changes also summarized in #2484 (with some contrived tests in
amethyst.pio).