Skip to content

Stack Position Labels #18

@michaelkamprath

Description

@michaelkamprath

I have no idea how the notation would make sense, and I also never have seen this anywhere. But one thing would be extremely useful:

a label for stack positions (offsets)

    ld a,0x42 ; var_x
    push a
    ld a,0x23 ; var_y
    push a
    
    ld a,[sp+1] ; stackpointer=var_y, stackpointer+1 = var_x
    
    ld a,0xff ; var_z
    push a
    
    ld a,[sp+2] ; stackpointer=var_z, stackpointer+1 = var_y, stackpointer+2 = var_x

sometimes it's hard to keep track of this, and everytime you insert something, you'll have to update all the stackpointer offsets.

to make this work the assembler needs to know which instructions modify the stackpointer and I have no idea how the labels would look like.

Originally posted by @sebseb7 in #17 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions