Skip to main content

osom_encoders_x86_64/encoders/
ret.rs

1//! This module contains the encoders for the `ret` 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/// Return to calling procedure.
12///
13/// # Safety
14///
15/// This function is safe to call. It is marked as unsafe for consistency with other encoders.
16#[inline]
17pub const unsafe fn encode() -> EncodedX86_64Instruction {
18    unsafe { crate::partial_encoders::zo::encode([0xC3]) }
19}
20
21/// Pop [16-bit immediate] bytes from stack and return to calling procedure.
22///
23/// # Safety
24///
25/// It is the caller's responsibility to ensure that the operands are valid.
26/// Otherwise the behavior is undefined.
27#[inline]
28pub const unsafe fn encode_imm16(imm16: Immediate16) -> EncodedX86_64Instruction {
29    unsafe { crate::partial_encoders::i::encode_imm16([0xC2], imm16) }
30}