LIB2 / FILE VIEW

USER_MANUAL.md

DOWNLOAD ORIGINAL ↓

# B9 / generation 1 — User manual

**Library:** `src/lib2/b9/1/`  
**Edition:** 2026-11-18, source/document review (documentation only)  
**Qualification:** Wave 7 CLARITAS curated source and paired native binary parity accepted; this is not a blanket arithmetic runtime or hardware qualification.

## What this member does

Operate on Casio nine-byte B9 decimal values: conversion, validation, raw value transfer, sign, addition, subtraction and multiplication.

## Public interfaces

| Entry point or group | Inputs, outputs and behavior |
|---|---|
| `B9_PARSE / B9_FORMAT` | Convert RAM ASCII ↔ 9-byte B9; parse returns `$0` status; format emits ASCII and a length. |
| `B9_VALIDATE / B9_SGN` | Check encoding and obtain zero/positive/negative classification. |
| `B9_ZERO / B9_COPY` | Initialize or copy exactly nine bytes. |
| `B9_LOAD_A / B9_SAVE_A` | Transfer between RAM and native A register block `$10..$18`. |
| `B9_LOAD_B / B9_SAVE_B` | Transfer between RAM and native B register block `$0..$8`. |
| `B9_ADD / B9_SUB / B9_MUL` | `$10/$11` A pointer, `$12/$13` B pointer, `$14/$15` writable destination; `$0` operation status. |

## How to integrate

Include **only** needed engine files. Include `b9_value.inc` where an arithmetic module calls `B9_COPY`. Allocate and validate both operand and destination buffers, set pointer registers, `CAL B9_ADD` (or selected entry), inspect `$0`, then consume result only on success.

**Composition sketch (not an independently assembled client):**

```asm
        LDW     $10,NUM_A
        LDW     $12,NUM_B
        LDW     $14,NUM_DEST
        CAL     B9_ADD             ; inspect $0 before using destination
```

## Environment, dependencies and memory

UA14 RAM pointers; nine-byte buffers; `$SX=0`, `$SY=1`, valid stack. Scratch ranges differ by engine (convert `2E40..2EC4`, arithmetic around `3000..31EC`, multiplication `3B00..3BAC`); confirm non-overlap. Calls non-reentrant.

## Limits and evidence

Historical API.md discusses a narrower candidate converter and contains dated “pending native” language; `ARITH_API.md`, `MUL_API.md`, five current source files and the accepted Wave 7 parity record resolve the different scopes. Do not conflate parity with universal arithmetic proof.

**This documentation does not introduce a new build or runtime PASS.** Source equivalence, native assembler parity, emulator execution and physical-machine evidence remain distinct.

## Actual source and further reference

- [This exact member folder in Google Drive](https://drive.google.com/drive/folders/1hgmT1Ja2EHZETHH6TzJgo23EqdF3Ies8)
- Source modules: `b9_convert.inc`, `b9_value.inc`, `b9_sgn.inc`, `b9_arith.inc`, `b9_mul.inc`.
- Further contracts/source notes: API.md, ARITH_API.md, MUL_API.md, README.md. These may include dated donor paths or older acceptance statements.
- For a new consumer, pin exact source files and hashes, verify full include closure, inspect register/bank/resource conflicts and test the resulting application on each claimed target.

*Praeteritum ad futurum servamus.*