summaryrefslogtreecommitdiff
path: root/programs/c-ports/subeditor.h
blob: 452dfb32abc18a3246dbbd854457b4e33a2abfdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <curses.h>

#define debug 1
#define debug_cmd_buf 0

extern WINDOW *scr;

/* SuBEditor Stuff. */
extern char *buffer;
extern char *cmd_buf;

extern uint8_t scr_row;
extern uint8_t scr_col;
extern uint8_t scr_trow;
extern uint8_t scr_tcol;
extern uint16_t scr_ptr;

extern uint8_t byte;
extern uint8_t mask;

extern uint8_t a;
extern uint8_t b;
extern uint8_t c;
extern uint8_t d;
extern uint8_t e;
extern uint8_t f;

extern uint8_t bitmask;
extern uint8_t bitabl[];

extern uint8_t scr_str;
extern uint8_t scr_end;
extern uint8_t wrapped;

/* SuBAsm Stuff. */
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];
char *comment[0x1000];
char *str[0x1000];
struct line tokline[0x1000];

extern void print_str(const char *str);
extern int str_cmp(const char *s0, const char *s1);
extern uint8_t subasm();