flat assembler
Message board for the users of flat assembler.

Index > Windows > parity bit

Author
Thread Post new topic Reply to topic
marcinzabrze12



Joined: 07 Aug 2011
Posts: 60
marcinzabrze12
Helo everyone. Parity Flag should give to me result of last operation i'm right or no ?
Code:
start:
        mov             eax, 3
        jp              @F
        invoke  MessageBox, HWND_DESKTOP, 'IS NOT PARITY VALUE', 'RESULT:', MB_OK
        invoke  ExitProcess, 0
        @@:
        invoke  MessageBox, HWND_DESKTOP, 'IS PARITY VALUE', 'RESULT:', MB_OK
        invoke  ExitProcess, 0
    


this code tell me that in eax i have parity value Shocked
Post 31 Mar 2013, 18:21
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 21:08; edited 1 time in total
Post 31 Mar 2013, 18:24
View user's profile Send private message Reply with quote
marcinzabrze12



Joined: 07 Aug 2011
Posts: 60
marcinzabrze12
Code:
mov             eax, 00000000000000000000000000000010b
        test            eax, eax
        jp              @F
        ... 
    


something strange because code like above tell me that in eax is not parity ... I know that i can use simple

Code:
         bt     eax, 0
         jc      .not_parity
    


... but i want to know what is wrong in this code.
Post 31 Mar 2013, 18:59
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 21:08; edited 1 time in total
Post 31 Mar 2013, 19:05
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
marcinzabrze12,

HaHaAnonymous is right. Another important thing to consider is that only least significant byte of the result matters.
Post 31 Mar 2013, 19:11
View user's profile Send private message Reply with quote
marcinzabrze12



Joined: 07 Aug 2011
Posts: 60
marcinzabrze12
omg. thak you people. now everything is clear. i was think that is like decimal system where 2 is parity .... ok. thanks.
Post 31 Mar 2013, 20:02
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.