chibicc icon indicating copy to clipboard operation
chibicc copied to clipboard

`asm()` argument shouldn't be `data`

Open lynn opened this issue 2 years ago • 0 comments

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.

lynn avatar Jul 05 '23 23:07 lynn