Skip to content

Commit

Permalink
Add sections for calls, memory areas, and update includes
Browse files Browse the repository at this point in the history
Co-Authored-By: RoccoLox Programs <roccoloxprograms2018@gmail.com>
  • Loading branch information
TIny-Hacker and RoccoLoxPrograms committed Mar 11, 2024
1 parent b00636c commit 26ae0af
Show file tree
Hide file tree
Showing 49 changed files with 3,349 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
public/
testing/
32 changes: 32 additions & 0 deletions archetypes/calls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: System call name
geekdocHidden: true
params:
address: System call address
category: System call category
name: System call name
---

Overview of what the system call does / is used for

### Address: $000000

### Inputs:
* Input 1: Description
* Input 2: Description...

### Outputs:
* Output 1: Description
* Output 2: Description...

### Destroys:
* Destroy 1
* Destroy 2...

### Examples: <!-- If applicable -->
Description of example:

```asm
; example code goes here
; since it's an example, be sure to comment thoroughly
```
13 changes: 13 additions & 0 deletions archetypes/memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Memory area name
geekdocHidden: true
params:
address: Memory address
name: Memory area name
---

Overview of what the memory area does / is used for

### Address: $000000

### Size: Size of the area in bytes
Binary file modified assets/include.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ baseURL = 'https://ezce.github.io/ez80-docs/'
languageCode = 'en-us'
title = 'eZ80 docs'
theme = "hugo-geekdoc"
ignorefiles = [ "content/instructions/readme.md" ]
ignorefiles = [ "content/instructions/readme.md", "content/syscalls/readme.md", "content/memory/readme.md" ]

pluralizeListTitles = false

