Exemplo n.º 1
0
		// LDCz 553 ?
		// SDCz 599 ?

		#region Setup

		private static GenerateInstructionR[] SetupTableR()
		{
			GenerateInstructionR[] instrs = new GenerateInstructionR[ 64 ];

			// Populate table
			GenerateInstructionR unk = new GenerateInstructionR( UnknownR );
			for( int n = 0; n < instrs.Length; n++ )
				instrs[ n ] = unk;

			instrs[ 0 ] = new GenerateInstructionR( Arithmetic.SLL );
			instrs[ 2 ] = new GenerateInstructionR( Arithmetic.SRL );
			instrs[ 3 ] = new GenerateInstructionR( Arithmetic.SRA );
			instrs[ 4 ] = new GenerateInstructionR( Arithmetic.SLLV );
			instrs[ 6 ] = new GenerateInstructionR( Arithmetic.SRLV );
			instrs[ 7 ] = new GenerateInstructionR( Arithmetic.SRAV );
			instrs[ 8 ] = new GenerateInstructionR( Control.JR );
			instrs[ 9 ] = new GenerateInstructionR( Control.JALR );
			instrs[ 10 ] = new GenerateInstructionR( Arithmetic.MOVZ );
			instrs[ 11 ] = new GenerateInstructionR( Arithmetic.MOVN );
			instrs[ 12 ] = new GenerateInstructionR( Special.SYSCALL );
			instrs[ 13 ] = new GenerateInstructionR( Special.BREAK );
			instrs[ 15 ] = new GenerateInstructionR( Special.SYNC );
			instrs[ 16 ] = new GenerateInstructionR( Arithmetic.MFHI );
			instrs[ 17 ] = new GenerateInstructionR( Arithmetic.MTHI );
			instrs[ 18 ] = new GenerateInstructionR( Arithmetic.MFLO );
			instrs[ 19 ] = new GenerateInstructionR( Arithmetic.MTLO );
			instrs[ 22 ] = new GenerateInstructionR( Arithmetic.CLZ );
			instrs[ 23 ] = new GenerateInstructionR( Arithmetic.CLO );
			instrs[ 24 ] = new GenerateInstructionR( Arithmetic.MULT );
			instrs[ 25 ] = new GenerateInstructionR( Arithmetic.MULTU );
			instrs[ 26 ] = new GenerateInstructionR( Arithmetic.DIV );
			instrs[ 27 ] = new GenerateInstructionR( Arithmetic.DIVU );
			instrs[ 32 ] = new GenerateInstructionR( Arithmetic.ADD );
			instrs[ 33 ] = new GenerateInstructionR( Arithmetic.ADDU );
			instrs[ 34 ] = new GenerateInstructionR( Arithmetic.SUB );
			instrs[ 35 ] = new GenerateInstructionR( Arithmetic.SUBU );
			instrs[ 36 ] = new GenerateInstructionR( Arithmetic.AND );
			instrs[ 37 ] = new GenerateInstructionR( Arithmetic.OR );
			instrs[ 38 ] = new GenerateInstructionR( Arithmetic.XOR );
			instrs[ 39 ] = new GenerateInstructionR( Arithmetic.NOR );
			instrs[ 42 ] = new GenerateInstructionR( Arithmetic.SLT );
			instrs[ 43 ] = new GenerateInstructionR( Arithmetic.SLTU );
			instrs[ 44 ] = new GenerateInstructionR( Arithmetic.MAX );
			instrs[ 45 ] = new GenerateInstructionR( Arithmetic.MIN );

			return instrs;
		}
Exemplo n.º 2
0
		private static GenerateInstructionR[] SetupTableAllegrex()
		{
			GenerateInstructionR[] instrs = new GenerateInstructionR[ 64 ];

			// Populate table
			GenerateInstructionR unk = new GenerateInstructionR( UnknownR );
			for( int n = 0; n < instrs.Length; n++ )
				instrs[ n ] = unk;

			instrs[ 0 ] = new GenerateInstructionR( Special.HALT );
			instrs[ 0x24 ] = new GenerateInstructionR( Special.MFIC );
			instrs[ 0x26 ] = new GenerateInstructionR( Special.MTIC );

			return instrs;
		}