aboutsummaryrefslogtreecommitdiff
path: root/parse.cpp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-03-20 23:20:00 +0100
committertomsmeding <tom.smeding@gmail.com>2017-03-21 22:49:30 +0100
commit7c437e1e39f73517b458aa72f9754e165f572969 (patch)
tree1ed52f6fd8fd87fb70daf2fe6b0b14d7878ee90c /parse.cpp
parent32c25651f707b13f5f0c27cf807521cf163dcacb (diff)
Add debugger instruction (int3)
Just compiles to an 'int3' instruction; not a full-featured debugger...
Diffstat (limited to 'parse.cpp')
-rw-r--r--parse.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/parse.cpp b/parse.cpp
index cbfb306..8c1a21e 100644
--- a/parse.cpp
+++ b/parse.cpp
@@ -109,8 +109,8 @@ Team assemble(const string &source){
pargs.push_back(parseArgument(s,labels,
{(int)team.banks.size()-1,(int)team.banks.back().size()}));
}
- if(word1=="jump"||word1=="turn"||word1=="scan")assert(pargs.size()==1);
- else if(word1=="die"||word1=="move")assert(pargs.size()==0);
+ if(word1=="debugger"||word1=="die"||word1=="move")assert(pargs.size()==0);
+ else if(word1=="jump"||word1=="turn"||word1=="scan")assert(pargs.size()==1);
else if(word1=="create")assert(pargs.size()==3);
else assert(pargs.size()==2);
@@ -127,6 +127,7 @@ Team assemble(const string &source){
else if(word1=="turn")s.push_back(Instruction::make(ins_t::turn,{pargs[0]}));
else if(word1=="scan")s.push_back(Instruction::make(ins_t::scan,{pargs[0]}));
else if(word1=="create")s.push_back(Instruction::make(ins_t::create,{pargs[0],pargs[1],pargs[2]}));
+ else if(word1=="debugger")s.push_back(Instruction::make(ins_t::debugger,{}));
else assert(false);
}
}