diff options
author | Charles Crayne <chuck@thor.crayne.org> | 2007-11-07 19:03:46 -0800 |
---|---|---|
committer | Charles Crayne <chuck@thor.crayne.org> | 2007-11-07 19:03:46 -0800 |
commit | 5fbbc8c2e7fbf6756fd1e8a400c6295c2428b897 (patch) | |
tree | 09ca73dd80523d4ab459961b01a1263ae657c5f7 | |
parent | 8c7eca493600aa2ee39554dfe8712fb30a8cec3f (diff) | |
download | nasm-5fbbc8c2e7fbf6756fd1e8a400c6295c2428b897.tar.gz |
Upgrade RAA functions to hold 64-bit data.
-rw-r--r-- | assemble.c | 6 | ||||
-rw-r--r-- | nasm.c | 5 | ||||
-rw-r--r-- | nasmlib.c | 4 | ||||
-rw-r--r-- | nasmlib.h | 8 |
4 files changed, 12 insertions, 11 deletions
@@ -218,10 +218,10 @@ static void out(int64_t offset, int32_t segto, const void *data, outfmt->output(segto, data, type, segment, wrt); } -static int jmp_match(int32_t segment, int32_t offset, int bits, +static int jmp_match(int32_t segment, int64_t offset, int bits, insn * ins, const char *code) { - int32_t isize; + int64_t isize; uint8_t c = code[0]; if (c != 0370 && c != 0371) @@ -723,7 +723,7 @@ int64_t insn_size(int32_t segment, int64_t offset, int bits, uint32_t cp, if (m == 100) { /* we've matched an instruction. */ - int32_t isize; + int64_t isize; const char *codes = temp->code; int j; @@ -837,7 +837,8 @@ static void assemble_file(char *fname) insn output_ins; int i, validid; bool rn_error; - int32_t seg, offs; + int32_t seg; + int64_t offs; struct tokenval tokval; expr *e; int pass, pass_max; @@ -1313,7 +1314,7 @@ static void assemble_file(char *fname) if (pass1 == 1) { - int32_t l = insn_size(location.segment, offs, sb, cpu, + int64_t l = insn_size(location.segment, offs, sb, cpu, &output_ins, report_error); /* if (using_debug_info) && output_ins.opcode != -1) */ @@ -459,7 +459,7 @@ void raa_free(struct RAA *r) } } -int32_t raa_read(struct RAA *r, int32_t posn) +int64_t raa_read(struct RAA *r, int32_t posn) { if (posn >= r->stepsize * LAYERSIZ(r)) return 0; /* Return 0 for undefined entries */ @@ -474,7 +474,7 @@ int32_t raa_read(struct RAA *r, int32_t posn) return r->u.l.data[posn]; } -struct RAA *raa_write(struct RAA *r, int32_t posn, int32_t value) +struct RAA *raa_write(struct RAA *r, int32_t posn, int64_t value) { struct RAA *result; @@ -212,7 +212,7 @@ void fwriteint64_t(int64_t data, FILE * fp); * chunk. */ -#define RAA_BLKSIZE 65536 /* this many longs allocated at once */ +#define RAA_BLKSIZE 32768 /* this many longs allocated at once */ #define RAA_LAYERSIZE 32768 /* this many _pointers_ allocated */ typedef struct RAA RAA; @@ -239,7 +239,7 @@ struct RAA { int32_t stepsize; union RAA_UNION { struct RAA_LEAF { - int32_t data[RAA_BLKSIZE]; + int64_t data[RAA_BLKSIZE]; } l; struct RAA_BRANCH { struct RAA *data[RAA_LAYERSIZE]; @@ -249,8 +249,8 @@ struct RAA { struct RAA *raa_init(void); void raa_free(struct RAA *); -int32_t raa_read(struct RAA *, int32_t); -struct RAA *raa_write(struct RAA *r, int32_t posn, int32_t value); +int64_t raa_read(struct RAA *, int32_t); +struct RAA *raa_write(struct RAA *r, int32_t posn, int64_t value); /* * Routines to manage a dynamic sequential-access array, under the |