mirror of
https://github.com/marketideas/qasm.git
synced 2025-01-17 15:30:25 +00:00
adding script to create M32 output files
This commit is contained in:
parent
e2dd7ab645
commit
630ea66623
Makefileasm.cppasm.hmerlintests.shruntests.sh
testdata/M32_expected
1000-allops-value-658161001-allops-zero-658161002-embedded-instructions1003-flags-and-branches1004-data-recognition2000-allops-value-65022001-allops-zero-65022002-allops-value-65C022003-allops-zero-65C022004-numeric-types2005-string-types2006-operand-formats2007-labels-and-symbols2008-address-changes2010-target-adjustment2011-hinting2012-label-localizer2013-notes-and-comments2014-label-dp2019-local-variables2020-cycle-counts-658162021-external-symbols2022-extension-scripts
1
Makefile
1
Makefile
@ -34,6 +34,7 @@ debug:
|
|||||||
distclean:
|
distclean:
|
||||||
rm -rf ./build
|
rm -rf ./build
|
||||||
-rm -rf ./testout
|
-rm -rf ./testout
|
||||||
|
-rm -rf ./m32out
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -rf ./build
|
-rm -rf ./build
|
||||||
|
1
asm.cpp
1
asm.cpp
@ -1554,6 +1554,7 @@ void CLASS::initpass(void)
|
|||||||
truncdata = 0;
|
truncdata = 0;
|
||||||
variables.clear(); // clear the variables for each pass
|
variables.clear(); // clear the variables for each pass
|
||||||
|
|
||||||
|
macros.clear();
|
||||||
while (!PCstack.empty())
|
while (!PCstack.empty())
|
||||||
{
|
{
|
||||||
PCstack.pop();
|
PCstack.pop();
|
||||||
|
34
asm.h
34
asm.h
@ -280,11 +280,12 @@ public:
|
|||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
void clear(void) {
|
void clear(void)
|
||||||
lupct=0;
|
{
|
||||||
lupoffset=0;
|
lupct = 0;
|
||||||
luprunning=0;
|
lupoffset = 0;
|
||||||
lupskip=false;
|
luprunning = 0;
|
||||||
|
lupskip = false;
|
||||||
}
|
}
|
||||||
uint16_t lupct;
|
uint16_t lupct;
|
||||||
bool lupskip;
|
bool lupskip;
|
||||||
@ -299,9 +300,10 @@ public:
|
|||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
void clear(void) {
|
void clear(void)
|
||||||
doskip=false;
|
{
|
||||||
value=0;
|
doskip = false;
|
||||||
|
value = 0;
|
||||||
}
|
}
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
bool doskip;
|
bool doskip;
|
||||||
@ -334,7 +336,7 @@ public:
|
|||||||
value = 0;
|
value = 0;
|
||||||
used = false;
|
used = false;
|
||||||
//text = "";
|
//text = "";
|
||||||
var_text="";
|
var_text = "";
|
||||||
name = "";
|
name = "";
|
||||||
namelc = "";
|
namelc = "";
|
||||||
stype = 0;
|
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 TPsuedoOp;
|
||||||
|
|
||||||
class T65816Asm : public TFileProcessor
|
class T65816Asm : public TFileProcessor
|
||||||
@ -371,8 +384,8 @@ public:
|
|||||||
|
|
||||||
std::string currentsymstr;
|
std::string currentsymstr;
|
||||||
std::vector<MerlinLine> lines;
|
std::vector<MerlinLine> lines;
|
||||||
|
Poco::HashMap<std::string, TMacro> macros;
|
||||||
Poco::HashMap<std::string, TSymbol>opcodes;
|
Poco::HashMap<std::string, TSymbol>opcodes;
|
||||||
Poco::HashMap<std::string, TSymbol> macros;
|
|
||||||
Poco::HashMap<std::string, TSymbol> symbols;
|
Poco::HashMap<std::string, TSymbol> symbols;
|
||||||
Poco::HashMap<std::string, TSymbol> variables;
|
Poco::HashMap<std::string, TSymbol> variables;
|
||||||
|
|
||||||
@ -386,6 +399,7 @@ public:
|
|||||||
std::stack<TLUPstruct> LUPstack;
|
std::stack<TLUPstruct> LUPstack;
|
||||||
std::stack<TDOstruct> DOstack;
|
std::stack<TDOstruct> DOstack;
|
||||||
std::stack<bool> LSTstack;
|
std::stack<bool> LSTstack;
|
||||||
|
std::stack<TMacro> curMacro;
|
||||||
|
|
||||||
TPsuedoOp *psuedoops;
|
TPsuedoOp *psuedoops;
|
||||||
|
|
||||||
|
35
merlintests.sh
Executable file
35
merlintests.sh
Executable file
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -40,8 +40,8 @@ for S in $SRC ; do
|
|||||||
MSHA="Q"
|
MSHA="Q"
|
||||||
QSHA="M"
|
QSHA="M"
|
||||||
|
|
||||||
if [ -f ./testdata/M32_expected/$BASE ] ; then
|
if [ -f ./m32out/$BASE.bin ] ; then
|
||||||
MSHA=`sha256sum ./testdata/M32_expected/$BASE | awk '{ print $1;}'` 2>/dev/null >/dev/null
|
MSHA=`sha256sum ./m32out/$BASE.bin | awk '{ print $1;}'` 2>/dev/null >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $OUTDIR/$BASE.bin ] ; then
|
if [ -f $OUTDIR/$BASE.bin ] ; then
|
||||||
|
BIN
testdata/M32_expected/1000-allops-value-65816
vendored
BIN
testdata/M32_expected/1000-allops-value-65816
vendored
Binary file not shown.
BIN
testdata/M32_expected/1001-allops-zero-65816
vendored
BIN
testdata/M32_expected/1001-allops-zero-65816
vendored
Binary file not shown.
BIN
testdata/M32_expected/1002-embedded-instructions
vendored
BIN
testdata/M32_expected/1002-embedded-instructions
vendored
Binary file not shown.
BIN
testdata/M32_expected/1003-flags-and-branches
vendored
BIN
testdata/M32_expected/1003-flags-and-branches
vendored
Binary file not shown.
BIN
testdata/M32_expected/1004-data-recognition
vendored
BIN
testdata/M32_expected/1004-data-recognition
vendored
Binary file not shown.
BIN
testdata/M32_expected/2000-allops-value-6502
vendored
BIN
testdata/M32_expected/2000-allops-value-6502
vendored
Binary file not shown.
BIN
testdata/M32_expected/2001-allops-zero-6502
vendored
BIN
testdata/M32_expected/2001-allops-zero-6502
vendored
Binary file not shown.
BIN
testdata/M32_expected/2002-allops-value-65C02
vendored
BIN
testdata/M32_expected/2002-allops-value-65C02
vendored
Binary file not shown.
BIN
testdata/M32_expected/2003-allops-zero-65C02
vendored
BIN
testdata/M32_expected/2003-allops-zero-65C02
vendored
Binary file not shown.
BIN
testdata/M32_expected/2004-numeric-types
vendored
BIN
testdata/M32_expected/2004-numeric-types
vendored
Binary file not shown.
BIN
testdata/M32_expected/2005-string-types
vendored
BIN
testdata/M32_expected/2005-string-types
vendored
Binary file not shown.
BIN
testdata/M32_expected/2006-operand-formats
vendored
BIN
testdata/M32_expected/2006-operand-formats
vendored
Binary file not shown.
BIN
testdata/M32_expected/2007-labels-and-symbols
vendored
BIN
testdata/M32_expected/2007-labels-and-symbols
vendored
Binary file not shown.
BIN
testdata/M32_expected/2008-address-changes
vendored
BIN
testdata/M32_expected/2008-address-changes
vendored
Binary file not shown.
BIN
testdata/M32_expected/2010-target-adjustment
vendored
BIN
testdata/M32_expected/2010-target-adjustment
vendored
Binary file not shown.
2
testdata/M32_expected/2011-hinting
vendored
2
testdata/M32_expected/2011-hinting
vendored
@ -1,2 +0,0 @@
|
|||||||
,,©ę,˘˙ę
|
|
||||||
ę,˘˙ę V$©˘" ( V$©3˘D : =ęV$ E` V$©U˘f`<60>‚<EFBFBD>©™`
|
|
BIN
testdata/M32_expected/2012-label-localizer
vendored
BIN
testdata/M32_expected/2012-label-localizer
vendored
Binary file not shown.
BIN
testdata/M32_expected/2013-notes-and-comments
vendored
BIN
testdata/M32_expected/2013-notes-and-comments
vendored
Binary file not shown.
BIN
testdata/M32_expected/2014-label-dp
vendored
BIN
testdata/M32_expected/2014-label-dp
vendored
Binary file not shown.
BIN
testdata/M32_expected/2019-local-variables
vendored
BIN
testdata/M32_expected/2019-local-variables
vendored
Binary file not shown.
BIN
testdata/M32_expected/2020-cycle-counts-65816
vendored
BIN
testdata/M32_expected/2020-cycle-counts-65816
vendored
Binary file not shown.
BIN
testdata/M32_expected/2021-external-symbols
vendored
BIN
testdata/M32_expected/2021-external-symbols
vendored
Binary file not shown.
BIN
testdata/M32_expected/2022-extension-scripts
vendored
BIN
testdata/M32_expected/2022-extension-scripts
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user