Post Reply 
HP-71 BASIC funny quirks
01-27-2023, 10:35 PM
Post: #6
RE: HP-71 BASIC funny quirks
(01-27-2023 05:31 PM)Valentin Albillo Wrote:  Yes, and I was delighted when I got my SHARP PC-1211 back in the early 80's and saw that it tokenized the keywords so that INPUT or DEGREES, say, would only use 1 byte of RAM instead of the 5 or 7 required by the usual BASIC dialects of the time.

The tokenization also meant faster program execution, and SHARP pointed out the memory advantages in their brochure "Con memoria equivalente a 4 Kbytes" (i.e. you could do with the built-in 1.4 Kbytes what would require 4 Kbytes using non-tokenizing BASIC dialects.)

Regards.
V.

One of the interesting design choices by SHARP for all of their early Pocket Computers in the 80s was to preallocate variables A-Z and A$-Z$ in memory (before Casio copied the same approach.) Hence, running a BASIC program will never produce an out-of-memory runtime error for these variables. The downside is that A$-Z$ are the same as A-Z and strings can only can contain up to 7 characters. The A(n) (or @(n)) array provides extra space, which can produce an out-of-memory error and so does the use of variables AA-ZZ,A0-Z9 and AA$-ZZ$,A0$-Z9$. Casio requires DEFM, so it won't run out of memory at runtime but this approach lacks SHARP's flexibility to dynamically extend array A(n) as needed by the program. But there is also DIM on most SHARPs.

I'm curious which BASIC dialects/machines you're referring to that stored executable programs in non-tokenized form in memory? The inventors of BASIC used a semi-compiled tokenized format for storing programs for example Tokenization with one byte is quite common (e.g. the C64) or two bytes per token. Some BASIC dialects retain program spacing by storing space "tokens", others remove extra spacing altogether to save space.

Fully compiled BASIC instead of tokenized for interpretation is a different matter altogether, of course.

Some Sharp models use two bytes per token to extend the range of tokens. PC-1360 also uses two bytes whereas PC-1350 always uses one byte. This can be a problem when CLOADing PC-1350 programs into a PC-1360 as one may get an error when a tokenized line no longer fits the BASIC line length limit.

Fortunately, we have better programming languages these days.

- Rob

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP-71 BASIC funny quirks - J-F Garnier - 01-27-2023, 08:55 AM
RE: HP-71 BASIC funny quirks - Albert Chan - 01-27-2023, 02:56 PM
RE: HP-71 BASIC funny quirks - J-F Garnier - 01-27-2023, 04:21 PM
RE: HP-71 BASIC funny quirks - robve - 01-27-2023 10:35 PM
RE: HP-71 BASIC funny quirks - robve - 01-28-2023, 02:55 AM
RE: HP-71 BASIC funny quirks - Albert Chan - 01-28-2023, 12:39 PM
RE: HP-71 BASIC funny quirks - J-F Garnier - 01-28-2023, 05:03 PM
RE: HP-71 BASIC funny quirks - brouhaha - 01-28-2023, 04:03 AM
RE: HP-71 BASIC funny quirks - robve - 01-28-2023, 02:51 PM



User(s) browsing this thread: 1 Guest(s)