get_eff_addr_modrm_16(9)
π get_eff_addr_modrm_16 β like, the kernel API manual, bestie
okay so real talk, this one lives in the get_eff_addr_modrm_16(9) corner of the Kernel API Manual and it's giving "niche x86 decoder lore that only the girlies in arch/x86/lib understand" β¨
πΈ NAME πΈ
get_eff_addr_modrm_16 β bestie, it obtains the referenced effective address via ModRM π no cap, that's the whole vibe.
β¨ SYNOPSIS β¨
int get_eff_addr_modrm_16 (struct insn *insn , struct pt_regs *regs ,
int *regoff , short *eff_addr );
π¦ ARGUMENTS π¦
insnβ the instruction, and it must be valid, like that's not optional, that's the whole assignment πregsβ the register values exactly as seen when entering kernel moderegoffβ the obtained operand offset, inpt_regs, that's associated with the segmenteff_addrβ the obtained effective address, the main character fr fr π
π₯ DESCRIPTION π₯
okay so picture this: you want the 16-bit effective address referenced by the ModRM byte of insn, right? That's the mission. π«Ά
So after identifying the registers involved in the register-indirect memory reference, its value gets obtained from the operands in regs. The computed address is stored in eff_addr. Also β and this part is cute β the register operand that indicates the associated segment is stored in regoff. You can use that parameter later to determine such segment. iykyk π
β the returns, periodt
0on success.eff_addrwill have the referenced effective address.regoffwill have a register, as an offset from the base ofpt_regs, that can be used to resolve the associated segment. slay π-EINVALon error. π
ngl bestie, that's it β no secret extra returns hiding in the back of the group chat.
π SEE ALSO π
Kernel file ./arch/x86/lib/insn-eval.c β and honestly the whole friend group is here, so let's list every single one because we do not leave anyone on read π:
is_string_insn(9), insn_has_rep_prefix(9), get_seg_reg_override_idx(9), check_seg_overrides(9), resolve_default_seg(9), resolve_seg_reg(9), get_segment_selector(9), get_reg_offset_16(9), get_desc(9), insn_get_seg_base(9), get_seg_limit(9), insn_get_code_seg_params(9), insn_get_modrm_rm_off(9), insn_get_modrm_reg_off(9), insn_get_modrm_reg_ptr(9), get_seg_base_limit(9), get_eff_addr_reg(9), get_eff_addr_modrm(9), get_eff_addr_sib(9), get_addr_ref_16(9), get_addr_ref_32(9), get_addr_ref_64(9), insn_get_addr_ref(9), insn_fetch_from_user(9), insn_fetch_from_user_inatomic(9), insn_decode_from_regs(9), insn_decode_mmio(9)
okay that's the whole page and she ate, no crumbs π
source: ./arch/x86/lib Β· dated October 2026 Β· and that's the get_eff_addr_modrm_16(9) sign-off, mwah ππ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms