public void Run(Steps_Table_Model steps, Stack_Table_Model stack, Machine reg) { Mem_Step s = steps.Get_Current_Step(); try { float acc = stack.Top(0); stack.Replace(acc == 0.0F ? 1.0F : 0.0F); } catch (Exception_Stack_Overflow e) { if (reg.Index_To_Memory(Constants.PERROR).Get_Value() == 0.0F) reg.Index_To_Memory(Constants.PERROR).Set_Value(5); // error code throw e; } finally { steps.Increment_Step(); } }
public void Run(Steps_Table_Model steps, Stack_Table_Model stack, Machine reg) { Mem_Step s = steps.Get_Current_Step(); try { float r = (float) reg.Index_To_Memory(s.Get_Register1()).Get_Status(); stack.Push(r); } catch (Exception_Stack_Overflow e) { if (reg.Index_To_Memory(Constants.PERROR).Get_Value() == 0.0F) reg.Index_To_Memory(Constants.PERROR).Set_Value(5); // error code throw e; } finally { steps.Increment_Step(); } }