diff --git a/assemble_aux.c b/assemble_aux.c index dc6b9d0..d645ea9 100644 --- a/assemble_aux.c +++ b/assemble_aux.c @@ -693,8 +693,15 @@ void write_globals( SYMBOL_ITER sym_iter; int isect; - if (obj == NULL) - return; /* Nothing to do if no OBJ file. */ + if (obj == NULL) { + for (isect = 0; isect < sector; isect++) { + psect = sections[isect]; + + psect->sector = isect; /* Assign it a sector */ + psect->pc = 0; /* Reset its PC for second pass */ + } + return; /* Nothing more to do if no OBJ file. */ + } gsd_init(&gsd, obj); diff --git a/macro11.c b/macro11.c index ad3c155..bb2249d 100644 --- a/macro11.c +++ b/macro11.c @@ -353,13 +353,6 @@ int main( stack_push(&stack, str); } - /* - * Reset dot in all sections. write_globals() only does it - * if there is an object file. - */ - for (i = 0; i < sector; i++) { - sections[i]->pc = 0; - } DOT = 0; current_pc->section = &blank_section;