Added bytecode output.

This commit is contained in:
David Anderson
2004-08-08 10:15:08 +00:00
parent 023f9b43ea
commit 7b111a179e
25 changed files with 534 additions and 59 deletions

View File

@ -23,6 +23,11 @@
#include "amxasm.h"
DataMngr::~DataMngr()
{
Clear();
}
void DataMngr::Clear()
{
std::vector<DataMngr::Datum *>::iterator i;
@ -48,6 +53,9 @@ void DataMngr::Add(std::string &s, CExpr &expr, bool db)
D->symbol.assign(s);
D->e = expr;
int size = ((D->e.GetType() == Val_Number) ?
cellsize : D->e.Size() * cellsize);
if (List.size() == 0)
{
D->offset = 0;
@ -58,6 +66,8 @@ void DataMngr::Add(std::string &s, CExpr &expr, bool db)
cellsize : p->e.Size() * cellsize);
}
cursize += size;
List.push_back(D);
}
@ -86,4 +96,19 @@ int DataMngr::GetOffset(std::string &sym)
return DataMngr::nof;
return D->offset;
}
int DataMngr::GetSize()
{
return cursize;
}
void DataMngr::GetData(std::vector<DataMngr::Datum *> &dList)
{
std::vector<DataMngr::Datum *>::iterator i;
for (i=List.begin(); i!=List.end(); i++)
{
dList.push_back( (*i) );
}
}