Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PETSCII
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Base 128== {{Unreferenced|section|date=March 2024}} Out of PETSCII's first 192 codes, there are 128 graphic characters: 32β127 and 160β192. This permits "base128"-style encodings in DATA statements, or perhaps between PETSCII-speaking machines. This can also include control characters, which are visible when quoted, although which control characters are defined varies between systems. The primary application for a "Base 128" encoding is in DATA statements in Commodore BASIC. Binary data can be stored with relatively low overhead, allowing one character of data to encode seven bits of data. On a standard 80-character line, typically four characters are used for the line number, and two characters for the abbreviated DATA statement (<code>dA</code>). Since the comma and colon are significant to BASIC, a quote character is also needed, leaving 73 characters for data. At seven bits per character, one DATA line could store 511 bits of binary data, for 79% efficiency. If three-digit line numbers are used, efficiency increases to 80%. If two-digit line numbers are used, efficiency is 82%. {| class="wikitable" ! Line Numbers !! Data chars per Line !! Bits per Line !! Efficiency !! Max. Lines !! Max. Total Data Bytes |- | 1-9<ref group="lower-alpha" name="GOTO"/> || 76 || 532 || 0.83125 || 9 || 598 |- | 10-99 || 75 || 525 || 0.820312 || 90 || 5,906 |- | 100-999 || 74 || 518 || 0.809375 || 900 || 58,275 |- | 1000-9999 || 73 || 511 || 0.7984375 || 9,000 || 574,875 |- | 10000-65535<ref group="lower-alpha" name="off-by-one"/> || 72 || 504 || 0.7875 || 55,536<ref group="lower-alpha" name="off-by-one"/> || 3.5 MB (approx.) |} <references group="lower-alpha"> <ref name="GOTO">Assume line 0 is a GOTO.</ref> <ref name="off-by-one">Maximum line number is probably off-by-one.</ref> </references> For storing binary data in Commodore BASIC, it appears that two- or three-digit line numbers are typically the best choice. ===Base 164=== 164 PETSCII characters are representable in quoted strings; theoretically, then, Base 164 is possible. This adds in the color values, the function keys, and cursor controls.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)