-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d5d86c
commit 430dcd9
Showing
5 changed files
with
873 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "parsecmds.h" | ||
#include <fstream> | ||
string inStr = ""; | ||
int main (){ | ||
monkey (); | ||
cout << "\n Welcome to MonkeyScript85 v1.0\n\n"; | ||
cout << "Translator of 8085 Assembly Code to Human-Understandable Instructions for the 8085 Programming Kit.\nMade by KosmicDaKerbal.\n\n\n\nStarting Monke Terminal...\t\t\t\tNote: Only Capital Letters are accepted.\n"; | ||
while (inStr != "EXIT"){ | ||
inStr = ""; | ||
cout << "\nMonke Listen> "; | ||
getline(cin, inStr); | ||
if (inStr.length() > 32){ | ||
cout << "Monke no understand arguments above 32 characters :("; | ||
} else if (inStr == "CONVERT"){ | ||
string file = ""; | ||
cout << "Enter Input File: "; | ||
getline(cin, file); | ||
ifstream inputFile; | ||
inputFile.open(file.c_str()); | ||
if (!inputFile.is_open()) { | ||
cerr << "Error opening the file: Check Filename and Extension" << endl; | ||
} else { | ||
cout << "Enter Location of Start Code: "; | ||
string start; | ||
int conf = 0; | ||
getline(cin, start); | ||
for (int n = 0; n <= 3; n++){ | ||
for (int m = 0; m <=15; m++){ | ||
if (start.at(n) == acceptable [m]){ | ||
conf++; | ||
} | ||
} | ||
} | ||
if (conf == 4){ | ||
output = "#Generated by MonkeyScript85 v1.0 at " + currentDateTime() + "\n\nMAIN PROGRAM:\nPRESS RST\nPRESS SET\nTYPE " + start + "\nPRESS INR"; | ||
string line; | ||
while (getline(inputFile, line)){ | ||
parsecmds (line, 1, 1); | ||
} | ||
inputFile.close(); | ||
ofstream out ("MSc_Output.txt"); | ||
string buf = "\n\nTO EXECUTE:\nPRESS RST\nPRESS GO\nTYPE " + start + "\nPRESS EXEC {If everything is fine, then you should see Fr 1 End}"; | ||
output.append (buf); | ||
out << output; | ||
out.close(); | ||
} else { | ||
cout << "Error in Beginning Address."; | ||
} | ||
} | ||
} else { | ||
parsecmds(inStr, globlog, 0); | ||
} | ||
} | ||
cout << "\nMonke go home. Byebye!\n"; | ||
system ("pause"); | ||
} |
Oops, something went wrong.