Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESTORE command is missing in BP BASIC #147

Open
PSLLSP opened this issue Aug 9, 2020 · 0 comments
Open

RESTORE command is missing in BP BASIC #147

PSLLSP opened this issue Aug 9, 2020 · 0 comments

Comments

@PSLLSP
Copy link

PSLLSP commented Aug 9, 2020

BP BASIC have commands READ and DATA to work with sequences of numbers. It doesn't have command RESTORE to set reading to certain point. This is a bug from my point of view.

BP BASIC documentation is not good and I have to experiment to find details about commands. I have found that when all data are read with READ command, reading starts from the start. That is not bad but it is an ERROR in other BASIC implementations (error like OUT OF DATA).

Statements READ and DATA could be used to generate sequence of pulses with different length. In the case that two different patterns has to be combined, RESTORE command is useful; like to have two subroutines to generate two different patterns.

I have simpler example to demonstrate how DATA sequence is read in the loop:

HiZ(BASIC)>list

10  FOR I=1 TO 20
20  READ A
30  PRINT I;" ";A
40  NEXT I
50  DATA 2,3,5,7,9,11
60  DATA 13,17,19
65535  END 
62 bytes.
Ready
HiZ(BASIC)>run
1 2
2 3
3 5
4 7
5 9
6 11
7 13
8 17
9 19
10 2
11 3
12 5
13 7
14 9
15 11
16 13
17 17
18 19
19 2
20 3

Ready
HiZ(BASIC)>

Example of program that uses RESTORE (that is not supported and escaped with REM):

10 REM RESTORE 300
20 GOSUB 200
30 FOR I=1 TO 5
40 REM RESTORE 400
50 GOSUB 200
60 NEXT I
70 REM RESTORE 300
80 GOSUB 200
90 REM RESTORE 300
100 GOSUB 200
110 END
200 READ A
210 IF A=9999 THEN RETURN
220 PRINT A
230 GOTO 200
300  DATA 1,2,4,8,9999
400  DATA 9,3,1,9999

My BusPirate is from eBay, small cute box with two LEDs.

HiZ>i
Bus Pirate v3.b clone w/different PIC
Firmware v6.3-beta1 r2151  Bootloader v4.4
DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
http://dangerousprototypes.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant