library-am9511

Guides editing and rebuilding the Am9511A APU float library in z88dk.

1.1k|206|Updated Mar 16, 2016
One-click install
npx skills add https://github.com/z88dk/z88dk --skill library-am9511-z88dk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: library-am9511
Source: https://github.com/z88dk/z88dk/tree/main/.agents/skills/library-am9511
Command: npx skills add https://github.com/z88dk/z88dk --skill library-am9511-z88dk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on z88dk's Am9511A (Intel 8231A) hardware APU float library requires deep knowledge of IEEE-754 vs APU float formats, pushf/popf status mapping, and multi-product rebuild steps; mistakes cause Inf/NaN bugs, stack misalignment, or broken library builds. ## Core Features & Use Cases - APU interface reference: Documents push/pop byte order, command byte format, status register error codes, and I/O macros for z80 and 8085 targets. - IEEE specials handling: Explains how am32_fspecial.asm implements Inf/NaN algebra in software since the APU chip has no native Inf/NaN encodings. - Link flags and rebuild workflow: Covers --math-am9511, --am9511, --am9511h flags for classic and newlib, plus safe full-product rebuild commands that preserve ftoa/ftoe in the .lib. - Use Case: When debugging a divide-by-zero returning wrong results on an Am9511A target, use this Skill to trace popf status mapping (DIV0 → ±Inf) and verify the link flags pull in the APU path instead of genmath's sqrt. ## Quick Start Ask the AI to explain how popf maps Am9511A status register error codes to IEEE special values when editing libsrc/math/float/am9511.

Frequently Asked Questions about library-am9511

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I link the Am9511 APU float library in z88dk?

Use --math-am9511 or --am9511 for classic z80 targets with the APU at the configured port map. For 8085 use --math-am9511 with -clib=8085; newlib uses --am9511 or -lam9511 with IEEE float mode on the z80 clib only.

How does the Am9511A handle Inf and NaN values?

The Am9511A chip has no native Inf or NaN encodings. The library implements IEEE specials in software via am32_fspecial.asm before pushing operands, and popf maps APU status errors to IEEE values: overflow to ±Inf, underflow to 0, and negative sqrt to NaN.

What is the push and pop byte order for the Am9511A?

Push operands LSB first with MSB last, and pop results MSB first with LSB last. A wrong byte count or order misaligns the internal byte pointer because the APU stack is a LIFO with wraparound.

Why does my Am9511 library build lose ftoa after rebuilding?

Wiping the obj/ directory without re-running the full Makefile drops the cimpl ftoa/ftoe objects from the .lib. Run a full make in libsrc/math/float/am9511 after removing only specific object files, then copy the products into lib/clibs/.

Does z88dk-ticks emulate the Am9511A APU?

Yes, z88dk-ticks includes an Am9511 model in src/ticks/am9511.c using default ports 0x42 and 0x43. The model is approximate and not bit-exact silicon, so status-bit accuracy may differ from real hardware.

Am9511A vs math32 software float, which should I use?

The Am9511A is a hardware APU with a smaller range (about ±2.7e-20 to 9.2e18) and no Inf/NaN, while math32 is a full software IEEE-754 implementation. Compare both with TIMER benchmarks using --math-am9511 versus the math32 library.