Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Position Labels #18

Open
michaelkamprath opened this issue Jul 17, 2022 · 0 comments
Open

Stack Position Labels #18

michaelkamprath opened this issue Jul 17, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@michaelkamprath
Copy link
Owner

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)

@michaelkamprath michaelkamprath added the enhancement New feature or request label Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant