LIB2 / FILE VIEW

API.md

DOWNLOAD ORIGINAL ↓

# MathSoft/2 — Provisional ABI ledger (source-observed)

**Not a finalized consumer ABI.** This records the r019 donor's contracts without implying broad-domain or reentrant qualification. Numerical code was not changed.

| Public entry | Owner | Inputs | Result | Dependency |
|---|---|---|---|---|
| `M11_ADD` | `add.inc` | `M_IN`, `M_A_INB` | `M_OUT`, `$0` | `B9_ADD` |
| `M11_SUB` | `sub.inc` | `M_IN`, `M_A_INB` | `M_OUT`, `$0` | `B9_SUB` |
| `M11_MUL` | `mul.inc` | `M_IN`, `M_A_INB` | `M_OUT`, `$0` | `B9_MUL` |
| `M11_DIV` | `div.inc` | `M_IN`, `M_A_INB` | `M_OUT`, `$0` | `_D11_*` |
| `M11_SQRT` | `sqrt.inc` | `M_IN` | `M_OUT`, `$0` | `_S11_*` |
| `M11_EXP` | `exp.inc` | `M_IN` | `M_OUT`, `$0` | `_E11_*` |
| `M11_LGT`, `M11_LN` | `log_core.inc` | `M_IN` | `M_OUT`, `$0` | shared `_L11_CORE` |
| `M11_SIN`, `M11_COS`, `M11_TAN` | `trig_core.inc` | `M_IN` | `M_OUT`, `$0` | shared `_M11_TR_WCALL` |
| `M11_SINH`, `M11_COSH`, `M11_TANH` | `hyp_core.inc` | `M_IN` | `M_OUT`, `$0` | shared `_H11_API` |
| `M11_ASINH`, `M11_ACOSH`, `M11_ATANH` | `invhyp_core.inc` | `M_IN` | `M_OUT`, `$0` | shared `_I11_FIBE8` |

- The current validation app defines `M_IN` at `UA14:2D20`, `M_OUT` at `UA14:2D30`, `M_A_INB` at `UA14:2D40`. These three addresses belong to *that app*, not to future generic library clients.
- ADD/SUB/MUL load pointers into `$10/$12/$14` and dispatch to B9; the other functions use fixed `M_*` symbolic storage. A single universal pointer ABI has **not** been established.
- Use 9-byte B9 buffers; `$0` returns operation-specific status. Status 0 indicates success; 1 generally indicates invalid/domain input; 2 is range where implemented. Do **not** assume uniform error paths or unchanged output on failure. The hyperbolic invalid-input path clears `M_OUT` before returning 1.
- UA14, `$SX=0`, `$SY=1`, valid stack and exclusive, non-nested scratch ownership are required. Caller-register/bank/flags preservation is **not** certified.
- The 17 public symbols are identified, but independent per-entry ABI/reg-clobber/alias tests are still required before general-purpose promotion. Maintain existing T04 exact-byte `SIN(390°)` exception.