Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM Assembly Language Programming - 1 #227

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions SRIP/Codes/css/editor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@import url('http://getbootstrap.com/2.3.2/assets/css/bootstrap.css');

.container {
margin-top: 10px;
}

.nav-tabs > li {
position:relative;
}

.nav-tabs > li > a {
display:inline-block;
}

.nav-tabs > li > span {
display:none;
cursor:pointer;
position:absolute;
right: 6px;
top: 8px;
color: red;
}

.nav-tabs > li:hover > span {
display: inline-block;
}
35 changes: 35 additions & 0 deletions SRIP/Codes/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ARM Simulator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/editor.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<script>
$(function(){
$("#includedNav").load("nav.html");
});
</script>
<script>
$(function(){
$("#includedFooter").load("footer.html");
});
</script>
</head>
<body>
<div id="includedNav"></div>
<div class="">
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#">Editor</a></li>
<li><a href="execute.html">Execute</a></li>
<li><a href="sample_codes.html">Sample Codes</a></li>
<li><a href="help.html">Help</a></li>
</ul>
</div>

</body>
<script type="text/javascript" src="js/editor.js"></script>
</html>
16 changes: 16 additions & 0 deletions SRIP/Codes/editor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ul class="nav nav-tabs">
<li class="active"><a href="#contact_01" data-toggle="tab">arm1</a><span>x</span></li>
<li><a href="#" class="add-contact" data-toggle="tab">+ Add Tab</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="contact_01">
<form action="/action_page.php">
<textarea name="comments" id="comments" style="width:92%;padding:2%;height:400px; border:10px double yellowgreen;"></textarea>
<br>
</form>
</div>
<div class="tab-pane" id="contact_02">Contact Form: Molly Lewis</div>
</div>
<div class="tab-pane" id="contact"></div>

<script type="text/javascript" src="js/editor.js"></script>
Empty file added SRIP/Codes/execute.html
Empty file.
9 changes: 9 additions & 0 deletions SRIP/Codes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

