Skip to content

Commit

Permalink
Add section on suffixes, more flags
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 Jun 12, 2024
1 parent 581cdf6 commit 0600d75
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 2 deletions.
26 changes: 26 additions & 0 deletions content/instructions/suffixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,29 @@ weight: -20
---

{{< toc >}}

## Overview
Many instructions have optional suffixes which can be added for switching between memory modes. The four suffixes available are **.SIS**, **.SIL**, **.LIS**, and **.LIL**. These suffixes can be used when an exception to the default memory mode is needed for a certain instruction or a section of instructions.

These four suffixes are made up of two parts, the first being either **.S** or **.L** and the second being either **.IS** or **.IL**. The **.S** and **.L** portion (**S**hort and **L**ong) indicate whether the the operation and internal registers use 16-bits or 24-bits, respectively. They also indicate whether the MBASE is used for addresses, with **.S** using it and **.L** not.

The **.IS** or **.IL** portion (**I**nstruction Stream **S**hort and **I**nstruction Stream **L**ong) affect the CPU's control block, indicating whether a multibyte immediate data or address value fetched during instruction execution is 2 or 3 bytes long. For example, an `ld.lil hl, imm24` requires 3 bytes of data (imm24) to be loaded while an `ld.sis hl, imm16` instruction requires only 2 bytes of data (imm16) to be loaded.

If only a partial suffix is supplied, such as `ld.s` or `ld.il`, the assembler determines the other part of the suffix based on the default memory mode which is determined by the ADL mode bit. For more detail, see the table below:

| Partial Suffix | ADL Bit | Full Suffix |
|----------------|---------|-------------|
| .S | 0 | .SIS |
| .S | 1 | .SIL |
| .L | 0 | .LIS |
| .L | 1 | .LIL |
| .IS | 0 | .SIS |
| .IS | 1 | .LIS |
| .IL | 0 | .SIL |
| .IL | 1 | .LIL |

## Single-Instruction Suffix Application
The CPU can perform a single instruction's operation in a specified memory mode and will then switch back to the prior mode afterwards. This applies to all instructions using suffixes other than [`call`](../processor-control/#call), [`jp`](../processor-control/#jp), [`ret`](../processor-control/#ret), [`reti`](../processor-control/#reti), [`retn`](../processor-control/#retn), and [`rst`](../processor-control/#rst).

## Persistent Suffix Application
To make a persistent change in memory mode, a control transfer instruction ([`call`](../processor-control/#call), [`jp`](../processor-control/#jp), [`ret`](../processor-control/#ret), [`reti`](../processor-control/#reti), [`retn`](../processor-control/#retn), and [`rst`](../processor-control/#rst)) with a suffix must be used. It is also possible to achieve this with an interrupt or trap operation, though user-written code does not really have control over this. After the memory mode has been changed by one of these instructions, it will remain changed until the same method is used to change it back. For example, calling or jumping with the `.lis` suffix will keep the changed memory mode active, but returning with `.lil` will force it back.
17 changes: 17 additions & 0 deletions content/memory/all/flags/indicFlags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: indicFlags
geekdocHidden: true
params:
address: $D00092 (ti.flags + $12)
name: indicFlags
---

#### Bit 0 - indicRun:
Set if the run indicator is on, reset otherwise.

#### Bit 1 - indicInUse:
Set if the indicator save area is in use, reset if the area is free.

### Address: $D00092 (ti.flags + $12)

### Size: 1 byte
14 changes: 14 additions & 0 deletions content/memory/all/flags/promptFlags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: promptFlags
geekdocHidden: true
params:
address: $D00091 (ti.flags + $11)
name: promptFlags
---

#### Bit 0 - promptEdit:
Set when editing in the prompt buffer.

### Address: $D00091 (ti.flags + $11)

### Size: 1 byte
26 changes: 26 additions & 0 deletions content/memory/all/flags/seqFlags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: seqFlags
geekdocHidden: true
params:
address: $D0008F (ti.flags + $0F)
name: seqFlags
---

#### Bit 0 - webMode:
Set for web mode, reset for normal sequence mode.

#### Bit 1 - webVert:
Seems to be set along with bit 3 for uw mode.

#### Bit 2 - sequv:
Set for uv mode.

#### Bit 3 - seqvw:
Set for vw mode.

#### Bit 4 - sequw:
Set for uw mode. (Might be unused?)

### Address: $D0008F (ti.flags + $0F)

### Size: 1 byte
4 changes: 2 additions & 2 deletions layouts/shortcodes/keypad.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@
"skSin", "kSin", "kASin", "kCapE", "kLe"],
["27", "2C", "39", "9B", "E3",
"skMatrix", "kAppsMenu", "kAngle", "kCapB", "kLb"],
["28", "B4", "41", undefined, undefined,
"skGraphvar", "kVarX", "kLinkIO", undefined, undefined],
["28", "B4", "41", "FB", undefined,
"skGraphvar", "kVarX", "kLinkIO", "None", undefined],
[undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined],
["2A", "8A", "0C", "B1", "F9",
Expand Down

0 comments on commit 0600d75

Please sign in to comment.