qasm/psuedo.cpp
2019-11-12 17:03:51 -08:00

60 lines
909 B
C++

#include "psuedo.h"
#define CLASS TPsuedoOp
CLASS::CLASS()
{
}
CLASS::~CLASS()
{
}
int CLASS::doLST(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
std::string s;
if (a.pass > 0)
{
s = Poco::toUpper(Poco::trim(line.operand));
if ((s == "") || (s == "ON") || (line.expr_value > 0))
{
//printf("ON\n");
a.skiplist = true;
a.listing = true;
}
else if ((s == "OFF") || (line.expr_value == 0))
{
//printf("OFF\n");
a.skiplist = true;
a.listing = false;
}
}
return (0);
}
int CLASS::ProcessOpcode(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
int res = 0;
switch (opinfo.opcode)
{
default:
res = -1; // undefined p-op
line.setError(errUnimplemented);
break;
case P_ORG:
a.currentpc = line.expr_value;
break;
case P_SAV:
a.savepath = line.operand;
break;
case P_LST:
res = doLST(a, line, opinfo);
break;
}
return (res);
}