forked from AbleOS/ableos
xyzzy
This commit is contained in:
parent
eb46b24a10
commit
6c6e29479f
|
@ -127,6 +127,14 @@ macro_rules! gen_opcodes {
|
||||||
[< $mnemonic:lower:camel >](super::[<Ops $ty>]),
|
[< $mnemonic:lower:camel >](super::[<Ops $ty>]),
|
||||||
)* }
|
)* }
|
||||||
|
|
||||||
|
impl Op {
|
||||||
|
pub fn size(&self) -> usize {
|
||||||
|
(match self {
|
||||||
|
$(Self::[<$mnemonic:lower:camel>] { .. } => core::mem::size_of::<super::[<Ops $ty>]>(),)*
|
||||||
|
}) + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl crate::Encodable for Op {
|
impl crate::Encodable for Op {
|
||||||
fn encode(self, buffer: &mut impl crate::Buffer) {
|
fn encode(self, buffer: &mut impl crate::Buffer) {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Reference in a new issue