push eax

invoke GetDlgItemInt, hWin, IDC_EDT1, 0, TRUE

mov input, eax

pop eax

mov ah, 240

add ah, input

jc ueberlauf

jmp okay

ueberlauf:  invoke MessageBox,hWin,ADDR MsgBoxError, ADDR MsgBoxHeader , MB_OK + MB_ICONEXCLAMATION

okay:      invoke MessageBox,hWin,ADDR MsgBoxSuccess, ADDR MsgBoxHeader , MB_OK + MB_ICONEXCLAMATION


my plan is that the programmjump to the label okay ifthe parity flag isn`t aktiv and if the value is to high it has to jump to the label ueberlauf

But there are 2 problems:
1. I get an 32 bit register (eax) und i have to cast ist to ah, so that i can add the input value

and the second is that the program jump to the label ueberlauf and after tha also to the label okay
Posted on 2006-12-13 16:59:55 by golden_jubilee
I will have to assume that you expect a value lower than 255 from the GetDlgItemInt function. If that is correct, and you need to retain the content of EAX (even though you are trashing the AH part of it), you could do the following if you don't need the result of the addition in the AH register. If you don't need to retain any content of the EAX register, remove the "push eax" and "pop eax" instructions, and the result of the addition MOD(256) will be in the EAX (AL) register.

push eax
invoke GetDlgItemInt, hWin, IDC_EDT1, 0, TRUE
add al,240
pop eax
jpe ueberlauf  ;the jump is taken if the parity flag PF=1
invoke MessageBox,hWin,ADDR MsgBoxSuccess, ADDR MsgBoxHeader , MB_OK + MB_ICONEXCLAMATION
jmp whatever
ueberlauf:  invoke MessageBox,hWin,ADDR MsgBoxError, ADDR MsgBoxHeader , MB_OK + MB_ICONEXCLAMATION
whatever:


Note: the "jc" instruction has nothing to do with the parity flag but with the CARRY flag. If "carry" is what you really meant, replace the "jpe" by "jc" (if the carry flag CF=1) in the above code.

Raymond
Posted on 2006-12-13 22:06:36 by Raymond