etk icon indicating copy to clipboard operation
etk copied to clipboard

Nested/local labels

Open SamWilsn opened this issue 4 years ago • 0 comments

Example

I think we could support something like:

root:
    push1 .nested
    jump
    .nested:
        jumpdest

other:
    .nested:
        push1 root.nested

This example would define the following labels:

  • root at 0
  • root.nested at 3
  • other at 4
  • other.nested at 4

Necessary Considerations

  • Probably should pay special attention how how this interacts with user defined macros (#18)
  • Deeply nested labels root.nested.super_nested
  • Parent references (maybe ..nested or super.nested or something else entirely)

Further Reading

https://www.tortall.net/projects/yasm/manual/html/nasm-local-label.html

SamWilsn avatar Jul 10 '21 21:07 SamWilsn