mirror of
https://github.com/marketideas/qasm.git
synced 2026-04-25 18:46:57 +00:00
adding script to create M32 output files
This commit is contained in:
@@ -34,6 +34,7 @@ debug:
|
||||
distclean:
|
||||
rm -rf ./build
|
||||
-rm -rf ./testout
|
||||
-rm -rf ./m32out
|
||||
|
||||
clean:
|
||||
-rm -rf ./build
|
||||
|
||||
@@ -1554,6 +1554,7 @@ void CLASS::initpass(void)
|
||||
truncdata = 0;
|
||||
variables.clear(); // clear the variables for each pass
|
||||
|
||||
macros.clear();
|
||||
while (!PCstack.empty())
|
||||
{
|
||||
PCstack.pop();
|
||||
|
||||
@@ -280,11 +280,12 @@ public:
|
||||
{
|
||||
clear();
|
||||
}
|
||||
void clear(void) {
|
||||
lupct=0;
|
||||
lupoffset=0;
|
||||
luprunning=0;
|
||||
lupskip=false;
|
||||
void clear(void)
|
||||
{
|
||||
lupct = 0;
|
||||
lupoffset = 0;
|
||||
luprunning = 0;
|
||||
lupskip = false;
|
||||
}
|
||||
uint16_t lupct;
|
||||
bool lupskip;
|
||||
@@ -299,9 +300,10 @@ public:
|
||||
{
|
||||
clear();
|
||||
}
|
||||
void clear(void) {
|
||||
doskip=false;
|
||||
value=0;
|
||||
void clear(void)
|
||||
{
|
||||
doskip = false;
|
||||
value = 0;
|
||||
}
|
||||
uint32_t value;
|
||||
bool doskip;
|
||||
@@ -334,7 +336,7 @@ public:
|
||||
value = 0;
|
||||
used = false;
|
||||
//text = "";
|
||||
var_text="";
|
||||
var_text = "";
|
||||
name = "";
|
||||
namelc = "";
|
||||
stype = 0;
|
||||
@@ -343,6 +345,17 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class TMacro
|
||||
{
|
||||
public:
|
||||
std::string name;
|
||||
std::string lcname;
|
||||
uint32_t currentline;
|
||||
std::vector<MerlinLine> lines;
|
||||
std::vector<std::string> variables;
|
||||
};
|
||||
|
||||
class TPsuedoOp;
|
||||
|
||||
class T65816Asm : public TFileProcessor
|
||||
@@ -371,8 +384,8 @@ public:
|
||||
|
||||
std::string currentsymstr;
|
||||
std::vector<MerlinLine> lines;
|
||||
Poco::HashMap<std::string, TMacro> macros;
|
||||
Poco::HashMap<std::string, TSymbol>opcodes;
|
||||
Poco::HashMap<std::string, TSymbol> macros;
|
||||
Poco::HashMap<std::string, TSymbol> symbols;
|
||||
Poco::HashMap<std::string, TSymbol> variables;
|
||||
|
||||
@@ -386,6 +399,7 @@ public:
|
||||
std::stack<TLUPstruct> LUPstack;
|
||||
std::stack<TDOstruct> DOstack;
|
||||
std::stack<bool> LSTstack;
|
||||
std::stack<TMacro> curMacro;
|
||||
|
||||
TPsuedoOp *psuedoops;
|
||||
|
||||
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
OUTDIR=./m32out
|
||||
|
||||
rm -rf $OUTDIR
|
||||
mkdir -p $OUTDIR
|
||||
|
||||
SRC=`ls ./testdata | grep -E '^([0-9]+)(.*)\.[Ss]'`
|
||||
|
||||
#SRC=`ls ./testdata | grep -E '^([0-9]+)(.*)\.[Ss]' | grep -i 2007`
|
||||
|
||||
for S in $SRC ; do
|
||||
|
||||
S1=$S
|
||||
S1=${S1/.S/}
|
||||
S1=${S1/.s/}
|
||||
|
||||
BASE=${S/.S/}
|
||||
BASE=${BASE/.s/}
|
||||
cd ./testdata
|
||||
#merlin32 $S 2>/dev/null >/dev/null
|
||||
merlin32 . $S 2>/dev/null
|
||||
|
||||
R=?$
|
||||
cd - >/dev/null
|
||||
cp ./testdata/$S1 $OUTDIR/$S1.bin 2>/dev/null
|
||||
rm -f ./testdata/*.txt 2>/dev/null
|
||||
rm -f ./testdata/$S1 2>/dev/null
|
||||
R=?$
|
||||
|
||||
done
|
||||
ls $OUTDIR
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ for S in $SRC ; do
|
||||
MSHA="Q"
|
||||
QSHA="M"
|
||||
|
||||
if [ -f ./testdata/M32_expected/$BASE ] ; then
|
||||
MSHA=`sha256sum ./testdata/M32_expected/$BASE | awk '{ print $1;}'` 2>/dev/null >/dev/null
|
||||
if [ -f ./m32out/$BASE.bin ] ; then
|
||||
MSHA=`sha256sum ./m32out/$BASE.bin | awk '{ print $1;}'` 2>/dev/null >/dev/null
|
||||
fi
|
||||
|
||||
if [ -f $OUTDIR/$BASE.bin ] ; then
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
,,©ę,˘˙ę
|
||||
ę,˘˙ę V$©˘" ( V$©3˘D : =ęV$ E` V$©U˘f`�‚�©™`
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user