2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 69f00ccb authored by Martin Ruckert's avatar Martin Ruckert
Browse files

first version running as mmixide

parent bf724549
@x @x
@<Stuff for \CEE/ preprocessor@>@; @<Stuff for \CEE/ preprocessor@>@;
typedef enum{@+false,true@+} bool;
@<Tetrabyte and octabyte type definitions@>@;
@<Other type definitions@>@;
@<Global variables@>@;
@<Subroutines@>
@y @y
@<Stuff for \CEE/ preprocessor@>@; @<Stuff for \CEE/ preprocessor@>@;
#pragma warning(disable : 4146 4018 4244 4267)
#include "libconfig.h" #include "libconfig.h"
typedef enum{@+false,true@+} bool;
@<Tetrabyte and octabyte type definitions@>@;
@<Other type definitions@>@;
@<Global variables@>@;
#include "libimport.h" #include "libimport.h"
#pragma warning(disable : 4146 4018 4244 4267) @<Subroutines@>
@z @z
...@@ -26,7 +26,11 @@ ...@@ -26,7 +26,11 @@
#define MMIX_STORE_IVTC(virt,phys) store_exec_translation(&(virt),&(phys)) #define MMIX_STORE_IVTC(virt,phys) store_exec_translation(&(virt),&(phys))
#define MMIX_STORE_DVTC(virt,phys) store_data_translation(&(virt),&(phys)) #define MMIX_STORE_DVTC(virt,phys) store_data_translation(&(virt),&(phys))
#ifdef WIN32
#define MMIX_DELAY(ms,d) d = vmb_wait_for_event_timed(&vmb,ms) #define MMIX_DELAY(ms,d) d = vmb_wait_for_event_timed(&vmb,ms)
#else
#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 ineterrupts*/
#define MMIX_GET_INTERRUPT \ #define MMIX_GET_INTERRUPT \
...@@ -61,13 +65,18 @@ if (vmb_get_interrupt(&vmb,&new_Q.h,&new_Q.l)==1) \ ...@@ -61,13 +65,18 @@ if (vmb_get_interrupt(&vmb,&new_Q.h,&new_Q.l)==1) \
otherwise it will resume at Main */ otherwise it will resume at Main */
#define MMIX_BOOT #define MMIX_BOOT
#ifdef _MMIXAL_
#undef MMIX_PRINT
#else
#define MMIX_PRINT #define MMIX_PRINT
#endif
#ifdef MMIX_PRINT #ifdef MMIX_PRINT
extern int mmix_printf(char *format,...); extern int mmix_printf(FILE *f,char *format,...);
extern int mmix_vprintf(char *format, va_list vargs);
extern int mmix_fputc(int c, FILE *f); extern int mmix_fputc(int c, FILE *f);
#define printf(...) mmix_printf(__VA_ARGS__) #define printf(...) mmix_printf(stdout,__VA_ARGS__)
#define fprintf(file,...) mmix_printf(__VA_ARGS__) #define fprintf(file,...) mmix_printf(file,__VA_ARGS__)
#define vprintf(format,vargs) mmix_vprintf(format,vargs)
#define fputc(c,f) mmix_fputc(c,f) #define fputc(c,f) mmix_fputc(c,f)
#endif #endif
...@@ -99,9 +108,7 @@ extern int mmix_fputc(int c, FILE *f); ...@@ -99,9 +108,7 @@ extern int mmix_fputc(int c, FILE *f);
#define MMXIAL_LINE_TRUNCATED fprintf(stderr,"(say `-b <number>' to increase the length of my input buffer)\n"); #define MMXIAL_LINE_TRUNCATED fprintf(stderr,"(say `-b <number>' to increase the length of my input buffer)\n");
/* MMIXAL has its own notion of file numbers as embedded in the mmo file
we might want to convert this to a global file number */
#define MMIX_FILE_NO(file_no) filename2file(filename[file_no], file_no)
/* define this to record file line and location associations while assembling */ /* define this to record file line and location associations while assembling */
#define MMIXAL_LINE_LOC(file_no,line_no,cur_loc) add_line_loc(file_no,line_no,cur_loc) #define MMIXAL_LINE_LOC(file_no,line_no,cur_loc) add_line_loc(file_no,line_no,cur_loc)
......
...@@ -53,9 +53,11 @@ ...@@ -53,9 +53,11 @@
#ifdef MMIX_PRINT #ifdef MMIX_PRINT
extern int mmix_printf(FILE *f,char *format,...); extern int mmix_printf(FILE *f,char *format,...);
extern int mmix_vprintf(char *format, va_list vargs);
extern int mmix_fputc(int c, FILE *f); extern int mmix_fputc(int c, FILE *f);
#define printf(...) mmix_printf(stdout,__VA_ARGS__) #define printf(...) mmix_printf(stdout,__VA_ARGS__)
#define fprintf(file,...) mmix_printf(file,__VA_ARGS__) #define fprintf(file,...) mmix_printf(file,__VA_ARGS__)
#define vprintf(format,vargs) mmix_vprintf(format,vargs)
#define fputc(c,f) mmix_fputc(c,f) #define fputc(c,f) mmix_fputc(c,f)
#endif #endif
......
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
#include "mmix-bus.h" #include "mmix-bus.h"
extern device_info vmb; extern device_info vmb;
extern void win32_log(char *msg);
\ No newline at end of file
@x @x
#include <stdio.h> @<Preprocessor macros@>@;
#include <stdlib.h> @<Type definitions@>@;
@<External subroutines@>@;
@<Global variables@>@;
@<Subroutines@>@;
@y @y
#include <stdio.h> @<Preprocessor macros@>@;
#include <stdlib.h> #pragma warning(disable : 4996 4267)
#include "libconfig.h" #include "libconfig.h"
@<Type definitions@>@;
@<External subroutines@>@;
@<Global variables@>@;
#include "libimport.h" #include "libimport.h"
#pragma warning(disable : 4996 4267) @<Subroutines@>@;
@z @z
@x @x
......
...@@ -389,7 +389,6 @@ int main(argc,argv) ...@@ -389,7 +389,6 @@ int main(argc,argv)
#include <setjmp.h> #include <setjmp.h>
#define _MMIXAL_ #define _MMIXAL_
#include "libconfig.h" #include "libconfig.h"
#include "libimport.h"
@# @#
...@@ -397,6 +396,8 @@ int main(argc,argv) ...@@ -397,6 +396,8 @@ int main(argc,argv)
@<Preprocessor definitions@>@; @<Preprocessor definitions@>@;
@<Type definitions@>@; @<Type definitions@>@;
@<Global variables@>@; @<Global variables@>@;
#include "libimport.h"
extern void report_error(char * message, int file_no, int line_no); extern void report_error(char * message, int file_no, int line_no);
extern jmp_buf mmixal_exit; extern jmp_buf mmixal_exit;
......
...@@ -64,7 +64,9 @@ The tet field of the mem_tetra may be eliminated. ...@@ -64,7 +64,9 @@ The tet field of the mem_tetra may be eliminated.
@x @x
tetra tet; /* the tetrabyte of simulated memory */ tetra tet; /* the tetrabyte of simulated memory */
@y @y
MMIX_MEM_TET #ifdef MMIX_MEM_TET
tetra tet; /* the tetrabyte of simulated memory */
#endif
@z @z
@x @x
...@@ -947,8 +949,10 @@ fin_pst: ...@@ -947,8 +949,10 @@ fin_pst:
if (!MMIX_STT(b,w)) goto page_fault; if (!MMIX_STT(b,w)) goto page_fault;
fin_st: fin_st:
ll=mem_find(w); test_store_bkpt(ll); ll=mem_find(w); test_store_bkpt(ll);
#ifdef MMIX_MEM_TET
w.l&=-8;@+ll=mem_find(w); w.l&=-8;@+ll=mem_find(w);
a.h=ll->tet;@+ a.l=(ll+1)->tet; /* for trace output */ a.h=ll->tet;@+ a.l=(ll+1)->tet; /* for trace output */
#endif
break; break;
@z @z
...@@ -2449,7 +2453,7 @@ signal(SIGINT,catchint); /* now |catchint| will catch the first interrupt */ ...@@ -2449,7 +2453,7 @@ signal(SIGINT,catchint); /* now |catchint| will catch the first interrupt */
@ @(libinit.c@>= @ @(libinit.c@>=
#ifdef WIN32 #ifdef WIN32
BOOL CtrlHandler( DWORD fdwCtrlType ) BOOL CtrlHandler( DWORD fdwCtrlType )
{ MMIX_CTRL_HANDLER { MMIX_CTRL_HANDLER;
interrupt=true; interrupt=true;
if (fdwCtrlType==CTRL_C_EVENT || fdwCtrlType==CTRL_BREAK_EVENT ) if (fdwCtrlType==CTRL_C_EVENT || fdwCtrlType==CTRL_BREAK_EVENT )
{ {
...@@ -2476,7 +2480,7 @@ void catchint(n) ...@@ -2476,7 +2480,7 @@ void catchint(n)
interact: @<Put a new command in |command_buf|@>; interact: @<Put a new command in |command_buf|@>;
@y @y
interact: @<Put a new command in |command_buf|@>; interact: @<Put a new command in |command_buf|@>;
MMIX_GET_INTERRUPT MMIX_GET_INTERRUPT;
@z @z
@x @x
...@@ -2597,8 +2601,8 @@ void show_breaks @,@,@[ARGS((mem_node*))@];@+@t}\6{@> ...@@ -2597,8 +2601,8 @@ void show_breaks @,@,@[ARGS((mem_node*))@];@+@t}\6{@>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <setjmp.h> #include <setjmp.h>
#include "libconfig.h"
#include <time.h> #include <time.h>
#include "libconfig.h"
#include "libtype.h" #include "libtype.h"
#include "libglobals.h" #include "libglobals.h"
#include "mmixlib.h" #include "mmixlib.h"
......
...@@ -120,8 +120,8 @@ extern octa*l; ...@@ -120,8 +120,8 @@ extern octa*l;
extern int lring_size; extern int lring_size;
extern int lring_mask; extern int lring_mask;
extern int S; extern int S;
char*special_name[32]; extern char*special_name[32];
extern octa new_Q;
extern void mmputchars(unsigned char *buf,int size,octa addr); extern void mmputchars(unsigned char *buf,int size,octa addr);
extern int mmgetchars(unsigned char *buf, int size, octa addr, int stop); extern int mmgetchars(unsigned char *buf, int size, octa addr, int stop);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)" OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4" ConfigurationType="4"
CharacterSet="1" CharacterSet="0"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB" AdditionalIncludeDirectories="util;../vmblib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;VMB"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)" OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4" ConfigurationType="4"
CharacterSet="1" CharacterSet="0"
WholeProgramOptimization="1" WholeProgramOptimization="1"
> >
<Tool <Tool
...@@ -104,6 +105,7 @@ ...@@ -104,6 +105,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="3" Optimization="3"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="util;vmblib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB" PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0" RuntimeLibrary="0"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
...@@ -674,10 +676,6 @@ ...@@ -674,10 +676,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd" Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
> >
<File
RelativePath=".\vmb\address.h"
>
</File>
<File <File
RelativePath=".\libconfig.h" RelativePath=".\libconfig.h"
> >
......
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