News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

zf

Started by santa, March 08, 2006, 09:23:47 PM

Previous topic - Next topic

santa


How can I check if zero flag is set ? Which bit ?

respect  :8)

P1

Santa,

There is an op code that does all the work for you.

jz Target ( or jnz )
.
.
.
Target:

Regards,  P1  :8)

santa


I konw that, but the thing is that I need check a bit which is responsible for setting ZF

:wink

P1

In QEditor there is an OPCODES help file.  This is clipped from there.

FLAGS - Intel 8086 Family Flags Register

      |11|10|F|E|D|C|B|A|9|8|7|6|5|4|3|2|1|0|
        |  | | | | | | | | | | | | | | | | '---  CF Carry Flag
        |  | | | | | | | | | | | | | | | '---  1
        |  | | | | | | | | | | | | | | '---  PF Parity Flag
        |  | | | | | | | | | | | | | '---  0
        |  | | | | | | | | | | | | '---  AF Auxiliary Flag

        |  | | | | | | | | | | | '---  0
        |  | | | | | | | | | | '---  ZF Zero Flag
        |  | | | | | | | | | '---  SF Sign Flag
        |  | | | | | | | | '---  TF Trap Flag  (Single Step)
        |  | | | | | | | '---  IF Interrupt Flag
        |  | | | | | | '---  DF Direction Flag
        |  | | | | | '---  OF Overflow flag
        |  | | | '-----  IOPL I/O Privilege Level  (286+ only)
        |  | | '-----  NT Nested Task Flag  (286+ only)

        |  | '-----  0
        |  '-----  RF Resume Flag (386+ only)
        '------  VM  Virtual Mode Flag (386+ only)
        - see   PUSHF  POPF  STI  CLI  STD  CLD


Regards,  P1  :8)

donkey

As P1's chart demonstrates it is bit 6 however using BitTest (BT) you will still have to perform a conditional jump based on the result, in effect you are only copying the Zero flag (ZF) into the Carry flag (CF)

pushfd
pop eax
bt eax,6
jnc @F
; bit is set

@@:
; bit is not set


Alot of extra work to replace

jnz @F
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

P1

#5
Santa,

What is it your doing???  It would help in giving you an answer, that more directed at what your doing.

Regards,  P1  :8)

santa

Hi Hi

P1 .....  it's a secret  :8) but your explanation is sufficient. I have forgotten the bassis of asm ... he he ... I know it's not funny

respect

P1

Quote from: Santa on March 09, 2006, 04:11:54 PMit's a secret  :8)
Just a quick reminder, Please observe all MASMforum rules and guidelines.

Playing with flags is not normal programming.  Has been used for cracks and hacks to work around logic flow of other programs.

Regards,  P1  :8)

Mark Jones

Ho Ho Ho!

Those who believe in cracking programs - have never written any.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

santa

 :clap:

Don't be ridiculous, Please. I've just asked a simple question about asm. I know rules !

it's a secret - he he he ... joke

evlncrn8

Quote from: Mark Jones on March 09, 2006, 05:44:15 PM
Ho Ho Ho!

Those who believe in cracking programs - have never written any.

i beg to differ