-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.html
More file actions
277 lines (229 loc) · 12.3 KB
/
setup.html
File metadata and controls
277 lines (229 loc) · 12.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" type="image/png" href="img/nasm-logo.png">
<title>NASM Tutorial</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<!-- Navigation bar -->
<header class="navbar bg-primary navbar-dark fixed-top">
<div class="toggler-div">
<button type="button" id="sidebarCollapse" class="navbar-toggler" data-toggle="collapse"
data-target="#sidebar" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation">
<div id="nav-icon">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</button>
</div>
<div class="logo">
<a href="index.html">
<img src="img/nasm-logo.png">
</a>
<span class="logo-h2">Netwide Assembler Tutorial</span>
</div>
</header>
<!-- Navigation bar ends -->
<!-- Sidebar -->
<div class="wrapper">
<nav id="sidebar" class="collapse navbar-collpase">
<div class="sidebar-header">
<img src="img/MNIT-logo.png" alt="MENU">
</div>
<ul class="list-unstyled components">
<li>
<a href="index.html">Introduction</a>
</li>
<li class="active">
<a href="#">Setup</a>
</li>
<li>
<a href="#" data-toggle="collapse" aria-expanded="false" data-target="#basics"
class="dropdown-toggle">Basics</a>
<ul class="collapse list-unstyled" id="basics">
<li>
<a href="basic/assembly.html">Assembly Language</a>
</li>
<li>
<a href="basic/register.html">Registers</a>
</li>
<li>
<a href="basic/syntax.html">Basic Syntax</a>
</li>
</ul>
</li>
<li>
<a href="#" data-toggle="collapse" aria-expanded="false" data-target="#examples"
class="dropdown-toggle">Examples</a>
<ul class="collapse list-unstyled" id="examples">
<li>
<a href="example/hello.html">Hello World</a>
</li>
<li>
<a href="example/read_write.html">Input and Output</a>
</li>
<li>
<a href="example/operations.html">Arithematic Operations</a>
</li>
<li>
<a href="example/jump.html">Jump Statement</a>
</li>
<li>
<a href="example/factorial.html">Factorial</a>
</li>
<li>
<a href="example/file.html">File Handling</a>
</li>
</ul>
</li>
</ul>
<div class="sidebar-footer container">
<a href="mailto:2018ucp1154@mnit.ac.in" target="_blank" class="btn-social btn-google-plus"><i
class="fa fa-google-plus"></i></a>
<a href="https://github.com/AKASHCS50/NASM-Tutorial" target="_blank" class="btn-social btn-github"><i
class="fa fa-github-alt"></i></a>
<a href="https://www.linkedin.com/in/akash-sharma-1a5433178/" target="_blank"
class="btn-social btn-linkedin"><i class="fa fa-linkedin"></i></a>
</div>
</nav>
<!-- Sidebar ends -->
<!-- Content part -->
<main>
<div class="container content">
<div class="content-div">
<strong>Assembly language</strong> interacts directly with machine, hence the NASM assembler
software changes with the bit configuration of
Linux machine.
<br />
In this tutorial we will be focussing on <strong>32-bit Intel IA-32</strong> architecture.
</div>
<div class="content-div">
<h4>Checking if NASM already exists on your system-</h4>
Type the following code in terminal
<div class="code-block">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-home-tab" data-toggle="pill" href="#pills-21"
role="tab" aria-controls="pills-21" aria-selected="true">Terminal</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#pills-22"
role="tab" aria-controls="pills-22" aria-selected="false">Result</a>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-21" role="tabpanel"
aria-labelledby="pills-21">
<pre><code>
<span><span class="start">>></span> whereis nasm</span>
</code></pre>
</div>
<div class="tab-pane fade" id="pills-22" role="tabpanel"
aria-labelledby="pills-22">
<pre><code>
<span><span class="start">>></span> .nasm: /usr/bin/nasm /usr/share/man/man1/nasm.1.gz<span>
</code></pre>
</div>
</div>
</div>
If the output shows - <span class="start"><code><strong><i> nasm: /usr/bin/nasm
</i></strong></code></span> then you are good to go. 👍
<br /><br />
Else if you see the following output - <span class="start"><code><strong><i> nasm:
</strong></i></code></span> then you need to follow the below steps to setup NASM.
</div>
<div class="content-div">
<h4>Steps to setup NASM environment -</h4>
<ul>
<li>Open the official NASM website <a href="https://www.nasm.us/">https://www.nasm.us/</a> </li>
<li>Click on <strong class="start">STABLE</strong> latest released version</li>
<li>Download the Linux source archive <span class="start">nasm-X.XX.tar.gz</span>, where X.XX is
the NASM version number in the archive.</li>
<li>Unzip the downloaded <span class="start">tar.gz</span> file at suitable location and open
terminal in the newly created NASM folder</li>
<li>Type the following command in termianal
<span class="start"> >></span><span class="start"><code><strong><i> ./configure
</i></strong></code></span></li>
This shell script will find the best C compiler to use and set up Makefiles accordingly.
<li>Type<span class="start"> >></span><span class="start"><code><strong><i> make
</i></strong></code></span> to build the nasm and ndisasm binaries.</li>
<li>Type<span class="start"> >></span><span class="start"><code><strong><i> make
install </i></strong></code></span> to install nasm and ndisasm in
/usr/local/bin and to install the man pages.</li>
</ul>
</div>
<div class="content-div">
You can also use following terminal command to install NASM -<br/>
<div class="code-block">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-home-tab" data-toggle="pill" href="#pills-23"
role="tab" aria-controls="pills-23" aria-selected="true">Terminal</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#pills-24"
role="tab" aria-controls="pills-24" aria-selected="false">Result</a>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-23" role="tabpanel"
aria-labelledby="23">
<pre><code>
<p><span class="start">>></span> sudo apt-get install nasm </p>
<p><span class="start">>></span> sudo apt-get update </p>
<p><span class="start">>></span> whereis nasm </p>
</code></pre>
</div>
<div class="tab-pane fade" id="pills-24" role="tabpanel"
aria-labelledby="pills-24">
<pre><code>
<p><span class="start">>></span> Reading package lists... Done</p>
<p> . </p>
<p> . </p>
<p> . </p>
<p>Setting up nasm </p>
<p><span class="start">>></span> 0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.</span></p>
<p><span class="start">>></span> nasm: /usr/bin/nasm /usr/share/man/man1/nasm.1.gz</span></p>
</code></pre>
</div>
</div>
</div>
</div>
<div class="content-div">
Now you are all set to <a href="basic/assembly.html">start learning</a> basics of NASM.
</div>
</div>
</main>
</div>
<!-- Content Part ends -->
<!-- Footer -->
<footer id="sticky-footer" class="py-4 bg-dark text-white-50">
<div class="container text-center footer-div">
Developed by <strong>Akash Sharma, 2018UCP1154</strong> as a part of <strong>System Programmming Tutorial
</strong>.
</div>
</footer>
<!-- Footer ends -->
<!-- Javascript -->
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="JS/main.js"></script>
<!-- Javascript Ends -->
</body>
</html>