summaryrefslogtreecommitdiff
path: root/programs/c-ports/subasm.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-04-02 19:04:12 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-04-02 19:04:12 -0400
commit59dc46ca8fe1eb6f98abb98fe8579aeaedd2ff15 (patch)
tree4a762bad3013693c8640a36fa626042cfaa13d83 /programs/c-ports/subasm.c
parent6bad8fa605f5011cadab428156c18b4067922185 (diff)
Made the emulator less bloated, and faster.
Diffstat (limited to 'programs/c-ports/subasm.c')
-rw-r--r--programs/c-ports/subasm.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/programs/c-ports/subasm.c b/programs/c-ports/subasm.c
index 89d1507..73bb74c 100644
--- a/programs/c-ports/subasm.c
+++ b/programs/c-ports/subasm.c
@@ -1,18 +1,7 @@
#include "subeditor.h"
-struct line {
- uint8_t dir;
- uint8_t mne;
- uint8_t am;
- uint8_t opbase;
- uint16_t com;
- uint16_t label;
- uint64_t op;
-};
-char *label[0x1000];
+
uint64_t label_addr[0x1000];
-/*char *comment[0x1000];*/
-/*char *string[0x1000];*/
enum dir {
DIR_ORG,
@@ -52,9 +41,8 @@ enum base {
};
-char lexeme[0x100];
+char lexeme[0x200];
uint8_t lex_type;
-struct line tokline[0x1000];
uint16_t linenum = 10;
static const char *mne_t[90] = {
@@ -258,7 +246,7 @@ uint8_t lex(char *str) {
uint16_t j = 0;
lex_type = 0xFF;
uint8_t k = 0;
- int line = 40;
+ int line = 56;
int16_t ln = -1;
int y, x;
char lnum[6];
@@ -333,12 +321,12 @@ uint8_t lex(char *str) {
case ';':
i++;
while (str[i] != '\0') {
- lexeme[j++] = str[i++];
+ lexeme[j] = str[i];
/*comment[linenum][j] = str[i];*/
- /*j++, i++;*/
+ j++, i++;
}
lexeme[j] = '\0';
- /*comment[linenum][j] = '\0';*/
+ comment[linenum][j] = '\0';
lex_type = TOK_COMMENT;
break;
case '#':