e.g.:
Code: Select all
10 ' PRINT "FOOBAR"
Code: Select all
10 ' $87 "FOOBAR"
Code: Select all
10 $83 $87 "FOOBAR"
Code: Select all
10 ' PRINT "FOOBAR"
Code: Select all
10 ' $87 "FOOBAR"
Code: Select all
10 $83 $87 "FOOBAR"
Code: Select all
10 ' PRINT "PRINT"
Code: Select all
BASIC program dump:
$1e $16
$00
$0a $3a $83 $20 $50 $52 $49 $4e $54 $20 $22 $50 $52 $49 $4e $54 $22
$00
$00
$00
progam start $1e01
next_address: $1e16
line_number: 10
length: 21
tokens: $3a,$83,$20,$50,$52,$49,$4e,$54,$20,$22,$50,$52,$49,$4e,$54,$22,$00
progam start $1e16
next_address: $0000
Code: Select all
0x0a -> 10
0x3a -> ":"
0x83 -> "'"
0x20 -> ' '
0x50 -> 'P'
0x52 -> 'R'
0x49 -> 'I'
0x4e -> 'N'
0x54 -> 'T'
0x20 -> ' '
0x22 -> '"'
0x50 -> 'P'
0x52 -> 'R'
0x49 -> 'I'
0x4e -> 'N'
0x54 -> 'T'
0x22 -> '"'
Code: Select all
10 ' FOO
Code: Select all
10 :' FOO
This is to satisfy how the interpreter is working. Since the commentary single quote can start right after a basic statement, the interpreter has to be told that the comment starts. The comment is also a "statement" and a statement can only start at a line beginning or after the statement separator ":". The BASIC tokenizer silently inserts the ":" and LIST does the suppress.jedie wrote:Now i can test it in DragonPy... I used this listing and used the function to extract the BASIC Listing...
[..]
So, yes: No tokens in comment lines... A translation:The interesting thing here is, that there is a : inserted before the comment!Code: Select all
0x0a -> 10 0x3a -> ":" 0x83 -> "'" 0x20 -> ' ' 0x50 -> 'P' 0x52 -> 'R' 0x49 -> 'I' 0x4e -> 'N' 0x54 -> 'T' 0x20 -> ' ' 0x22 -> '"' 0x50 -> 'P' 0x52 -> 'R' 0x49 -> 'I' 0x4e -> 'N' 0x54 -> 'T' 0x22 -> '"'
e.g.: You write this:and the internal representations is this:Code: Select all
10 ' FOO
Code: Select all
10 :' FOO
Code: Select all
":'" -> "'"
":ELSE" -> "ELSE"
I think so, but I actually didn't analyze the LIST routine in ROM where such thing could be observed. Even with my de-tokenizer script I saw no other "constructions" like this (for a limited collection of programs I wrote). But this observation is probably neither complete nor will prove this fact ...jedie wrote:That makes sense. And yes, i see the same with "ELSE"...
Are ' and ELSE the only "exceptions" ?
Maybe i add simple replace rules:Code: Select all
":'" -> "'" ":ELSE" -> "ELSE"