This commit is contained in:
kudzu_cp 2012-07-09 14:44:38 +00:00
parent 5fdc80a24a
commit a02e97a7ff
3 changed files with 57 additions and 4 deletions

View file

@ -11,11 +11,48 @@ namespace Cosmos.Debug.DebugStub {
public override void Assemble() {
new Comment("X#: Group DebugStub");
new LiteralAssemblerCode("; test when emitted after usage too");
new Comment("X#: const DsVsip_Noop = 0");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Noop equ 0");
new Comment("X#: ! DebugStub_Const_DsVsip_CmdCompleted equ 9");
new Comment("X#: const DsVsip_TracePoint = 1");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_TracePoint equ 1");
new Comment("X#: const DsVsip_Message = 2");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Message equ 2");
new Comment("X#: const DsVsip_BreakPoint = 3");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_BreakPoint equ 3");
new Comment("X#: const DsVsip_Error = 4");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Error equ 4");
new Comment("X#: const DsVsip_Pointer = 5");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Pointer equ 5");
new Comment("X#: const DsVsip_Started = 6");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Started equ 6");
new Comment("X#: const DsVsip_MethodContext = 7");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_MethodContext equ 7");
new Comment("X#: const DsVsip_MemoryData = 8");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_MemoryData equ 8");
new Comment("X#: const DsVsip_CmdCompleted = 9");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_CmdCompleted equ 9");
new Comment("X#: const DsVsip_Registers = 10");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Registers equ 10");
new Comment("X#: const DsVsip_Frame = 11");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Frame equ 11");
new Comment("X#: const DsVsip_Stack = 12");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Stack equ 12");
new Comment("X#: const DsVsip_Pong = 13");
new LiteralAssemblerCode("DebugStub_Const_DsVsip_Pong equ 13");
new Comment("X#: procedure AckCommand {");
new LiteralAssemblerCode("DebugStub_AckCommand:");

View file

@ -1,7 +1,19 @@
Group DebugStub
# test when emitted after usage too
! DebugStub_Const_DsVsip_CmdCompleted equ 9
const DsVsip_Noop = 0
const DsVsip_TracePoint = 1
const DsVsip_Message = 2
const DsVsip_BreakPoint = 3
const DsVsip_Error = 4
const DsVsip_Pointer = 5
const DsVsip_Started = 6
const DsVsip_MethodContext = 7
const DsVsip_MemoryData = 8
const DsVsip_CmdCompleted = 9
const DsVsip_Registers = 10
const DsVsip_Frame = 11
const DsVsip_Stack = 12
const DsVsip_Pong = 13
procedure AckCommand {
# We acknowledge receipt of the command AND the processing of it.

View file

@ -147,6 +147,10 @@ namespace Cosmos.Compiler.XSharp {
rCode.Add("Jp " + GetLabel(aTokens[1]));
});
AddPattern("const _ABC = 123", delegate(TokenList aTokens, ref List<string> rCode) {
rCode.Add(GroupLabel("Const_" + aTokens[1]) + " equ " + aTokens[3]);
});
AddPattern(true, "var _ABC", delegate(TokenList aTokens, ref List<string> rCode) {
rCode.Add("mAssembler.DataMembers.Add(new DataMember(" + Quoted(GetLabel(aTokens[1])) + ", 0));");
});