[FEAT] Decompiler
[BUG] Several address calculation errors
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stack>
|
||||
#include "decompiler.h"
|
||||
|
||||
#define MAX_CODE_SIZE 65536
|
||||
#define MAX_LABELS 256
|
||||
@@ -326,7 +327,7 @@ static void parse_expr_atom() {
|
||||
const int address = get_variable_address();
|
||||
if (address == -1) return;
|
||||
emmit(scope_is_local() ? OP_LDL : OP_LD);
|
||||
emmit(address);
|
||||
emmit_dw(address);
|
||||
tkn_next();
|
||||
return;
|
||||
} else {
|
||||
@@ -890,7 +891,9 @@ void parser_parse(const char* buffer, byte* mem) {
|
||||
//codepos = 0xA000;
|
||||
//emmit(OP_JMP);
|
||||
//emmit_w(0xA000);
|
||||
}
|
||||
} else {
|
||||
decompiler_save(code, codepos);
|
||||
}
|
||||
|
||||
//FILE *f = fopen("test.bin", "wb");
|
||||
//fwrite(mem, codepos, 1, f);
|
||||
|
||||
Reference in New Issue
Block a user