From a02e97a7fffc2be0000d7438b72fee269455b04d Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Mon, 9 Jul 2012 14:44:38 +0000 Subject: [PATCH] --- .../Cosmos.Compiler.DebugStub/CmdProcess.cs | 41 ++++++++++++++++++- .../Cosmos.Compiler.DebugStub/CmdProcess.xs | 16 +++++++- .../Compiler/Cosmos.XSharp/TokenPatterns.cs | 4 ++ 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.cs b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.cs index 7186e7be5..7077bd489 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.cs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.cs @@ -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:"); diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs index 162d35502..1a23b84f7 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs @@ -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. diff --git a/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs b/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs index fa8796537..bf3150675 100644 --- a/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs +++ b/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs @@ -147,6 +147,10 @@ namespace Cosmos.Compiler.XSharp { rCode.Add("Jp " + GetLabel(aTokens[1])); }); + AddPattern("const _ABC = 123", delegate(TokenList aTokens, ref List rCode) { + rCode.Add(GroupLabel("Const_" + aTokens[1]) + " equ " + aTokens[3]); + }); + AddPattern(true, "var _ABC", delegate(TokenList aTokens, ref List rCode) { rCode.Add("mAssembler.DataMembers.Add(new DataMember(" + Quoted(GetLabel(aTokens[1])) + ", 0));"); });