-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add further fix for ON 2 GOTO 10, plus a test for it
- Loading branch information
1 parent
c42e32b
commit 104e77f
Showing
5 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[pcbasic] | ||
font=freedos | ||
quit=True | ||
run=TEST.BAS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
10 REM PC-BASIC test | ||
20 REM calculated jumps | ||
30 open "output.txt" for output as 1 | ||
40 on error goto 1000 | ||
50 print#1, 50 | ||
60 a = 0: gosub 500 | ||
61 a = 1: gosub 500 | ||
62 a = 2: gosub 500 | ||
69 a = -1: gosub 500 | ||
70 a = 255: gosub 500 | ||
71 a = 256: gosub 500 | ||
72 a = 32767: gosub 500 | ||
73 a = 65535: gosub 500 | ||
160 a = 0: gosub 600 | ||
161 a = 1: gosub 600 | ||
162 a = 2: gosub 600 | ||
169 a = -1: gosub 600 | ||
170 a = 255: gosub 600 | ||
171 a = 256: gosub 600 | ||
172 a = 32767: gosub 600 | ||
173 a = 65535: gosub 600 | ||
490 end | ||
500 on a goto, | ||
510 print#1, 510: return | ||
600 on a gosub, | ||
610 print#1, 610: return | ||
1000 print#1, err, erl, a | ||
1010 resume next | ||
|
||
|
30 changes: 30 additions & 0 deletions
30
tests/basic/gwbasic/ON_x_GOTO_GOSUB_comma/model/OUTPUT.TXT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
50 | ||
510 | ||
2 500 1 | ||
510 | ||
2 500 2 | ||
510 | ||
5 500 -1 | ||
510 | ||
510 | ||
5 500 256 | ||
510 | ||
5 500 32767 | ||
510 | ||
6 500 65535 | ||
510 | ||
610 | ||
2 600 1 | ||
610 | ||
2 600 2 | ||
610 | ||
5 600 -1 | ||
610 | ||
610 | ||
5 600 256 | ||
610 | ||
5 600 32767 | ||
610 | ||
6 600 65535 | ||
610 | ||