Skip to content

Assembly error when using string and SELECT CASE in FUNCTION #263

@kochs-online

Description

@kochs-online

I'm really new to XC=BASIC, but I think I came across a bug. This is the minimal code example I came up with to reproduce the behaviour:

FUNCTION myfunc AS BYTE ()
  DIM s AS STRING * 1

  SELECT CASE s
  END SELECT
END FUNCTION

PRINT myfunc()

Running $ xcbasic3 test.bas test.prg --target=pet8032 ends with this error message:

test.bas:6.0: WARNING: FUNCTION "myfunc()" never calls itself, consider making it STATIC
** ERROR ** There has been an error while trying to execute DASM, please see the bellow message.
Tried to execute: dasm /tmp//xcbtmp_FEBB3EF0.asm -otest.prg -s/tmp//xcbtmp_FEBB3EF0.sym
char = '{' 123 (-1: 35)
char = '}' 125 (-1: 50)
char = '{' 123 (-1: 35)
char = '}' 125 (-1: 50)
char = '{' 123 (-1: 35)
char = '}' 125 (-1: 50)
/tmp//xcbtmp_FEBB3EF0.asm (59): error: Not enough args passed to Macro.
/tmp//xcbtmp_FEBB3EF0.asm (59): error: Illegal character '{2}'.
/tmp//xcbtmp_FEBB3EF0.asm (59): error: Illegal character '}'.

Unrecoverable error(s) in pass, aborting assembly!
Complete. (5)

Edit: I'm using XC=BASIC version 3.1.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions