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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
#pragma varargck type "I" u32int
typedef struct Sym Sym;
typedef struct Refinst Refinst;
typedef struct Wval Wval;
typedef struct Con Con;
struct Sym {
Avl;
char *name;
long lex;
union {
struct {
int opc, f; /* LOP LHERE LBACK LFORW */
};
u32int mval; /* LSYMDEF */
struct {
int *refs, i, max; /* LSYMREF */
};
};
char nbuf[1];
};
struct Con {
Sym *sym;
u32int exp;
Con *link;
};
int mixvm(int, int);
void repl(int);
u32int mixst(u32int, u32int, int);
void mixprint(int, int);
long yylex(void);
int yyparse(void);
void yyerror(char*, ...);
void vmerror(char*, ...);
void skipto(char);
Sym *sym(char*);
Sym *getsym(char*);
void sinit(void);
int asmfile(char*);
int V(u32int, int);
int Ifmt(Fmt*);
Rune mixtorune(int);
int runetomix(Rune);
void cinit(void);
void warn(char*, ...);
void *emalloc(ulong);
void *emallocz(ulong);
void *erealloc(void*, ulong);
char *estrdup(char*);
char *strskip(char*);
char *strim(char*);
void *bsearch(void*, void*, long, int, int(*)(void*, void*));
Avltree *syms;
int star, line, vmstart, yydone, curpc;
Con *cons;
char *filename;
extern int mask[5];
u32int cells[4000];
char bp[4000];
jmp_buf errjmp;
Biobuf bin;
u32int ra, rx, ri[7];
int ce, cl, cg, ot;
#define F(a, b) 8*(a)+(b)
#define UNF(a, b, f) ((a) = f/8, (b) = f%8)
enum {
BITS = 6,
MASK1 = 63,
MASK2 = (63<<6) | MASK1,
MASK3 = (63<<12) | MASK2,
MASK4 = (63<<18) | MASK3,
MASK5 = (63<<24) | MASK4,
OVERB = 1<<30,
SIGNB = 1<<31,
};
|