News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

addr vrs offset

Started by dc, May 24, 2024, 10:21:41 AM

Previous topic - Next topic

daydreamer

Quote from: sinsi on May 24, 2024, 04:44:34 PM
Quote from: daydreamer on May 24, 2024, 03:49:01 PMI prefer use lea eax,variable
Instead of mov eax,offset variable
Like this
Princess:lea eax,Luke
The instruction can be a byte or two longer though, if that matters.
It's a good idea in 64-bit programming, never use OFFSET and you will have position-independent code (RIP-relative), no fixups/relocations.

I dont care because I often code SSE/SSE2,SSE opcodes is 3+ bytes in size,SSE2 opcodes is 4+ bytes in size,load source and destination adresses into gp regs are before innerloop,inside innerloop lower opcode size means ability to unroll loop more times
 
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