<footer>
<div class="container">
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#">Run Input/Output</a></li>
<li><a href="#">Simulator Messages</a></li>
</ul>
</div>
</footer>
100 changes: 100 additions & 0 deletions SRIP/Codes/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<div>
<b>
User's Guide
</b>
<p>
<b>
1.Introduction
</b>
<p>
This simulator is designed to run assembly codes, programed in Arm assmebly language.
</p>
<b>
2. Layout
</b>
<p>
At the top of the simulator there is a <b>MenuBar</b>. The Menubar provides following functionalities ..
<ul>
<li>File</li>
<ul>
<li>
Options for writing a new code; opening a file; closing or saving the current code etc
</li>
<li>
Exiting the Simulator
</li>
</ul>
<li>Edit</li>
<ul>
<li>
Editor options like undo, redo, select all etc.
</li>
</ul>
<li>Run</li>
<ul>
<li>
Assemble the code
</li>
<li>
Run the whole program
</li>
<li>
Run the current instruction of the program
</li>
</ul>
</ul>
The main panel consistes of 4 tabs.
<ul>
<li>
<b>Editor</b>: Here the user will write their programs. The editor can have multiple tabs of code section. In each tab user can write their programs.
</li>
<li>
<b>Execute</b>: Assembling and running of the user code will be done here. It consists of various sections like the register table, text section, memory table etc.
</li>
<li>
<b>Sample Codes</b>: Various sample Arm Programs are provided here for the user help.
</li>
<li>
<b>Help</b>: User guide to understand the simulator.
</li>
</ul>
The bottom I/O panel is to generate the assembler messages. Assembly errors, runtime errors, input/output messages etc will be generated here.
</p>
<b>
3. Writing and Running a sample program
</b>
<p>
<ul>
<li>
To write a program, the first thing we have to do, is to open a new editor where we can write our program. To do that ..
<ol>
<li>
Click on the <b>File</b> button from the menu. A list will appear.
</li>
<li>
Click on the <b>New</b> button from the list. A new editor will appear in the editor tab. Here we will write our program.
</li>
</ol>
</li>
<li>
Next, we will write our code in the editor. We can either start from scratch and write the program or we can copy the sample code, present in the sample codes tab, and modify it to our needs.
</li>
<li>
After writing our program, we will assemble it. To do that ..
<ol>
<li>
Click on the <b>Run</b> buttion from the menu. A list will appear.
</li>
<li>
Click on the <b>Assemble</b> button from the list.
</li>
</ol>
This will assemble our arm program and the control will be transfered from the editor window to the execute window. If there are error(s) in our program, the subsequent messages will be displayed in the bottom I/O panel.
</li>
<li>
After the program has been successfuly assebled, we can run it. We can either choose to run the whole program in one shot, or we can run one instruction at a time. To do the, the execute panel has two buttons, <b>Run</b> and <b>Step</b>
</li>
</ul>
</p>
</p>
</div>
105 changes: 105 additions & 0 deletions SRIP/Codes/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ARM Simulator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/editor.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<script>
$(function(){
$("#includedNav").load("nav.html");
});
</script>
<script>
$(function(){
$("#includedFooter").load("footer.html");
});
</script>
<script>
$(function(){
$("#includedExecute").load("execute.html");
});
</script>
<script>
$(function(){
$("#includedCodes").load("sample_codes.html");
});
</script>
<script>
$(function(){
$("#includedEditor").load("editor.html");
});
</script>
<script>
$(function(){
$("#includedHelp").load("help.html");
});
</script>
</head>
<body>
<div id="includedNav"></div>
<!-- <div class="container">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#editor">Editor</a></li>
<li><a data-toggle="tab" href="#execute">Execute</a></li>
<li><a data-toggle="tab" href="#sample_codes">Sample Codes</a></li>
<li><a data-toggle="tab" href="#help">Help</a></li>
</ul>
</div>
<div class="tab-content">
<p><a href="execute.html">HTML Images</a> is a link to a page on this website.</p> -->
<!-- <div id="editor" class="tab-pane fade in active">
<ul class="nav nav-tabs">
<li class="active"><a href="#contact_01" data-toggle="tab">arm1</a><span>x</span></li>
<li><a href="#" class="add-contact" data-toggle="tab">+ Add Tab</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="contact_01">
<form action="/action_page.php">
<textarea name="textarea" rows="27" cols="10"></textarea>
<br>
</form>
</div>
<div class="tab-pane" id="contact_02">Contact Form: Molly Lewis</div>
</div> -->
<!-- <div class="tab-pane" id="contact"></div>
</div>
<div id="execute" class="tab-pane fade">
<div id="includedExecute"></div> -->
<!-- </div>
</div> -->
<div class="container">
<!-- <h2>Dynamic Tabs</h2> -->
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#editor">Editor</a></li>
<!-- <li><a data-toggle="tab" href="#execute">Execute</a></li> -->
<li><a data-toggle="tab" href="#sample_codes">Sample Codes</a></li>
<li><a data-toggle="tab" href="#help">Help</a></li>
</ul>

<div class="tab-content">
<div id="editor" class="tab-pane fade in active">
<div id="includedEditor"></div>
</div>
<div id="execute" class="tab-pane fade">
<div id="includedExecute"></div>
</div>
<div id="sample_codes" class="tab-pane fade">
<div id="includedCodes"></div>
</div>
<div id="help" class="tab-pane fade">
<div id="includedHelp"></div>
</div>
</div>
</div>

<div id="includedFooter"></div>
<div class = "container">
<button onclick="document.getElementById('textfield').value = ''">Clear</button>
<textarea name="textarea" id="textfield" rows="4" cols="10"></textarea>
</div>
</body>
</html>
17 changes: 17 additions & 0 deletions SRIP/Codes/js/editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$(".nav-tabs").on("click", "a", function(e){
e.preventDefault();
$(this).tab('show');
})
.on("click", "span", function () {
var anchor = $(this).siblings('a');
$(anchor.attr('href')).remove();
$(this).parent().remove();
$(".nav-tabs li").children('a').first().click();
});

$('.add-contact').click(function(e) {
e.preventDefault();
var id = $(".nav-tabs").children().length; //think about it ;)
$(this).closest('li').before('<li><a href="#contact">arm'+id+'</a><span>x</span></li>');
$('.tab-content').append('<div class="tab-pane" id="contact"><form action="/action_page.php"><textarea name="comments" id="comments" style="width:92%;padding:2%;height:400px; border:10px double yellowgreen;"></textarea><br></form></div>');
});
50 changes: 50 additions & 0 deletions SRIP/Codes/nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@


<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- <a class="navbar-brand" href="#">WebSiteName</a> -->
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">File</a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
<li><a href="#">Page 1-3</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Edit</a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
<li><a href="#">Page 1-3</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Run</a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
<li><a href="#">Page 1-3</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Help</a>
<ul class="dropdown-menu">
<li><a data-toggle="tab" href="#help">Help</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>

Loading