[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to detect EOFs in SEQ-files using M/C?
On Mon, 9 Sep 2002, Glenn P., wrote:
|On Sun., 08-Sep-2002, at 05:00pm PDT (-0700 GMT), "Matthew Montchalin"
|posted (off-topic) in "Comp.Sys.CBM":
|
| >> PI isn't a variable. It is a keyword, albeit an unusual one, complete
| >> with its own token. I believe it acts as a function with a fixed value.
|
| > Hmmmm. How is pi represented on the Apple II?
|
|I wouldn't know, Friend. This is the "Comp.Sys.CBM" newsgroup -- it has
|nothing at all to do with the Apple (which, just to refresh your memory,
|was a COMPETITOR to Commodore computers!).
Yes, but I cross-posted into comp.sys.apple2 out of curiosity (and for
the sake of enlightenment). :)
|Speaking whereof, I have trimmed the follow-up line so that this thread
|will hereafter propagate only on comp.sys.apple2, since it apparently has
|NO relevance to Commodore computers...
Well, if one wishes to follow the history of the various implementations
of BASIC, one may find oneself wandering far afield from where one
first starts looking.
| > Surely they don't use a whole token just for PI?
|
|I'm not at all sure that you understand *either* PI, or BASIC tokens.
|
|1. A BASIC token is simply a special byte that represents a keyword in the
| BASIC language. For example, byte 128 (decimal) is the END token. The
| keyword RESTORE, on the other hand, is represented by byte 140 (again
| in decimal). This is a marvelous way of squeezing the seven bytes of
| the word "RESTORE" into only one byte; and in fact, that's exactly what
| the system of tokens is designed to do. Without tokens, BASIC programs
| would be MUCH larger than they are.
Do any of the Applesoft versions of Basic use tokens? The concept behind
tokens is that you save space that way.
|2. PI is a transcendental irrational number of infinite length. It starts
| out 3.141592679... and extends on into infinity. There cannot be an
| EXACT representation of PI, just an approximation; but on the Commodore
| computer that representation is nine digits long (if my memory does not
| completely deceive me, 11 digits internally).
|
|Since PI is frequently uses and would otherwise take up a lot of space,
|Commodore, in a perfectly reasonable move, assigned it to a one-byte token.
|That way, instead of saying 100 x=3.14159267, the programmer can save nine
|bytes and write 100 x=[pi character] instead.
|
|What's so strange about that???
What's strange, is using $ff to represent pi, if memory serves me right.
Um, it's not $5f is it? -And surely not $5c, which is - I think - the
British pound character.