'What is the difference between putting a 32-bit and a 64-bit register in the effective address? [duplicate]

When I assemble this (with nasm),

extern L
jmp [eax + ebx * 2 + L]
jmp [rax + rbx * 2 + L]
jmp [eax + L]
jmp [rax + L]

the result is,

67 ff a4 58 ...
ff a4 58 ...
67 ff a0 ...
ff a0 ...

There is an additional 0x67 in the resulting binary for putting a 32-bit register, but either way, at least in my program, seems to produce the same result.

Is one way just redundant, or can they sometimes produce a different result?

If they are the same, then what is a better choice?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source