Skip to content

Feature Suggestion: Add ability to declare labels for defined ranges (i.e. per-subroutine Zero-Page local variables) #20

@phillipeaton

Description

@phillipeaton

The 6502 CPU doesn't have many registers, but Zero-Page memory would appear to be used by many programs to perform a similar function to registers.

In practice, this means that many program subroutines use the same Zero-Page memory locations for different short-term purposes (i.e. like a register or local variable), such that you are not able to globally label some Zero-Page memory locations for any given program with useful names, when using dasmfw.

A clunky workaround I'm using is to run a sed script (see listing) on the output from dasmfw to insert additional EQUs with extended names (lines 3-12) and update the usage of the plain ZPnn labels with the extended names on a particular range of addresses ($3601 to $3734, lines 15-24).

(It's possible that dasmfw multilabel functionality provides this local label ability, but I can't figure out how it works.)

image

Additional Info: I've learned that the 6502bench disassembler program has functionality that inserts locals into the listing, as can be seen in the picture below; $98 and $99 are used in many places throughout this assembly listing, with different names each time. It's documented here: https://6502bench.com/sgtutorial/local-variables.html

image

Thanks for reading.

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