[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-by
From: |
Jurek Szczesiul |
Subject: |
Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-byte integer ? |
Date: |
Fri, 4 Nov 2005 10:04:09 +0100 |
>>
>> unsigned char temp;
>>
>> temp = (address >> 16) & 0xFF;
>>
>> if(temp & 0x04)
>
>
Hi Vince !
You could also try to retrieve directly the 2. ( from 0) byte of ulong and check
the bit , something like this ( -Os) :
if( *((uchar*)&long1+2) & 0x4) PORTB = 0x1;
8c: 80 91 65 00 lds r24, 0x0065
90: 82 ff sbrs r24, 2
92: 02 c0 rjmp .+4 ; 0x98
94: 81 e0 ldi r24, 0x01 ; 1
96: 88 bb out 0x18, r24 ; 24
(long1 located at 0x63-0x66 here - Atmega8)
HTH
Best regards Jurek S.
- [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Royce Pereira, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Ian Caddy, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-byte integer ?,
Jurek Szczesiul <=
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-byte integer ?, Vincent Trouilliez, 2005/11/04
- RE: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte integer ?, niklo, 2005/11/04
- RE: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte intege, Dave Hansen, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte intege, David Brown, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Dave Hansen, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Dave Hylands, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Vincent Trouilliez, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Joerg Wunsch, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Vincent Trouilliez, 2005/11/05