[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] PORTC
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] PORTC |
Date: |
Mon, 10 Mar 2008 21:32:05 +0100 (MET) |
"Andi" <address@hidden> wrote:
> This is the code:
Sending compilable code makes us better trust you not doing any
copy&paste errors. Let's hope all that you left out is the #include
<avr/io.h>.
> the LST generated file:
I never understand why people are so fond of that unreadable
disassembly stuff. It also appears your copy&paste left out some
single letters there.
Here's the assembly code the compiler generates when I add the
<avr/io.h> include line, and compile it for an ATmega8 with -Os:
..global InitLoad
.type InitLoad, @function
InitLoad:
/* prologue: frame size=0 */
/* prologue end (size=0) */
sbi 52-0x20,2
cbi 53-0x20,2
/* epilogue: frame size=0 */
ret
/* epilogue end (size=1) */
/* function InitLoad size 3 (2) */
.size InitLoad, .-InitLoad
..global InitPABX
.type InitPABX, @function
InitPABX:
/* prologue: frame size=0 */
/* prologue end (size=0) */
sbi 52-0x20,1
sbi 49-0x20,4
cbi 53-0x20,1
cbi 50-0x20,4
/* epilogue: frame size=0 */
ret
/* epilogue end (size=1) */
/* function InitPABX size 5 (4) */
That looks pretty fine to me. If I compile it into a .o file, and
just disassemble it (without the annoying attempt to intersperse it
with what the disassembler believes were the related source code),
I get:
Disassembly of section .text:
00000000 <InitLoad>:
0: a2 9a sbi 0x14, 2 ; 20
2: aa 98 cbi 0x15, 2 ; 21
4: 08 95 ret
00000006 <InitPABX>:
6: a1 9a sbi 0x14, 1 ; 20
8: 8c 9a sbi 0x11, 4 ; 17
a: a9 98 cbi 0x15, 1 ; 21
c: 94 98 cbi 0x12, 4 ; 18
e: 08 95 ret
Again, all looks fine to me.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
- [avr-gcc-list] PORTC, Andi, 2008/03/04
- Re: [avr-gcc-list] PORTC, Paulo Marques, 2008/03/04
- Re: [avr-gcc-list] PORTC, Andi, 2008/03/04
- Re: [avr-gcc-list] PORTC,
Joerg Wunsch <=
- Re: [avr-gcc-list] PORTC, Andi, 2008/03/10
- Re: [avr-gcc-list] PORTC, Joerg Wunsch, 2008/03/11
- Re: [avr-gcc-list] PORTC, David Kelly, 2008/03/11
- Re: [avr-gcc-list] PORTC, Andi, 2008/03/11
- Re: [avr-gcc-list] PORTC, Joerg Wunsch, 2008/03/12