-
Notifications
You must be signed in to change notification settings - Fork 0
container
Anz edited this page Jan 7, 2011
·
11 revisions
#define MAGIC_NUMBER 0xAFFEAFFE
#define CONTAINER_VERSION 1
#define CONTENT_VERSION 1
#define HEADER_SIZE 24
#define SYMBOL_NAME_SIZE 512
#define SYMBOL_SIZE 516
#define BYTECODE_SIZE 5struct container_header {
unsigned int magic_number;
unsigned int container_version;
unsigned int content_version;
size_t symbol_segment_size;
size_t external_symbol_segment_size;
size_t text_segment_size;
};
struct container_symbol {
int addr;
char name[SYMBOL_NAME_SIZE];
};
struct container_external_symbol {
char name[SYMBOL_NAME_SIZE];
};
struct container_bytecode {
char instruction;
int argument;
};+--------------+-------------------+-----------------+
+ MAGIC NUMBER | CONTAINER VERSION | CONTENT VERSION +
+--------------+-------------------+-----------------+
+ SYMBOL SIZE | EXTERNAL SIZE | TEXT SIZE +
+--------------+-------------------+-----------------+
+ +
+ SYMBOL SEGMENT +
+ +
+----------------------------------------------------+
+ +
+ EXTERNAL SYMBOL SEGMENT +
+ +
+----------------------------------------------------+
+ +
+ TEXT SEGMENT +
+ +
+----------------------------------------------------+