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

Commit 21d6e186 authored by Martin Ruckert's avatar Martin Ruckert
Browse files

adapting for mmixvd

parent 43897533
@x
#include <stdio.h>
#include <stdlib.h>
@y
#include <stdio.h>
#include <stdlib.h>
#include "libconfig.h"
#include "libimport.h"
#pragma warning(disable : 4996 4267)
@z
@x
if (fwrite(buf,1,n,sfile[handle].fp)!=n) return ominus(zero_octa,size);
fflush(sfile[handle].fp);
@y
#ifdef MMIX_PRINT
if (sfile[handle].fp==stdout || sfile[handle].fp==stderr)
win32_log(buf);
else
#endif
{ if (fwrite(buf,1,n,sfile[handle].fp)!=n) return ominus(zero_octa,size);
fflush(sfile[handle].fp);
}
@z
@x
if (fwrite(buf,1,n,sfile[handle].fp)!=n) return neg_one;
@y
#ifdef MMIX_PRINT
if (sfile[handle].fp==stdout || sfile[handle].fp==stderr)
win32_log(buf);
else
#endif
if (fwrite(buf,1,n,sfile[handle].fp)!=n) return neg_one;
@z
@x
fflush(sfile[handle].fp);
@y
#ifdef MMIX_PRINT
if (sfile[handle].fp!=stdout && sfile[handle].fp!=stderr)
#endif
fflush(sfile[handle].fp);
@z
@x
if (fwrite(buf,1,n,sfile[handle].fp)!=n) return neg_one;
@y
#ifdef MMIX_PRINT
if (sfile[handle].fp==stdout || sfile[handle].fp==stderr)
win32_log(buf);
else
#endif
if (fwrite(buf,1,n,sfile[handle].fp)!=n) return neg_one;
@z
@x
fflush(sfile[handle].fp);
@y
#ifdef MMIX_PRINT
if (sfile[handle].fp!=stdout && sfile[handle].fp!=stderr)
#endif
fflush(sfile[handle].fp);
@z
...@@ -138,6 +138,7 @@ void report_error(message) ...@@ -138,6 +138,7 @@ void report_error(message)
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>
#include "libname.h"
#define _MMIXAL_ #define _MMIXAL_
int err_count; int err_count;
...@@ -149,7 +150,7 @@ extern jmp_buf mmixal_exit; ...@@ -149,7 +150,7 @@ extern jmp_buf mmixal_exit;
void report_error(char *message,int file_no,int line_no) void report_error(char *message,int file_no,int line_no)
{ char *filename; { char *filename;
filename=file2name(file_no); filename=file2filename(file_no);
if (!filename) filename="(nofile)"; if (!filename) filename="(nofile)";
if (message[0]=='*') if (message[0]=='*')
fprintf(stderr,"\"%s\", line %d warning: %s\n", fprintf(stderr,"\"%s\", line %d warning: %s\n",
......
...@@ -118,7 +118,7 @@ extern void mmputchars(unsigned char *buf,int size,octa addr); ...@@ -118,7 +118,7 @@ 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);
extern FILE*fake_stdin;
extern mem_tetra* mem_find(octa addr); extern mem_tetra* mem_find(octa addr);
extern mem_node*mem_root; extern mem_node*mem_root;
...@@ -233,7 +233,8 @@ extern void mmix_status(int status); ...@@ -233,7 +233,8 @@ extern void mmix_status(int status);
#endif #endif
/* function from mmix-io */
void mmix_fake_stdin(FILE *f);
/* functions that mmixal provides */ /* functions that mmixal provides */
extern int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_option); extern int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_option);
......
...@@ -715,7 +715,7 @@ ...@@ -715,7 +715,7 @@
> >
</File> </File>
<File <File
RelativePath=".\io-win.ch" RelativePath=".\libio.ch"
> >
</File> </File>
<File <File
...@@ -752,7 +752,7 @@ ...@@ -752,7 +752,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="ctangle mmix-io with libio.ch" Description="ctangle mmix-io with libio.ch"
CommandLine="ctangle mmixware\mmix-io.w libio.ch" CommandLine="ctangle mmixware\mmix-io.w libio.ch&#x0D;&#x0A;"
AdditionalDependencies="libio.ch" AdditionalDependencies="libio.ch"
Outputs="mmix-io.c" Outputs="mmix-io.c"
/> />
...@@ -763,7 +763,7 @@ ...@@ -763,7 +763,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="ctangle mmix-io with libio.ch" Description="ctangle mmix-io with libio.ch"
CommandLine="ctangle mmixware\mmix-io.w libio.ch" CommandLine="ctangle mmixware\mmix-io.w libio.ch&#x0D;&#x0A;"
AdditionalDependencies="libio.ch" AdditionalDependencies="libio.ch"
Outputs="mmix-io.c" Outputs="mmix-io.c"
/> />
......
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