Post Reply 
HP-71 BASIC funny quirks
01-28-2023, 07:19 PM
Post: #12
RE: HP-71 BASIC funny quirks
(01-28-2023 12:39 PM)Albert Chan Wrote:  If I understand correctly, the process of tokenizing HP71B program, we lose the source.
That's why de-compiler was needed, to reconstruct the source, as close as possible.
This save memory, at the cost of slower program listing. (reconstruction takes time)

An interesting approach was the one used in the Sinclair ZX Spectrum.

When the user entered a BASIC line from the command prompt (possibly including numeric constants,) the line was immediately checked for correct syntax (thus avoiding storing faulty lines in program memory, as many contemporary BASIC dialects did,) which was a one-time process and made checking syntax at runtime utterly innecessary, thus significantly speeding up program execution.

Once the line passed the syntax check, it was also stored in tokenized form (forced by the user interface,) and if a numeric literal was detected, it was converted on the fly to its 5-byte internal binary form, which was then inserted in the line just after the source literal, so both the text literal and the internal binary form were included in the program line and thus the source wasn't lost and would be available verbatim for listings without wasting time in decompilation, while the binary form would be immediately available for computations without further interpretation or conversion from the literal at runtime.

In other words, the best of both worlds: keyword tokenization, no decompilation, no run-time syntax checks and no run-time numeric conversions from source code to binary form.

V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
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 - Valentin Albillo - 01-28-2023 07:19 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: 5 Guest(s)