replaced my modified file but invalid opcode still remains

This commit is contained in:
Dokugogagoji_cp 2008-08-12 10:23:21 +00:00
parent e059a92e77
commit e55ec570fd
5 changed files with 83 additions and 54 deletions

View file

@ -10,7 +10,7 @@ namespace Cosmos.Kernel.Plugs.Assemblers {
// public static void ZeroFill(uint aStartAddress, uint aLength) {}
public override void Assemble(Assembler aAssembler) {
new CPUx86.ClrDirFlag();
new ClrDirFlag();
new CPUx86.Move("edi", "[ebp + 0xC]"); // address
new CPUx86.Move("ecx", "[ebp + 8]"); // length
new CPUx86.Move("eax", "0");

View file

@ -36,57 +36,60 @@ namespace Cosmos.Kernel {
switch (xCurrentDigit)
{
case 0:
Console.Write('0');
break;
xDigitString = "0";
goto default;
case 1:
Console.Write('1');
break;
xDigitString = "1";
goto default;
case 2:
Console.Write('2');
break;
xDigitString = "2";
goto default;
case 3:
Console.Write('3');
break;
xDigitString = "3";
goto default;
case 4:
Console.Write('4');
break;
xDigitString = "4";
goto default;
case 5:
Console.Write('5');
break;
xDigitString = "5";
goto default;
case 6:
Console.Write('6');
break;
xDigitString = "6";
goto default;
case 7:
Console.Write('7');
break;
xDigitString = "7";
goto default;
case 8:
Console.Write('8');
break;
xDigitString = "8";
goto default;
case 9:
Console.Write('9');
break;
xDigitString = "9";
goto default;
case 10:
Console.Write('A');
break;
xDigitString = "A";
goto default;
case 11:
Console.Write('B');
break;
xDigitString = "B";
goto default;
case 12:
Console.Write('C');
break;
xDigitString = "C";
goto default;
case 13:
Console.Write('D');
break;
xDigitString = "D";
goto default;
case 14:
Console.Write('E');
break;
xDigitString = "E";
goto default;
case 15:
Console.Write('F');
xDigitString = "F";
goto default;
default:
Console.Write(xDigitString);
break;
}
}
}
private static bool mDebugDisplayInitialized = false;
// this method displays the used/total memory of the heap on the first line of the text screen
@ -99,14 +102,14 @@ namespace Cosmos.Kernel {
Console.CursorTop = 0;
Console.Write("[Heap Usage: ");
WriteNumber(mStartAddress,
32);
32);
Console.Write("/");
WriteNumber(mEndOfRam,
32);
32);
Console.Write("] bytes");
while(Console.CursorLeft < (Console.WindowWidth-1)) {
Console.Write(" ");
}
Console.Write(" ");
}
Console.CursorLeft = xOldPositionLeft;
Console.CursorTop = xOldPositionTop;
}else {
@ -285,52 +288,52 @@ namespace Cosmos.Kernel {
// {
// case 0:
// xDigitString = "0";
//
// goto default;
// case 1:
// xDigitString = "1";
//
// goto default;
// case 2:
// xDigitString = "2";
//
// goto default;
// case 3:
// xDigitString = "3";
//
// goto default;
// case 4:
// xDigitString = "4";
//
// goto default;
// case 5:
// xDigitString = "5";
//
// goto default;
// case 6:
// xDigitString = "6";
//
// goto default;
// case 7:
// xDigitString = "7";
//
// goto default;
// case 8:
// xDigitString = "8";
//
// goto default;
// case 9:
// xDigitString = "9";
//
// goto default;
// case 10:
// xDigitString = "A";
//
// goto default;
// case 11:
// xDigitString = "B";
//
// goto default;
// case 12:
// xDigitString = "C";
//
// goto default;
// case 13:
// xDigitString = "D";
//
// goto default;
// case 14:
// xDigitString = "E";
//
// goto default;
// case 15:
// xDigitString = "F";
//
// goto default;
// default:
// Console.Write(xDigitString);
// break;

View file

@ -80,6 +80,7 @@
<Compile Include="CmpByteString.cs" />
<Compile Include="CmpWordString.cs" />
<Compile Include="EffectAddr.cs" />
<Compile Include="JumpOnGreater.cs" />
<Compile Include="LoadESWithPointer.cs" />
<Compile Include="FlagIntoAH.cs" />
<Compile Include="LoadByte.cs" />

View file

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Indy.IL2CPU.Assembler.X86
{
/// <summary>
/// CMP DEST, SOURCE
/// if (DEST > SOURCE) jump (signed)
/// </summary>
#warning this instruction should be renamed to JumpIfGreater after corresponding obsolete instruction is deleted
[OpCode(0xFFFFFFFF, "jg")]
public class JumpOnGreater : JumpBase
{
public JumpOnGreater(string aAddress)
: base(aAddress)
{
}
public override string ToString()
{
return "jg " + Address;
}
}
}

View file

@ -38,7 +38,7 @@ namespace Indy.IL2CPU.IL.X86 {
new CPUx86.Sub("ebx", "eax");
new CPUx86.SubWithCarry("ecx", "edx");
//result = value1 - value2
new CPUx86.JumpIfGreater(TargetLabel);
new CPUx86.JumpOnGreater(TargetLabel);
}else
{
new CPUx86.Pop(CPUx86.Registers.EAX);