Help me! I need smart jump for x86 
Author Message
 Help me! I need smart jump for x86

Prompt me as possible write a following code from 4 string (but i have 5
string) without JNE?
MOV AL,2
CMP [EAX],AL
JNE NoWrite
MOV [EAX],3
NoWrite:

Be possibility of comparison and performance of following command depending
on the result?



Sat, 03 Aug 2002 03:00:00 GMT  
 Help me! I need smart jump for x86

Quote:
> Prompt me as possible write a following code from 4 string (but i have 5
> string) without JNE?
> MOV AL,2
> CMP [EAX],AL
> JNE NoWrite
> MOV [EAX],3
> NoWrite:

This part:
Quote:
> MOV AL,2
> CMP [EAX],AL

Could re-write as:
    cmp byte ptr [eax],2

I can't think of a way to handle it without the JNE.  Sorry.  I'll try to
help more if you can give me information about the whole project.

- Rick



Sat, 03 Aug 2002 03:00:00 GMT  
 Help me! I need smart jump for x86
Art Dikov wrote :

Quote:
>> MOV AL,2
>> CMP [EAX],AL
>> JNE NoWrite
>> MOV [EAX],3
>> NoWrite:

A bit strange:

  MOV AL,2             ; this modify eax
  CMP [EAX],AL     ; eax has changed

What value in eax before first instruction?

Previous answer is wrong:

  CMP [EAX], 2

is not the same if AL <> 2 before first instruction

If B[eax] can only be, let us say 1, 2, 3 or 0
before you test it, you can do all this in one
single line:

  OR B[eax], 3  ; and,

if you want B[eax] to be turn 3, only if it is 2:

  MOV BL, B[EAX]
  SHR BL, 1
  OR  BL, B[EAX]
  MOV B[EAX], BL

Many other solution depending on the problem.
If it doesn't fit, ask again with the initial
value of eax and tell us what you mean to do...

bye. Betov.



Sat, 03 Aug 2002 03:00:00 GMT  
 Help me! I need smart jump for x86

Quote:
> MOV AL,2
> CMP [EAX],AL
> JNE NoWrite
> MOV [EAX],3
> NoWrite:

On a Pentium+ you might use this:

CMP BYTE PTR [EAX],2
CMOVNE BYTE PTR [EAX],3



Sat, 03 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Please help me! I need smart jump! for x86

2. x86 ignore my jump!!

3. jump start for x86 assembly(?)

4. I need an x86 assembler, please help me!!!

5. Need Help Choosing a x86 assembler!!!

6. Need help: Python and Oracle on Linux x86

7. Jump...Jump

8. Help please, Smart-ICEPIC.

9. Help please, Smart-ICEPIC.

10. Help with writing a smart game player

11. Need a good Disassembler to trace jumps in 16-Bit-Windows-EXE

12. Need a good Disassembler to trace jumps in 16-Bit-Windows-EXE

 

 
Powered by phpBB® Forum Software