Merge pull request #6 from lroathe/master

Bring my branch up to date
This commit is contained in:
Lane Roathe 2019-11-15 18:10:11 -08:00 committed by GitHub
commit b208c4bd41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 1696 additions and 469 deletions

View File

@ -3,28 +3,29 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
project(QAsm)
set(CMAKE_BUILD_TYPE Debug)
set(APPVERSION "1.0.1")
set(CMAKE_BUILD_TYPE DEBUG)
set(APPVERSION "4.0.9")
set(LIBRARY_NAME pal)
set(FIND_LIBRARY_USE_LIB64_PATHS TRUE)
include(./lib${LIBRARY_NAME}/cmake/CMakeHeader.txt)
set ( PROJECT_NAME "qasm" )
set(SOURCE
${PROJECT_ROOT}/${PROJECT_ID}.cpp
${PROJECT_ROOT}/${PROJECT_NAME}.cpp
${PROJECT_ROOT}/asm.cpp
${PROJECT_ROOT}/opcodes.cpp
${PROJECT_ROOT}/eval.cpp
${PROJECT_ROOT}/psuedo.cpp
)
find_package(OpenSSL REQUIRED)
find_package(Poco REQUIRED Foundation Util XML JSON NetSSL)
#find_package(OpenSSL REQUIRED)
find_package(Poco REQUIRED Foundation Util XML JSON )
include_directories(BEFORE
${PROJECT_ROOT}
${PROJECT_ROOT}/lib${LIBRARY_NAME}/include/${LIBRARY_NAME}
${OPENSSL_INCLUDE_DIR}
#${OPENSSL_INCLUDE_DIR}
${Poco_INCLUDE_DIRS}
)

View File

@ -1,6 +1,12 @@
#export CC=/usr/bin/clang
#export CXX=/usr/bin/clang++
export USE_CLANG=1
ifeq ($(USE_CLANG),1)
export CXX=/usr/bin/clang++
export CC=/usr/bin/clang
else
export CXX=g++
export CC=gcc
endif
V?=
S=
@ -35,6 +41,9 @@ install:
reformat:
qasm -x REFORMAT src/main.s
compare:
-bcompare . ../lane_hex &
asm:
test1:
@ -42,6 +51,9 @@ test1:
test2:
-qasm src/testfile.s
test3:
-qasm src/var.s

665
asm.cpp
View File

