Date: Sat, 01 Apr 2023 14:11:30 -0300
On Saturday, 1 April 2023 13:00:40 -03 Frederick Virchanza Gotham via Std-
Proposals wrote:
> ret
> xchg ax,ax
>
> I don't know what that last line is doing there after the function has
> returned, by anyway moving on. . .
That's just alignment. The xchg ax,ax instruction is a 2-byte NOP (the 1-byte
NOP instruction is "xchg eax, eax"). For 3 or more bytes, the compiler inserts
the nopl or nopw instructions instead.
Proposals wrote:
> ret
> xchg ax,ax
>
> I don't know what that last line is doing there after the function has
> returned, by anyway moving on. . .
That's just alignment. The xchg ax,ax instruction is a 2-byte NOP (the 1-byte
NOP instruction is "xchg eax, eax"). For 3 or more bytes, the compiler inserts
the nopl or nopw instructions instead.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel DCAI Cloud Engineering
Received on 2023-04-01 17:11:34