On Sat, 15 Oct 2005, Nick Bensema wrote:
I grew up initially with several computers in the Atari 8-bit series.
After my 130XE died, I got my grandfather's Commodore 64. They had
one thing in common: wacky dissociation between screen memory and
their OS's idea of ASCII.
With both computers, you could display letters on the screen with a
POKE to video memory. However, the number you POKEd was almost never
the same number you would put into a CHR$ function to print that
character.
For example, to get an uppercase A, you would:
(a) PRINT CHR$(65) (assuming uppercase mode if C64)
(b) POKE 1024,1 (Commodore 64)
(c) POKE 40000,33 (48k Atari 8-bit)
Is there any reason the screen memory was set up this way? Why wouldn't all three be 65?
Heh. Try the Apple ][ (where, thankfully, it's much simpler)...
]? chr$(65)
A
]poke 1024,193
]
At least it's as easy as adding a 128 on the Apple.
Also, what's the deal with the backspace? In PETSCII, it's CHR$(20),
even though CHR$(8) is right there doing nothing. In ATASCII, it's CHR$(126). I understand that ATASCII puts graphics tiles in its
first 27 characters, so it can't use CHR$(8) for backspace or
CHR$(13) for CR. But ASCII DEL, at CHR$(127), is RIGHT NEXT DOOR,
but ATASCII puts the tab there instead.
Thankfully on the Apple it's 127. (8 is Left Arrow, which made keyboard handling a nightmare in the original Dapple. 9 is of course Tab. Apple
used ASCII quite straightforwardly in their computers, thank God.)
PRINT CHR$(65)A
CALL POKEV(0,161) ! place A at screen location 0 (and POKEV requires E/A or Minimem or an enhanced XB)
With both computers, you could display letters on the screen with a
POKE to video memory. However, the number you POKEd was almost never
the same number you would put into a CHR$ function to print that character.
With both computers, you could display letters on the screen with a
POKE to video memory. However, the number you POKEd was almost never
the same number you would put into a CHR$ function to print that
character.
And there is yet another disconnect, with keyboard scan codes. So to
expand on your example, you would press A (keyboard code 10), and an A
(ASCII 65) would appear, and appear in screen memory as value 1 (A). o_O
In article <11l7bgqiuegh344@news.supernews.com>,
And there is yet another disconnect, with keyboard scan codes. So to
expand on your example, you would press A (keyboard code 10), and an A
(ASCII 65) would appear, and appear in screen memory as value 1 (A).
o_O
Well, at least scan codes can be blamed somewhat on the layout of the keyboard. Maybe that explains the seemingly random arrangement of
the PETSCII graphics accessed by the Commodore key...
In article <11l7bgqiuegh344@news.supernews.com>,
Leif Bloomquist <spam@127.0.0.1301> wrote:
With both computers, you could display letters on the screen with a
POKE to video memory. However, the number you POKEd was almost never >> > > the same number you would put into a CHR$ function to print that
character.
And there is yet another disconnect, with keyboard scan codes. So to >expand on your example, you would press A (keyboard code 10), and an A >(ASCII 65) would appear, and appear in screen memory as value 1 (A). o_O
Well, at least scan codes can be blamed somewhat on the layout of the keyboard. Maybe that explains the seemingly random arrangement of
the PETSCII graphics accessed by the Commodore key...
--
Nick Bensema <nickb@io.com> AIM: NBensema
==== ======= ============== http://www.io.com/~nickb/
Sysop: | Gate Keeper |
---|---|
Location: | Shelby, NC |
Users: | 764 |
Nodes: | 20 (0 / 20) |
Uptime: | 40:46:34 |
Calls: | 11,275 |
Calls today: | 1 |
Files: | 5,288 |
D/L today: |
81 files (10,064K bytes) |
Messages: | 521,283 |