Add more jump instructions

This commit is contained in:
g1n 2021-10-15 13:23:42 +03:00
parent b4d0f5d108
commit 9044dfc6b6
2 changed files with 49 additions and 22 deletions

View File

@ -219,22 +219,22 @@
<div id="content"> <div id="content">
<h1 class="title">ocpu</h1> <h1 class="title">ocpu</h1>
<div id="outline-container-orgf884f54" class="outline-2"> <div id="outline-container-orgd1abad0" class="outline-2">
<h2 id="orgf884f54">GRU ocpu - yet another cpu design</h2> <h2 id="orgd1abad0">GRU ocpu - yet another cpu design</h2>
<div class="outline-text-2" id="text-orgf884f54"> <div class="outline-text-2" id="text-orgd1abad0">
</div> </div>
<div id="outline-container-orgc253b03" class="outline-3"> <div id="outline-container-org2633cef" class="outline-3">
<h3 id="orgc253b03">Features</h3> <h3 id="org2633cef">Features</h3>
<div class="outline-text-3" id="text-orgc253b03"> <div class="outline-text-3" id="text-org2633cef">
<ul class="org-ul"> <ul class="org-ul">
<li>little endian</li> <li>little endian</li>
<li>8-bit (maybe will be changed in future)</li> <li>8-bit (maybe will be changed in future)</li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-orgd42b4ad" class="outline-3"> <div id="outline-container-org6fd1008" class="outline-3">
<h3 id="orgd42b4ad">Registers</h3> <h3 id="org6fd1008">Registers</h3>
<div class="outline-text-3" id="text-orgd42b4ad"> <div class="outline-text-3" id="text-org6fd1008">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
@ -346,9 +346,9 @@
</div> </div>
</div> </div>
<div id="outline-container-org4e18f52" class="outline-3"> <div id="outline-container-org23162a0" class="outline-3">
<h3 id="org4e18f52">Instuctions</h3> <h3 id="org23162a0">Instuctions</h3>
<div class="outline-text-3" id="text-org4e18f52"> <div class="outline-text-3" id="text-org23162a0">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
@ -485,28 +485,28 @@
<tr> <tr>
<td class="org-left">CMP</td> <td class="org-left">CMP</td>
<td class="org-right">0x25</td> <td class="org-right">0x25</td>
<td class="org-left">&#xa0;</td> <td class="org-left">Compare</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td class="org-left">PUSH</td> <td class="org-left">PUSH</td>
<td class="org-right">0x30</td> <td class="org-right">0x30</td>
<td class="org-left">&#xa0;</td> <td class="org-left">Push to stack</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td class="org-left">POP</td> <td class="org-left">POP</td>
<td class="org-right">0x31</td> <td class="org-right">0x31</td>
<td class="org-left">&#xa0;</td> <td class="org-left">Pop to stack</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td class="org-left">JMP</td> <td class="org-left">JMP</td>
<td class="org-right">0x40</td> <td class="org-right">0x40</td>
<td class="org-left">&#xa0;</td> <td class="org-left">Jump</td>
</tr> </tr>
</tbody> </tbody>
<tbody> <tbody>
@ -546,8 +546,29 @@
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
<td class="org-left">JE</td>
<td class="org-right">0x46</td>
<td class="org-left">Jump if equal</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">JL</td>
<td class="org-right">0x47</td>
<td class="org-left">Jump if lower</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">JH</td>
<td class="org-right">0x48</td>
<td class="org-left">Jump if higher</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">RTS</td> <td class="org-left">RTS</td>
<td class="org-right">0x42</td> <td class="org-right">0x49</td>
<td class="org-left">Return from subroutine</td> <td class="org-left">Return from subroutine</td>
</tr> </tr>
</tbody> </tbody>

View File

@ -72,13 +72,13 @@
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| NAND | 0x24 | | | NAND | 0x24 | |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| CMP | 0x25 | | | CMP | 0x25 | Compare |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| PUSH | 0x30 | | | PUSH | 0x30 | Push to stack |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| POP | 0x31 | | | POP | 0x31 | Pop to stack |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| JMP | 0x40 | | | JMP | 0x40 | Jump |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| JSR | 0x41 | Jump to subroutine | | JSR | 0x41 | Jump to subroutine |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
@ -90,7 +90,13 @@
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| JNZ | 0x45 | Jump if non-zero | | JNZ | 0x45 | Jump if non-zero |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| RTS | 0x42 | Return from subroutine | | JE | 0x46 | Jump if equal |
|--------------+--------+-------------------------------------------|
| JL | 0x47 | Jump if lower |
|--------------+--------+-------------------------------------------|
| JH | 0x48 | Jump if higher |
|--------------+--------+-------------------------------------------|
| RTS | 0x49 | Return from subroutine |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|
| INB | 0x50 | Copies value from I/O port to destination | | INB | 0x50 | Copies value from I/O port to destination |
|--------------+--------+-------------------------------------------| |--------------+--------+-------------------------------------------|