diff --git a/assemble_aux.c b/assemble_aux.c index f678185..5b6395e 100644 --- a/assemble_aux.c +++ b/assemble_aux.c @@ -531,6 +531,10 @@ void mode_extension( store_global_displaced_offset_word(str, tr, 2, offset, sym->label); else store_global_offset_word(str, tr, 2, offset, sym->label); + } else if (sym->section->type == SECTION_REGISTER) { + /* Delayed action: evaluate_rec() excludes SECTION_REGISTER when + * turning symbols into EX_LIT. Do it here now. */ + store_word(str, tr, 2, sym->value + offset); } else { /* Relative to non-external symbol. */ if (current_pc->section == sym->section) { diff --git a/tests/test-word-comma.mac b/tests/test-word-comma.mac index acdb3ca..0d24907 100644 --- a/tests/test-word-comma.mac +++ b/tests/test-word-comma.mac @@ -10,4 +10,11 @@ start: .word 123 ; 1 word .word 1,,3 ; 3 words .word 1,2,3 ; 3 words + ; all the values below are not relocatable. .word r0,wait,r1+1,wait+2,%4,%4+1 ; 0, 1, 2, 3, 4, 5 + mov #r0,r0 + mov #wait,r0 + mov #r1+1,r0 + mov #wait+2,r0 + mov #%4,r0 + mov #%4+1,r0