Cosmos/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.asm
kudzu_cp 5f1c3ddb87
2012-07-13 17:21:59 +00:00

101 lines
2.8 KiB
NASM

DebugStub_ProcessCommandNew:
Call DebugStub_ComReadAL
Push EAX
Cmp AL, DebugStub_Const_Vs2Ds_Noop
JE DebugStub_ProcessCommandNew_Exit
Mov EAX, 0
Call DebugStub_ComReadAL
Mov [DebugStub_CommandID], EAX
Mov EAX, [ESP + 0]
Cmp EAX, DebugStub_Const_Vs2Ds_TraceOff
JNE DebugStub_ProcessCommandNew_Block1End
Call DebugStub_TraceOff
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block1End:
Cmp EAX, DebugStub_Const_Vs2Ds_TraceOn
JNE DebugStub_ProcessCommandNew_Block2End
Call DebugStub_TraceOn
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block2End:
Cmp EAX, DebugStub_Const_Vs2Ds_Break
JNE DebugStub_ProcessCommandNew_Block3End
Call DebugStub_Break
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block3End:
Cmp EAX, DebugStub_Const_Vs2Ds_BreakOnAddress
JNE DebugStub_ProcessCommandNew_Block4End
Call DebugStub_BreakOnAddress
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block4End:
Cmp EAX, DebugStub_Const_Vs2Ds_SendMethodContext
JNE DebugStub_ProcessCommandNew_Block5End
Call DebugStub_SendMethodContext
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block5End:
Cmp EAX, DebugStub_Const_Vs2Ds_SendMemory
JNE DebugStub_ProcessCommandNew_Block6End
Call DebugStub_SendMemory
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block6End:
Cmp EAX, DebugStub_Const_Vs2Ds_SendRegisters
JNE DebugStub_ProcessCommandNew_Block7End
Call DebugStub_SendRegisters
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block7End:
Cmp EAX, DebugStub_Const_Vs2Ds_SendFrame
JNE DebugStub_ProcessCommandNew_Block8End
Call DebugStub_SendFrame
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block8End:
Cmp EAX, DebugStub_Const_Vs2Ds_SendStack
JNE DebugStub_ProcessCommandNew_Block9End
Call DebugStub_SendStack
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block9End:
Cmp EAX, DebugStub_Const_Vs2Ds_Ping
JNE DebugStub_ProcessCommandNew_Block10End
Call DebugStub_Ping
Call DebugStub_AckCommand
Jmp DebugStub_ProcessCommandNew_Exit
DebugStub_ProcessCommandNew_Block10End:
DebugStub_ProcessCommandNew_Exit:
Pop EAX
Ret
DebugStub_AckCommand:
Mov AL, DebugStub_Const_Ds2Vs_CmdCompleted
Call DebugStub_ComWriteAL
Mov EAX, [DebugStub_CommandID]
Call DebugStub_ComWriteAL
DebugStub_AckCommand_Exit:
Ret
DebugStub_ProcessCommandBatch:
DebugStub_ProcessCommandBatch_Begin:
Call DebugStub_ProcessCommand
Cmp AL, 8
JNE DebugStub_ProcessCommandBatch_Begin
Call DebugStub_AckCommand
DebugStub_ProcessCommandBatch_Exit:
Ret