Difference between revisions of "CSC103 2011 Assembly Language Examples"

From dftwiki3
Jump to: navigation, search
(Program 2)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
--[[User:Thiebaut|D. Thiebaut]] 11:37, 15 February 2011 (EST)
 
--[[User:Thiebaut|D. Thiebaut]] 11:37, 15 February 2011 (EST)
 
----
 
----
 
+
<onlydft>
 
=Program 1=
 
=Program 1=
  
Line 69: Line 69:
 
sum: data
 
sum: data
 
</pre></code>
 
</pre></code>
 +
 +
=Program 4=
 +
* Add all the numbers between 1 and 10 in a loop
 +
<code><pre>
 +
start: lod count
 +
add sum
 +
sto sum
 +
lod count
 +
sub-c 1
 +
sto count
 +
jmz done
 +
jmp start
 +
done: hlt
 +
 +
 +
@14
 +
count: 10
 +
sum: data
 +
</pre></code>
 +
</onlydft>
 
<br />
 
<br />
 
<br />
 
<br />

Latest revision as of 12:19, 15 February 2011

--D. Thiebaut 11:37, 15 February 2011 (EST)



...