avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: [avr-gcc-list] Codepage


From: Joerg Wunsch
Subject: Re: Re[2]: [avr-gcc-list] Codepage
Date: Mon, 21 Oct 2002 18:13:06 +0200 (MET DST)

Alexei Govorukhin <address@hidden> wrote:

> I am talking about cde pages. For example, in PC
> Letter 'A' has code 65, 'B' - 66, 'C' - 67 ...

That far, it's just plain ASCII.

> In AVR GCC, as I have discovered, 'A' has code 1, 'B' - 2, and what
> about other symbols, like '?' or '\'.

Nope.  gcc itself doesn't have any notion of a `codepage'.  Your
editor might have, and that's usually just ASCII.  Maybe it'll default
to ISO 8859-1 inside strings, let's see:

$ echo 'char foo[] = "Text: äöü\n";' |\
/usr/local/lib/gcc-lib/avr/3.3/cc1 -quiet -o /dev/stdout
        .file   "<stdin>"
        .arch avr2
__SREG__ = 0x3f
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__tmp_reg__ = 0
__zero_reg__ = 1
        .global __do_copy_data
        .global __do_clear_bss
.global foo
        .data
        .type   foo, @object
        .size   foo, 11
foo:
        .string "Text: \344\366\374\n"
/* File "<stdin>": code    0 = 0x0000 (   0), prologues   0, epilogues   0 */

Yep, it seems it uses ISO 8859-1 when being faced with characters >
0x80.  You can easily see the (hexadecimal) character codes when
dumping the generated object file:

$ avr-objdump -s foo.o

foo.o:     file format elf32-avr

Contents of section .text:
Contents of section .data:
 0000 54657874 3a20e4f6 fc0a00             Text: .....     


-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]