Statistics

Members: 1927
News: 293
Web Links: 1
Visitors: 3933122

Who's Online

We have 2 guests online
Damn Vulnerable LinuxDamn Vulnerable Linux (DVL) is a Linux-based (modified Damn Small Linux) tool for IT-Security & IT-Anti- Security and Attack & Defense. [CLICK HERE FOR MORE INFOS! ]

Featured Conference Video

T16-Recon2006-Joe_Stewart-OllyBonE.gif OllyBone - Semi-Automatic Unpacking on IA-32. View the conference video here!
Abs
User Rating: / 0
PoorBest 
Written by Chris Dragan   


;Summary:       Calculates absolute value of a signed integer in eax.
;Compatibility: 386+
;Notes:     9 bytes, 4 clocks (P5), destroys ecx
    mov    ecx, eax    ; Duplicate value
    shr    ecx, 31     ; Fill ecx with its sign
    xor    eax, ecx    ; Do 'not eax' if negative
    sub    eax, ecx    ; Do 'inc eax' if negative

; For comparison, the standard way (2-8 clocks on P5 and 1-17 on P6):
;        or      eax, eax
;        js      @@1
;        neg     eax
;@@1: