Re: length of a string?

From: Ivan Kossey (Kossey_at_cablenet.de)
Date: 12/16/04


Date: Thu, 16 Dec 2004 20:13:36 +0100

The only difference is that dec does not set the carry flag. If You need
carry decrementig zero then use
 sub eax,1

otherwise dec eax is shorter and use it.

Cheers
Ivan Kossey
"Bonj" <Bonj@discussions.microsoft.com> wrote in message
news:E942AD39-1E3F-4C7E-9507-B649DA3D3CD8@microsoft.com...
> Is
> sub eax, 1
> better than
> dec eax
> ?
>



Relevant Pages

  • Re: Who said registers are born equal ?
    ... >mov eax D$Memory ... So intel x86 chip R&D, give eax a special (shorter MachineCode). ...
    (alt.lang.asm)
  • Re: MOVZX has stall register
    ... |> MOV BYTE PTR, ... |> MOV EAX, 0FEH ... even I see a big waste in using 32-bits for one flag, ... | because it uses AH register. ...
    (comp.lang.asm.x86)
  • Re: MOVZX has stall register
    ... > MOV EAX, 0FEH ... Matt Taylor tells the same thing to use 32 Bits instructions rather ... CH, and DH register. ... I don't need it if I use Sign Flag, Zero Flag, and Carry Flag. ...
    (comp.lang.asm.x86)
  • Re: MOVZX has stall register
    ... MOV EAX, 0FEH ... Carry Flag is enabled. ... It would be 0FFFFFFFFH in EAX register. ... C/C++ Compiler compiles to add too many extra instructions ...
    (comp.lang.asm.x86)
  • Re: Portability
    ... Without an overflow flag, < is wordy. ... There are words to overwrite the TOS with a flag dep= ... CODE < EAX, EAX XOR EBX POP ECX POP EBX, ECX CMP ... CODE U< EAX, EAX XOR EBX POP ECX POP EBX, ECX CMP ...
    (comp.lang.forth)