add some doc

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2025-02-20 17:50:15 +01:00
parent 095ce2ce93
commit 354e93aa4d
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

View file

@ -101,14 +101,31 @@ pub enum Instruction {
CheckCast { reg: u8, lit: IdType },
/// Check if an object if an instance of a type.
/// (put 1 in the dest register if yes, else 0)
InstanceOf { dest: u8, obj: u8, lit: IdType },
InstanceOf {
/// 4 bits register
dest: u8,
/// 4 bits register
obj: u8,
lit: IdType,
},
/// Get the number of item in an array.
/// (put the lenght in the dest register)
ArrayLength { dest: u8, arr: u8 },
ArrayLength {
/// 4 bits register
dest: u8,
/// 4 bits register
arr: u8,
},
/// Construct a new instance of the indicated type and store a reference to it.
NewInstance { reg: u8, lit: IdType },
/// Construct a new array of the indicated type and size in size_reg and store a reference to it.
NewArray { reg: u8, size_reg: u8, lit: IdType },
NewArray {
/// 4 bits register
reg: u8,
/// 4 bits register
size_reg: u8,
lit: IdType,
},
/// Construct a new array of the indicated type and size fill it with the values of the
/// given registers.
///