fn push_stack_u16(&mut self, value: u16) {
        let address = u16::from_le_bytes([self.s, memory_range::STACK_PAGE]);
        // The stack points to the next available memory.
        self.bus.borrow_mut().set_u16(
            // An additional byte is needed to store a u16. Subtract since the stack
            // grows down.
            address.wrapping_sub(1),
            value,
        );
        // Grow down only after setting the memory.
        self.s = self.s.wrapping_sub(2);
    }
/// This function implements pushing to the stack.
/// See the "S" register for more details.
This function implements pushing to the stack.
See the "S" register for more details.
This function implements pushing to the stack . See the " S " register for more details .
fn push_stack_u16(&mut self, value: u16) {
        let address = u16::from_le_bytes([self.s, memory_range::STACK_PAGE]);
        // The stack points to the next available memory.
        self.bus.borrow_mut().set_u16(
            // An additional byte is needed to store a u16. Subtract since the stack
            // grows down.
            address.wrapping_sub(1),
            value,
        );
        // Grow down only after setting the memory.
        self.s = self.s.wrapping_sub(2);
    }
fn push_stack_u16 ( & mut self , value : u16 ) { let address = u16 :: from_le_bytes ( [ self . s , memory_range :: STACK_PAGE ] ) ; // The stack points to the next available memory. self . bus . borrow_mut ( ) . set_u16 ( // An additional byte is needed to store a u16. Subtract since the stack // grows down. address . wrapping_sub ( 1 ) , value , ) ; // Grow down only after setting the memory. self . s = self . s . wrapping_sub ( 2 ) ; }
This function implements pushing to the stack.
This function implements pushing to the stack .
&mut self
value
u16
&mut self
value
u16