Expand Down
2 changes: 0 additions & 2 deletions content/basics/your-first-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ One of the most important things when making a project is sticking to a consiste
```Plain
project // The main folder for your project
├── include // A folder containing the include files
│ ├── commands.alm
│ ├── ez80.alm
│ ├── ez80.inc
│ ├── ti84pceg.inc
│ ├── tiformat.inc
Expand Down
20 changes: 10 additions & 10 deletions content/instructions/processor-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Sets the interrupt mode to either 0, 1, or 2. The different modes are described
| Mode | Behavior |
|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0 | The interrupting device inserts an instruction on the data bus during an interrupt acknowledge cycle. |
| 1 | The CPU responds to an interrupt by executing a restart to location 0x000038. |
| 1 | The CPU responds to an interrupt by executing a restart to location $000038. |
| 2 | The interrupting device places the low-order address of the interrupt vector on the data bus during an interrupt acknowledge cycle. The `i` register provides the high-order byte of the interrupt vector table address. The 16-bit value formed is the starting address of the interrupt service routine. |
* Opcode: `11101101` `010` `mode` `110`
| Mode | Bit Field |
Expand Down Expand Up @@ -313,21 +313,21 @@ Used at the end of a nonmaskable interrupt service routine to return to the poin
## RST

{{< expand "rst imm8" "..." >}}
This instruction functions similar to the [`call`](#call) instruction. However `imm8` is limited to 8 specific values: 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, and 0x38. The address of the instruction following the current `rst` instruction is pushed to the stack, and then `pc` is loaded with `imm8`.
This instruction functions similar to the [`call`](#call) instruction. However `imm8` is limited to 8 specific values: $00, $08, $10, $18, $20, $28, $30, and $38. The address of the instruction following the current `rst` instruction is pushed to the stack, and then `pc` is loaded with `imm8`.
{{< hint type=warning >}}
Using this instruction on the CE will most likely cause a crash to occur, regardless of the restart address.
{{< /hint >}}
* Opcode: `11` `imm8` `111`
| Restart Address | Bit Field |
|-----------------|-----------|
| 0x00 | 000 |
| 0x08 | 001 |
| 0x10 | 010 |
| 0x18 | 011 |
| 0x20 | 100 |
| 0x28 | 101 |
| 0x30 | 110 |
| 0x38 | 111 |
| $00 | 000 |
| $08 | 001 |
| $10 | 010 |
| $18 | 011 |
| $20 | 100 |
| $28 | 101 |
| $30 | 110 |
| $38 | 111 |
* Bytes: 1
* Flags:
* None
Expand Down
4 changes: 4 additions & 0 deletions content/memory/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Memory Areas
weight: -20
---
5 changes: 5 additions & 0 deletions content/memory/all/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: All
geekdocHidden: true
weight: -20
---
76 changes: 76 additions & 0 deletions content/memory/all/errNo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: errNo
geekdocHidden: true
params:
address: $D008DF
name: errNo
---

Holds an error code for certain system error routines. These are taken from **ti84pceg.inc**, and you should note that some allow "Goto" by default while others do not. However, this behavior can be changed by modifying bit 7. To allow the "Goto" option for a system error, bit 7 of the error code should be set, and to prevent it, bit 7 should be reset.

{{< expand "Error Codes" "..." >}}
| Error | Default Code (Hex) |
|-------------------|--------------------|
| E_Mask (No error) | $7F |
| E_Overflow | $81 |
| E_DivBy0 | $82 |
| E_SingularMat | $83 |
| E_Domain | $84 |
| E_Increment | $85 |
| E_Break | $86 |
| E_NonReal | $87 |
| E_Syntax | $88 |
| E_DataType | $89 |
| E_Argument | $8A |
| E_DimMismatch | $8B |
| E_Dimension | $8C |
| E_Undefined | $8D |
| E_Memory | $8E |
| E_Invalid | $8F |
| E_IllegalNest | $90 |
| E_Bound | $91 |
| E_GraphRange | $92 |
| E_Zoom | $93 |
| E_Label | $14 |
| E_Stat | $15 |
| E_Solver | $96 |
| E_Singularity | $97 |
| E_SignChange | $98 |
| E_Iterations | $99 |
| E_BadGuess | $9A |
| E_StatPlo | $1B |
| E_TolTooSmall | $9C |
| E_Reserved | $9D |
| E_Mode | $9E |
| E_LnkErr | $9F |
| E_LnkMemErr | $A0 |
| E_LnkTransErr | $A1 |
| E_LnkDupErr | $A2 |
| E_LnkMemFull | $A3 |
| E_Unknown | $A4 |
| E_Scale | $A5 |
| E_IdNotFound | $26 |
| E_NoMode | $A7 |
| E_Validation | $28 |
| E_Length | $A9 |
| E_Application | $AA |
| E_AppErr1 | $AB |
| E_AppErr2 | $AC |
| E_ExpiredApp | $2D |
| E_BadAdd | $2E |
| E_Archived | $AF |
| E_Version | $30 |
| E_ArchFull | $31 |
| E_Variable | $B2 |
| E_Duplicate | $B3 |
| E_Date | $B4 |
| E_UnknownCmd | $B5 |
| E_OverLimit | $36 |
| E_Disabled | $37 |
| E_Xmit | $38 |
| E_MemFull | $39 |
{{< /expand >}}

### Address: $D008DF

### Size: 1 byte
67 changes: 67 additions & 0 deletions content/memory/all/kbdScanCode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: kbdScanCode
geekdocHidden: true
params:
address: $D00587
name: kbdScanCode
---

Contains a scan code from the last time the keyboard was scanned. A list of possible scan codes is below:

{{< expand "Scan Codes" "..." >}}
| Scan Code | Scan Code (Hex) |
|------------|-----------------|
| skDown | $01 |
| skLeft | $02 |
| skRight | $03 |
| skUp | $04 |
| skEnter | $09 |
| skAdd | $0A |
| skSub | $0B |
| skMul | $0C |
| skDiv | $0D |
| skPower | $0E |
| skClear | $0F |
| skChs | $11 |
| sk3 | $12 |
| sk6 | $13 |
| sk9 | $14 |
| skRParen | $15 |
| skTan | $16 |
| skVars | $17 |
| skDecPnt | $19 |
| sk2 | $1A |
| sk5 | $1B |
| sk8 | $1C |
| skLParen | $1D |
| skCos | $1E |
| skPrgm | $1F |
| skStat | $20 |
| sk0 | $21 |
| sk1 | $22 |
| sk4 | $23 |
| sk7 | $24 |
| skComma | $25 |
| skSin | $26 |
| skMatrix | $27 |
| skGraphvar | $28 |
| skStore | $2A |
| skLn | $2B |
| skLog | $2C |
| skSquare | $2D |
| skRecip | $2E |
| skMath | $2F |
| skAlpha | $30 |
| skGraph | $31 |
| skTrace | $32 |
| skZoom | $33 |
| skWindow | $34 |
| skYequ | $35 |
| sk2nd | $36 |
| skMode | $37 |
| skDel | $38 |
{{< /expand >}}

### Address: $D00587

### Size: 1 byte
8 changes: 8 additions & 0 deletions content/memory/by-address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: By Address
weight: -20
---

A list of notable memory areas, sorted by hexadecimal address.

{{% list-by-address "memory/all" %}}
10 changes: 10 additions & 0 deletions content/memory/by-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: By Name
weight: -20
---

A list of notable memory areas, sorted alphabetically by name.

{{< toc >}}

{{% list-by-name "memory/all" %}}
27 changes: 27 additions & 0 deletions content/memory/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

## Format

The format memory areas is as follows:

````Markdown
---
title: Memory area name
geekdocHidden: true
params:
address: Memory address
name: Memory area name
---

Overview of what the memory area does / is used for

### Address: $000000

### Size: Size of the area in bytes
````

An alternative method is to use the command `hugo new "memory/all/<name>.md" --kind memory`

Each area should have its own file, named after the area. These files go in the **content/memory/all/** directory.

It is also recommended to take a look at some the already existing documentation to get a feel for how things should be formatted.
4 changes: 4 additions & 0 deletions content/syscalls/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: System Calls
weight: -20
---
25 changes: 25 additions & 0 deletions content/syscalls/all/BootOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: BootOS
geekdocHidden: true
params:
address: $020108
category: System
name: BootOS
---

As the name suggests, this call boots the OS.

{{< hint type=caution >}}
If this routine is called, it will not return.
{{< /hint >}}

### Address: $020108

### Inputs:
* None.

### Outputs:
* Boots the OS.

### Destroys:
* All RAM is reset.
21 changes: 21 additions & 0 deletions content/syscalls/all/CallFontHook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: CallFontHook
geekdocHidden: true
params:
address: $020130
category: Hooks
name: CallFontHook
---

Checks if a valid font hook is currently installed. If so, that hook is called, otherwise, this routine returns.

### Address: $020130

### Inputs:
* None.

### Outputs:
* Calls the currently installed font hook if it exists.

### Destroys:
* If no font hook exists, this call does not destory anything. Otherwise it follows the behavior of the currently installed font hook.
21 changes: 21 additions & 0 deletions content/syscalls/all/CallLocalizeHook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: CallLocalizeHook
geekdocHidden: true
params:
address: $020134
category: Hooks
name: CallLocalizeHook
---

Checks if a valid localization hook is currently installed. If so, that hook is called, otherwise, this routine returns.

### Address: $020134

### Inputs:
* None.

### Outputs:
* Calls the currently installed localization hook if it exists.

### Destroys:
* If no localization hook exists, this call does not destory anything. Otherwise it follows the behavior of the currently installed localization hook.
Loading

0 comments on commit 26ae0af

Please sign in to comment.