Difference between revisions of "Simple Computer Simulator Instruction-Set"
(→Instructions Using a Single Constant) |
(→Memory Instructions) |
||
Line 72: | Line 72: | ||
|} | |} | ||
<br /> | <br /> | ||
− | ==Memory Instructions== | + | ==Number-in-Memory Instructions== |
<br /> | <br /> | ||
+ | {| class="wikitable" width="100%" | ||
+ | ! width="20%" | Instruction | ||
+ | ! width="15%" |Code<br />(decimal) | ||
+ | ! width="15%" |Code<br />( binary) | ||
+ | ! width="50%" |Description | ||
+ | |- | ||
+ | | | ||
+ | ADDm | ||
+ | | | ||
+ | 26 | ||
+ | | | ||
+ | 00011010 | ||
+ | | | ||
+ | * | ||
+ | |- | ||
+ | | | ||
+ | COMPm | ||
+ | | | ||
+ | 86 | ||
+ | | | ||
+ | 01010110 | ||
+ | | | ||
+ | * | ||
+ | |- | ||
+ | | | ||
+ | DIVm | ||
+ | | | ||
+ | 46 | ||
+ | | | ||
+ | 00101110 | ||
+ | | | ||
+ | * | ||
+ | |- | ||
+ | | | ||
+ | LOADm | ||
+ | | | ||
+ | 6 | ||
+ | | | ||
+ | 00000110 | ||
+ | | | ||
+ | * | ||
+ | |- | ||
+ | | | ||
+ | MULm | ||
+ | | | ||
+ | 42 | ||
+ | | | ||
+ | 00101010 | ||
+ | | | ||
+ | * | ||
+ | |- | ||
+ | | | ||
+ | STOREm | ||
+ | | | ||
+ | 18 | ||
+ | | | ||
+ | 00010010 | ||
+ | | | ||
+ | * | ||
+ | |- | ||
+ | | | ||
+ | SUBm | ||
+ | | | ||
+ | 34 | ||
+ | | | ||
+ | 00100010 | ||
+ | | | ||
+ | * | ||
+ | |} | ||
+ | <!-- =============================================================== --> | ||
+ | |||
+ | <br /> | ||
+ | ==Number-with-Address-in-Index Instructions== | ||
+ | <br /> | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
! width="20%" | Instruction | ! width="20%" | Instruction | ||
Line 107: | Line 181: | ||
| | | | ||
* | * | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| | | | ||
Line 153: | Line 219: | ||
| | | | ||
* | * | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| | | | ||
Line 172: | Line 230: | ||
* | * | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| | | | ||
Line 254: | Line 304: | ||
| | | | ||
* | * | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| | | | ||
Line 273: | Line 315: | ||
* | * | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| | | | ||
Line 318: | Line 352: | ||
| | | | ||
* | * | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| | | | ||
Line 364: | Line 390: | ||
| | | | ||
* | * | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| | | |
Revision as of 14:26, 27 August 2014
--D. Thiebaut (talk) 16:57, 26 August 2014 (EDT)
Instructions Using a Single Constant
These instructions operate with a single number (we refer to them as constants) that is either loaded into, added, or subtracted from the accumulator register.
Instruction | Code (decimal) |
Code ( binary) |
Description |
---|---|---|---|
ADD number |
24 |
00011000 |
|
COMP number |
84 |
01010100 |
|
DIV number |
44 |
00101100 |
|
LOAD number |
4 |
00000100 |
|
MUL number |
40 |
00101000 |
|
SUB number |
32 |
00100000 |
|
Number-in-Memory Instructions
Instruction | Code (decimal) |
Code ( binary) |
Description |
---|---|---|---|
ADDm |
26 |
00011010 |
|
COMPm |
86 |
01010110 |
|
DIVm |
46 |
00101110 |
|
LOADm |
6 |
00000110 |
|
MULm |
42 |
00101010 |
|
STOREm |
18 |
00010010 |
|
SUBm |
34 |
00100010 |
|
Number-with-Address-in-Index Instructions
Instruction | Code (decimal) |
Code ( binary) |
Description |
---|---|---|---|
ADDX |
28 |
00011100 |
|
ADDXm |
30 |
00011110 |
|
ADDXx |
29 |
00011101 |
|
ADDx |
25 |
00011001 |
|
COMPX |
92 |
01011100 |
|
COMPXm |
94 |
01011110 |
|
COMPXx |
93 |
01011101 |
|
COMPx |
85 |
01010101 |
|
DIVx |
45 |
00101101 |
|
HALT |
127 |
01111111 |
|
JEQ |
68 |
01000100 |
|
JLT |
72 |
01001000 |
|
JUMP |
64 |
01000000 |
|
LOADX |
8 |
00001000 |
|
LOADXm |
10 |
00001010 |
|
LOADXx |
9 |
00001001 |
|
LOADx |
5 |
00000101 |
|
MULx |
41 |
00101001 |
|
NOP |
0 |
00000000 |
|
STOREXm |
22 |
00010110 |
|
STOREXx |
21 |
00010101 |
|
STOREx |
17 |
00010001 |
|
SUBX |
36 |
00100100 |
|
SUBXm |
38 |
00100110 |
|
SUBXx |
37 |
00100101 |
|
SUBx |
33 |
00100001 |
|
TAX |
79 |
01001111 |
|
TXA |
83 |
01010011 |
|