Skip to main content

osom_encoders_x86_64/encoders/
call.rs

1//! This module contains the encoders for the `call` instruction group.
2#![allow(unused_imports)]
3
4// ** This file is automatically generated from x86.yaml schema. Do not modify! **
5
6use crate::models::{
7    EncodedX86_64Instruction, GPR, GPROrMemory, Immediate8, Immediate16, Immediate32, Immediate64, Memory, Offset,
8    Scale, Size,
9};
10
11/// Call to RIP-relative address.
12///
13/// # Safety
14///
15/// It is the caller's responsibility to ensure that the operands are valid.
16/// Otherwise the behavior is undefined.
17#[inline]
18pub const unsafe fn encode_imm32(imm32: Immediate32) -> EncodedX86_64Instruction {
19    unsafe { crate::partial_encoders::i::encode_imm32([0xE8], imm32) }
20}
21
22/// Call to address in 64-bit register or memory.
23///
24/// # Safety
25///
26/// It is the caller's responsibility to ensure that the operands are valid.
27/// Otherwise the behavior is undefined.
28#[inline]
29pub const unsafe fn encode_rm64(rm64: GPROrMemory) -> EncodedX86_64Instruction {
30    unsafe { crate::partial_encoders::m::encode_gpr_or_memory([0xFF], 0x02, rm64, false, false) }
31}