-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy patho65.h
82 lines (68 loc) · 1.57 KB
/
o65.h
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
/* $VER: vlink o65.h V0.16h (19.01.21)
*
* This file is part of vlink, a portable linker for multiple
* object formats.
* Copyright (c) 1997-2021 Frank Wille
*/
#define NSECS 4
/* section names */
#define TEXTNAME text_name
#define DATANAME data_name
#define BSSNAME bss_name
#define ZERONAME zero_name
/* section indexes */
enum {
TSEC=0,DSEC,BSEC,ZSEC
};
/* O65 Header Info */
struct o65info {
struct ObjectUnit *object;
uint16_t mode;
uint32_t base[NSECS];
uint32_t len[NSECS];
struct Section *sec[NSECS];
uint8_t *data[DSEC+1]; /* only TSEC and DSEC have initialized data */
unsigned namecount;
char **names;
};
/* mode bits */
#define MO65_65816 (1<<15)
#define MO65_PAGED (1<<14)
#define MO65_LONG (1<<13)
#define MO65_OBJ (1<<12)
#define MO65_SIMPLE (1<<11)
#define MO65_CHAIN (1<<10)
#define MO65_BSSZERO (1<<9)
#define MO65_CPU2(m) ((m&0x00f0)>>4)
#define MO65_ALIGN(m) (m&3)
/* cpu2 values */
enum {
CPU2_6502=0,CPU2_65C02,CPU2_65SC02,CPU2_65CE02,CPU2_NMOS6502,CPU2_65816
};
/* alignments */
enum {
AO65_BYTE=0,AO65_WORD,AO65_LONG,AO65_BLOCK
};
/* header options */
enum {
HOPT_FNAME=0,HOPT_OS,HOPT_GEN,HOPT_AUTHOR,HOPT_TIME
};
/* relocations */
#define R65TYPE(b) (b & 0xf0)
#define R65SEG(b) (b & 0x0f)
#define UNDSEGID 0
#define ABSSEGID 1
#define MINSEGID 2
#define MAXSEGID (MINSEGID+NSECS-1)
struct ImportNode {
struct node n;
struct ImportNode *hashchain;
const char *name;
unsigned idx;
};
struct ImportList {
struct list l;
struct ImportNode **hashtab;
unsigned entries;
};
#define IMPHTABSIZE 0x100