Skip to content

Commit

Permalink
Merge pull request #141 from lorderikir/v0.8.0-release
Browse files Browse the repository at this point in the history
v0.8.0 release
  • Loading branch information
ericjiang97 committed Aug 19, 2016
2 parents 4d105a5 + 0584a0d commit 6ce482d
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
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) [![devDependency Status](https://david-dm.org/marie-js/MARIE.js/dev-status.svg)](https://david-dm.org/marie-js/MARIE.js#info=devDependencies) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com/) [![npm version](https://badge.fury.io/js/npm.svg)](https://badge.fury.io/js/npm)
==============
Current version: `0.7.18`
Current version: `0.8.0`

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MARIE.js",
"version": "0.7.18",
"version": "0.8.0",
"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
15 changes: 15 additions & 0 deletions src/code/addition.mas
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/ Addition Calculator
/ by the MARIE.js Team
/ Copyright (C) 2016. Licensed under the MIT License

Input
Store X
Input
Store Y

Add X
Output
Halt

X, DEC 0
Y, DEC 0
27 changes: 27 additions & 0 deletions src/code/multiply.mas
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/ Multiplication Calculator
/ by the MARIE.js Team
/ Copyright (C) 2016. Licensed under the MIT License

/ Prompt user to type in integers
INPUT
Store X
INPUT
Store Y

/ Loop for performing iterative addition
loop, Load num
Add X
Store num

Load Y
Subt one
Store Y

Skipcond 400 / have we completed the multiplication?
Jump loop / no; repeat loop
/ yes, so exit the loop

/ Output result to user then halt program
Load num
Output
Halt
27 changes: 27 additions & 0 deletions src/js/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ window.addEventListener("load", function() {
saveTimeout = null,
modifiedFile = false,
selectedMemoryCell = null,
queryString = window.location.search.substring(1), //returns first query string
symbolCells = null;

textArea.value = localStorage.getItem("marie-program") || "";
Expand Down Expand Up @@ -353,6 +354,7 @@ window.addEventListener("load", function() {
finishInputReplaceMemoryCell();
});


function populateWatchList(asm, sim) {
while (watchList.firstChild) {
watchList.removeChild(watchList.firstChild);
Expand Down Expand Up @@ -1263,6 +1265,31 @@ window.addEventListener("load", function() {
window.location.hash = "";
});

function readCode(){
var xhr = new XMLHttpRequest();

xhr.onreadystatechange = function() {
if(xhr.readyState === 4){
if(xhr.status == 200){
loadContents(xhr.responseText, xhr);
}
}
};
xhr.open('GET',fileAddress,true);
xhr.send();
}

function loadContents(responseText){
programCodeMirror.setValue(responseText);
}

if(queryString !== ""){
var fileAddress = "./code/"+queryString+".mas";
console.log("Loading from" + fileAddress);
programCodeMirror.setValue("");
readCode();
}

function handleDatapathUI() {
if(window.location.hash === "#datapath") {
if(!datapath.loaded) {
Expand Down

0 comments on commit 6ce482d

Please sign in to comment.