summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mixlib/mix_ins.h2
-rw-r--r--mixlib/mix_parser.c8
-rw-r--r--mixlib/mix_scanner.l2
3 files changed, 9 insertions, 3 deletions
diff --git a/mixlib/mix_ins.h b/mixlib/mix_ins.h
index 5915a19..d0829e5 100644
--- a/mixlib/mix_ins.h
+++ b/mixlib/mix_ins.h
@@ -144,7 +144,7 @@ mix_ins_to_word(const mix_ins_t *ins);
extern mix_ins_id_t
mix_word_to_ins(mix_word_t w, mix_ins_t *ins);
-#define mix_word_set_address(word,addr) (word) |= ((addr)<<18)
+#define mix_word_add_address(word,addr) (word) |= ((addr)<<18)
/* decompose an instruction codified in a word into its parts */
#define mix_get_ins_address(word) ((mix_address_t)((word)>>18))
diff --git a/mixlib/mix_parser.c b/mixlib/mix_parser.c
index fc80a76..82dd692 100644
--- a/mixlib/mix_parser.c
+++ b/mixlib/mix_parser.c
@@ -209,7 +209,13 @@ update_future_refs_value_ (mix_parser_t *parser, const gchar *name,
node =
(ins_node_ *)g_tree_lookup (parser->ins_table,tmp->data);
g_assert (node);
- mix_word_set_address (node->ins, value);
+ if (mix_get_ins_address (node->ins) == 1) {
+ value = mix_short_negative (value);
+ node->ins = mix_word_set_field (node->ins,
+ MIX_WORD_ZERO,
+ mix_fspec_new (1,2));
+ }
+ mix_word_add_address (node->ins, value);
g_tree_insert (parser->ins_table, tmp->data, (gpointer)node);
tmp = g_slist_next (tmp);
}
diff --git a/mixlib/mix_scanner.l b/mixlib/mix_scanner.l
index b1d4a13..c98d0b2 100644
--- a/mixlib/mix_scanner.l
+++ b/mixlib/mix_scanner.l
@@ -314,7 +314,7 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)*
if ( !mix_symbol_table_is_defined (parser->symbol_table, s) )
{
mix_parser_set_future_ref (parser, s);
- unput ('0');
+ unput (neg? '1':'0');
}
else
{