summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Crayne <chuck@thor.crayne.org>2007-11-07 19:03:46 -0800
committerCharles Crayne <chuck@thor.crayne.org>2007-11-07 19:03:46 -0800
commit5fbbc8c2e7fbf6756fd1e8a400c6295c2428b897 (patch)
tree09ca73dd80523d4ab459961b01a1263ae657c5f7
parent8c7eca493600aa2ee39554dfe8712fb30a8cec3f (diff)
downloadnasm-5fbbc8c2e7fbf6756fd1e8a400c6295c2428b897.tar.gz
Upgrade RAA functions to hold 64-bit data.
-rw-r--r--assemble.c6
-rw-r--r--nasm.c5
-rw-r--r--nasmlib.c4
-rw-r--r--nasmlib.h8
4 files changed, 12 insertions, 11 deletions
diff --git a/assemble.c b/assemble.c
index 80c95f1c..9f3b9470 100644
--- a/assemble.c
+++ b/assemble.c
@@ -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;
diff --git a/nasm.c b/nasm.c
index 6ec7f079..880d0a5a 100644
--- a/nasm.c
+++ b/nasm.c
@@ -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) */
diff --git a/nasmlib.c b/nasmlib.c
index f0651833..c05746af 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -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;
diff --git a/nasmlib.h b/nasmlib.h
index 3850634f..43c07f03 100644
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -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