News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Turning a positive register into a negative one.

Started by xandaz, November 26, 2021, 04:46:16 AM

Previous topic - Next topic

xandaz

    Hey. I'm trying to move the File Pointer back to it's beggining but am having a hard time. Shouldn't NEG eax do the trick? Could SetFilePointer,hFile,0,0,FILE_BEGIN do the trick? Thanks for helping me out in advance.

jj2007

Which value is in eax?
What does the manual say about SetFilePointer?

xandaz

    Hi JJ. EAX has a variable positive number. Also i got over SetFilePointer. Thanks

hutch--

Using EAX will probably garrantee that it gets overwritten. Get used to using memory variables where you use EAX as transfer, NEG it then load it into a 32 bit variable.

daydreamer

Quote from: hutch-- on November 26, 2021, 10:16:10 AM
Using EAX will probably garrantee that it gets overwritten. Get used to using memory variables where you use EAX as transfer, NEG it then load it into a 32 bit variable.
I prefer the rv macro
Mov variable, rv(apicall,a,b,c)
Some api calls,like SetTextColor and SetBkColor works great with push return value= old RGB color and pop later to restore colors
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

That is not a distinction magnus, the rv macro simply feeds the return value (eax) into a variable. Its done as a notation convenience.

xandaz