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 static void ZeroFill(uint aStartAddress, uint aLength) {}
public override void Assemble(Assembler aAssembler) { public override void Assemble(Assembler aAssembler) {
new CPUx86.ClrDirFlag(); new ClrDirFlag();
new CPUx86.Move("edi", "[ebp + 0xC]"); // address new CPUx86.Move("edi", "[ebp + 0xC]"); // address
new CPUx86.Move("ecx", "[ebp + 8]"); // length new CPUx86.Move("ecx", "[ebp + 8]"); // length
new CPUx86.Move("eax", "0"); new CPUx86.Move("eax", "0");

View file

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

View file

@ -80,6 +80,7 @@
<Compile Include="CmpByteString.cs" /> <Compile Include="CmpByteString.cs" />
<Compile Include="CmpWordString.cs" /> <Compile Include="CmpWordString.cs" />
<Compile Include="EffectAddr.cs" /> <Compile Include="EffectAddr.cs" />
<Compile Include="JumpOnGreater.cs" />
<Compile Include="LoadESWithPointer.cs" /> <Compile Include="LoadESWithPointer.cs" />
<Compile Include="FlagIntoAH.cs" /> <Compile Include="FlagIntoAH.cs" />
<Compile Include="LoadByte.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.Sub("ebx", "eax");
new CPUx86.SubWithCarry("ecx", "edx"); new CPUx86.SubWithCarry("ecx", "edx");
//result = value1 - value2 //result = value1 - value2
new CPUx86.JumpIfGreater(TargetLabel); new CPUx86.JumpOnGreater(TargetLabel);
}else }else
{ {
new CPUx86.Pop(CPUx86.Registers.EAX); new CPUx86.Pop(CPUx86.Registers.EAX);