[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Compile Error
From: |
Trampas |
Subject: |
RE: [avr-gcc-list] Compile Error |
Date: |
Sun, 23 Jan 2005 08:51:56 -0500 |
Yeap it is correct...
a=a+1 is the same as a=a-(-1) and when using fixed point math with an 8 bit
value 255 is a -1.
Regards,
Trampas
-----Original Message-----
From: address@hidden [mailto:address@hidden
On Behalf Of lgp
Sent: Saturday, January 22, 2005 3:46 AM
To: avr-gcc-list
Subject: [avr-gcc-list] Compile Error
Source file is:
int main( void ){
unsigned char a;
a++;
while(1);
}
List file is:
int main( void ){
8e: ce e5 ldi r28, 0x5E ; 94
90: d4 e0 ldi r29, 0x04 ; 4
92: de bf out 0x3e, r29 ; 62
94: cd bf out 0x3d, r28 ; 61
unsigned char a;
a++;
96: 89 81 ldd r24, Y+1 ; 0x01
98: 8f 5f subi r24, 0xFF ; 255
9a: 89 83 std Y+1, r24 ; 0x01
while(1);
9c: ff cf rjmp .-2 ; 0x9c
Is it right??
a++;
96: 89 81 ldd r24, Y+1 ; 0x01
>> 98: 8f 5f subi r24, 0xFF ; 255 ??????
9a: 89 83 std Y+1, r24 ; 0x01
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list