summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-05-26 19:49:41 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-05-26 19:49:41 +0000
commit667dd804e651001c60f0e0b8dc3d08ec3ebeb0ee (patch)
tree50e84e3a493d49963c0fa0a8c6ff020eeda7fcd4 /eval.c
parent460764e07f11ac987e1352bb873b5687f66df77c (diff)
downloadnasm-667dd804e651001c60f0e0b8dc3d08ec3ebeb0ee.tar.gz
Handle $ and $$ in ABSOLUTE sections
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index d97127c9..72bb4d03 100644
--- a/eval.c
+++ b/eval.c
@@ -45,6 +45,10 @@ static int *opflags;
static struct eval_hints *hint;
+extern int in_abs_seg; /* ABSOLUTE segment flag */
+extern long abs_seg; /* ABSOLUTE segment */
+extern long abs_offset; /* ABSOLUTE segment offset */
+
/*
* Unimportant cleanup is done to avoid confusing people who are trying
* to debug real memory leaks
@@ -701,11 +705,11 @@ static expr *expr6(int critical)
type = EXPR_SIMPLE; /* might get overridden by UNKNOWN */
if (i == TOKEN_BASE)
{
- label_seg = location->segment;
+ label_seg = in_abs_seg ? abs_seg : location->segment;
label_ofs = 0;
} else if (i == TOKEN_HERE) {
- label_seg = location->segment;
- label_ofs = location->offset;
+ label_seg = in_abs_seg ? abs_seg : location->segment;
+ label_ofs = in_abs_seg ? abs_offset : location->offset;
} else {
if (!labelfunc(tokval->t_charptr,&label_seg,&label_ofs))
{