The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 60ed7f75 authored by Felix Albrecht's avatar Felix Albrecht
Browse files

Complete add of hole source code.

parent abd2b748
......@@ -7,6 +7,7 @@
#include "Scintilla.h"
#include "FCNTL.H"
#include <Windows.h>
#include <sstream>
#include <ios>
#include <stdio.h>
#include <io.h>
......@@ -41,6 +42,7 @@ const int blockSize = 128 * 1024;
const COLORREF black = RGB(0,0,0);
const COLORREF white = RGB(0xff,0xff,0xff);
const COLORREF nearlyWhite = RGB(0xF0, 0xF0, 0xF0);
wchar_t home[256];
......@@ -76,7 +78,7 @@ struct DMApp {
void EnableAMenuItem(int id, bool enable);
void CheckMenus();
void Notify(SCNotification *notification);
void positionCursor();
void positionCaret();
void SetAStyle(int style, COLORREF fore, COLORREF back=white, int size=-1, const char *face=0);
void InitialiseEditor();
......@@ -99,7 +101,7 @@ void DMApp::GetRange(int start, int end, char *text) {
tr.chrg.cpMin = start;
tr.chrg.cpMax = end;
tr.lpstrText = (LPWSTR) text;
SendMessage(wEditor, EM_GETTEXTRANGE, 0, reinterpret_cast<LPARAM>(&tr));
SendMessage(wEditor, SCI_GETTEXTRANGE, 0, reinterpret_cast<LPARAM>(&tr));
}
void DMApp::SetTitle() {
......@@ -111,9 +113,12 @@ void DMApp::SetTitle() {
}
void DMApp::New() {
app.SendEditor(SCI_MARKERDELETEALL, -1);
SendMessage(app.wErrorList, LB_RESETCONTENT, 0, 0);
SaveIfUnsure();
SendEditor(SCI_CLEARALL);
SendEditor(EM_EMPTYUNDOBUFFER);
fullPath[0] = '\0';
swprintf(fullPath, L"\\New.mms\0");
SetTitle();
isDirty = false;
SendEditor(SCI_SETSAVEPOINT);
......@@ -179,6 +184,12 @@ void DMApp::Open() {
if (::GetOpenFileName(&ofn)) {
OpenFile(openName);
}
char buffer[7];
sprintf(buffer, "%s", "_");
sprintf(buffer, "%d", (int)SendEditor(SCI_GETLINECOUNT));
SendEditor(SCI_SETMARGINWIDTHN, 0, (int)SendEditor(SCI_TEXTWIDTH, STYLE_LINENUMBER, (LPARAM)buffer) + 5);
}
void DMApp::Save() {
......@@ -246,11 +257,6 @@ int DMApp::SaveIfUnsure() {
void DMApp::Command(int id) {
switch (id) {
case 65536:
if(HIWORD(id) == LBN_DBLCLK)
positionCursor();
break;
case IDM_FILE_NEW:
if (SaveIfUnsure() != IDCANCEL) {
New();
......@@ -325,53 +331,6 @@ void DMApp::Notify(SCNotification *notification) {
}
}
const char htmlKeyWords[] =
"a abbr acronym address applet area b base basefont "
"bdo big blockquote body br button caption center "
"cite code col colgroup dd del dfn dir div dl dt em "
"fieldset font form frame frameset h1 h2 h3 h4 h5 h6 "
"head hr html i iframe img input ins isindex kbd label "
"legend li link map menu meta noframes noscript "
"object ol optgroup option p param pre q s samp "
"script select small span strike strong style sub sup "
"table tbody td textarea tfoot th thead title tr tt u ul "
"var xmlns "
"abbr accept-charset accept accesskey action align alink "
"alt archive axis background bgcolor border "
"cellpadding cellspacing char charoff charset checked cite "
"class classid clear codebase codetype color cols colspan "
"compact content coords "
"data datafld dataformatas datapagesize datasrc datetime "
"declare defer dir disabled enctype "
"face for frame frameborder "
"headers height href hreflang hspace http-equiv "
"id ismap label lang language link longdesc "
"marginwidth marginheight maxlength media method multiple "
"name nohref noresize noshade nowrap "
"object onblur onchange onclick ondblclick onfocus "
"onkeydown onkeypress onkeyup onload onmousedown "
"onmousemove onmouseover onmouseout onmouseup "
"onreset onselect onsubmit onunload "
"profile prompt readonly rel rev rows rowspan rules "
"scheme scope shape size span src standby start style "
"summary tabindex target text title type usemap "
"valign value valuetype version vlink vspace width "
"text password checkbox radio submit reset "
"file hidden image "
"public !doctype xml";
const char jsKeyWords[] =
"break case catch continue default "
"do else for function if return throw try var while";
const char vbsKeyWords[] =
"and as byref byval case call const "
"continue dim do each else elseif end error exit false for function global "
"goto if in loop me new next not nothing on optional or private public "
"redim rem resume select set sub then to true type while with "
"boolean byte currency date double integer long object single string type "
"variant";
void DMApp::SetAStyle(int style, COLORREF fore, COLORREF back, int size, const char *face) {
SendEditor(SCI_STYLESETFORE, style, fore);
SendEditor(SCI_STYLESETBACK, style, back);
......@@ -383,148 +342,63 @@ void DMApp::SetAStyle(int style, COLORREF fore, COLORREF back, int size, const c
void DMApp::InitialiseEditor() {
SendEditor(SCI_SETLEXER, SCLEX_MMIXAL);
SendEditor(SCI_SETSTYLEBITS, 7);
SendEditor(SCI_SETKEYWORDS, 0,
reinterpret_cast<LPARAM>(htmlKeyWords));
SendEditor(SCI_SETKEYWORDS, 1,
reinterpret_cast<LPARAM>(jsKeyWords));
SendEditor(SCI_SETKEYWORDS, 2,
reinterpret_cast<LPARAM>(vbsKeyWords));
SendEditor(SCI_SETMARGINTYPEN, 0, SC_MARGIN_NUMBER);
SendEditor(SCI_SETMARGINWIDTHN, 0, (int)SendEditor(SCI_TEXTWIDTH, STYLE_LINENUMBER, (LPARAM)"_1") + 10);
// Set up the global default style. These attributes are used wherever no explicit choices are made.
SetAStyle(STYLE_DEFAULT, black, white, 11, "Verdana");
SendEditor(SCI_STYLECLEARALL); // Copies global style to all others
const COLORREF red = RGB(0xFF, 0, 0);
const COLORREF offWhite = RGB(0xFF, 0xFB, 0xF0);
const COLORREF darkGreen = RGB(0, 0x80, 0);
const COLORREF darkBlue = RGB(0, 0, 0x80);
// Hypertext default is used for all the document's text
SetAStyle(SCE_H_DEFAULT, black, white, 11, "Times New Roman");
// Unknown tags and attributes are highlighed in red.
// If a tag is actually OK, it should be added in lower case to the htmlKeyWords string.
SetAStyle(SCE_H_TAG, darkBlue);
SetAStyle(SCE_H_TAGUNKNOWN, red);
SetAStyle(SCE_H_ATTRIBUTE, darkBlue);
SetAStyle(SCE_H_ATTRIBUTEUNKNOWN, red);
SetAStyle(SCE_H_NUMBER, RGB(0x80,0,0x80));
SetAStyle(SCE_H_DOUBLESTRING, RGB(0,0x80,0));
SetAStyle(SCE_H_SINGLESTRING, RGB(0,0x80,0));
SetAStyle(SCE_H_OTHER, RGB(0x80,0,0x80));
SetAStyle(SCE_H_COMMENT, RGB(0x80,0x80,0));
SetAStyle(SCE_H_ENTITY, RGB(0x80,0,0x80));
SetAStyle(SCE_H_TAGEND, darkBlue);
SetAStyle(SCE_H_XMLSTART, darkBlue); // <?
SetAStyle(SCE_H_XMLEND, darkBlue); // ?>
SetAStyle(SCE_H_SCRIPT, darkBlue); // <script
SetAStyle(SCE_H_ASP, RGB(0x4F, 0x4F, 0), RGB(0xFF, 0xFF, 0)); // <% ... %>
SetAStyle(SCE_H_ASPAT, RGB(0x4F, 0x4F, 0), RGB(0xFF, 0xFF, 0)); // <%@ ... %>
SetAStyle(SCE_HB_DEFAULT, black);
SetAStyle(SCE_HB_COMMENTLINE, darkGreen);
SetAStyle(SCE_HB_NUMBER, RGB(0,0x80,0x80));
SetAStyle(SCE_HB_WORD, darkBlue);
SendEditor(SCI_STYLESETBOLD, SCE_HB_WORD, 1);
SetAStyle(SCE_HB_STRING, RGB(0x80,0,0x80));
SetAStyle(SCE_HB_IDENTIFIER, black);
SendEditor(SCI_SETMARGINTYPEN, 1, SC_MARGIN_BACK);
// This light blue is found in the windows system palette so is safe to use even in 256 colour modes.
const COLORREF red = RGB(0xFF, 0, 0);
const COLORREF darkRed = RGB(0x80, 0, 0);
const COLORREF darkGreen = RGB(0, 0x67, 0);
const COLORREF lightGreen = RGB(0x30, 0xB0, 0x30);
const COLORREF green = RGB(0, 0xB0, 0);
const COLORREF darkLightGreen = RGB(0x30, 0x67, 0x30);
const COLORREF darkBlue = RGB(0, 0, 0x67);
const COLORREF blue = RGB(0, 0, 0xA0);
const COLORREF brown = RGB(0x80, 0x80, 0);
const COLORREF orange = RGB(0xFF, 0x80, 0);
const COLORREF lightBlue = RGB(0xA6, 0xCA, 0xF0);
// Show the whole section of VBScript with light blue background
for (int bstyle=SCE_HB_DEFAULT; bstyle<=SCE_HB_STRINGEOL; bstyle++) {
SendEditor(SCI_STYLESETFONT, bstyle,
reinterpret_cast<LPARAM>("Georgia"));
SendEditor(SCI_STYLESETBACK, bstyle, lightBlue);
// This call extends the backround colour of the last style on the line to the edge of the window
SendEditor(SCI_STYLESETEOLFILLED, bstyle, 1);
}
SendEditor(SCI_STYLESETBACK, SCE_HB_STRINGEOL, RGB(0x7F,0x7F,0xFF));
SendEditor(SCI_STYLESETFONT, SCE_HB_COMMENTLINE,
reinterpret_cast<LPARAM>("Comic Sans MS"));
SetAStyle(SCE_HBA_DEFAULT, black);
SetAStyle(SCE_HBA_COMMENTLINE, darkGreen);
SetAStyle(SCE_HBA_NUMBER, RGB(0,0x80,0x80));
SetAStyle(SCE_HBA_WORD, darkBlue);
SendEditor(SCI_STYLESETBOLD, SCE_HBA_WORD, 1);
SetAStyle(SCE_HBA_STRING, RGB(0x80,0,0x80));
SetAStyle(SCE_HBA_IDENTIFIER, black);
// Show the whole section of ASP VBScript with bright yellow background
for (int bastyle=SCE_HBA_DEFAULT; bastyle<=SCE_HBA_STRINGEOL; bastyle++) {
SendEditor(SCI_STYLESETFONT, bastyle,
reinterpret_cast<LPARAM>("Georgia"));
SendEditor(SCI_STYLESETBACK, bastyle, RGB(0xFF, 0xFF, 0));
// This call extends the backround colour of the last style on the line to the edge of the window
SendEditor(SCI_STYLESETEOLFILLED, bastyle, 1);
}
SendEditor(SCI_STYLESETBACK, SCE_HBA_STRINGEOL, RGB(0xCF,0xCF,0x7F));
SendEditor(SCI_STYLESETFONT, SCE_HBA_COMMENTLINE,
reinterpret_cast<LPARAM>("Comic Sans MS"));
// If there is no need to support embedded Javascript, the following code can be dropped.
// Javascript will still be correctly processed but will be displayed in just the default style.
const COLORREF darkYellow = RGB(0xA0, 0xA0, 0);
const COLORREF darkGrey = RGB(0x50, 0x50, 0x50);
const COLORREF lightGrey = RGB(0xA0, 0xA0, 0xA0);
SetAStyle(SCE_HJ_START, RGB(0x80,0x80,0));
SetAStyle(SCE_HJ_DEFAULT, black);
SetAStyle(SCE_HJ_COMMENT, darkGreen);
SetAStyle(SCE_HJ_COMMENTLINE, darkGreen);
SetAStyle(SCE_HJ_COMMENTDOC, darkGreen);
SetAStyle(SCE_HJ_NUMBER, RGB(0,0x80,0x80));
SetAStyle(SCE_HJ_WORD, black);
SetAStyle(SCE_HJ_KEYWORD, darkBlue);
SetAStyle(SCE_HJ_DOUBLESTRING, RGB(0x80,0,0x80));
SetAStyle(SCE_HJ_SINGLESTRING, RGB(0x80,0,0x80));
SetAStyle(SCE_HJ_SYMBOLS, black);
SetAStyle(SCE_HJA_START, RGB(0x80,0x80,0));
SetAStyle(SCE_HJA_DEFAULT, black);
SetAStyle(SCE_HJA_COMMENT, darkGreen);
SetAStyle(SCE_HJA_COMMENTLINE, darkGreen);
SetAStyle(SCE_HJA_COMMENTDOC, darkGreen);
SetAStyle(SCE_HJA_NUMBER, RGB(0,0x80,0x80));
SetAStyle(SCE_HJA_WORD, black);
SetAStyle(SCE_HJA_KEYWORD, darkBlue);
SetAStyle(SCE_HJA_DOUBLESTRING, RGB(0x80,0,0x80));
SetAStyle(SCE_HJA_SINGLESTRING, RGB(0x80,0,0x80));
SetAStyle(SCE_HJA_SYMBOLS, black);
// Show the whole section of Javascript with off white background
for (int jstyle=SCE_HJ_DEFAULT; jstyle<=SCE_HJ_SYMBOLS; jstyle++) {
SendEditor(SCI_STYLESETFONT, jstyle,
reinterpret_cast<LPARAM>("Lucida Sans Unicode"));
SendEditor(SCI_STYLESETBACK, jstyle, offWhite);
SendEditor(SCI_STYLESETEOLFILLED, jstyle, 1);
}
SendEditor(SCI_STYLESETBACK, SCE_HJ_STRINGEOL, RGB(0xDF, 0xDF, 0x7F));
SendEditor(SCI_STYLESETEOLFILLED, SCE_HJ_STRINGEOL, 1);
// Show the whole section of Javascript with brown background
for (int jastyle=SCE_HJA_DEFAULT; jastyle<=SCE_HJA_SYMBOLS; jastyle++) {
SendEditor(SCI_STYLESETFONT, jastyle,
reinterpret_cast<LPARAM>("Lucida Sans Unicode"));
SendEditor(SCI_STYLESETBACK, jastyle, RGB(0xDF, 0xDF, 0x7F));
SendEditor(SCI_STYLESETEOLFILLED, jastyle, 1);
}
SendEditor(SCI_STYLESETBACK, SCE_HJA_STRINGEOL, RGB(0x0,0xAF,0x5F));
SendEditor(SCI_STYLESETEOLFILLED, SCE_HJA_STRINGEOL, 1);
SetAStyle(STYLE_DEFAULT, black, white, 11, "Verdana");
SendEditor(SCI_STYLECLEARALL);
SendEditor(SCI_SETCARETLINEVISIBLE, true);
SendEditor(SCI_SETCARETLINEBACK, nearlyWhite);
SetAStyle(SCE_MMIXAL_CHAR, brown);
SetAStyle(SCE_MMIXAL_LABEL, darkGrey);
SetAStyle(SCE_MMIXAL_OPCODE_PRE, darkLightGreen);
SetAStyle(SCE_MMIXAL_OPCODE_UNKNOWN, lightGreen);
SetAStyle(SCE_MMIXAL_OPCODE_VALID, green);
SetAStyle(SCE_MMIXAL_OPCODE_POST, darkGreen);
SetAStyle(SCE_MMIXAL_NUMBER, orange);
SetAStyle(SCE_MMIXAL_SYMBOL, lightBlue);
SetAStyle(SCE_MMIXAL_STRING, darkYellow);
SetAStyle(SCE_MMIXAL_COMMENT, lightGrey);
SetAStyle(SCE_MMIXAL_REF, blue);
SetAStyle(SCE_MMIXAL_REGISTER, red);
SetAStyle(SCE_MMIXAL_INCLUDE, darkRed);
SetAStyle(SCE_MMIXAL_HEX, orange);
SetAStyle(SCE_MMIXAL_OPERATOR, black);
SetAStyle(SCE_MMIXAL_OPERANDS, darkBlue);
SetAStyle(SCE_MMIXAL_LEADWS, black);
SendEditor(SCI_MARKERDEFINE, ErrorMarker, SC_MARK_FULLRECT);
SendEditor(SCI_MARKERSETFORE, ErrorMarker, RGB(0x7F, 0x7F, 0x7F));
SendEditor(SCI_MARKERSETBACK, ErrorMarker, RGB(0xFF, 0x0, 0x0));
SendEditor(SCI_MARKERSETBACKSELECTED, ErrorMarker, RGB(0x7F, 0x0, 0x0));
SendEditor(SCI_MARKERSETBACK, ErrorMarker, RGB(0xFF, 0, 0));
SendEditor(SCI_MARKERSETBACKSELECTED, ErrorMarker, RGB(0x7F, 0, 0));
SendEditor(SCI_MARKERDEFINE, BackgroundMarker, SC_MARK_BACKGROUND);
SendEditor(SCI_MARKERSETBACK, BackgroundMarker, RGB(0x9F, 0x9F, 0x9F));
SendEditor(SCI_MARKERSETBACKSELECTED, BackgroundMarker, RGB(0x8F, 0x8F, 0x8F));
}
void DMApp::positionCursor(){
// ERR: SendMessage
void DMApp::positionCaret(){
int selection = (int) SendMessage(wErrorList, LB_GETCURSEL, 0, 0);
int lineNumber = (int) SendMessage(wErrorList, LB_GETITEMDATA, selection, 0);
SendEditor(SCI_GOTOLINE, lineNumber, 0);
......@@ -533,6 +407,7 @@ void DMApp::positionCursor(){
EXTERN_C char* mmixal(FILE* file, char* filename);
EXTERN_C char* mmixsim(FILE* file);
EXTERN_C int interacting;
DWORD WINAPI ConsoleThread(LPVOID lpParam){
......@@ -567,12 +442,13 @@ DWORD WINAPI ConsoleThread(LPVOID lpParam){
std::ios_base::sync_with_stdio();
interacting = 1;
mmixsim((FILE*)lpParam);
return 0;
}
extern "C" void addListString(char* text, int lineNumber, bool isError){
extern "C" void addListString(char* text, int lineNumber){
wchar_t* wText = new wchar_t[strlen(text)+1];
mbstowcs(wText, text, strlen(text)+1);
......@@ -585,16 +461,6 @@ extern "C" void addListString(char* text, int lineNumber, bool isError){
app.SendEditor(SCI_MARKERADD, lineNumber - 1, BackgroundMarker);
}
INT_PTR CALLBACK DialogProc( HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam ){
switch( iMessage ){
case WM_COMMAND:
switch( LOWORD( wParam ) ){
}
break;
}
return FALSE;
}
int APIENTRY _tWinMain(HINSTANCE instance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
......@@ -692,23 +558,16 @@ int APIENTRY _tWinMain(HINSTANCE instance,
app.hInstance,
0);
//app.wError = CreateDialog(app.hInstance, MAKEINTRESOURCE(IDD_ERROR), app.wMain, NULL);
//app.wErrorList = GetDlgItem(app.wError, IDC_ERRORLIST);
app.wErrorList = CreateWindow(
L"ListBox",
NULL,
WS_CHILD | WS_VSCROLL | WS_CLIPCHILDREN | LBS_HASSTRINGS | LBS_NOTIFY | LBS_HASSTRINGS,
L"Error",
WS_CHILD | WS_VSCROLL | WS_CLIPCHILDREN | LBS_HASSTRINGS | LBS_NOTIFY,
rc.left, rc.top + ((rc.bottom - rc.top) / 5) * 4,
rc.right - rc.left, (rc.bottom - rc.top) / 5,
app.wMain,
0,
app.hInstance,
0);
//SetParent(app.wErrorList, app.wMain);
//SetWindowPos(app.wErrorList, 0, rc.left, rc.top + ((rc.bottom - rc.top) / 5) * 4, rc.right - rc.left, (rc.bottom - rc.top) / 5, 0);
if(!app.wErrorList){
LPTSTR lpMsgBuf;
......@@ -775,7 +634,6 @@ void assemble(){
char *path = new char[wcslen(app.fullPath) + 1];
wcstombs(path, app.fullPath, wcslen(app.fullPath) + 1);
mmixal(src_file, path);
}
}
......@@ -887,7 +745,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam)
case 0:
if(HIWORD(wParam) == LBN_DBLCLK){
app.positionCursor();
app.positionCaret();
}
break;
......@@ -902,16 +760,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam)
run();
break;
case IDC_ERRORLIST:
if(HIWORD(wParam) == LBN_DBLCLK){
app.positionCursor();
}
break;
case IDM_ABOUT:
HWND about = CreateDialog(app.hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), app.wMain, NULL);
HWND about = CreateDialog(app.hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), app.wMain, About);
ShowWindow(about, SW_SHOWNORMAL);
}
......@@ -919,22 +770,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam)
case WM_NOTIFY:
hdr = (LPNMHDR)lParam;
switch(hdr->code){
case LBN_SETFOCUS:
app.positionCursor();
break;
case LBN_DBLCLK:
app.positionCursor();
break;
default:
break;
}
app.Notify(reinterpret_cast<SCNotification *>(lParam));
return 0;
......@@ -948,14 +783,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam)
::PostQuitMessage(0);
}
return 0;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Hier den Zeichnungscode hinzufgen.
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_CTLCOLORLISTBOX:
if((HWND)lParam == app.wErrorList){
......@@ -983,14 +810,6 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
case WM_INITDIALOG:
/*ErrorHandle = GetDlgItem(app.wMain, IDD_ERROR);
ErrorListHandle = GetDlgItem(app.wError, IDC_ERRORLIST);
RECT rc;
::GetClientRect(hDlg, &rc);
SetWindowPos(ErrorListHandle, 0, rc.left, rc.top + ((rc.bottom - rc.top) / 5) * 4, rc.right - rc.left, (rc.bottom - rc.top) / 5, 0);
SetWindowPos(ErrorHandle, 0, rc.left, rc.top + ((rc.bottom - rc.top) / 5) * 4, rc.right - rc.left, (rc.bottom - rc.top) / 5, 0);
*/
return (INT_PTR)TRUE;
case WM_COMMAND:
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -19,7 +19,7 @@
#define mmo_err { \
fprintf(stderr,"Bad object file! (Try running MMOtype.)\n") ; \
\
exit(-4) ; \
return 0; \
} \
#define mmo_load(loc,val) ll= mem_find(loc) ,ll->tet^= val \
......@@ -633,7 +633,7 @@ char*trap_format[]= {
/*:110*//*113:*/
#line 2440 "mmix-sim.w"
#line 48 "mmix-sim.ch"
#line 62 "mmix-sim.ch"
extern void mmix_io_init ARGS((void));
extern octa mmix_fopen ARGS((unsigned char,octa,octa));
extern octa mmix_fclose ARGS((unsigned char));
......@@ -1361,7 +1361,7 @@ default:if(usage){
fprintf(stderr,
"Usage: %s <options> progfile command-line-args...\n",myself);
#line 85 "mmix-sim.ch"
#line 99 "mmix-sim.ch"
for(k= 0;usage_help[k][0];k++)fprintf(stderr,"%s",usage_help[k]);
#line 2982 "mmix-sim.w"
}else for(k= 0;usage_help[k][1]!='b';k++)printf("%s",usage_help[k]);
......@@ -1481,7 +1481,7 @@ fputc(t&0xff,dump_file);
#line 2890 "mmix-sim.w"
#line 73 "mmix-sim.ch"
#line 87 "mmix-sim.ch"
char*mmixsim(FILE*exFile)
#line 2895 "mmix-sim.w"
{
......@@ -1655,7 +1655,7 @@ while(!postamble);
aux.h= 0x60000000;aux.l= 0x18;
ll= mem_find(aux);
(ll-1)->tet= 2;
#line 24 "mmix-sim.ch"
#line 38 "mmix-sim.ch"
#line 1050 "mmix-sim.w"
(ll-4)->tet= 0x40000000;
......@@ -1685,7 +1685,7 @@ if(!buffer)panic("Can't allocate source line buffer");
g[rK]= neg_one;
g[rN].h= (VERSION<<24)+(SUBVERSION<<16)+(SUBSUBVERSION<<8);
#line 30 "mmix-sim.ch"
#line 44 "mmix-sim.ch"
g[rN].l= time(NULL);
#line 1807 "mmix-sim.w"
g[rT].h= 0x80000005;
......@@ -1730,7 +1730,7 @@ if(ll->tet)inst_ptr= x;
resuming= true;
rop= RESUME_AGAIN;
g[rX].l= ((tetra)UNSAVE<<24)+255;
#line 108 "mmix-sim.ch"
#line 122 "mmix-sim.ch"
if(dump_file){
x.l= 1;
dump(mem_root);
......
......@@ -18,6 +18,20 @@ if (!mmo_file) {
mmo_file=exFile;
@z
@x
@d mmo_err {
fprintf(stderr,"Bad object file! (Try running MMOtype.)\n");
@.Bad object file@>
exit(-4);
}
@y
@d mmo_err {
fprintf(stderr,"Bad object file! (Try running MMOtype.)\n");
@.Bad object file@>
return 0;
}
@z
@x
(ll-5)->tet=argc; /* and $\$0=|argc|$ */
@y
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
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