@ -25,18 +25,43 @@ void CLASS::setError(uint32_t ecode)
void CLASS::print(uint32_t lineno)
{
int i, l, pcol;
int pcol;
uint32_t l, i;
int commentcol = 40;
static bool checked = false;
static bool nc1 = false;
bool nc = false;
uint32_t b = 4; // how many bytes show on the first line
l = outbytect;
if (l > 4)
if (datafillct > 0)
{
l = 4;
l = datafillct;
}
else
{
l = outbytect;
}
if (l > b)
{
l = b;
}
if (!checked)
{
nc1 = getBool("option.nocolor", false);
checked = true;
}
else
{
nc = nc1;
}
if (!isatty(STDOUT_FILENO))
{
nc = true;
}
nc = getBool("option.nocolor", false);
if (!nc)
{
if (errorcode > 0)
@ -60,7 +85,6 @@ void CLASS::print(uint32_t lineno)
{
empty = true;
}
int b = 4;
pcol = 0;
if (!empty)
@ -74,16 +98,24 @@ void CLASS::print(uint32_t lineno)
for (i = 0; i < l; i++)
{
pcol += printf("%02X ", outbytes[i]);
uint8_t a = datafillbyte;
if (datafillct == 0)
{
a = outbytes[i];
}
pcol += printf("%02X ", a);
}
for (i = l; i < b; i++)
{
pcol += printf(" ");
}
pcol += printf("%6d ", lineno + 1);
if (showmx)
{
if (outbytect > 0)
if ((outbytect + datafillct) > 0)
{
pcol += printf("%%%c%c ", linemx & 02 ? '1' : '0', linemx & 01 ? '1' : '0');
}
@ -97,7 +129,6 @@ void CLASS::print(uint32_t lineno)
{
pcol += printf("%02X ", addressmode & 0xFF);
}
pcol += printf("%6d ", lineno + 1);
pcol = 0; // reset pcol here because this is where source code starts
@ -140,7 +171,51 @@ void CLASS::print(uint32_t lineno)
{
SetColor(CL_NORMAL | BG_NORMAL);
}
printf("\n");
uint32_t obc = datafillct;
if (obc == 0)
{
obc = outbytect;
}
uint32_t ct = 1;
if (obc > b)
{
ct = 0;
uint8_t db;
uint32_t t = b;
char *s = (char *)" ";
b = 8;
//printf("t=%d ct=%d\n",t,outbytect);
printf("\n");
while (t < obc)
{
db = datafillbyte;
if (datafillct == 0)
{
db = outbytes[t];
}
if (ct == 0)
{
printf("%s", s);
}
printf("%02X ", db);
t++;
ct++;
if (ct >= b)
{
printf("\n");
ct = 0;
}
}
}
if (ct > 0)
{
printf("\n");
}
}
@ -164,6 +239,8 @@ void CLASS::clear()
errorcode = 0;
errorText = "";
outbytect = 0;
datafillct = 0;
datafillbyte = 0;
lineno = 0;
outbytes.clear();
addressmode = 0;
@ -183,6 +260,7 @@ void CLASS::set(std::string line)
clear();
delim = 0;
//printf("line: |%s|\n", line.c_str());
while (i < l)
{
@ -337,9 +415,11 @@ void CLASS::errorOut(uint16_t code)
void CLASS::init(void)
{
filenames.clear();
starttime = GetTickCount();
syntax = SYNTAX_MERLIN;
initialdir = Poco::Path::current();
syntax = 0;
filecount = 0;
}
void CLASS::complete(void)
@ -348,7 +428,11 @@ void CLASS::complete(void)
uint64_t n = GetTickCount();
if (isDebug())
{
printf("Processing Time: %lu ms\n", n - starttime);
//cout << "Processing Time: " << n - starttime << "ms" << endl;
uint64_t x = n - starttime;
uint32_t x1 = x & 0xFFFFFFFF;
printf("Processing Time: %u ms\n", x1);
}
}
@ -358,114 +442,280 @@ void CLASS::process(void)
}
int CLASS::doline(int lineno, std::string line)
{
UNUSED(lineno);
UNUSED(line);
int res = -1;
return (res);
}
int CLASS::processfile(std::string &p)
std::string CLASS::processFilename(std::string fn, std::string curDir, int level)
{
std::string res = fn;
std::string s, s1;
Path p = Poco::Path(fn);
try
{
int n = p.depth();
//LOG_DEBUG << "n=" << n << " " << fn << endl;
if (n == 0)
{
res = curDir + fn;
}
if (n > 0)
{
std::string d1 = p[0];
uint32_t v = 100;
try
{
v = Poco::NumberParser::parseUnsigned(d1);
}
catch (...)
{
v = 99;
}
if (v < 10)
{
Poco::Path p1 = p.popFrontDirectory();
s = p1.toString();
s1 = "global.path" + Poco::NumberFormatter::format(v);
switch (v)
{
case 0:
s = initialdir + s;
break;
default:
s = getConfig(s1, ".") + "/" + s;
if (level < 5)
{
s = processFilename(s, curDir, level + 1);
}
break;
}
p = s;
p.makeAbsolute();
}
res = p.toString();
}
}
catch (Poco::Exception &e)
{
if (isDebug() > 2)
{
cout << "exception: " << e.displayText() << endl;
}
}
catch (std::exception &e)
{
if (isDebug() > 2)
{
cout << e.what() << endl;
}
}
p = res;
p.makeAbsolute();
res = p.toString();
char buff[PATH_MAX + 1];
memset(buff, 0x00, sizeof(buff));
char *rp = realpath(res.c_str(), buff);
if (rp != NULL)
{
//printf("realpath: %s\n", buff);
res = rp;
}
p = res;
p.makeAbsolute();
res = p.toString();
//LOG_DEBUG << "convert: |" << res << "|" << endl;
return (res);
}
int CLASS::processfile(std::string p, std::string &newfilename)
{
//Poco::File fn(p);
int c;
int res = -1;
uint32_t linect;
bool done, valid;
std::string currentdir;
std::string p1;
std::string line, op;
linect = 0;
done = false;
currentdir = Poco::Path::current();
if (filecount == 0)
{
initialdir = currentdir;
//printf("initialdir=%s\n",initialdir.c_str());
}
//printf("currentdir=%s initialdir=%s\n", currentdir.c_str(), initialdir.c_str());
//LOG_DEBUG << "initial file name: " << p << endl;
p = processFilename(p, (filecount == 0) ? currentdir : currentdir, 0);
//LOG_DEBUG << "Converted filename: " << p << endl;
Poco::Path tp(p);
Poco::Path path = tp.makeAbsolute();
Poco::Path parent = path.parent();
std::string dir = parent.toString();
valid = true;
p1 = tp.toString();
Poco::File fn(p1);
if (!fn.exists())
try
{
fn = Poco::File(p1 + ".s");
if (filecount == 0)
{
// is this the first file in the compilation, or a PUT/USE?
// if first, change CWD to location of file
LOG_DEBUG << "Changing directory to: " << dir << endl;
if (chdir(dir.c_str())) {} // change directory to where the file is
}
p1 = path.toString();
newfilename = p1;
//LOG_DEBUG << "initial file name: " << p1 << endl;
valid = true;
Poco::File fn(p1);
if (!fn.exists())
{
fn = Poco::File(p1 + ".S");
fn = Poco::File(p1 + ".s");
if (!fn.exists())
{
fn = Poco::File(p1 + ".mac");
fn = Poco::File(p1 + ".S");
if (!fn.exists())
{
valid = false;
fn = Poco::File(p1 + ".mac");
if (!fn.exists())
{
fn = Poco::File(p1);
valid = false;
}
}
}
}
}
p1 = fn.path();
p1 = fn.path();
//LOG_DEBUG << "File name: " << p1 << endl;
if (valid)
{
std::ifstream f(p1);
if (f.is_open())
int ecode = -3;
valid = false;
if (fn.exists())
{
//printf("file is open\n");
line = "";
while ((!done) && (f.good()) && (!f.eof()))
ecode = -2;
valid = true;
//LOG_DEBUG << "File exists: " << p1 << endl;
if (fn.isLink())
{
c = f.get();
if (c == 0x8D) // merlin line ending
{
c = 0x0A; // convert to linux
}
if (c == 0x8A) // possible merlin line ending
{
c = 0x00; // ignore
}
c &= 0x7F;
int x;
switch (c)
{
case 0x0D:
break;
case 0x09:
line += " ";
break;
case 0x0A:
linect++;
x = doline(linect, line);
if (x < 0)
{
done = true;
}
line = "";
break;
default:
if ((c >= ' ') && (c < 0x7F))
{
line += c;
}
else
{
//printf("garbage %08X\n",c);
}
break;
}
//LOG_DEBUG << "File is a link: " << p1 << endl;
}
if ( (f.eof()))
if ((fn.isDirectory()) || (!fn.canRead()))
{
res = 0;
//LOG_DEBUG << "File is a directory: " << p1 << endl;
valid = false;
}
}
}
else
{
fprintf(stderr, "File <%s> does not exist.\n\n", p.c_str());
}
//printf("\n\nfile read result: %d\n", res);
newfilename = p1;
if (!valid)
{
//fprintf(stderr, "Unable to access file: %s\n", p1.c_str());
errorct = 1;
return (ecode);
}
if (valid)
{
if (filecount == 0)
{
}
else
{
for (auto itr = filenames.begin(); itr != filenames.end(); ++itr)
{
if (*itr == p1)
{
return (-9);
}
}
}
filecount++;
filenames.push_back(p1);
std::ifstream f(p1);
if (f.is_open())
{
//printf("file is open\n");
line = "";
while ((!done) && (f.good()) && (!f.eof()))
{
c = f.get();
if (c == 0x8D) // merlin line ending
{
c = 0x0A; // convert to linux
}
if (c == 0x8A) // possible merlin line ending
{
c = 0x00; // ignore
}
c &= 0x7F;
int x;
switch (c)
{
case 0x0D:
break;
case 0x09:
line += " ";
break;
case 0x0A:
linect++;
x = doline(linect, line);
if (x < 0)
{
done = true;
}
line = "";
break;
default:
if ((c >= ' ') && (c < 0x7F))
{
line += c;
}
else
{
//printf("garbage %08X\n",c);
}
break;
}
}
if ( (f.eof()))
{
res = 0;
}
}
}
else
{
fprintf(stderr, "File <%s> does not exist.\n\n", p.c_str());
}
}
catch (...)
{
}
return (res);
}
@ -483,6 +733,8 @@ void CLASS::init(void)
int ts, tabpos;
lines.clear();
syntax = SYNTAX_MERLIN;
std::string tabstr = getConfig("reformat.tabs", "8,16,32");
tabstr = Poco::trim(tabstr);
@ -510,6 +762,8 @@ void CLASS::init(void)
int CLASS::doline(int lineno, std::string line)
{
UNUSED(lineno);
MerlinLine l(line);
lines.push_back(l);
return 0;
@ -703,6 +957,9 @@ TSymbol *CLASS::addVariable(std::string sym, std::string val, bool replace)
s.text = val;
s.used = false;
s.cb = NULL;
//printf("addvariable: %s %s\n", s.name.c_str(), s.text.c_str());
std::pair<std::string, TSymbol> p(Poco::toUpper(sym), s);
variables.insert(p);
res = findVariable(sym);
@ -735,6 +992,7 @@ void CLASS::showVariables(void)
{
printf("%-16s %s\n", itr->first.c_str(), itr->second.text.c_str());
}
printf("\n");
}
}
@ -742,45 +1000,52 @@ void CLASS::showVariables(void)
// false to print by value;
void CLASS::showSymbolTable(bool alpha)
{
std::map<std::string, uint32_t> alphamap;
std::map<uint32_t, std::string> nummap;
int columns = 4;
int column = columns;
for (auto itr = symbols.begin(); itr != symbols.end(); itr++)
if (symbols.size() > 0)
{
TSymbol ptr = itr->second;
alphamap.insert(pair<std::string, uint32_t>(ptr.name, ptr.value));
nummap.insert(pair<uint32_t, std::string>(ptr.value, ptr.name));
}
std::map<std::string, uint32_t> alphamap;
std::map<uint32_t, std::string> nummap;
if (alpha)
{
printf("\n\nSymbol table sorted alphabetically:\n\n");
int columns = getInt("asm.symcolumns", 3);
int column = columns;
for (auto itr = alphamap.begin(); itr != alphamap.end(); ++itr)
for (auto itr = symbols.begin(); itr != symbols.end(); itr++)
{
printf("%-16s 0x%08X ", itr->first.c_str(), itr->second);
if ( !--column )
TSymbol ptr = itr->second;
alphamap.insert(pair<std::string, uint32_t>(ptr.name, ptr.value));
nummap.insert(pair<uint32_t, std::string>(ptr.value, ptr.name));
}
if (alpha)
{
printf("\n\nSymbol table sorted alphabetically:\n\n");
for (auto itr = alphamap.begin(); itr != alphamap.end(); ++itr)
{
printf("\n");
column = columns;
printf("%-16s 0x%08X ", itr->first.c_str(), itr->second);
if ( !--column )
{
printf("\n");
column = columns;
}
}
}
}
else
{
printf("\n\nSymbol table sorted numerically:\n\n");
for (auto itr = nummap.begin(); itr != nummap.end(); ++itr)
else
{
printf("0x%08X %-16s ", itr->first, itr->second.c_str());
if ( !--column )
printf("\n\nSymbol table sorted numerically:\n\n");
for (auto itr = nummap.begin(); itr != nummap.end(); ++itr)
{
printf("\n");
column = columns;
printf("0x%08X %-16s ", itr->first, itr->second.c_str());
if ( !--column )
{
printf("\n");
column = columns;
}
}
}
if (column > 0)
{
printf("\n");
}
}
}
@ -860,7 +1125,7 @@ typedef struct
std::string regEx;
uint16_t addrMode;
std::string text;
std::string expression;
//std::string expression;
} TaddrMode;
// these are the regular expressions that determine the addressing mode
@ -896,6 +1161,9 @@ const TaddrMode addrRegEx[] =
// one or more of any character except ][,();
const std::string valExpression = "^([^\\]\\[,();]+)$";
// this one looks for ]variables
const std::string varExpression = "([]]{1}[:0-9A-Z_a-z]{1}[0-9A-Z_a-z]*)";
// opcode check. emitted opcodes are compared against this
// table, and if the XC status doesn't meet the requirements
// an error is thrown
@ -987,12 +1255,17 @@ void CLASS::initpass(void)
dumstartaddr = 0;
dumstart = 0;
variables.clear(); // clear the variables for each pass
while (!PCstack.empty())
{
PCstack.pop();
}
while (!LUPstack.empty())
{
LUPstack.pop();
}
curLUP.clear();
savepath = "";
}
@ -1004,6 +1277,11 @@ void CLASS::complete(void)
{
if (errorct == 0)
{
std::string currentdir = Poco::Path::current();
savepath = processFilename(savepath, currentdir, 0);
printf("saving to file: %s\n", savepath.c_str());
std::ofstream f(savepath);
uint32_t lineno = 0;
@ -1052,7 +1330,8 @@ int CLASS::evaluate(MerlinLine &line, std::string expr, int64_t &value)
if (isDebug() > 2)
{
int c = SetColor(CL_RED);
printf("eval Error=%d %08lX |%s|\n", res, result, eval.badsymbol.c_str());
uint32_t rr = result & 0xFFFFFFFF;
printf("eval Error=%d %08X |%s|\n", res, rr, eval.badsymbol.c_str());
SetColor(c);
}
}
@ -1062,7 +1341,8 @@ int CLASS::evaluate(MerlinLine &line, std::string expr, int64_t &value)
value = result;
if ((listing) && (pass > 0) && (isDebug() > 2))
{
printf("EV1=%08lX '%c'\n", v1, line.expr_shift);
uint32_t rr = v1 & 0xFFFFFFFF;
printf("EV1=%08X '%c'\n", rr, line.expr_shift);
}
if (v1 >= 0x10000)
{
@ -1081,7 +1361,8 @@ int CLASS::evaluate(MerlinLine &line, std::string expr, int64_t &value)
}
if (isDebug() >= 3)
{
printf("Eval Result: %08lX (status=%d)\n", value, res);
uint32_t rr = value & 0xFFFFFFFF;
printf("Eval Result: %08X (status=%d)\n", rr, res);
}
return (res);
}
@ -1201,16 +1482,75 @@ int CLASS::parseOperand(MerlinLine & line)
return (res);
}
int CLASS::substituteVariables(MerlinLine & line)
{
int res = -1;
int x;
std::string::size_type offset, slen;
std::string oper = line.operand;
std::string s;
TSymbol *sym;
uint32_t len, off, ct;
slen = oper.length();
if (slen > 0)
{
std::vector<std::string> groups;
offset = 0;
RegularExpression varEx(varExpression, Poco::RegularExpression::RE_EXTRA, true);
Poco::RegularExpression::MatchVec mVec;
//printf("|%s|%s|\n", varExpression.c_str(), oper.c_str());
groups.clear();
ct = 0;
while (offset < slen)
{
try
{
varEx.match(oper, offset, mVec, 0);
}
catch (...)
{
offset = slen;
}
x = mVec.size();
if (x > 0)
{
res = 0;
off = mVec[0].offset;
len = mVec[0].length;
s = oper.substr(off, len);
sym = findVariable(s);
if (sym != NULL)
{
ct++;
if (pass > 0)
{
//printf("%d |%s|\n", ct, s.c_str());
}
}
offset += len;
}
else
{
offset = slen;
}
}
}
return (res);
}
void CLASS::process(void)
{
uint32_t l;
int x;;
char c;
std::string op, operand;
//uint32_t operand_eval;
//uint16_t addrmode;
char buff[256];
std::string op, operand, ls;
//MerlinLine *line;
pass = 0;
while (pass < 2)
{
@ -1232,7 +1572,7 @@ void CLASS::process(void)
line.bytect = 0;
line.showmx = showmx;
if ((line.lable != "") && (pass == 0))
if ((line.lable != ""))
{
std::string lable = Poco::trim(line.lable);
TSymbol *sym = NULL;
@ -1241,14 +1581,19 @@ void CLASS::process(void)
switch (c)
{
case ']':
sym = addVariable(line.lable, "", true);
sprintf(buff, "$%X", PC.currentpc);
ls = buff;
sym = addVariable(line.lable, ls, true);
if (sym == NULL) { dupsym = true; }
break;
case ':':
break;
default:
sym = addSymbol(line.lable, PC.currentpc, false);
if (sym == NULL) { dupsym = true; }
if (pass == 0)
{
sym = addSymbol(line.lable, PC.currentpc, false);
if (sym == NULL) { dupsym = true; }
}
break;
}
if (dupsym)
@ -1256,6 +1601,7 @@ void CLASS::process(void)
line.setError(errDupSymbol);
}
}
x = substituteVariables(line);
x = parseOperand(line);
if (x >= 0)
{
@ -1345,8 +1691,11 @@ void CLASS::process(void)
int CLASS::doline(int lineno, std::string line)
{
int res = 0;
int x;
std::string op;
UNUSED(lineno);
MerlinLine l(line);
op = Poco::toLower(l.opcode);
@ -1361,10 +1710,69 @@ int CLASS::doline(int lineno, std::string line)
l.syntax = syntax;
lines.push_back(l);
if ((op == "use") || (op == "put"))
if (op == "lup")
{
//printf("processing % s\n",l.operand.c_str());
processfile(l.operand);
curLUP.lupoffset = lines.size();
LUPstack.push(curLUP);
curLUP.luprunning++;
curLUP.lupct = 3;
}
else if (op == "--^")
{
if (curLUP.luprunning > 0)
{
while (curLUP.luprunning > 0)
{
if (curLUP.lupct > 0)
{
curLUP.lupct--;
}
if (curLUP.lupct == 0)
{
curLUP.luprunning--;
curLUP = LUPstack.top();
LUPstack.pop();
}
}
}
else
{
l.setError(errDuplicateFile);
curLUP.luprunning = 0;
l.print(0);
errorct++;
res = -1;
}
}
else if ((op == "use") || (op == "put"))
{
std::string fn;
x = processfile(l.operand, fn);
if (x < 0)
{
switch (x)
{
case -9:
l.setError(errDuplicateFile);
break;
case -3:
l.setError(errFileNotFound);
break;
case -2:
l.setError(errFileNoAccess);
break;
default:
l.setError(errFileNotFound);
break;
}
l.operand = fn;
l.print(0);
errorct++;
res = -1;
}
}
return (res);
@ -1397,6 +1805,9 @@ void CLASS::complete(void)
int CLASS::doline(int lineno, std::string line)
{
UNUSED(lineno);
UNUSED(line);
int res = 0;
return (res);

67
asm.h
View File

@ -25,7 +25,7 @@
#define OP_SPECIAL 0x0008
// these bits are actually the CC (last 2 bits) of opcode addressing
#define OP_CLASS0 0x0000
#define OP_CLASS0 0x0000
#define OP_CLASS1 0x0100
#define OP_CLASS2 0x0200
#define OP_CLASS3 0x0300
@ -40,13 +40,13 @@ enum asmErrors
errNone,
errWarn,
errIncomplete,
errUnimplemented,
errFatal,
errBadAddressMode,
errBadOpcode,
errIncompatibleOpcode,
errBadByteCount,
errBadBranch,
errUnimplemented,
errForwardRef,
errNoRedefinition,
errBadOperand,
@ -54,7 +54,13 @@ enum asmErrors
errBadDUMop,
errOverflow,
errRecursiveOp,
errOpcodeNotStarted,
errOpcodeNotStarted,
errDuplicateFile,
errFileNotFound,
errFileNoAccess,
errBadEvaluation,
errMalformed,
errBadCharacter,
errMAX
};
@ -64,21 +70,28 @@ const std::string errStrings[errMAX + 1] =
"No Error",
"Warning",
"Unfinished Opcode",
"Unimplemented Instruction",
"Fatal",
"Unsupported Addressing Mode",
"Unknown Opcode",
"Opcode not available under CPU mode",
"Byte output differs between passes",
"Relative branch offset too large",
"Unimplemented Instruction",
"Forward Reference to symbol",
"Unable to redefine symbol",
"Unable to evaluate",
"Error in expression",
"Duplicate Symbol",
"Invalid use of DUM/DEND",
"Overflow detected",
"Recursive Operand",
"Opcode without start",
"Opcode without start",
"File already included",
"File not found",
"File no access",
"Unable to evaluate",
"Malformed Operand",
"Bad character in input",
""
};
#else
@ -123,7 +136,7 @@ public:
{
origin = old.origin;
currentpc = old.currentpc;
orgsave=old.orgsave;
orgsave = old.orgsave;
totalbytes = old.totalbytes;
};
@ -132,7 +145,7 @@ public:
origin = other.origin;
currentpc = other.currentpc;
totalbytes = other.totalbytes;
orgsave=other.orgsave;
orgsave = other.orgsave;
return (*this);
};
@ -141,7 +154,7 @@ public:
origin = 0;
currentpc = 0;
totalbytes = 0;
orgsave=0;
orgsave = 0;
};
~TOriginSection()
{
@ -178,6 +191,8 @@ public:
uint16_t pass0bytect;
uint16_t bytect;
uint16_t datafillct;
uint8_t datafillbyte;
uint16_t outbytect;
std::vector<uint8_t> outbytes;
@ -193,14 +208,19 @@ public:
class TFileProcessor
{
protected:
std::string initialdir;
std::vector<std::string> filenames;
uint8_t syntax;
uint64_t starttime;
uint32_t filecount; // how many files have been read in (because of included files from source
public:
uint32_t errorct;
std::string filename;
TFileProcessor();
virtual ~TFileProcessor();
virtual int processfile(std::string &p);
virtual std::string processFilename(std::string p, std::string currentdir, int level);
virtual int processfile(std::string p, std::string &newfilename);
virtual void init(void);
virtual int doline(int lineno, std::string line);
virtual void process(void);
@ -223,6 +243,23 @@ public:
virtual void complete(void);
};
class TLUPstruct
{
public:
TLUPstruct()
{
clear();
}
void clear(void) {
lupct=0;
lupoffset=0;
luprunning=0;
}
uint16_t lupct;
uint32_t lupoffset;
uint16_t luprunning;
};
class TSymbol;
typedef int (*TOpCB)(MerlinLine &line, TSymbol &sym);
typedef std::function<int (MerlinLine &line, TSymbol &sym)> TOpCallback;
@ -289,10 +326,15 @@ public:
TOriginSection PC;
std::stack<TOriginSection> PCstack;
std::stack<TLUPstruct> LUPstack;
TLUPstruct curLUP;
TPsuedoOp *psuedoops;
uint16_t pass;
bool inDUMSection; // yes if we are in a DUM/DEND section
T65816Asm();
virtual ~T65816Asm();
@ -314,8 +356,9 @@ public:
void initpass(void);
void showSymbolTable(bool alpha);
void showVariables(void);
int evaluate(MerlinLine &line,std::string expr, int64_t &value);
int evaluate(MerlinLine &line, std::string expr, int64_t &value);
int substituteVariables(MerlinLine & line);
int parseOperand(MerlinLine &line);
int getAddrMode(MerlinLine &line);
void setOpcode(MerlinLine &line, uint8_t op);
@ -350,4 +393,4 @@ public:
virtual void process(void);
virtual void complete(void);
};
};

