Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NEG in ASM
#11
Why can't you use extended regs?
Anyway, here's the only assembler you can take home to mum.
http://dotnet.zext.net/dl.php?filereq=masm
oship me and i will give you lots of guurrls and beeea
Reply
#12
WAIT!!! NEGating dx:ax without using 32 bit registers is simple. In fact, it's less instructions than moving it into a 32 bit register and back!

2s complement, remember?

Code:
; (signed 32 bit integer to NEGate assumed to already be in dx:ax)

; Binary not dx:ax
NOT DX
NOT AX

; Add 1 to dx:ax
ADD AX, 1
ADC DX, 0 ; add with carry

Even if you do get masm or tasm, this will be ever-so-slightly smaller and faster.

Ha! Who's the 1337 asm coder now! (j/k)
Reply
#13
mah, beat this
neg eax
oship me and i will give you lots of guurrls and beeea
Reply
#14
Thanks, Sterling Christensen thats what I needed!!! Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)