Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird DEFB bug (*solved*)
#1
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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)