FAQ  •  Register  •  Login

Weird DEFB bug (*solved*)

<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sun Feb 22, 2015 3:25 am

Weird DEFB bug (*solved*)

Try running this program:

  Code:
    GO TO 10

sample:
    asm
       defb "A(B)CD"
    end asm

10  DIM a,i AS UBYTE
    FOR i = 0 TO 5
    LET a=PEEK(@sample+i)
    PRINT a;" '";CHR$(a);"'"
    NEXT i


It was supposed to produce this output:

  Code:
65 'A'
40 '('
66 'B'
41 ')'
67 'C'
68 'D'


However it will produce this output instead:

  Code:
65 'A'
32 ' '
40 '('
66 'B'
41 ')'
67 'C'


Apparently this extra space (code 32) mysteriously appears whenever there's parenthesis inside a defb string.

Tested using latest version 1.4.0s1902. This problem always happens regardless of optimization level for compilation.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sat Jul 11, 2015 2:53 pm

Re: Weird DEFB bug

Confirmed bug. :shock:
And I'm puzzled, because I though it was in the preprocessor. It is not.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sat Jul 11, 2015 5:55 pm

Re: Weird DEFB bug

boriel wrote:Confirmed bug. :shock:
And I'm puzzled, because I though it was in the preprocessor. It is not.

Ok. It seems fixed now, but please, check even your old programs to see if they works ok.
It was a bug in an bizarre code in the optimizer I need to refact (as always).

Please, can you download ZX BASIC 1.4.0-r1912 and tell me if it works ok? :roll:
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat Jul 11, 2015 6:16 pm

Re: Weird DEFB bug

It works now, thanks!!!

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO