logoalt Hacker News

eigenform10/01/20241 replyview on HN

> immediate addressing mode addition

Well, except for the fact that you need to read from a register before adding the immediate displacement to it. You'd have to know the physical register and do the read very early (before renaming), or predict the value!


Replies

eigenform10/01/2024

I just realized you were probably referring to the example given from the AnandTech article with `lea r64, [r64+imm8]`.

Caveat is just that [presumably] the source and destination registers have to be matching (since `lea rax, [rax+imm]` is just `add rax, imm`).

show 1 reply