diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2020-08-08 10:28:36 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2020-08-08 10:28:36 -0400 |
commit | 1ec19679b3db209429b0897f6ccda6d09d018a70 (patch) | |
tree | ef17e28b388a04fadeb14982a5332eb647981d8b /asmmon.h | |
parent | 39081609ec4f1f5d96e15e346eecd09ca2cc9f41 (diff) |
Did a ton of stuff.
- Changed the file structure of the SuB Suite, so that
all variable declarations, symbols, and constants
are in a single file.
- Moved the C library functionss into a separate
file, and made them use stack frames.
- Added support for using the emulator's assembler for
realtime debugging, to enter it, get in to stepping
mode by pressing Ctrl+s, press any other key, then
press F1,
The reason for having to press some other key before
pressing F1 is because it only allows entering the
assembler when the keyboard is not ready.
- Added the ".res" directive to the emulator's
assembler, the ".res" directive tells the assembler
to reserve however many bytes specified by the
operand.
- Fixed some bugs in the emulator's assembler.
Diffstat (limited to 'asmmon.h')
-rw-r--r-- | asmmon.h | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -3,7 +3,6 @@ #include <string.h> #define MAX_TOK 0x1000 -#define TXS_MNE_ID 78 /* Used for a special case in the assembler. */ typedef struct tok token ; typedef struct ln line ; @@ -66,8 +65,11 @@ extern line *last_line; extern token *tokens; extern token *last_tok; extern symbol *symbols; +extern symbol *last_sym; extern symbol *locals; +extern symbol *last_loc; extern fixup *fixups; +extern fixup *last_fix; extern uint8_t lex_type; @@ -77,7 +79,8 @@ enum dir { DIR_WORD, DIR_DWORD, DIR_QWORD, - DIR_INCLUDE + DIR_INCLUDE, + DIR_RES }; enum token { @@ -161,8 +164,8 @@ static const uint8_t opcodes[OPNUM][10] = { [CMP] = {0xB1, 0xB6, 0xFF, 0xFF, 0x25, 0x7D, 0x7C, 0xB4, 0xFF, 0xFF}, /* CMP */ [CPB] = {0x2A, 0x2D, 0xFF, 0xFF, 0x55, 0xAD, 0xAC, 0x2C, 0xFF, 0xFF}, /* CPB */ [CPS] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00}, /* CPS */ - [CPX] = {0x3A, 0x4D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3C, 0xFF, 0xFF}, /* CPX */ - [CPY] = {0x4A, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4C, 0xFF, 0xFF}, /* CPY */ + [CPX] = {0x3A, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3C, 0xFF, 0xFF}, /* CPX */ + [CPY] = {0x4A, 0x4D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4C, 0xFF, 0xFF}, /* CPY */ [DAB] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA2}, /* DAB */ [DEB] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC2}, /* DEB */ [DEC] = {0xFF, 0x0D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0C, 0xFF, 0x0A}, /* DEC */ @@ -227,13 +230,14 @@ static const uint8_t opcodes[OPNUM][10] = { [XOR] = {0x41, 0x46, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x44, 0xFF, 0xFF} /* XOR */ }; -static const char *dir_t[6] = { +static const char *dir_t[7] = { [0] = "org", [1] = "byte", [2] = "word", [3] = "dword", [4] = "qword", - [5] = "include" + [5] = "include", + [6] = "res" }; static const char *rs_t[4] = { |