Skip to content

Support local labels. #27

@kevincox

Description

@kevincox

A whishlist item.

Some assembers (such as nasm) support local labels (https://github.com/yasm/yasm/wiki/NasmSyntax#labels). Basically labels that start with a dot are forgotten about any time a label not starting with a dot it read. This allows using nice short labels inside of a function.

; My function
foo:
    mov cx, 100
    .label:
        noop
        loop .label
    ret

; Other function
bar:
    cmp ax, bx
    je .label ; Refers to label below.
    noop
.label: ; No collision.
    ret

This is a really convenient feature, sometimes loop is really the best label name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions