Skip to content

Commit

Permalink
Merge pull request #158 from lorderikir/master
Browse files Browse the repository at this point in the history
v0.9.3 update
  • Loading branch information
ericjiang97 committed Sep 6, 2016
2 parents 2f87215 + 279d499 commit afd9385
Show file tree
Hide file tree
Showing 8 changed files with 600 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/MARIE-js/MARIE.js.svg?branch=master)](https://travis-ci.org/MARIE-js/MARIE.js) [![Gitter chat](https://badges.gitter.im/MARIE-js/gitter.png)](https://gitter.im/MARIE-js/Lobby) [![npm version](https://badge.fury.io/js/npm.svg)](https://badge.fury.io/js/npm)
==============
Current version: `0.9.2`
Current version: `0.9.3`

MARIE.js is an implementation of a simulator for a 'Machine Architecture that is Really Intuitive and Easy'
from [The Essentials of Computer Organization and Architecture](https://books.google.com.au/books/about/The_Essentials_of_Computer_Organization.html?id=3kQoAwAAQBAJ&redir_esc=y) (Linda Null, Julia Lobur) in JavaScript.
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "MARIE.js",
"version": "0.9.2",
"version": "0.9.3",
"description": "MARIE.js is an implementation of a simulator for a 'Machine Architecture that is Really Intuitive and Easy' from The Essentials of Computer Organization and Architecture (Linda Null, Julia Lobur) in JavaScript.",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/code/multiply.mas
Expand Up @@ -24,4 +24,7 @@ loop, Load num
/ Output result to user then halt program
Load num
Output
Halt
Halt

X, DEC 0
Y, DEC 0
545 changes: 545 additions & 0 deletions src/code/quicksort.mas

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions src/js/marie.js
Expand Up @@ -301,14 +301,19 @@ var MarieSim,

oldValue = this[target];

this[target] = Utility.uintToInt(src & msk);

if(target == "pc") {
if(0 <= this[target] && this[target] >= 4096) {
if(this[target] >= 4096) {
throw new MarieSimError("RuntimeError", "The address " + (this[target]).toString() + " is out of bounds.");
}
else if(0 <= this[target]){
throw new MarieSimError("RuntimeError", "The address -" + (this[target]).toString() + " is out of bounds.");
}
}

this[target] = Utility.uintToInt(src & msk);



if (typeof source == "string") {
if(this.onRegRead) {
this.onRegRead.call(this, {
Expand Down Expand Up @@ -382,10 +387,14 @@ var MarieSim,
this[target] += typeof source == "string" ? this[source] : source;

if(target == "pc") {
if(0 <= this[target] && this[target] >= 4096) {
if(this[target] >= 4096) {
throw new MarieSimError("RuntimeError", "The address " + (this[target]).toString() + " is out of bounds.");
}
else if(0 <= this[target]){
throw new MarieSimError("RuntimeError", "The address -" + (this[target]).toString() + " is out of bounds.");
}
}

}

if(typeof source == "string") {
Expand Down
28 changes: 14 additions & 14 deletions src/js/tour.js
Expand Up @@ -24,52 +24,59 @@ $(document).ready(function() {
backdrop: true,
element: "#program-container",
title: "Coding Area",
content: "This is where you type your code here"
content: "This is where you type your code here, you can debug your code by opening 'Watchlist' and clicking to the right of the line number to add breakpoints. Green line shows current excution, grey line shows 'fetch' line "
},
{
onShow: viewHome,
smartPlacement: true,
backdrop: true,
element: "#register-container",
title: "Registers",
content: "This shows you the register values"
content: "This area shows you the register values, we have the Accumlator (AC), Program Counter (PC), IR"
},
{
onShow: viewHome,
smartPlacement: true,
backdrop: true,
element: "#tab-container",
title: "Values and Outputs",
content: "This shows you the output in Register Log, Output Values and how the data is being transferred in RTL"
content: "This shows you the output in Register Log, Output Values and how the data is being transferred in RTL, MAR, MBR and Input/Output"
},
{
onShow: viewHome,
smartPlacement: true,
backdrop: true,
element: "#status-info",
title: "Status bar",
content: "Shows you current status: also shows error messages"
content: "This is the status bar, this area shows you error messages to help you debug your code"
},
{
onShow: viewHome,
smartPlacement: true,
element: "#output-select",
title: "Select Output Type",
content: "Change the output type here with the options (HEX - Base 8, DEC - Base 10, ASCII - Base 16) . This by default is set to HEX. ",
},
{
onShow: viewHome,
smartPlacement: true,
element: "#bottom-menu",
title: "Control Bar",
content: "This is the bar used for stepping through the code, and building it"
content: "This is the control bar used for controlling the execution and the assembling of the code"
},
{
onShow: viewHome,
smartPlacement: true,
element: "#assemble",
title: "Assembling the Code",
content: "Build the code here"
content: "This button builds the code"
},
{
onShow: viewHome,
smartPlacement: true,
element: "#step",
title: "Step",
content: "Step Through the Code using this button"
content: "This steps one line through the code"
},
{
onShow: viewHome,
Expand Down Expand Up @@ -106,13 +113,6 @@ $(document).ready(function() {
title: "Delay Slider",
content: "This slider sets the timing of the execution of each step"
},
{
onShow: viewHome,
smartPlacement: true,
element: "#output-select",
title: "Select Output Type",
content: "Change the output type here with the options (HEX - Base 8, DEC - Base 10, ASCII - Base 16) . This by default is set to HEX. ",
},
{
onShow: viewDatapath,
smartPlacement: true,
Expand Down
20 changes: 19 additions & 1 deletion src/templates/about.ejs
Expand Up @@ -8,11 +8,29 @@
<h2>About MARIE</h2>
<p>MARIE ('Machine Architecture that is Really Intuitive and Easy') is a machine architecture and assembly language from <a href="https://books.google.com.au/books/about/The_Essentials_of_Computer_Organization.html?id=3kQoAwAAQBAJ&redir_esc=y" target="_blank">The Essentials of Computer Organization and Architecture</a> (Linda Null, Julia Lobur). The publisher provides a set of <a href="http://computerscience.jbpub.com/ecoa/3e/simulators.aspx">simulators for the machine</a>, written in Java. However, since using simulators can be rather difficult, we have implemented a web-based version, so that students are able to access it readily and easily. Since beginning the project we have added many features such as importing and exporting of Marie Assembly Source files (*.mas) to provide compatibility with the existing simulators.</p>
<br>
<hr>
<h2>Terms of Use</h2>
By agreeing to the following terms and conditions, you understand that:
<ul>
<li> you are bound by the Higher Education Plagiarism Notice set here: <a href="https://github.com/MARIE-js/MARIE.js/wiki#plagiarism-notice-for-higher-education-students" target="_blank">https://github.com/MARIE-js/MARIE.js/wiki#plagiarism-notice-for-higher-education-students</a></li>
<li>all source code is bound by the MIT license, as specified in the README.md file: <a href="https://github.com/MARIE-js/MARIE.js#license" target="_blank">https://github.com/MARIE-js/MARIE.js#license</a></li>
<li>the Terms of Use may change in the future</li>
</ul>
<hr>
<h2>About MARIE.js</h2>
<p>MARIE.js is an implementation of a simulator for a 'Machine Architecture that is Really Intuitive and Easy' in JavaScript.</p>
<p>It is currently developed by <a href="https://github.com/cyderize">Jason Nguyen</a>, <a href="https://github.com/jos0003">Saurabh Joshi</a> and <a href="https://github.com/lorderikir">Eric Jiang</a>.</p>

<p>Some example/demostration code is writtern by <a href="https://github.com/RavenKelder">Felix Salim</a></p>
<hr>
<h2>License</h2>
<p>Copyright (c) 2016 Jason Nguyen, Saurabh Joshi, Eric Jiang</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>

<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>

<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>

<hr>
<p>
<em>This project is designed by students of:</em><br>
<a href="http://infotech.monash.edu.au/"><img src="./images/infotechlogo.gif" alt="Faculty of Information Technology, Monash"></a><br>
Expand Down
4 changes: 3 additions & 1 deletion src/templates/index.ejs
Expand Up @@ -5,10 +5,12 @@
<main>

<div class="container">
<div id="warn-missing-file" class="alert alert-warning">

<div id="warn-missing-file" class="alert alert-warning" hidden>
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> The file inputed was not found (Error 404).
</div>

<div id="flex">
<div id="program-container">
<span>Assembly code: <span id="saved-status"></span></span>
Expand Down

0 comments on commit afd9385

Please sign in to comment.