Update heap, stack and opcodes

This commit is contained in:
Werner
2021-11-29 20:43:59 -03:00
parent 03e43f39ce
commit 38236f0ad5
10 changed files with 396 additions and 180 deletions

View File

@ -6,6 +6,7 @@ pub type AddressRegister = (Word, Byte);
pub type Register = Byte;
pub type TwoRegisters = (Byte, Byte);
pub type ThreeRegisters = (Byte, Byte, Byte);
pub type FourRegisters = (Byte, Byte, Byte, Byte);
#[inline]
pub fn GetRegisterAddress(vm: &mut Machine) -> RegisterAddress {
@ -31,3 +32,13 @@ pub fn GetTwoRegisters(vm: &mut Machine) -> TwoRegisters {
pub fn GetThreeRegisters(vm: &mut Machine) -> ThreeRegisters {
(vm.ReadByte(None), vm.ReadByte(None), vm.ReadByte(None))
}
#[inline]
pub fn GetFourRegisters(vm: &mut Machine) -> FourRegisters {
(
vm.ReadByte(None),
vm.ReadByte(None),
vm.ReadByte(None),
vm.ReadByte(None),
)
}