Bitmasks

For those of you brave enough to try the beta releases, please ask your questions and post your issues here! Remember, the more info the better!

Moderators: robertisaar, dex

Locked
Sil
Posts: 38
Joined: Mon Feb 13, 2006 6:03 am

Bitmasks

Post by Sil »

cant figure out how to add bitmasks
i dont understand, like in tunerpro rt aldl editor you put in the address
then put in the bit
in scannerpro there is operations?wtf

say i want to add the following, how would i go about doing it....

Code: Select all

 59      FMDBYTE1     BIT STATUS WORD
            0      PARK/NEUTRAL                                1=OFF  0=ON
            1      3RD GEAR                                    1=ON   0=OFF
            2      4TH GEAR                                    1=ON   0=OFF
            3      P/S CRAMP    (0=CRAMP)                      1=OFF  0=ON
            4      READ BUT NOT USED
            5      V5 COOLING FAN DISCRETE (A/C PRESSURE SW)   1=OFF  0=ON       (1 = REQUESTED)
            6      DISCRETE CRUISE CONTROL                     1=OFF  0=ON
            7      AIR CONDITIONER REQUEST                     1=ON   0=OFF
User avatar
Mangus
TunerPro Author
Posts: 1918
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

Bitwise AND

0x1 = bit 0
0x2 = bit 1
0x4 = bit 2
0x8 = bit 3
0x10 = bit 4
0x20 = bit 5
0x40 = bit 6
0x80 = bit 7

so, for 4th gear flag, set the offset to 58 (0-based), Bitwise AND, operand is 0x04, and result is 0x04. This is the same as saying "if the data at offset 58 is ANDed with 0x04 and the result is 0x04, then the flag is set, otherwise it's cleared".

More information on bitwise operations here:
http://en.wikipedia.org/wiki/Bitwise_operation
***************************************
TunerPro Author
1989 Trans Am
Sil
Posts: 38
Joined: Mon Feb 13, 2006 6:03 am

Post by Sil »

alrighty, thanks for clarifing
was confused when i was looking at the 8d adx and seen values like 3c ect..
so when i compared that to the a100 aldl stuff it didnt match the address and i got confused lol
Locked