View File

@ -1,16 +1,21 @@
#pragma once
// define application options here
#define PAL_APPCLASS TMyCustomApp
#define PAL_APPCLASS TQAsmApp
#define NO_SIGNAL_HANDLING
//#define SERVERAPP
#define ENABLE_SSL
#define USE_LOGGER
//#define ENABLE_SSL
//#define USE_LOGGER
//#define USE_NET
//#define USE_SSL
//#define USE_JSON
//#define USE_XML
// help text
#define HELP_USAGE "<options> filename"
#define HELP_PURPOSE "a program that does something"
#define HELP_USAGE "<options> <list of files>"
#define HELP_PURPOSE "\nMerlin 16+ Compatible 65816 Development Tool"

View File

@ -26,7 +26,7 @@ std::deque<Token> CLASS::exprToTokens(const std::string& expr)
std::deque<Token> tokens;
int state = 0;
char c;
char delim;
char delim = 0;
std::string ident, asc;
std::string ops = "+-*//^!.&()";
@ -36,6 +36,7 @@ std::deque<Token> CLASS::exprToTokens(const std::string& expr)
bool numexpect;
Token::Type t;
delim=0;
numexpect = true;
for (const auto* p = expr.c_str(); *p; ++p)
{
@ -378,7 +379,7 @@ int CLASS::parseNumber(std::string n, int64_t &val)
i = 0;
l = n.length();
l = (int)n.length();
s = "";
for (i = 0; i < l; i++)
{

View File

@ -24,6 +24,8 @@ void CLASS::setOpcode(MerlinLine &line, uint8_t op)
int CLASS::doPSEUDO(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
int res;
res = psuedoops->ProcessOpcode(*this, line, sym);
@ -32,6 +34,8 @@ int CLASS::doPSEUDO(MerlinLine &line, TSymbol &sym)
int CLASS::doXC(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
std::string s;
int res = 0;
@ -53,6 +57,8 @@ int CLASS::doXC(MerlinLine &line, TSymbol &sym)
int CLASS::doMX(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
if (cpumode < MODE_65816)
{
line.setError(errIncompatibleOpcode);
@ -67,6 +73,7 @@ int CLASS::doMX(MerlinLine &line, TSymbol &sym)
int CLASS::doEQU(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
int res = 0;
TSymbol *s;
if (line.lable.length() > 0)
@ -100,6 +107,7 @@ int CLASS::doEQU(MerlinLine &line, TSymbol &sym)
int CLASS::doUNK(MerlinLine &line, TSymbol &sym)
{
int res = -1;
UNUSED(sym);
res = 0;
if (pass > 0)
@ -117,6 +125,7 @@ int CLASS::doPER(MerlinLine &line, TSymbol &sym)
{
int res;
int32_t value = 0;;
UNUSED(sym);
res = 0;
if ((line.addressmode == syn_abs) || (line.addressmode == syn_imm))
@ -147,6 +156,7 @@ int CLASS::doMVN(MerlinLine &line, TSymbol &sym)
{
int res;
uint8_t op;
UNUSED(sym);
if (line.addressmode == syn_bm)
{
@ -197,6 +207,7 @@ int CLASS::doNoPattern(MerlinLine &line, TSymbol &sym)
// STZ = 1
// TSB = 2
// TRB = 3
UNUSED(sym);
int res, i;
uint8_t err;
@ -565,6 +576,11 @@ int CLASS::doBase6502(MerlinLine & line, TSymbol & sym)
}
}
}
if (line.flags&FLAG_FORCELONG)
{
line.setError(errBadAddressMode);
}
goto out;
}
if (m == syn_imm)
@ -670,6 +686,9 @@ out:
int CLASS::doEND(MerlinLine & line, TSymbol & sym)
{
UNUSED(sym);
UNUSED(line);
int res = 0;
passcomplete = true;
@ -678,6 +697,8 @@ int CLASS::doEND(MerlinLine & line, TSymbol & sym)
int CLASS::doBYTE(MerlinLine & line, TSymbol & sym)
{
UNUSED(sym);
int res = 1;
if (pass > 0)
@ -695,7 +716,7 @@ void CLASS::insertOpcodes(void)
pushopcode("EXT", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("ENT", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("ORG", P_ORG, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DSK", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DSK", P_SAV, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("SAV", P_SAV, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DS", P_DS, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("REL", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
@ -724,14 +745,14 @@ void CLASS::insertOpcodes(void)
pushopcode("FLS", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("REV", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("STR", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DA", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DW", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DDB", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DFB", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DB", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("ADR", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("ADRL", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("HEX", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DA", P_DATA, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DW", P_DATA, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DDB", P_DATA, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DFB", P_DATA, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DB", P_DATA, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("ADR", P_DATA, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("ADRL",P_DATA, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("HEX", P_HEX, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DS", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("DO", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));
pushopcode("ELSE", 0x00, OP_PSUEDO, OPHANDLER(&CLASS::doPSEUDO));

View File

@ -1,4 +1,5 @@
#include "psuedo.h"
#include "eval.h"
#define CLASS TPsuedoOp
@ -12,12 +13,129 @@ CLASS::~CLASS()
}
constexpr unsigned int strhash(const char *str, int h = 0)
{
return !str[h] ? 5381 : (strhash(str, h + 1) * 33) ^ str[h];
}
int CLASS::doDATA(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
TEvaluator eval(a);
int i;
int outct = 0;
int wordsize = 2;
int endian = 0;
std::string oper = line.operand;
std::string op = Poco::toUpper(Poco::trim(line.opcode));
Poco::StringTokenizer tok(oper, ",", Poco::StringTokenizer::TOK_TRIM |
Poco::StringTokenizer::TOK_IGNORE_EMPTY);
const char *ptr = (const char *)op.c_str();
switch (strhash(ptr) )
{
case strhash((const char *)"DA"):
case strhash((const char *)"DW"):
wordsize = 2;
break;
case strhash((const char *)"DDB"):
wordsize = 2;
endian = 1;
break;
case strhash((const char *)"DFB"):
case strhash((const char *)"DB"):
wordsize = 1;
break;
case strhash((const char *)"ADR"):
wordsize = 3;
break;
case strhash((const char *)"ADRL"):
wordsize = 4;
break;
default:
wordsize = 0;
break;
}
for (auto itr = tok.begin(); itr != tok.end(); ++itr)
{
//printf("%s\n",(*itr).c_str());
//evaluate each of these strings, check for errors on pass 2
std::string expr = *itr;
int64_t eval_result = 0;
uint8_t shift;
int r;
uint8_t b;
shift = 0;
r = eval.evaluate(expr, eval_result, shift);
if (r < 0)
{
//printf("eval error %d |%s|\n", r,expr.c_str());
if (a.pass > 0)
{
line.setError(errBadEvaluation);
}
}
if (shift == '>')
{
eval_result = (eval_result) & 0xFF;
}
if (shift == '<')
{
eval_result = (eval_result >> 8) & 0xFF;
}
else if ((shift == '^') || (shift == '|'))
{
eval_result = (eval_result >> 16) & 0xFF;
}
outct += wordsize;
if (a.pass > 0)
{
if (!endian) // little endian
{
for (i = 0; i < wordsize; i++)
{
b = (eval_result >> (8 * i)) & 0xFF;
line.outbytes.push_back(b);
//printf("%02X\n",b);
}
}
else
{
// big endian
for (i = 0; i < wordsize; i++)
{
b = (eval_result >> ((wordsize - 1 - i) * 8)) & 0xFF;
line.outbytes.push_back(b);
//printf("%02X\n",b);
}
}
}
}
#if 0
// SGQ - remove when complete
line.datafillct = outct;
line.datafillbyte = 0xCA;
// ===============
#endif
line.outbytect = outct;
return (outct);
}
int CLASS::doDS(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
int res = 0;
int32_t v = line.expr_value;
if (line.eval_result!=0)
if (line.eval_result != 0)
{
line.setError(errForwardRef);
}
@ -29,14 +147,18 @@ int CLASS::doDS(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
res = v;
if (a.pass>0)
line.datafillbyte = line.eval_result & 0xFF;
line.datafillct = v;
#if 0
if (a.pass > 0)
{
for (int i=0;i<v;i++)
for (int i = 0; i < v; i++)
{
line.outbytes.push_back(0x00);
}
line.outbytect=v;
line.outbytect = v;
}
#endif
}
return (res);
@ -44,6 +166,8 @@ int CLASS::doDS(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
int CLASS::doDUM(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
int res = 0;
bool isdend = ((opinfo.opcode == P_DEND) ? true : false);
@ -67,6 +191,8 @@ int CLASS::doDUM(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
int CLASS::doLST(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
std::string s;
if (a.pass > 0)
{
@ -87,6 +213,73 @@ int CLASS::doLST(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
return (0);
}
int CLASS::doHEX(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
std::string os = Poco::toUpper(Poco::trim(line.operand));
uint32_t bytect = 0;
uint8_t b = 0;
uint8_t ct = 0;
for ( uint32_t i = 0; i < os.length(); ++i )
{
char c = os[i];
if ((c >= '0') && (c <= '9'))
{
c = c - '0';
}
else if ((c >= 'a') && (c <= 'f'))
{
c = c - 'a' + 10;
}
else if ((c >= 'A') && (c <= 'F'))
{
c = c - 'A' + 10;
}
else if (c == ',')
{
continue;
}
else
{
line.setError(errBadCharacter);
return 0;
}
// Got a good char, append to hex string and see if we've got a byte
switch (ct)
{
case 0:
b = (c << 4);
break;
case 1:
b |= c;
break;
}
ct = (ct + 1) & 0x01;
if (!ct)
{
if (a.pass > 0)
{
line.outbytes.push_back(b);
}
b = 0;
bytect++;
}
}
if (ct & 0x01) // we got an odd number of nibbles
{
line.setError(errMalformed);
bytect = 0;
}
line.outbytect = bytect;
//printf("bytect=%d\n",bytect);
return bytect;
}
int CLASS::ProcessOpcode(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
int res = 0;
@ -110,24 +303,30 @@ int CLASS::ProcessOpcode(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
res = doDUM(a, line, opinfo);
break;
case P_ORG:
if (line.operand.length()>0)
if (line.operand.length() > 0)
{
a.PC.orgsave=a.PC.currentpc;
a.PC.orgsave = a.PC.currentpc;
a.PC.currentpc = line.expr_value;
line.startpc=line.expr_value;
line.startpc = line.expr_value;
}
else
{
a.PC.currentpc = a.PC.orgsave;
line.startpc=a.PC.orgsave;
line.startpc = a.PC.orgsave;
}
break;
case P_SAV:
a.savepath = line.operand;
a.savepath = a.processFilename(line.operand, Poco::Path::current(), 0);
break;
case P_LST:
res = doLST(a, line, opinfo);
break;
case P_HEX:
res = doHEX(a, line, opinfo);
break;
case P_DATA:
res = doDATA(a, line, opinfo);
break;
}
return (res);
}

View File

@ -13,6 +13,8 @@ enum
P_DS,
P_PUT,
P_USE,
P_HEX,
P_DATA,
P_MAX
};
@ -26,9 +28,8 @@ public:
int doLST(T65816Asm &a, MerlinLine &line, TSymbol &opinfo);
int doDUM(T65816Asm &a, MerlinLine &line, TSymbol &opinfo);
int doDS(T65816Asm &a, MerlinLine &line, TSymbol &opinfo);
int doHEX(T65816Asm &a, MerlinLine &line, TSymbol &opinfo);
int doDATA(T65816Asm &a, MerlinLine &line, TSymbol &opinfo);
};
#undef CLASS

134
qasm.cpp
View File

@ -12,14 +12,24 @@ PAL_BASEAPP *PAL::appFactory(void)
// you MUST supply this array 'appOptions'. NULL line and end.
programOption PAL::appOptions[] =
{
#ifdef DEBUG
{ "debug", "d", "enable debug info (repeat for more verbosity)", "", false, true},
{ "config", "f", "load configuration data from a <file>", "<file>", false, false},
{ "exec", "x", "execute a command", "<command>", false, false},
#endif
//{ "config", "f", "load configuration data from a <file>", " <file>", false, false},
{ "exec", "x", "execute a command [asm, link, reformat] default=asm", " <command>", false, false},
{ "", "", "", "", false, false}
};
void CLASS::displayVersion()
{
std::string s = "";
#ifdef DEBUG
s = "-debug";
#endif
cerr << "quickASM 16++ v" << (std::string)STRINGIFY(APPVERSION) << s << endl;
}
int CLASS::runServerApp(PAL_EVENTMANAGER *em)
{
int res = -1;
@ -39,25 +49,50 @@ int CLASS::runServerApp(PAL_EVENTMANAGER *em)
return (res);
}
void CLASS::showerror(int ecode, std::string fname)
{
std::string s;
switch (ecode)
{
case -2:
s = "Permission Denied";
break;
case -3:
s = "File not found";
break;
default:
s = "Unknown Error";
break;
}
if (ecode < -1)
{
std::string a = Poco::Util::Application::instance().config().getString("application.name", "");
fprintf(stderr, "%s: %s: %s\n", a.c_str(), fname.c_str(), s.c_str());
}
}
int CLASS::runCommandLineApp(void)
{
TFileProcessor *t = NULL;
std::string line;
std::string startdirectory;
std::string fname;
// only called if SERVERAPP not defined
int res = -1;
//LOG_DEBUG << "command line mode" << endl;
if (commandargs.size()==0)
startdirectory = Poco::Path::current();
if (commandargs.size() == 0)
{
fprintf(stderr,"No files given (--help for help)\n\n");
return(res);
displayHelp();
return (res);
}
for (ArgVec::const_iterator it = commandargs.begin(); it != commandargs.end(); ++it)
{
Poco::File fn(*it);
int x;
std::string p = fn.path();
Poco::Path path(p);
//logger().information(path.toString());
@ -74,41 +109,62 @@ int CLASS::runCommandLineApp(void)
t = new TMerlinConverter();
if (t != NULL)
{
t->init();
std::string f = path.toString();
t->processfile(f);
t->process();
t->complete();
res = (t->errorct > 0) ? -1 : 0;
delete t;
t = NULL;
try
{
t->init();
std::string f = path.toString();
t->filename = f;
x = t->processfile(f, fname);
if (x == 0)
{
t->process();
t->complete();
}
else
{
showerror(x, fname);
t->errorct = 1;
}
res = (t->errorct > 0) ? -1 : 0;
}
catch (...)
{
delete t;
t = NULL;
}
}
}
else if (cmd == "ASM")
{
if (e == "S")
{
//logger().information("ASM: " + path.toString());
t = new T65816Asm();
}
if (e == "LNK")
{
//logger().information("LNK: " + path.toString());
t = new T65816Link();
}
int x;
t = new T65816Asm();
if (t != NULL)
{
t->init();
std::string f = path.toString();
t->processfile(f);
t->process();
t->complete();
res = (t->errorct > 0) ? -1 : 0;
delete t;
t = NULL;
try
{
t->init();
std::string f = path.toString();
t->filename = f;
x = t->processfile(f, fname);
f = t->filename;
if (x == 0)
{
t->process();
t->complete();
}
else
{
showerror(x, fname);
t->errorct = 1;
}
res = (t->errorct > 0) ? -1 : 0;
}
catch (...)
{
delete t;
t = NULL;
}
if (chdir(startdirectory.c_str())) {}; // return us back to where we were
}
else
{
@ -117,7 +173,7 @@ int CLASS::runCommandLineApp(void)
}
else
{
fprintf(stderr,"Invalid command: <%s>\n\n", cmd.c_str());
fprintf(stderr, "Invalid command: <%s>\n\n", cmd.c_str());
}
}
}

9
qasm.h
View File

@ -1,18 +1,27 @@
#pragma once
#include <inttypes.h>
#include "palPoco.h"
#include "pallogger.h"
#include "eventtask.h"
#include "baseapp.h"
#include "httpserver.h"
#ifndef UNUSED
#define UNUSED (void)
#endif
#define CLASS PAL_APPCLASS
using namespace PAL_NAMESPACE;
class CLASS : public PAL_BASEAPP
{
protected:
void showerror(int ecode,std::string fname);
virtual int runCommandLineApp(void);
virtual int runServerApp(PAL_EVENTMANAGER *em);
virtual void displayVersion();
public:
};

View File

@ -5,19 +5,19 @@ logfile=mylog.log
[option]
debug=1
nocolor=true
;must be an integer. Code can use this as a level
nocolor=false
;debug must be an integer. Code can use this as a level
[application]
timezone=America/Los_Angeles
[global]
; path0 can not be set. It will always be the linux 'pwd'
; path0 can not be set. It will always be the linux 'pwd' at the time of launch
path1=0/macros
path2=0/output
path3=
path3=0/src
path4=
path5=
path5=dirpath5
[asm]
casesen=true
@ -27,7 +27,8 @@ lst=true
cpu=M65816
trackrep=false
allowduplicate=true
merlincompatible=true;
merlincompatible=true
symcolumns=3
[reformat]
tabs=12; 18; 36

View File

@ -26,13 +26,13 @@
2F5E550D237BB3090091163D /* qasm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E5501237BB3090091163D /* qasm.cpp */; };
2F5E550E237BB3090091163D /* opcodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E5504237BB3090091163D /* opcodes.cpp */; };
2F5E550F237BB3090091163D /* psuedo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E5505237BB3090091163D /* psuedo.cpp */; };
2F5E5536237BB3190091163D /* palutils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E552D237BB3190091163D /* palutils.cpp */; };
2F5E5537237BB3190091163D /* httpserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E552E237BB3190091163D /* httpserver.cpp */; };
2F5E5538237BB3190091163D /* eventtask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E552F237BB3190091163D /* eventtask.cpp */; };
2F5E5539237BB3190091163D /* baseapp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E5530237BB3190091163D /* baseapp.cpp */; };
2F5E553A237BB3190091163D /* httpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E5531237BB3190091163D /* httpclient.cpp */; };
2F5E553B237BB3190091163D /* pallogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E5532237BB3190091163D /* pallogger.cpp */; };
2F5E553C237BB3190091163D /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E5533237BB3190091163D /* main.cpp */; };
2F5E55F8237CBECB0091163D /* palutils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E55EF237CBECB0091163D /* palutils.cpp */; };
2F5E55F9237CBECB0091163D /* httpserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E55F0237CBECB0091163D /* httpserver.cpp */; };
2F5E55FA237CBECB0091163D /* eventtask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E55F1237CBECB0091163D /* eventtask.cpp */; };
2F5E55FB237CBECB0091163D /* baseapp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E55F2237CBECB0091163D /* baseapp.cpp */; };
2F5E55FC237CBECB0091163D /* httpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E55F3237CBECB0091163D /* httpclient.cpp */; };
2F5E55FD237CBECB0091163D /* pallogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E55F4237CBECB0091163D /* pallogger.cpp */; };
2F5E55FE237CBECB0091163D /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E55F5237CBECB0091163D /* main.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -76,23 +76,108 @@
2F5E5508237BB3090091163D /* psuedo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psuedo.h; sourceTree = SOURCE_ROOT; };
2F5E5509237BB3090091163D /* qasm.ini */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = qasm.ini; sourceTree = SOURCE_ROOT; };
2F5E550A237BB3090091163D /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = SOURCE_ROOT; };
2F5E551A237BB3190091163D /* palPoco.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = palPoco.h; sourceTree = "<group>"; };
2F5E551B237BB3190091163D /* pallogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pallogger.h; sourceTree = "<group>"; };
2F5E551C237BB3190091163D /* eventtask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eventtask.h; sourceTree = "<group>"; };
2F5E551D237BB3190091163D /* baseapp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseapp.h; sourceTree = "<group>"; };
2F5E551E237BB3190091163D /* pal_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pal_config.h; sourceTree = "<group>"; };
2F5E551F237BB3190091163D /* httpserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = httpserver.h; sourceTree = "<group>"; };
2F5E5520237BB3190091163D /* httpclient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = httpclient.h; sourceTree = "<group>"; };
2F5E5521237BB3190091163D /* palutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = palutils.h; sourceTree = "<group>"; };
2F5E5522237BB3190091163D /* pal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pal.h; sourceTree = "<group>"; };
2F5E552D237BB3190091163D /* palutils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = palutils.cpp; sourceTree = "<group>"; };
2F5E552E237BB3190091163D /* httpserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = httpserver.cpp; sourceTree = "<group>"; };
2F5E552F237BB3190091163D /* eventtask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = eventtask.cpp; sourceTree = "<group>"; };
2F5E5530237BB3190091163D /* baseapp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseapp.cpp; sourceTree = "<group>"; };
2F5E5531237BB3190091163D /* httpclient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = httpclient.cpp; sourceTree = "<group>"; };
2F5E5532237BB3190091163D /* pallogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pallogger.cpp; sourceTree = "<group>"; };
2F5E5533237BB3190091163D /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
2F5E553E237BB3730091163D /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; path = src; sourceTree = SOURCE_ROOT; };
2F5E55DC237CBECB0091163D /* palPoco.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = palPoco.h; sourceTree = "<group>"; };
2F5E55DD237CBECB0091163D /* pallogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pallogger.h; sourceTree = "<group>"; };
2F5E55DE237CBECB0091163D /* eventtask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eventtask.h; sourceTree = "<group>"; };
2F5E55DF237CBECB0091163D /* baseapp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseapp.h; sourceTree = "<group>"; };
2F5E55E0237CBECB0091163D /* pal_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pal_config.h; sourceTree = "<group>"; };
2F5E55E1237CBECB0091163D /* httpserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = httpserver.h; sourceTree = "<group>"; };
2F5E55E2237CBECB0091163D /* httpclient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = httpclient.h; sourceTree = "<group>"; };
2F5E55E3237CBECB0091163D /* palutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = palutils.h; sourceTree = "<group>"; };
2F5E55E4237CBECB0091163D /* pal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pal.h; sourceTree = "<group>"; };
2F5E55EF237CBECB0091163D /* palutils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = palutils.cpp; sourceTree = "<group>"; };
2F5E55F0237CBECB0091163D /* httpserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = httpserver.cpp; sourceTree = "<group>"; };
2F5E55F1237CBECB0091163D /* eventtask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = eventtask.cpp; sourceTree = "<group>"; };
2F5E55F2237CBECB0091163D /* baseapp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseapp.cpp; sourceTree = "<group>"; };
2F5E55F3237CBECB0091163D /* httpclient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = httpclient.cpp; sourceTree = "<group>"; };
2F5E55F4237CBECB0091163D /* pallogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pallogger.cpp; sourceTree = "<group>"; };
2F5E55F5237CBECB0091163D /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
2F5E5665237CC26F0091163D /* main.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = main.s; sourceTree = "<group>"; };
2F5E5667237CC26F0091163D /* qatools */ = {isa = PBXFileReference; lastKnownFileType = file; path = qatools; sourceTree = "<group>"; };
2F5E5668237CC26F0091163D /* testfile.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = testfile.s; sourceTree = "<group>"; };
2F5E566A237CC26F0091163D /* tool.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = tool.macs.s; sourceTree = "<group>"; };
2F5E566B237CC26F0091163D /* qatools.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qatools.s; sourceTree = "<group>"; };
2F5E566C237CC26F0091163D /* qatools.1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qatools.1.s; sourceTree = "<group>"; };
2F5E566D237CC26F0091163D /* link.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.s; sourceTree = "<group>"; };
2F5E566E237CC26F0091163D /* qatools.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qatools.macs.s; sourceTree = "<group>"; };
2F5E5670237CC26F0091163D /* asm.cmd.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.cmd.s; sourceTree = "<group>"; };
2F5E5671237CC26F0091163D /* asm.dsk.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.dsk.s; sourceTree = "<group>"; };
2F5E5672237CC26F0091163D /* asm.opcodes.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.opcodes.s; sourceTree = "<group>"; };
2F5E5673237CC26F0091163D /* asm.1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.1.s; sourceTree = "<group>"; };
2F5E5674237CC26F0091163D /* asm.header.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.header.s; sourceTree = "<group>"; };
2F5E5675237CC26F0091163D /* asm.eval.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.eval.s; sourceTree = "<group>"; };
2F5E5676237CC26F0091163D /* asm.cond.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.cond.s; sourceTree = "<group>"; };
2F5E5677237CC26F0091163D /* asm.vars.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.vars.s; sourceTree = "<group>"; };
2F5E5678237CC26F0091163D /* asm.errors.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = asm.errors.s; sourceTree = "<group>"; };
2F5E5679237CC26F0091163D /* merlin_convert.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = merlin_convert.s; sourceTree = "<group>"; };
2F5E567B237CC26F0091163D /* ifd.equs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = ifd.equs.s; sourceTree = "<group>"; };
2F5E567C237CC26F0091163D /* qasm.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qasm.s; sourceTree = "<group>"; };
2F5E567D237CC26F0091163D /* equs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = equs.s; sourceTree = "<group>"; };
2F5E567E237CC26F0091163D /* ifd.lib.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = ifd.lib.s; sourceTree = "<group>"; };
2F5E567F237CC26F0091163D /* qasm2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qasm2.s; sourceTree = "<group>"; };
2F5E5680237CC26F0091163D /* macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = macs.s; sourceTree = "<group>"; };
2F5E5681237CC26F0091163D /* link.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.s; sourceTree = "<group>"; };
2F5E5682237CC26F0091163D /* qasm1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qasm1.s; sourceTree = "<group>"; };
2F5E5683237CC26F0091163D /* merlin_orig.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = merlin_orig.s; sourceTree = "<group>"; };
2F5E5685237CC2700091163D /* qasm.docs */ = {isa = PBXFileReference; lastKnownFileType = text; path = qasm.docs; sourceTree = "<group>"; };
2F5E5686237CC2700091163D /* shell.docs */ = {isa = PBXFileReference; lastKnownFileType = text; path = shell.docs; sourceTree = "<group>"; };
2F5E5687237CC2700091163D /* zak.idea */ = {isa = PBXFileReference; lastKnownFileType = text; path = zak.idea; sourceTree = "<group>"; };
2F5E5689237CC2700091163D /* edit.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = edit.macs.s; sourceTree = "<group>"; };
2F5E568A237CC2700091163D /* edit.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = edit.s; sourceTree = "<group>"; };
2F5E568B237CC2700091163D /* edit.types.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = edit.types.s; sourceTree = "<group>"; };
2F5E568C237CC2700091163D /* edit.apw.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = edit.apw.s; sourceTree = "<group>"; };
2F5E568D237CC2700091163D /* edit.1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = edit.1.s; sourceTree = "<group>"; };
2F5E568E237CC2700091163D /* edit.cmd.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = edit.cmd.s; sourceTree = "<group>"; };
2F5E568F237CC2700091163D /* edit.equs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = edit.equs.s; sourceTree = "<group>"; };
2F5E5691237CC2700091163D /* qaintcmd.cmd.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qaintcmd.cmd.s; sourceTree = "<group>"; };
2F5E5692237CC2700091163D /* qaintcmd.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qaintcmd.s; sourceTree = "<group>"; };
2F5E5693237CC2700091163D /* intcmd.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = intcmd.macs.s; sourceTree = "<group>"; };
2F5E5695237CC2700091163D /* qatext */ = {isa = PBXFileReference; lastKnownFileType = file; path = qatext; sourceTree = "<group>"; };
2F5E5696237CC2700091163D /* quicklink.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = quicklink.s; sourceTree = "<group>"; };
2F5E5697237CC2700091163D /* qagraf */ = {isa = PBXFileReference; lastKnownFileType = file; path = qagraf; sourceTree = "<group>"; };
2F5E5698237CC2700091163D /* qaprefs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qaprefs.s; sourceTree = "<group>"; };
2F5E5699237CC2700091163D /* qacmd */ = {isa = PBXFileReference; lastKnownFileType = text; path = qacmd; sourceTree = "<group>"; };
2F5E569A237CC2700091163D /* qaintcmd */ = {isa = PBXFileReference; lastKnownFileType = file; path = qaintcmd; sourceTree = "<group>"; };
2F5E569B237CC2700091163D /* qaprefs */ = {isa = PBXFileReference; lastKnownFileType = text; path = qaprefs; sourceTree = "<group>"; };
2F5E569C237CC2700091163D /* qatools */ = {isa = PBXFileReference; lastKnownFileType = text; path = qatools; sourceTree = "<group>"; };
2F5E569D237CC2700091163D /* qe.prefs */ = {isa = PBXFileReference; lastKnownFileType = file; path = qe.prefs; sourceTree = "<group>"; };
2F5E569E237CC2700091163D /* login */ = {isa = PBXFileReference; lastKnownFileType = text; path = login; sourceTree = "<group>"; };
2F5E56A0237CC2700091163D /* link.cmd.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.cmd.s; sourceTree = "<group>"; };
2F5E56A1237CC2700091163D /* link.eval.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.eval.s; sourceTree = "<group>"; };
2F5E56A2237CC2700091163D /* link.errors.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.errors.s; sourceTree = "<group>"; };
2F5E56A3237CC2700091163D /* linker.2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = linker.2.s; sourceTree = "<group>"; };
2F5E56A4237CC2700091163D /* link.header.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.header.s; sourceTree = "<group>"; };
2F5E56A5237CC2700091163D /* link.express.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.express.s; sourceTree = "<group>"; };
2F5E56A6237CC2700091163D /* linker.1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = linker.1.s; sourceTree = "<group>"; };
2F5E56A7237CC2700091163D /* link.vars.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = link.vars.s; sourceTree = "<group>"; };
2F5E56A9237CC2700091163D /* tool.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = tool.macs.s; sourceTree = "<group>"; };
2F5E56AA237CC2700091163D /* toolmacs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = toolmacs.s; sourceTree = "<group>"; };
2F5E56AB237CC2700091163D /* intcmd.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = intcmd.macs.s; sourceTree = "<group>"; };
2F5E56AC237CC2700091163D /* qatools.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qatools.macs.s; sourceTree = "<group>"; };
2F5E56AE237CC2700091163D /* dump.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = dump.s; sourceTree = "<group>"; };
2F5E56AF237CC2700091163D /* time.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = time.s; sourceTree = "<group>"; };
2F5E56B0237CC2700091163D /* cat.macs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = cat.macs.s; sourceTree = "<group>"; };
2F5E56B1237CC2700091163D /* cat.cmd.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = cat.cmd.s; sourceTree = "<group>"; };
2F5E56B2237CC2700091163D /* catalog.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = catalog.s; sourceTree = "<group>"; };
2F5E56B3237CC2700091163D /* del.cmd.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = del.cmd.s; sourceTree = "<group>"; };
2F5E56B4237CC2700091163D /* ascii.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = ascii.s; sourceTree = "<group>"; };
2F5E56B6237CC2700091163D /* external.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = external.s; sourceTree = "<group>"; };
2F5E56B7237CC2700091163D /* opcodetest.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = opcodetest.s; sourceTree = "<group>"; };
2F5E56B8237CC2700091163D /* globals.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = globals.s; sourceTree = "<group>"; };
2F5E56B9237CC2700091163D /* toolmacs.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = toolmacs.s; sourceTree = "<group>"; };
2F5E56BA237CC2700091163D /* opdata.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = opdata.s; sourceTree = "<group>"; };
2F5E56BB237CC2700091163D /* qa.equates.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = qa.equates.s; sourceTree = "<group>"; };
2F5E56BD237CC2700091163D /* rez */ = {isa = PBXFileReference; lastKnownFileType = text; path = rez; sourceTree = "<group>"; };
2F5E56BE237CC2700091163D /* dump */ = {isa = PBXFileReference; lastKnownFileType = file; path = dump; sourceTree = "<group>"; };
2F5E56BF237CC2700091163D /* delete */ = {isa = PBXFileReference; lastKnownFileType = file; path = delete; sourceTree = "<group>"; };
2F5E56C0237CC2700091163D /* qasmgs */ = {isa = PBXFileReference; lastKnownFileType = text; path = qasmgs; sourceTree = "<group>"; };
2F5E56C1237CC2700091163D /* lc */ = {isa = PBXFileReference; lastKnownFileType = file; path = lc; sourceTree = "<group>"; };
2F5E56C2237CC2700091163D /* catalog */ = {isa = PBXFileReference; lastKnownFileType = file; path = catalog; sourceTree = "<group>"; };
2F5E56C3237CC2700091163D /* deletelink */ = {isa = PBXFileReference; lastKnownFileType = file; path = deletelink; sourceTree = "<group>"; };
2F5E56C4237CC2700091163D /* time */ = {isa = PBXFileReference; lastKnownFileType = file; path = time; sourceTree = "<group>"; };
2F5E56C5237CC2700091163D /* edit */ = {isa = PBXFileReference; lastKnownFileType = text; path = edit; sourceTree = "<group>"; };
2F5E56C6237CC2700091163D /* qlinkgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = qlinkgs; sourceTree = "<group>"; };
2F5E571B237CDF0A0091163D /* testdata */ = {isa = PBXFileReference; lastKnownFileType = folder; path = testdata; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -123,9 +208,9 @@
2F5E548E237BAC9A0091163D = {
isa = PBXGroup;
children = (
2F5E5510237BB3190091163D /* libpal */,
2F5E55D1237CBECB0091163D /* libpal */,
2F5E5499237BAC9A0091163D /* qasm */,
2F5E553D237BB3490091163D /* Test */,
2F5E5663237CC25D0091163D /* Test */,
2F5E5498237BAC9A0091163D /* Products */,
2F5E54B4237BAE370091163D /* Frameworks */,
);
@ -180,60 +265,257 @@
name = Frameworks;
sourceTree = "<group>";
};
2F5E5510237BB3190091163D /* libpal */ = {
2F5E55D1237CBECB0091163D /* libpal */ = {
isa = PBXGroup;
children = (
2F5E5518237BB3190091163D /* include */,
2F5E552C237BB3190091163D /* src */,
2F5E55DA237CBECB0091163D /* include */,
2F5E55EE237CBECB0091163D /* src */,
);
name = libpal;
path = ../../libpal;
path = ../libpal;
sourceTree = "<group>";
};
2F5E5518237BB3190091163D /* include */ = {
2F5E55DA237CBECB0091163D /* include */ = {
isa = PBXGroup;
children = (
2F5E5519237BB3190091163D /* pal */,
2F5E55DB237CBECB0091163D /* pal */,
);
path = include;
sourceTree = "<group>";
};
2F5E5519237BB3190091163D /* pal */ = {
2F5E55DB237CBECB0091163D /* pal */ = {
isa = PBXGroup;
children = (
2F5E551A237BB3190091163D /* palPoco.h */,
2F5E551B237BB3190091163D /* pallogger.h */,
2F5E551C237BB3190091163D /* eventtask.h */,
2F5E551D237BB3190091163D /* baseapp.h */,
2F5E551E237BB3190091163D /* pal_config.h */,
2F5E551F237BB3190091163D /* httpserver.h */,
2F5E5520237BB3190091163D /* httpclient.h */,
2F5E5521237BB3190091163D /* palutils.h */,
2F5E5522237BB3190091163D /* pal.h */,
2F5E55DC237CBECB0091163D /* palPoco.h */,
2F5E55DD237CBECB0091163D /* pallogger.h */,
2F5E55DE237CBECB0091163D /* eventtask.h */,
2F5E55DF237CBECB0091163D /* baseapp.h */,
2F5E55E0237CBECB0091163D /* pal_config.h */,
2F5E55E1237CBECB0091163D /* httpserver.h */,
2F5E55E2237CBECB0091163D /* httpclient.h */,
2F5E55E3237CBECB0091163D /* palutils.h */,
2F5E55E4237CBECB0091163D /* pal.h */,
);
path = pal;
sourceTree = "<group>";
};
2F5E552C237BB3190091163D /* src */ = {
2F5E55EE237CBECB0091163D /* src */ = {
isa = PBXGroup;
children = (
2F5E552D237BB3190091163D /* palutils.cpp */,
2F5E552E237BB3190091163D /* httpserver.cpp */,
2F5E552F237BB3190091163D /* eventtask.cpp */,
2F5E5530237BB3190091163D /* baseapp.cpp */,
2F5E5531237BB3190091163D /* httpclient.cpp */,
2F5E5532237BB3190091163D /* pallogger.cpp */,
2F5E5533237BB3190091163D /* main.cpp */,
2F5E55EF237CBECB0091163D /* palutils.cpp */,
2F5E55F0237CBECB0091163D /* httpserver.cpp */,
2F5E55F1237CBECB0091163D /* eventtask.cpp */,
2F5E55F2237CBECB0091163D /* baseapp.cpp */,
2F5E55F3237CBECB0091163D /* httpclient.cpp */,
2F5E55F4237CBECB0091163D /* pallogger.cpp */,
2F5E55F5237CBECB0091163D /* main.cpp */,
);
path = src;
sourceTree = "<group>";
};
2F5E553D237BB3490091163D /* Test */ = {
2F5E5663237CC25D0091163D /* Test */ = {
isa = PBXGroup;
children = (
2F5E553E237BB3730091163D /* src */,
2F5E5664237CC26F0091163D /* src */,
2F5E571B237CDF0A0091163D /* testdata */,
);
path = Test;
name = Test;
sourceTree = "<group>";
};
2F5E5664237CC26F0091163D /* src */ = {
isa = PBXGroup;
children = (
2F5E5665237CC26F0091163D /* main.s */,
2F5E5666237CC26F0091163D /* obj */,
2F5E5668237CC26F0091163D /* testfile.s */,
2F5E5669237CC26F0091163D /* tools */,
2F5E566F237CC26F0091163D /* asm */,
2F5E5679237CC26F0091163D /* merlin_convert.s */,
2F5E567A237CC26F0091163D /* shell */,
2F5E5683237CC26F0091163D /* merlin_orig.s */,
2F5E5684237CC2700091163D /* docs */,
2F5E5688237CC2700091163D /* edit */,
2F5E5690237CC2700091163D /* intcmd */,
2F5E5694237CC2700091163D /* qasystem */,
2F5E569F237CC2700091163D /* link */,
2F5E56A8237CC2700091163D /* macs */,
2F5E56AD237CC2700091163D /* exe */,
2F5E56B5237CC2700091163D /* data */,
2F5E56BC237CC2700091163D /* utility */,
);
path = src;
sourceTree = "<group>";
};
2F5E5666237CC26F0091163D /* obj */ = {
isa = PBXGroup;
children = (
2F5E5667237CC26F0091163D /* qatools */,
);
path = obj;
sourceTree = "<group>";
};
2F5E5669237CC26F0091163D /* tools */ = {
isa = PBXGroup;
children = (
2F5E566A237CC26F0091163D /* tool.macs.s */,
2F5E566B237CC26F0091163D /* qatools.s */,
2F5E566C237CC26F0091163D /* qatools.1.s */,
2F5E566D237CC26F0091163D /* link.s */,
2F5E566E237CC26F0091163D /* qatools.macs.s */,
);
path = tools;
sourceTree = "<group>";
};
2F5E566F237CC26F0091163D /* asm */ = {
isa = PBXGroup;
children = (
2F5E5670237CC26F0091163D /* asm.cmd.s */,
2F5E5671237CC26F0091163D /* asm.dsk.s */,
2F5E5672237CC26F0091163D /* asm.opcodes.s */,
2F5E5673237CC26F0091163D /* asm.1.s */,
2F5E5674237CC26F0091163D /* asm.header.s */,
2F5E5675237CC26F0091163D /* asm.eval.s */,
2F5E5676237CC26F0091163D /* asm.cond.s */,
2F5E5677237CC26F0091163D /* asm.vars.s */,
2F5E5678237CC26F0091163D /* asm.errors.s */,
);
path = asm;
sourceTree = "<group>";
};
2F5E567A237CC26F0091163D /* shell */ = {
isa = PBXGroup;
children = (
2F5E567B237CC26F0091163D /* ifd.equs.s */,
2F5E567C237CC26F0091163D /* qasm.s */,
2F5E567D237CC26F0091163D /* equs.s */,
2F5E567E237CC26F0091163D /* ifd.lib.s */,
2F5E567F237CC26F0091163D /* qasm2.s */,
2F5E5680237CC26F0091163D /* macs.s */,
2F5E5681237CC26F0091163D /* link.s */,
2F5E5682237CC26F0091163D /* qasm1.s */,
);
path = shell;
sourceTree = "<group>";
};
2F5E5684237CC2700091163D /* docs */ = {
isa = PBXGroup;
children = (
2F5E5685237CC2700091163D /* qasm.docs */,
2F5E5686237CC2700091163D /* shell.docs */,
2F5E5687237CC2700091163D /* zak.idea */,
);
path = docs;
sourceTree = "<group>";
};
2F5E5688237CC2700091163D /* edit */ = {
isa = PBXGroup;
children = (
2F5E5689237CC2700091163D /* edit.macs.s */,
2F5E568A237CC2700091163D /* edit.s */,
2F5E568B237CC2700091163D /* edit.types.s */,
2F5E568C237CC2700091163D /* edit.apw.s */,
2F5E568D237CC2700091163D /* edit.1.s */,
2F5E568E237CC2700091163D /* edit.cmd.s */,
2F5E568F237CC2700091163D /* edit.equs.s */,
);
path = edit;
sourceTree = "<group>";
};
2F5E5690237CC2700091163D /* intcmd */ = {
isa = PBXGroup;
children = (
2F5E5691237CC2700091163D /* qaintcmd.cmd.s */,
2F5E5692237CC2700091163D /* qaintcmd.s */,
2F5E5693237CC2700091163D /* intcmd.macs.s */,
);
path = intcmd;
sourceTree = "<group>";
};
2F5E5694237CC2700091163D /* qasystem */ = {
isa = PBXGroup;
children = (
2F5E5695237CC2700091163D /* qatext */,
2F5E5696237CC2700091163D /* quicklink.s */,
2F5E5697237CC2700091163D /* qagraf */,
2F5E5698237CC2700091163D /* qaprefs.s */,
2F5E5699237CC2700091163D /* qacmd */,
2F5E569A237CC2700091163D /* qaintcmd */,
2F5E569B237CC2700091163D /* qaprefs */,
2F5E569C237CC2700091163D /* qatools */,
2F5E569D237CC2700091163D /* qe.prefs */,
2F5E569E237CC2700091163D /* login */,
);
path = qasystem;
sourceTree = "<group>";
};
2F5E569F237CC2700091163D /* link */ = {
isa = PBXGroup;
children = (
2F5E56A0237CC2700091163D /* link.cmd.s */,
2F5E56A1237CC2700091163D /* link.eval.s */,
2F5E56A2237CC2700091163D /* link.errors.s */,
2F5E56A3237CC2700091163D /* linker.2.s */,
2F5E56A4237CC2700091163D /* link.header.s */,
2F5E56A5237CC2700091163D /* link.express.s */,
2F5E56A6237CC2700091163D /* linker.1.s */,
2F5E56A7237CC2700091163D /* link.vars.s */,
);
path = link;
sourceTree = "<group>";
};
2F5E56A8237CC2700091163D /* macs */ = {
isa = PBXGroup;
children = (
2F5E56A9237CC2700091163D /* tool.macs.s */,
2F5E56AA237CC2700091163D /* toolmacs.s */,
2F5E56AB237CC2700091163D /* intcmd.macs.s */,
2F5E56AC237CC2700091163D /* qatools.macs.s */,
);
path = macs;
sourceTree = "<group>";
};
2F5E56AD237CC2700091163D /* exe */ = {
isa = PBXGroup;
children = (
2F5E56AE237CC2700091163D /* dump.s */,
2F5E56AF237CC2700091163D /* time.s */,
2F5E56B0237CC2700091163D /* cat.macs.s */,
2F5E56B1237CC2700091163D /* cat.cmd.s */,
2F5E56B2237CC2700091163D /* catalog.s */,
2F5E56B3237CC2700091163D /* del.cmd.s */,
2F5E56B4237CC2700091163D /* ascii.s */,
);
path = exe;
sourceTree = "<group>";
};
2F5E56B5237CC2700091163D /* data */ = {
isa = PBXGroup;
children = (
2F5E56B6237CC2700091163D /* external.s */,
2F5E56B7237CC2700091163D /* opcodetest.s */,
2F5E56B8237CC2700091163D /* globals.s */,
2F5E56B9237CC2700091163D /* toolmacs.s */,
2F5E56BA237CC2700091163D /* opdata.s */,
2F5E56BB237CC2700091163D /* qa.equates.s */,
);
path = data;
sourceTree = "<group>";
};
2F5E56BC237CC2700091163D /* utility */ = {
isa = PBXGroup;
children = (
2F5E56BD237CC2700091163D /* rez */,
2F5E56BE237CC2700091163D /* dump */,
2F5E56BF237CC2700091163D /* delete */,
2F5E56C0237CC2700091163D /* qasmgs */,
2F5E56C1237CC2700091163D /* lc */,
2F5E56C2237CC2700091163D /* catalog */,
2F5E56C3237CC2700091163D /* deletelink */,
2F5E56C4237CC2700091163D /* time */,
2F5E56C5237CC2700091163D /* edit */,
2F5E56C6237CC2700091163D /* qlinkgs */,
);
path = utility;
sourceTree = "<group>";
};
/* End PBXGroup section */
@ -262,7 +544,7 @@
2F5E548F237BAC9A0091163D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1120;
ORGANIZATIONNAME = "Lane Roathe";
TargetAttributes = {
2F5E5496237BAC9A0091163D = {
@ -276,6 +558,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 2F5E548E237BAC9A0091163D;
productRefGroup = 2F5E5498237BAC9A0091163D /* Products */;
@ -295,15 +578,15 @@
2F5E550F237BB3090091163D /* psuedo.cpp in Sources */,
2F5E550B237BB3090091163D /* eval.cpp in Sources */,
2F5E550E237BB3090091163D /* opcodes.cpp in Sources */,
2F5E5538237BB3190091163D /* eventtask.cpp in Sources */,
2F5E553C237BB3190091163D /* main.cpp in Sources */,
2F5E5537237BB3190091163D /* httpserver.cpp in Sources */,
2F5E5536237BB3190091163D /* palutils.cpp in Sources */,
2F5E553A237BB3190091163D /* httpclient.cpp in Sources */,
2F5E55FA237CBECB0091163D /* eventtask.cpp in Sources */,
2F5E55FE237CBECB0091163D /* main.cpp in Sources */,
2F5E55F9237CBECB0091163D /* httpserver.cpp in Sources */,
2F5E55F8237CBECB0091163D /* palutils.cpp in Sources */,
2F5E55FC237CBECB0091163D /* httpclient.cpp in Sources */,
2F5E550C237BB3090091163D /* asm.cpp in Sources */,
2F5E550D237BB3090091163D /* qasm.cpp in Sources */,
2F5E553B237BB3190091163D /* pallogger.cpp in Sources */,
2F5E5539237BB3190091163D /* baseapp.cpp in Sources */,
2F5E55FD237CBECB0091163D /* pallogger.cpp in Sources */,
2F5E55FB237CBECB0091163D /* baseapp.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -434,6 +717,7 @@
2F5E549F237BAC9A0091163D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 32JVURPAZ7;
LIBRARY_SEARCH_PATHS = (
@ -447,6 +731,7 @@
2F5E54A0237BAC9A0091163D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 32JVURPAZ7;
LIBRARY_SEARCH_PATHS = (

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@ -38,8 +36,8 @@
ReferencedContainer = "container:qasm.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@ -67,8 +65,6 @@
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

View File

@ -1,244 +1,405 @@
lst off
lst off
*
* main.s
* Merlin32 Test
*
* Created by Lane Roathe on 8/26/19.
* Copyright © 2019 Ideas From the Deep. All rights reserved.
* Copyright B) 2019 Ideas From the Deep. All rights reserved.
*
//]XCODESTART ; Keep this at the start and put your code after this
xc off
xc
xc
mx %00
xc off
xc
xc
mx %00
*==========================================================
* monitor addresses
TEXT = $FB39 ;Reset text window
TABV = $FB5B ;Complete vtab, using contents of 'A'
MONBELL = $FBE4 ;random bell noise!
HOME = $FC58 ;Clear text window
WAIT = $FCA8 ;delay routine
CROUT = $FD8E ;Print a CR
PRBYTE = $FDDA ;Print 'A' as a hex number
PRHEX = $FDE3 ;as above, but bits 0-3 only
COUT = $FDED ;Monitor char out
MOVE = $FE2C ;memory move routine
INVERSE = $FE80 ;Print in inverse
NORMAL = $FE84 ;Normal print
TEXT = $FB39 ;Reset text window
TABV = $FB5B ;Complete vtab, using contents of 'A'
MONBELL = $FBE4 ;random bell noise!
HOME = $FC58 ;Clear text window
WAIT = $FCA8 ;delay routine
CROUT = $FD8E ;Print a CR
PRBYTE = $FDDA ;Print 'A' as a hex number
PRHEX = $FDE3 ;as above, but bits 0-3 only
COUT = $FDED ;Monitor char out
MOVE = $FE2C ;memory move routine
INVERSE = $FE80 ;Print in inverse
NORMAL = $FE84 ;Normal print
* Jump Vectors
CONNECT = $3EA ;Connect DOS
DOSWARM = $3D0 ;exit to DOS prompt
RSTVEC = $3F2 ;reset vector
CONNECT = $3EA ;Connect DOS
DOSWARM = $3D0 ;exit to DOS prompt
RSTVEC = $3F2 ;reset vector
TSTADDR = $1000 ;absolute address for testing
TSTADDR = $1000 ;absolute address for testing
*==========================================================
* Data Index DUM section test
lst
DUM 0
dum0 ds 1 ;fractional byte
dum1 ds 1
dumSize = *
DEND
;lst off
lst
DUM 0
dum0 ds 1 ;fractional byte
dum1 ds 1
dumSize = *
DEND
;lst off
*==========================================================
* zero page (all zp var names are prefixed with _)
DUM 0
DUM 0
_ptr ds 2
_tmp ds 2
_ptr ds 2
_tmp ds 2
_num1 ds dumSize ;first and second operand values
_num1 ds dumSize ;first and second operand values
; test ORG with DUM section
; test ORG with DUM section
ORG $20
ORG $20
_LFT ds 1 ;Window edge 0..39
_LFT ds 1 ;Window edge 0..39
DEND
DEND
*==========================================================
* Program Entry
;Issue #26 - This should start at the ORG in the linkscript, not at the last ORG in the DUM sections.
START
;Issue #26 - This should start at the ORG in the linkscript, not at the last ORG in the DUM sections.
START
; PUT current issue here, so it's the first thing assembled.
; The rest below are unit tests to make sure future changes don't break existing code!
; PUT current issue here, so it's the first thing assembled.
; The rest below are unit tests to make sure future changes don't break existing code!
; START OF TESTS KNOWN TO HAVE PASSED IN PREVIOUS BUILDS
; START OF TESTS KNOWN TO HAVE PASSED IN PREVIOUS BUILDS
; --- Test all instructions in all their modes, with as many variants as possible ---
; --- Test all instructions in all their modes, with as many variants as possible ---
;adc (ZP,x)
adc (0,x)
adc ($80,x)
adc (_tmp,x)
adc (_tmp+0,x)
adc (_tmp+$10,x)
adc ($10+_tmp,x)
adc (_tmp+dum0,x)
adc (_tmp+dum1,x)
adc (_tmp+dum1+1,x)
adc (_tmp+dum0+dum1,x)
adc 0
adc $80
adc _tmp
adc #0
adc #$1111
adc $1111
; --- Other tests that have proven helpful ---
; Tests regarding issues with math and zp,x
sta TSTADDR+dum0
sta TSTADDR+_num1+dum0
sta TSTADDR+_num1+dum0,x
lda _num1+dum0
adc _num1+dum1
sbc _num1+dum1
bit _num1+dum0
sta _num1+dum0 ;(FIXED): can't use sta _num1+dum0
stz _num1+dum0
lda _num1+dum0,x
adc _num1+dum0,x
sbc _num1+dum0,x
bit _num1+dum0,x
sta _num1+dum0,x
stz _num1+dum0,x
lda _num1+dum0,y ;these assemble to abs accesses: lda $00C0,y
adc _num1+dum0,y
sbc _num1+dum0,y
sta _num1+dum0,y
; Label & branching tests
GetKey ldx $C000
bpl GetKey
]loop
dex
bne ]loop
tya
and #1
beq :err
tya
and #1
bne :good
:err
lda #0
:good
bne myQuit
nop
hex 2C ;bit
lda #1
myQuit
jmp DOSWARM
; --- Tests used when addressing issues opened against Merlin32 ---
;Issue #26 (lroathe) - ORG in DUM section is ignored, but can't mess up code ORG
org $2000
lda _LFT
ldx #_LFT
cpx #$20
org ;return to ongoing address
lst
lda $FF
;Issue #16 (fadden) - Byte reference modifiers are ignored (no way to force DP)
lda <$fff0 ;zp
lda >$fff0 ;ABS (lo word)
lda ^$fff0 ;ABS (hi word)
lda |$fff0 ;ABS (long in 65816 mode)
lda $08
lda $0008
lda $FFFF-$FFF7
lda $FFF0+24
ldaz $FFF0+24 ; forced DP
ldaz $FFFF ; forced DP
lda: $FFFF ; forced ABS (any char but 'L', 'D', and 'Z"
ldal $FFFF ; forced long abs (3 byte address)
ldaz $05
lda: $05
ldal $05
;adc (ZP,x)
adc (0,x)
lda <$fff0+24 ;zp
lda >$fff0+24 ;ABS (lo word)
lda ^$fff0+24 ;ABS (hi word)
lda |$fff0+24 ;ABS (long in 65816 mode)
adc ($80,x)
adc (_tmp,x)
adc (_tmp+0,x)
adc (_tmp+$10,x)
adc ($10+_tmp,x)
adc (_tmp+dum0,x)
adc (_tmp+dum1,x)
adc (_tmp+dum1+1,x)
adc (_tmp+dum0+dum1,x)
mx %11
adc 0
adc $80
adc _tmp
adc #0
adc #$1111
adc $1111
lda #<$fff0+24 ;byte
lda #>$fff0+24 ;page
lda #^$fff0+24 ;bank
; --- Other tests that have proven helpful ---
lda #<$1234 ;byte
lda #>$1234 ;page
lda #^$1234 ;bank
lda #^$A51234 ;bank
; Tests regarding issues with math and zp,x
sta TSTADDR+dum0
sta TSTADDR+_num1+dum0
sta TSTADDR+_num1+dum0,x
lda _num1+dum0
adc _num1+dum1
sbc _num1+dum1
bit _num1+dum0
sta _num1+dum0 ;(FIXED): can't use sta _num1+dum0
stz _num1+dum0
lda _num1+dum0,x
adc _num1+dum0,x
sbc _num1+dum0,x
bit _num1+dum0,x
sta _num1+dum0,x
stz _num1+dum0,x
lda _num1+dum0,y ;these assemble to abs accesses: lda $00C0,y
adc _num1+dum0,y
sbc _num1+dum0,y
sta _num1+dum0,y
; Label & branching tests
GetKey ldx $C000
bpl GetKey
]loop
dex
bne ]loop
tya
and #1
beq :err
tya
and #1
bne :good
:err
lda #0
:good
bne myQuit
nop
hex 2C ;bit
lda #1
myQuit
jmp DOSWARM
; --- Tests used when addressing issues opened against Merlin32 ---
;Issue #26 (lroathe) - ORG in DUM section is ignored, but can't mess up code ORG
org $2000
lda _LFT
ldx #_LFT
cpx #$20
org ;return to ongoing address
lst
lda $FF
;Issue #16 (fadden) - Byte reference modifiers are ignored (no way to force DP)
lda <$fff0 ;zp
lda >$fff0 ;ABS (lo word)
lda ^$fff0 ;ABS (hi word)
lda |$fff0 ;ABS (long in 65816 mode)
lda $08
lda $0008
lda $FFFF-$FFF7
lda $FFF0+24
ldaz $FFF0+24 ; forced DP
mx %00
ldaz $FFFF ; forced DP
lda: $FFFF ; forced ABS (any char but 'L', 'D', and 'Z"
ldal $FFFF ; forced long abs (3 byte address)
lda #<$fff0+24 ;byte
lda #>$fff0+24 ;page
lda #^$fff0+24 ;bank
ldaz $05
lda: $05
ldal $05
lda #<$1234 ;byte
lda #>$1234 ;page
lda #^$1234 ;bank
lda #^$A51234 ;bank
lda $45
lda $2345
lda $012345
ldaz $2345
lda: $45
ldal $012345
ldal $2345
ldal $45
lda <$2345
lda >$2345
lda <$012345
lda >$012345
lda ^$012345
lda |$012345
ora $45
ora $2345
ora $012345
oraz $2345
ora: $45
oral $012345
oral $2345
oral $45
ora <$2345
ora >$2345
ora <$012345
ora >$012345
ora ^$012345
ora |$012345
and $45
and $2345
and $012345
andz $2345
and: $45
andl $012345
andl $2345
andl $45
and <$2345
and >$2345
and <$012345
and >$012345
and ^$012345
and |$012345
eor $45
eor $2345
eor $012345
eorz $2345
eor: $45
eorl $012345
eorl $2345
eorl $45
eor <$2345
eor >$2345
eor <$012345
eor >$012345
eor ^$012345
eor |$012345
adc $45
adc $2345
adc $012345
adcz $2345
adc: $45
adcl $012345
adcl $2345
adcl $45
adc <$2345
adc >$2345
adc <$012345
adc >$012345
adc ^$012345
adc |$012345
sta $45
sta $2345
sta $012345
staz $2345
sta: $45
stal $012345
stal $2345
stal $45
sta <$2345
sta >$2345
sta <$012345
sta >$012345
sta ^$012345
sta |$012345
cmp $45
cmp $2345
cmp $012345
cmpz $2345
cmp: $45
cmpl $012345
cmpl $2345
cmpl $45
cmp <$2345
cmp >$2345
cmp <$012345
cmp >$012345
cmp ^$012345
cmp |$012345
sbc $45
sbc $2345
sbc $012345
sbcz $2345
sbc: $45
sbcl $012345
sbcl $2345
sbcl $45
sbc <$2345
sbc >$2345
sbc <$012345
sbc >$012345
sbc ^$012345
sbc |$012345
asll $1234
lda <$fff0+24 ;zp
lda >$fff0+24 ;ABS (lo word)
lda ^$fff0+24 ;ABS (hi word)
lda |$fff0+24 ;ABS (long in 65816 mode)
mx %11
lda #<$fff0+24 ;byte
lda #>$fff0+24 ;page
lda #^$fff0+24 ;bank
lda #<$1234 ;byte
lda #>$1234 ;page
lda #^$1234 ;bank
lda #^$A51234 ;bank
mx MX
mx %00
lda $0008 ;ZP
lda $08 ;ZP
lda $ffff-$fff7 ;ZP
lda $fff0+24 ;ABS (long in 65816 mode)
lda #<$fff0+24 ;byte
lda #>$fff0+24 ;page
lda #^$fff0+24 ;bank
lda #<$1234 ;byte
lda #>$1234 ;page
lda #^$1234 ;bank
lda #^$A51234 ;bank
;Issue #8 fadden) - STX zp,y fails to assemble
org $bc
mx MX
L00BC bit L00BC
lda $0008 ;ZP
lda $08 ;ZP
lda $ffff-$fff7 ;ZP
lda $fff0+24 ;ABS (long in 65816 mode)
org
stx $bc,y
;Issue #8 fadden) - STX zp,y fails to assemble
org $bc
L00BC bit L00BC
org
stx $bc,y
ldx L00BC,y
stx L00BC,y
* Data Storage Tests
hex 11,22,33,44,55,66,77,88,99
hex 112233445566778899F
hex 112233445I566778899FF
hex aabb,CC,0123456789ABCDEFabcdef,ff
ds 36
da $A55A
da $A55A,$1234
dw $A55A
dw $A55A,$1234
ddb $A55A
ddb $A55A,$1234
dfb $A55A
dfb $A55A,$1234
db $A55A
db $A55A,$1234
adr $01A55A
adr $01A55A,$011234
adrl $01A55A
adrl $01A55A,$011234
dw >$01A55A,>$011234
dw <$01A55A,<$011234
dw ^$01A55A,^$011234
dw |$01A55A,|$011234
db >$01A55A,>$011234
db <$01A55A,<$011234
db ^$01A55A,^$011234
db |$01A55A,|$011234
;lup 3
;db 0
;--^
ldx L00BC,y
stx L00BC,y
//]XCODEEND ; Keep this at the end and put your code above this
lst off
;lst off

25
src/var.s Normal file
View File

@ -0,0 +1,25 @@
lst
xc
xc
mx %00
org $4000
getkey = $FF00
]myvar = getkey
start nop
ldy #$00
]loop sta $800,y
dey
bne ]loop;]loop2
bne ]myvar;
bcs ]loop
bpl ]loop
rts
use var
lst on