Commit 19f80df7 authored by Martin Ruckert's avatar Martin Ruckert
Browse files

renaming the mmix source directory removing some options

parent 2b79e896
# the directory with the MMIXware sources
MMIXWARE=./mmixware
LIBSIM= libboot.c libfinal.c libload.c libprint.c libstats.c \
libcommand.c libinit.c libmem.c libprofile.c libtrace.c \
libdtrap.c libinteract.c libmmget.c libshowbreaks.c libglobals.c \
......@@ -25,28 +29,28 @@ libbase.o: libbase.c libbase.h libconfig.h
%.o : %.c abstime.h mmixlib.h $(LIBH)
boilerplate.w: mmix/boilerplate.w
boilerplate.w: $(MMIXWARE)/boilerplate.w
cp $< $@
abstime.h: mmix/abstime.h
abstime.h: $(MMIXWARE)/abstime.h
cp $< $@
mmix/abstime.h: mmix/abstime
$(MMIXWARE)/abstime.h: $(MMIXWARE)/abstime
$(MAKE) -C mmix abstime
mmix/abstime > mmix/abstime.h
$(MMIXWARE)/abstime > $(MMIXWARE)/abstime.h
mmix-arith.c: boilerplate.w mmix/mmix-arith.w
ctangle mmix/mmix-arith.w
mmix-arith.c: boilerplate.w $(MMIXWARE)/mmix-arith.w
ctangle $(MMIXWARE)/mmix-arith.w
mmix-io.c: boilerplate.w mmix/mmix-io.w
ctangle mmix/mmix-io.w
mmix-io.c: boilerplate.w $(MMIXWARE)/mmix-io.w
ctangle $(MMIXWARE)/mmix-io.w
$(LIBAL): boilerplate.w mmix/mmixal.w mmixallib.ch
ctangle mmix/mmixal.w mmixallib.ch
$(LIBAL): boilerplate.w $(MMIXWARE)/mmixal.w mmixallib.ch
ctangle $(MMIXWARE)/mmixal.w mmixallib.ch
$(LIBSIM) $(LIBH) mmix-sim.c: boilerplate.w mmix/mmix-sim.w mmixlib.ch libconfig.h
ctangle mmix/mmix-sim.w mmixlib.ch
$(LIBSIM) $(LIBH) mmix-sim.c: boilerplate.w $(MMIXWARE)/mmix-sim.w mmixlib.ch libconfig.h
ctangle $(MMIXWARE)/mmix-sim.w mmixlib.ch
libmmix.a: $(LIBOBJ)
......
......@@ -23,8 +23,8 @@
#define MMIX_FETCH(inst,loc) (ll=mem_find(loc),inst=ll->tet,true)
#define MMIX_STORE_IVTC(virt,phys)
#define MMIX_STORE_DVTC(virt,phys)
#define MMIX_STORE_IVTC(virt,phys)
#define MMIX_STORE_DVTC(virt,phys)
#ifdef WIN32
#define MMIX_DELAY(ms,d) (Sleep(ms), d=(ms))
......@@ -32,7 +32,7 @@
#define MMIX_DELAY(ms,d) (usleep(1000*(ms)), d=(ms))
#endif
/* define this to check for external asynchronous ineterrupts*/
/* define this to check for external asynchronous interrupts*/
#define MMIX_GET_INTERRUPT
/* this code is executed when MMIX enters the handler for Ctrl-C */
......@@ -61,10 +61,6 @@ extern int mmix_fputc(int c, FILE *f);
#define MMIX_USAGE if (!*cur_arg) scan_option("?",true) /* exit with usage note */
/* give a condition to break from the inner loop */
#define MMIX_BREAK_LOOP false
/* define this to get the real TRAP implementation not the MMIXWARE fake TRAPS */
#undef MMIX_TRAP
......
......@@ -280,6 +280,7 @@ int main(argc,argv)
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <setjmp.h>
#include "libconfig.h"
@#
@<Preprocessor definitions@>@;
......@@ -289,7 +290,7 @@ extern int buf_size;
extern char*src_file_name;
extern char obj_file_name[FILENAME_MAX+1];
extern char listing_name[FILENAME_MAX+1];
extern jmp_buf mmixal_exit;
extern void report_error(char * message, char *filename, int line_no);
extern int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_option);
......@@ -310,6 +311,7 @@ int main(argc,argv)
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <setjmp.h>
#include "libconfig.h"
@#
@h
......@@ -318,6 +320,7 @@ int main(argc,argv)
@<Global variables@>@;
extern void report_error(char * message, char *filename, int line_no);
extern jmp_buf mmixal_exit;
@<Subroutines@>@;
......@@ -378,7 +381,13 @@ int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_o
}
@z
We end with return instead of exit.
We end with return or longjmp instead of exit.
@x
exit(-1);
@y
longjmp(mmixal_exit,-1);
@z
@x
if (err_count) {
......@@ -432,6 +441,7 @@ clean_up:
return err_count;
@z
To report undefined local sysmbols we use the
usual error reporting.
......
......@@ -2316,7 +2316,6 @@ boot:
mmix_trace();
mmix_dynamic_trap();
if (resuming && op!=RESUME) resuming=false;
if (!resuming && MMIX_BREAK_LOOP) break;
} while (resuming || (!interrupt && !breakpoint));
if (interact_after_break)
interacting=true, interact_after_break=false;
......@@ -2372,8 +2371,9 @@ void scan_option @,@,@[ARGS((char*,bool))@];@+@t}\6{@>
case 'b':@+if (sscanf(arg+1,"%d",&buf_size)!=1) buf_size=0;@+return;
@y
case 'b':@+if (sscanf(arg+1,"%d",&buf_size)!=1) buf_size=0;@+return;
case 'O': show_operating_system=true;@+return; \
case 'o': show_operating_system=false;@+return;
MMIX_OPTIONS
@z
we need to replace all exits.
......@@ -2393,22 +2393,16 @@ bool profiling=0; /* should we print the profile at the end? */
@z
@x
"-s show statistics after each traced instruction\n",@|
"S set current segment to Stack_Segment\n",@|
@y
MMIX_OPTION_STRING
"-s show statistics after each traced instruction\n",@|
"S set current segment to Stack_Segment\n",@|
"N set current segment to Negative Addresses\n",@|
"O enable tracing inside the operating system\n",@|
"o disable tracing inside the operating system\n",@|
@z
@x
"T set current segment to Text_Segment\n",@|
@y
MMIX_INTERACT_STRING
"T set current segment to Text_Segment\n",@|
@z
@x
@ @<Initialize...@>=
signal(SIGINT,catchint); /* now |catchint| will catch the first interrupt */
......@@ -2555,7 +2549,9 @@ We allow breakpoints at all addresses.
case 'B': show_breaks(mem_root);
@y
case 'B': show_breaks(mem_root);@+goto passit;
MMIX_INTERACT_ACTION
case 'N': cur_seg.h=0x80000000;@+goto passit;
case 'O': show_operating_system=true;@+goto passit;
case 'o': show_operating_system=false;@+goto passit;
@z
@x
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment