osom_encoders_x86_64/encoders/int.rs
1//! This module contains the encoders for the `int` 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/// Generate software interrupt with vector specified by immediate byte.
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_imm8(imm8: Immediate8) -> EncodedX86_64Instruction {
19 unsafe { crate::partial_encoders::i::encode_imm8([0xCD], imm8) }
20}
21
22/// Generate debug trap. More or less equivalent to `int 1`.
23///
24/// # Safety
25///
26/// This function is safe to call. It is marked as unsafe for consistency with other encoders.
27#[inline]
28pub const unsafe fn encode_1() -> EncodedX86_64Instruction {
29 unsafe { crate::partial_encoders::zo::encode([0xF1]) }
30}
31
32/// Generate breakpoint trap. More or less equivalent to `int 3`.
33///
34/// # Safety
35///
36/// This function is safe to call. It is marked as unsafe for consistency with other encoders.
37#[inline]
38pub const unsafe fn encode_3() -> EncodedX86_64Instruction {
39 unsafe { crate::partial_encoders::zo::encode([0xCC]) }
40}