.RESTORE restores DOT too

this is how it should be according to page 6-42 of the manual.
Kermit does this ugly thing to backpatch some .word value:

     435 000070                         	dial$time	35.
       1 000070                         	modval	35.,dial.time
       1                                	.save
       2 000070                         	.psect	modinf
       3        000006                  	. = $$current + dial.time
       4 000006 000043                  	.word	35.
       5 000070                         	.restore
     436 000070                         	wake$string	<^E^M>

where the current program section already is modinf. So the .save stores
DOT, it's changed to a lower value (6) to backpatch, and .restore sets DOT
back to 70.
This commit is contained in:
Olaf Seibert 2015-05-22 00:13:54 +02:00
parent 9640d19a1f
commit 60af942129
3 changed files with 4 additions and 0 deletions

View File

@ -357,6 +357,7 @@ static int assemble(
}
sect_sp++;
sect_stack[sect_sp] = current_pc->section;
dot_stack[sect_sp] = DOT;
return 1;
case P_RESTORE:
@ -365,6 +366,7 @@ static int assemble(
return 0;
} else {
go_section(tr, sect_stack[sect_sp]);
DOT = dot_stack[sect_sp];
list_location(stack->top, DOT);
if (!enabl_lsb) {
lsb = get_next_lsb();

View File

@ -47,6 +47,7 @@ COND conds[MAX_CONDS]; /* Stack of recent conditions */
int last_cond; /* 0 means no stacked cond. */
SECTION *sect_stack[SECT_STACK_SIZE]; /* 32 saved sections */
int dot_stack[SECT_STACK_SIZE]; /* 32 saved sections */
int sect_sp; /* Stack pointer */
char *module_name = NULL; /* The module name (taken from the 'TITLE'); */

View File

@ -57,6 +57,7 @@ extern COND conds[MAX_CONDS]; /* Stack of recent conditions */
extern int last_cond; /* 0 means no stacked cond. */
extern SECTION *sect_stack[SECT_STACK_SIZE]; /* 32 saved sections */
extern int dot_stack[SECT_STACK_SIZE]; /* 32 saved sections */
extern int sect_sp; /* Stack pointer */
extern char *module_name; /* The module name (taken from the 'TITLE'); */