Difference between revisions of "CSC103 Basic Instructions"

From dftwiki3
Jump to: navigation, search
(Basic Instructions for the Pocessor Simulator)
(Basic Instructions for the Pocessor)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Basic Instructions for the Pocessor [http://maven.smith.edu/~thiebaut/classes/103/applets.htm Simulator]=
+
=Annotated Simulator=
 +
[[Image:CSC103_Annotated_Simulator.png]]
 +
 
 +
=Basic Instructions for the Pocessor=
  
 
Note "-C" means ''Constant''
 
Note "-C" means ''Constant''
  
<code><pre>
+
ADD&nbsp;&nbsp;&nbsp;Add&nbsp;to&nbsp;Acc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ADD-C&nbsp;&nbsp;&nbsp;Add&nbsp;C&nbsp;to&nbsp;Acc
ADD   Add to Acc           ADD-C   Add C to Acc
+
SUB&nbsp;&nbsp;&nbsp;Sub&nbsp;from&nbsp;Acc&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SUB-C&nbsp;&nbsp;&nbsp;Sub&nbsp;C&nbsp;from&nbsp;Acc
SUB   Sub from Acc         SUB-C   Sub C from Acc
+
AND&nbsp;&nbsp;&nbsp;And&nbsp;with&nbsp;Acc&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND-C&nbsp;&nbsp;&nbsp;And&nbsp;C&nbsp;with&nbsp;Acc
AND   And with Acc         AND-C   And C with Acc
+
OR&nbsp;&nbsp;&nbsp;&nbsp;Or&nbsp;with&nbsp;Acc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OR-C&nbsp;&nbsp;&nbsp;&nbsp;Or&nbsp;&nbsp;C&nbsp;with&nbsp;Acc
OR   Or with Acc           OR-C   Or C with Acc
+
NOT&nbsp;&nbsp;&nbsp;invert&nbsp;Acc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOD-C&nbsp;&nbsp;&nbsp;Load&nbsp;C&nbsp;in Acc
NOT   invert Acc           LOD-C   Load C in Acc
+
SHL&nbsp;&nbsp;&nbsp;Shift&nbsp;left&nbsp;Acc&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ADD-I&nbsp;&nbsp;&nbsp;Add-indirect
SHL   Shift left Acc       ADD-I   Add-indirect
+
SHR&nbsp;&nbsp;&nbsp;Shift&nbsp;right&nbsp;Acc&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SUB-I&nbsp;&nbsp;&nbsp;Sub-indirect
SHR   Shift right Acc       SUB-I   Sub-indirect
+
INC&nbsp;&nbsp;&nbsp;Increment&nbsp;Acc&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND-I&nbsp;&nbsp;&nbsp;And-indirect
INC   Increment Acc         AND-I   And-indirect
+
DEC&nbsp;&nbsp;&nbsp;Decrement&nbsp;Acc&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OR-I&nbsp;&nbsp;&nbsp;&nbsp;Or-indirect
DEC   Decrement Acc         OR-I   Or-indirect
+
LOD&nbsp;&nbsp;&nbsp;Load&nbsp;Acc&nbsp;from&nbsp;mem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOD-I&nbsp;&nbsp;&nbsp;Load&nbsp;indirect
LOD   Load Acc from mem       LOD-I   Load indirect
+
HLT&nbsp;&nbsp;&nbsp;Stop!&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STO-I&nbsp;&nbsp;&nbsp;Store&nbsp;indirect
HLT   Stop!               STO-I   Store indirect
+
JMP&nbsp;&nbsp;&nbsp;Jmp&nbsp;to&nbsp;address&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JMP-I&nbsp;&nbsp;&nbsp;Jmp&nbsp;indirect
JMP   Jmp to address       JMP-I   Jmp indirect
+
JMZ&nbsp;&nbsp;&nbsp;Jmp&nbsp;if&nbsp;Acc=0&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JMZ-I&nbsp;&nbsp;&nbsp;Jmp&nbsp;zero&nbsp;indirect
JMZ   Jmp if Acc=0         JMZ-I   Jmp zero indirect
+
JMN&nbsp;&nbsp;&nbsp;Jmp&nbsp;if&nbsp;negative&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JMN-I&nbsp;&nbsp;&nbsp;Jmp&nbsp;negative&nbsp;indirect
JMN   Jmp if negative       JMN-I   Jmp negative indirect
+
JMF&nbsp;&nbsp;&nbsp;Jmp&nbsp;on&nbsp;flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JMF-I&nbsp;&nbsp;&nbsp;Jmp&nbsp;flag&nbsp;indirect
JMF   Jmp on flag             JMF-I   Jmp flag indirect
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Store&nbsp;Acc&nbsp;in&nbsp;mem
                                      STO   Store Acc in mem
 
 
 
</pre></code>
 
  
=Annotated Simulator=
+
<br />
[[Image:CSC103_Annotated_Simulator.png]]
+
[[Category:CSC103]]

Latest revision as of 06:48, 17 September 2013

Annotated Simulator

CSC103 Annotated Simulator.png

Basic Instructions for the Pocessor

Note "-C" means Constant

ADD   Add to Acc      	      ADD-C   Add C to Acc
SUB   Sub from Acc    	      SUB-C   Sub C from Acc
AND   And with Acc    	      AND-C   And C with Acc
OR    Or with Acc     	      OR-C    Or  C with Acc
NOT   invert Acc      	      LOD-C   Load C in	Acc
SHL   Shift left Acc  	      ADD-I   Add-indirect
SHR   Shift right Acc 	      SUB-I   Sub-indirect
INC   Increment Acc   	      AND-I   And-indirect
DEC   Decrement Acc   	      OR-I    Or-indirect
LOD   Load Acc from mem      LOD-I   Load indirect
HLT   Stop!   	      	       STO-I   Store indirect
JMP   Jmp to address  	      JMP-I   Jmp indirect
JMZ   Jmp if Acc=0    	      JMZ-I   Jmp zero indirect
JMN   Jmp if negative 	      JMN-I   Jmp negative indirect
JMF   Jmp on flag            JMF-I   Jmp flag indirect
                             STO     Store Acc in mem