begin implementing some helpers

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%4042
This commit is contained in:
David Anderson
2006-07-31 18:59:17 +00:00
parent e03ab1e6d4
commit 83ae061c6e
4 changed files with 118 additions and 7 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ typedef struct sp_file_hdr_s
uint32_t disksize; /* size on disk */
uint32_t imagesize; /* size in memory */
uint8_t sections; /* number of sections */
uint32_t stringtab; /* offset to string table aa*/
uint32_t stringtab; /* offset to string table */
uint32_t dataoffs; /* offset to file proper (any compression starts here) */
} sp_file_hdr_t;
+7 -3
View File
@@ -12,6 +12,9 @@ typedef int32_t cell_t;
#define SP_ERR_NONE 0
#define SP_ERR_FILE_FORMAT 1 /* File format unrecognized */
#define SP_ERR_DECOMPRESSOR 2 /* A decompressor was not found */
#define SP_ERR_HEAPLOW 3 /* Not enough space left on the heap */
#define SP_ERR_PARAM 4 /* Invalid parameter */
#define SP_ERR_INVALID_ADDRESS 5 /* A memory address was not valid */
/**********************************************
*** The following structures are reference structures.
@@ -183,9 +186,10 @@ typedef struct sp_context_s
SPVM_EXEC exec; /* execution base */
cell_t pri; /* PRI register */
cell_t alt; /* ALT register */
cell_t *data; /* data chunk */
cell_t *heap; /* pointer after data for start of heap */
cell_t *sp; /* stack pointer */
uint8_t *data; /* data chunk */
cell_t heapbase; /* heap base */
cell_t hp; /* heap pointer */
cell_t sp; /* stack pointer */
ucell_t memory; /* total memory size; */
int32_t err; /* error code */
uint32_t pushcount; /* push count */