[cc65] Re: Print heart character on C64?

From: Jonathan Graham Harston <jgh1arcade.demon.co.uk>
Date: 2004-09-21 02:01:52
> Message-ID: <200409181627.45493.groepaz@gmx.net>
 
Groepaz <groepaz@gmx.net> wrote:
> On Saturday 18 September 2004 16:33, Raj Wurttemberg wrote:
> that happens because cc65 converts the charset encoding (from ascii to
petscii
> in this case). however, i am not sure if this is correct behaviour here
> (when using \x).... no idea what the standard says here.
 
The C standard says that C uses ASCII, regardless of what character set
encoding the underlying system uses.
 
So:
 putchar(0x21) always emits a pling,
 putchar(0x30) always emits a zero,
 putchar(0x41) always emits the system's representation
               of an upper case 'A'
 putchar(0x61) always emits the system's representation
               of a lower case 'A'.
 
For example, if you had a C compiler for the ZX80, then
 putchar(0x30) when sent to the screen would send 0x00
 to the screen drivers.
 
If you were using a system that used EBCDIC, then
 putchar(0x30) would send 0xF0.
 
-- 
J.G.Harston - jgh@arcade.demon.co.uk - mdfs.net/User/JGH
Badly formed email is deleted unseen as spam
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Sep 21 10:30:19 2004

This archive was generated by hypermail 2.1.8 : 2004-09-21 10:30:27 CEST