static public DynarecResult RET(DynarecContextChip8 Context) { return ast.Statements( #if !NATIVE_CALLS ast.Assign(Context.GetPC(), ast.Cast<ushort>(ast.CallInstance(Context.GetCallStack(), (Func<uint>)((new Stack<uint>()).Pop)))), #endif ast.Return() ); }
static public DynarecResult JP_addr(DynarecContextChip8 Context, ushort Address) { return ast.Statements( #if NATIVE_JUMPS ast.Statement(ast.CallTail(ast.CallDelegate(Context.GetCallForAddress(Address + Context.GetRegister(0)), Context.GetCpuContext()))), #else ast.Statements(ast.Assign(Context.GetPC(), Address + Context.GetRegister(0))), #endif ast.Return() ); }
static public DynarecResult CALL(DynarecContextChip8 Context, ushort Address) { return ast.Statements( #if NATIVE_CALLS ast.Statement(ast.CallDelegate(Context.GetCallForAddress(Address), Context.GetCpuContext())) #else ast.Statement(ast.CallInstance(Context.GetCallStack(), (Action<uint>)((new Stack<uint>()).Push), Context.EndPC)), ast.Statements(ast.Assign(Context.GetPC(), Address)), ast.Return() #endif ); }