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

asm() argument shouldn't be data #29

Open
lynn opened this issue Jul 5, 2023 · 0 comments · May be fixed by #34
Open

asm() argument shouldn't be data #29

lynn opened this issue Jul 5, 2023 · 0 comments · May be fixed by #34

Comments

@lynn
Copy link
Owner

lynn commented Jul 5, 2023

Right now something like

#include <uxn.h>

void main(void) {
  int n = asm("#1234");
}

compiles to

|0100
  LIT2r 0000 main_ POP2r BRK
( bss )
( data )
@L.data.0_
  "#1234    ( <---- oops 😅 )
( text )

@main_ ( -- result* )
    OVR2r LIT2r 0002 SUB2r #1234 STH2kr STA2
    #0000

  &return
    POP2r JMP2r

The expected behavior is not to emit @L.data.0_ "#1234.

samueldr added a commit to samueldr/chibicc-uxn that referenced this issue Jul 2, 2024
@samueldr samueldr linked a pull request Jul 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant