Skip to content

Commit

Permalink
Add documentation on FSZ instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
TollyH committed Aug 1, 2023
1 parent e09ad9e commit 3345729
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 14 deletions.
Binary file modified Documentation/Language.docx
Binary file not shown.
32 changes: 25 additions & 7 deletions Documentation/Language.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ <h2 id="introduction">Introduction</h2>
architectures such as x86.</p>
<p>AssEmbly was designed and implemented in its entirety by <a
href="https://github.com/TollyH">Tolly Hill</a>.</p>
<p>Last revised: 2023-07-31</p>
<p>Last revised: 2023-08-01</p>
<h2 id="table-of-contents">Table of Contents</h2>
<ul>
<li><a href="#assembly-language-reference">AssEmbly Language
Expand Down Expand Up @@ -1784,12 +1784,14 @@ <h3 id="reading-and-writing">Reading and Writing</h3>
JZO :READ ; If it isn&#39;t set (i.e. it is equal to 0), jump back to READ</code></pre>
<h3 id="other-operations">Other Operations</h3>
<p>As well as reading and writing, there are also instructions for
checking whether a file exists (<code>FEX</code>), and deleting a file
(<code>DFL</code>). They both take a path in the same way
<code>OFL</code> does, <code>DFL</code> having no effect other than
deleting the file, and <code>FEX</code> first taking a register operand
to store <code>1</code> in if the file exists, <code>0</code> if
not.</p>
checking whether a file exists (<code>FEX</code>), getting the size of a
file (<code>FSZ</code>), and deleting a file (<code>DFL</code>). They
all take a path in the same way <code>OFL</code> does. <code>DFL</code>
has no effect other than deleting the file. <code>FEX</code> and
<code>FSZ</code> first take a register operand to store their result in,
then the path to the file as the second operand. <code>FEX</code> stores
<code>1</code> in the register if the file exists, <code>0</code> if
not. <code>FSZ</code> stores the total size of the file in bytes.</p>
<h2 id="the-stack">The Stack</h2>
<p>The stack is a section of memory most often used in conjunction with
subroutines, explained in the subsequent section. It starts at the very
Expand Down Expand Up @@ -3380,6 +3382,22 @@ <h2 id="full-instruction-reference">Full Instruction Reference</h2>
<td><code>0xE6</code></td>
</tr>
<tr class="odd">
<td><code>FSZ</code></td>
<td>Get File Size</td>
<td>Register, Address</td>
<td>In a register, store the byte size of the file at the path specified
in memory starting at an address in a label</td>
<td><code>0xE7</code></td>
</tr>
<tr class="even">
<td><code>FSZ</code></td>
<td>Get File Size</td>
<td>Register, Pointer</td>
<td>In a register, store the byte size of the file at the path specified
in memory starting at an address in a register</td>
<td><code>0xE8</code></td>
</tr>
<tr class="odd">
<td><strong>Reading</strong></td>
<td></td>
<td></td>
Expand Down
6 changes: 4 additions & 2 deletions Documentation/Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AssEmbly is a mock processor architecture and assembly language written in C# an

AssEmbly was designed and implemented in its entirety by [Tolly Hill](https://github.com/TollyH).

Last revised: 2023-07-31
Last revised: 2023-08-01

## Table of Contents

Expand Down Expand Up @@ -1428,7 +1428,7 @@ JZO :READ ; If it isn't set (i.e. it is equal to 0), jump back to READ

### Other Operations

As well as reading and writing, there are also instructions for checking whether a file exists (`FEX`), and deleting a file (`DFL`). They both take a path in the same way `OFL` does, `DFL` having no effect other than deleting the file, and `FEX` first taking a register operand to store `1` in if the file exists, `0` if not.
As well as reading and writing, there are also instructions for checking whether a file exists (`FEX`), getting the size of a file (`FSZ`), and deleting a file (`DFL`). They all take a path in the same way `OFL` does. `DFL` has no effect other than deleting the file. `FEX` and `FSZ` first take a register operand to store their result in, then the path to the file as the second operand. `FEX` stores `1` in the register if the file exists, `0` if not. `FSZ` stores the total size of the file in bytes.

## The Stack

Expand Down Expand Up @@ -1786,6 +1786,8 @@ RET rfp
| `DFL` | Delete File | Pointer | Delete the file at the path specified by a `0x00` terminated string in memory starting at an address in a register | `0xE4` |
| `FEX` | File Exists | Register, Address | Store `1` in a register if the filepath specified in memory starting at an address in a label exists, else `0` | `0xE5` |
| `FEX` | File Exists | Register, Pointer | Store `1` in a register if the filepath specified in memory starting at an address in a register exists, else `0` | `0xE6` |
| `FSZ` | Get File Size | Register, Address | In a register, store the byte size of the file at the path specified in memory starting at an address in a label | `0xE7` |
| `FSZ` | Get File Size | Register, Pointer | In a register, store the byte size of the file at the path specified in memory starting at an address in a register | `0xE8` |
| **Reading** |||||
| `RCC` | Read Character from Console | Register | Read a character from the console as a byte, storing it in a register | `0xF0` |
| `RFC` | Read Character from File | Register | Read the next character from the currently open file as a byte, storing it in a register | `0xF1` |
Expand Down
22 changes: 17 additions & 5 deletions Documentation/Language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ such as x86.

AssEmbly was designed and implemented in its entirety by Tolly Hill.

Last revised: 2023-07-31
Last revised: 2023-08-01

Table of Contents

Expand Down Expand Up @@ -1710,10 +1710,12 @@ from the bit testing section:
Other Operations

As well as reading and writing, there are also instructions for checking
whether a file exists (FEX), and deleting a file (DFL). They both take a
path in the same way OFL does, DFL having no effect other than deleting
the file, and FEX first taking a register operand to store 1 in if the
file exists, 0 if not.
whether a file exists (FEX), getting the size of a file (FSZ), and
deleting a file (DFL). They all take a path in the same way OFL does.
DFL has no effect other than deleting the file. FEX and FSZ first take a
register operand to store their result in, then the path to the file as
the second operand. FEX stores 1 in the register if the file exists, 0
if not. FSZ stores the total size of the file in bytes.

The Stack

Expand Down Expand Up @@ -2584,6 +2586,16 @@ Full Instruction Reference
Pointer specified in memory starting at an
address in a register exists, else 0

FSZ Get File Size Register, In a register, store the byte size of 0xE7
Address the file at the path specified in
memory starting at an address in a
label

FSZ Get File Size Register, In a register, store the byte size of 0xE8
Pointer the file at the path specified in
memory starting at an address in a
register

Reading

RCC Read Character Register Read a character from the console as 0xF0
Expand Down

0 comments on commit 3345729

Please sign in to comment.