Add SEC and CLC - carry flag manipulation commands

This commit is contained in:
g1n 2022-04-19 17:27:01 +03:00
parent 9745520829
commit 9f2d1fd76c
Signed by: g1n
GPG Key ID: 8D352193D65D4E2C
2 changed files with 50 additions and 54 deletions

View File

@ -6,9 +6,9 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ocpu</title>
<meta name="generator" content="Org mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
<meta name="generator" content="Org Mode" />
<style>
#content { max-width: 60em; margin: auto; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
@ -29,8 +29,9 @@
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
border: 1px solid #e6e6e6;
border-radius: 3px;
background-color: #f2f2f2;
padding: 8pt;
font-family: monospace;
overflow: auto;
@ -39,21 +40,21 @@
pre.src {
position: relative;
overflow: auto;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
top: -8px;
right: 12px;
padding: 3px;
border: 1px solid black;
color: #555;
background-color: #f2f2f299;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-authinfo::before { content: 'Authinfo'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
@ -189,52 +190,29 @@
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript">
// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.add("code-highlighted");
target.classList.add("code-highlighted");
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.remove("code-highlighted");
target.classList.remove("code-highlighted");
}
}
/*]]>*///-->
// @license-end
</script>
</head>
<body>
<div id="content">
<div id="content" class="content">
<h1 class="title">ocpu</h1>
<div id="outline-container-orgd013fa7" class="outline-2">
<h2 id="orgd013fa7">GRU ocpu - yet another cpu design</h2>
<div class="outline-text-2" id="text-orgd013fa7">
<div id="outline-container-orgdbf2aac" class="outline-2">
<h2 id="orgdbf2aac">GRU ocpu - yet another cpu design</h2>
<div class="outline-text-2" id="text-orgdbf2aac">
</div>
<div id="outline-container-org0a18dbd" class="outline-3">
<h3 id="org0a18dbd">Features</h3>
<div class="outline-text-3" id="text-org0a18dbd">
<div id="outline-container-org2f38bc6" class="outline-3">
<h3 id="org2f38bc6">Features</h3>
<div class="outline-text-3" id="text-org2f38bc6">
<ul class="org-ul">
<li>little endian</li>
<li>16-bit</li>
</ul>
</div>
</div>
<div id="outline-container-org279fda0" class="outline-3">
<h3 id="org279fda0">Registers</h3>
<div class="outline-text-3" id="text-org279fda0">
<div id="outline-container-org4e7f827" class="outline-3">
<h3 id="org4e7f827">Registers</h3>
<div class="outline-text-3" id="text-org4e7f827">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
@ -388,7 +366,7 @@
<tbody>
<tr>
<td class="org-left">SP</td>
<td class="org-left">Poiner</td>
<td class="org-left">Pointer</td>
<td class="org-left">Stack Pointer, 16-bit</td>
</tr>
</tbody>
@ -430,9 +408,9 @@
</div>
</div>
<div id="outline-container-org740a818" class="outline-3">
<h3 id="org740a818">Instuctions</h3>
<div class="outline-text-3" id="text-org740a818">
<div id="outline-container-org2ba6ef9" class="outline-3">
<h3 id="org2ba6ef9">Instuctions</h3>
<div class="outline-text-3" id="text-org2ba6ef9">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
@ -725,6 +703,20 @@
<td class="org-left">No operation</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">SEC</td>
<td class="org-right">0x61</td>
<td class="org-left">Set carry flag</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">CLC</td>
<td class="org-right">0x62</td>
<td class="org-left">Clear carry flag</td>
</tr>
</tbody>
</table>
@ -752,6 +744,10 @@
0x5* - Ports Operations
</p>
<p>
0x6* - Flags Operations
</p>
<p>
0x90 - NOP
</p>
@ -769,10 +765,6 @@ TODO: add HLT
TODO: add instructions for memory use
</p>
<p>
TODO: add instructions for setting flags
</p>
<p>
TODO: add more description
</p>

View File

@ -50,7 +50,7 @@
|----------+----------+-------------------------|
| PC | Pointer | Program Counter, 16-bit |
|----------+----------+-------------------------|
| SP | Poiner | Stack Pointer, 16-bit |
| SP | Pointer | Stack Pointer, 16-bit |
|----------+----------+-------------------------|
| ZF | Flag | Zero Flag |
|----------+----------+-------------------------|
@ -135,6 +135,10 @@
| OUTB imm16 | 0x51 | Copies value from operand to I/O port |
|-----------------------+--------+-------------------------------------------|
| NOP | 0x90 | No operation |
|-----------------------+--------+-------------------------------------------|
| SEC | 0x61 | Set carry flag |
|-----------------------+--------+-------------------------------------------|
| CLC | 0x62 | Clear carry flag |
0x0* - MOV instructions (maybe it will for LDA or something)
@ -149,6 +153,8 @@
0x5* - Ports Operations
0x6* - Flags Operations
0x90 - NOP
@ -158,7 +164,5 @@ TODO: add HLT
TODO: add instructions for memory use
TODO: add instructions for setting flags
TODO: add more description