The MASM Forum

General => The Campus => Topic started by: RuiLoureiro on October 30, 2016, 12:35:09 AM

Title: How to convert a qword negative integer
Post by: RuiLoureiro on October 30, 2016, 12:35:09 AM
Hi all
i dont remember this now
How to convert a qword EDX:EAX to a positive qword EDX:EAX ?
Thanks  :t
:icon14:
Title: Re: How to convert a qword negative integer
Post by: nidud on October 30, 2016, 12:57:59 AM
deleted
Title: Re: How to convert a qword negative integer
Post by: RuiLoureiro on October 30, 2016, 01:57:32 AM
Quote from: nidud on October 30, 2016, 12:57:59 AM

   neg   eax
   neg   edx
   sbb   edx,0

Hi, thanks nidud  :t
Title: Re: How to convert a qword negative integer
Post by: Mikl__ on October 30, 2016, 02:49:42 AM
Olá, Rui!
AB.CDh=-(54.33h)
AB.80h=-(54.80h)
AB.4Fh=-(54.B1h)
AB.01h=-(54.FFh)
AB.00h=-(55.00h)
      not edx
      neg eax
      jnz exit
      inc edx
exit: ...
NEG and Flags Affected
Quote from: Intel® 64 and IA-32 Architectures
Software Developer's Manual. Volume 2B: Instruction Set Reference, N-Z
The CF flag set to 0 if the source operand is 0; otherwise it is set to 1. The OF, SF, ZF, AF, and PF flags are set according to the result.
not edx
neg eax
adc edx,0
na decisão de nidud trocar as primeira e segunda linhasneg edx
neg eax
sbb edx,0
Title: Re: How to convert a qword negative integer
Post by: RuiLoureiro on November 01, 2016, 11:06:21 AM
Olá Mikl__
Obrigado pela tua colaboração.
Então a solução do nidud não deve estar correcta, não é ?
Em todo o caso eu já não vou precisar disso.
Thank you so much, my friend Mkl__  :t

I am working in a new set of procedures
to implement a new way to do derivatives (and not only).
But it needs a lot of work.
The starting point is this: we have only 3 types
of expressions and 3 types of numeric constants:
integer- 3, -(50/5), 0.025E3
real- 2.3, -1.45e-5, ...
and rational- (-2/3), (4/5), (7/5), ...
And we have also literal constants(a,b,c,d...), pi and 'e'.
Solving an expression is to do a loop until the end
and solving each type (only 3). Of course the starting
result is a null string and each particular result
is added to that string. Till now, it works.
Até breve !
Good luck
:icon14: