Cosmos/source2/Compiler/Cosmos.Compiler.DebugStub/Screen.cs
kudzu_cp 712dbacc44
2012-07-11 20:23:01 +00:00

42 lines
1.8 KiB
C#

using System;
using System.Linq;
using Cosmos.Assembler;
using Cosmos.Assembler.x86;
namespace Cosmos.Debug.DebugStub {
public class Screen : Cosmos.Assembler.Code {
public Screen(Assembler.Assembler aAssembler) : base(aAssembler) {}
public override void Assemble() {
new LiteralAssemblerCode("DebugStub_Const_VidBase equ 0xB8000");
new LiteralAssemblerCode("DebugStub_Cls:");
new LiteralAssemblerCode("Mov ESI, DebugStub_Const_VidBase");
new LiteralAssemblerCode("DebugStub_Cls_BeginLoop:");
new LiteralAssemblerCode("Mov dword [ESI + 0], 0x00");
new LiteralAssemblerCode("Inc ESI");
new LiteralAssemblerCode("Mov dword [ESI + 0], 0x0A");
new LiteralAssemblerCode("Inc ESI");
new LiteralAssemblerCode("Cmp ESI, 0xB8FA0");
new LiteralAssemblerCode("JB DebugStub_Cls_BeginLoop");
new LiteralAssemblerCode("DebugStub_Cls_Exit:");
new LiteralAssemblerCode("Ret");
new LiteralAssemblerCode("DebugStub_DisplayWaitMsg:");
new LiteralAssemblerCode("Mov ESI, DebugWaitMsg");
new LiteralAssemblerCode("Mov EDI, DebugStub_Const_VidBase");
new LiteralAssemblerCode("Add EDI, 1640");
new LiteralAssemblerCode("Mov AL, 1");
new LiteralAssemblerCode("DebugStub_DisplayWaitMsg_Block1Begin:");
new LiteralAssemblerCode("Cmp AL, 0");
new LiteralAssemblerCode("JE DebugStub_DisplayWaitMsg_Block1End");
new LiteralAssemblerCode("Mov AL, [ESI + 0]");
new LiteralAssemblerCode("Mov [EDI + 0], AL");
new LiteralAssemblerCode("Inc ESI");
new LiteralAssemblerCode("Add EDI, 2");
new LiteralAssemblerCode("jmp DebugStub_DisplayWaitMsg_Block1Begin");
new LiteralAssemblerCode("DebugStub_DisplayWaitMsg_Block1End:");
new LiteralAssemblerCode("DebugStub_DisplayWaitMsg_Exit:");
new LiteralAssemblerCode("Ret");
}
}
}