Added Compact Encoding (-c)

Added second pass optimization (-h)
This commit is contained in:
David Anderson
2004-08-11 14:31:26 +00:00
parent c9a0a3f9be
commit 81b3e662cf
5 changed files with 291 additions and 42 deletions

View File

@ -68,16 +68,20 @@ public:
int CurCip() { return lastCip; }
Asm *CurAsm() { return curAsm; }
bool SetDebug();
public: //private
bool SetPack();
bool SetDOpt();
int DerefSymbol(std::string &str, SymbolType sym = Sym_None);
bool IsSymbol(std::string &str);
private:
void ProcessDirective(std::string &text);
void Init();
void InitOpcodes();
int Eval(std::string &str, SymbolType sym = Sym_None);
CExpr EvalE(std::string &str, SymbolType sym = Sym_None);
CExpr EvalRpn(rpn *r, SymbolType sym);
OpToken OperToken(char c);
char OperChar(OpToken c);
bool IsSymbol(std::string &str);
void WriteCell(FILE *fp, ucell *c, int repeat);
private:
std::vector<Asm *> CodeList;
std::map<std::string,int> OpCodes;
@ -96,6 +100,9 @@ private:
int cellsize;
int stacksize;
bool debug;
bool pack;
bool dopt;
int bitsOut;
Asm *curAsm;
};