Commit graph

338 commits

Author SHA1 Message Date
Darin Minamoto
80cc8ccccc
Merge 19c5986111 into 4f02c5fc66 2026-04-20 10:49:06 +00:00
Perry Kivolowitz
4f02c5fc66 section_1/kickstart: proofing pass
Copyedits only; no technical content added. Changes:

- subject-verb agreement: "idea of registers were introduced" -> "was"
- "operate as the speed" -> "operate at the speed"
- fixed ungrammatical "typing as apart from X, Y is Z" (now "typing:
  apart from X, Y is Z")
- comma after "x30" in list; replaced misleading claim "x31 is also
  not available" with "x31 has a special role (explained later)".
  x31 is not unavailable -- it encodes SP or XZR depending on
  instruction context, which the earlier phrasing obscured
- "hundreds of instructions each potentially has" -> "each potentially
  with" (agreement)
- "an mnemonic" -> "a mnemonic" (/n/ is a consonant sound)
- "a concrete examples" singular/plural typo
- de-duplicated back-to-back "For example" in Mixing Register Types

Rejected: leaving the "x31 is not available" line alone -- it's an
intro chapter, but "not available" reads as "doesn't exist", which
will contradict later chapters that use SP and XZR. Kept other
simplifications (informal "that big of" phrasing, stylistic comma use)
untouched.
2026-04-19 20:09:07 -05:00
Perry Kivolowitz
8db2733883 Proofing pass: macros/README, not_written_yet — doc MOD, fix variadic xref
- macros/README.md
  - Add ### MOD section documenting the previously-undocumented MOD
    macro (src_a, src_b, dest, scratch → sdiv/msub composition).
    Canonical apple-linux-convergence.S has defined MOD since at least
    the sync-script enforcement work (3144bc6); README drifted from it.
  - Rewrite variadic cross-reference to link BOTH more/varargs/README.md
    (the dedicated chapter) and more/apple_silicon/README.md (the
    Apple/Linux divergence discussion). Original pointed only at
    apple_silicon, which undersold the standalone varargs chapter.
  - Grammar: "Thank you to u/TNorthover for nudge" → "for the nudge".

- not_written_yet.md
  - Capitalize GitHub.

Rejected alternatives: (a) removing MOD from canonical instead of
documenting it — rejected per author direction, MOD is useful; (b)
repointing the variadic link to varargs only — rejected, the Apple
Silicon page's divergence discussion remains directly relevant in the
macros context.

Proofing status (NAS): LICENSE.md and not_written_yet.md flipped to
[reviewed]; macros/README.md flipped to [revised].
2026-04-19 10:41:48 -05:00
Perry Kivolowitz
4805083a87 README: proofing pass — typo fixes, factual corrections, updated bio
Full top-to-bottom proofread of the root README.

Narrow fixes (typos, grammar, formatting, broken syntax):

- Two malformed `</br>` closing tags replaced with `<br/>`.
- "See the [here](...)" → "See [this chapter](...) for..." (the
  previous phrasing had a dangling article and a preposition that
  did not parse cleanly).
- Stray angle brackets around a URL in the "Here is a link to 'a'
  main instruction set page" sentence removed (the brackets created
  a redundant autolink inside an already-formed markdown link).
- "quite straight forward" → "straightforward" (one word).
- "whose job it is turn high level languages" → inserted the
  missing "to".
- Added backticks around "gcc" and "g++" in the "We use gcc and g++
  directly..." sentence for consistency with every other reference
  to those tools in the file.
- `main.s` → `main.S` in the "Suppose main() is implemented in
  assembly language..." paragraph; the surrounding prose teaches
  the capital-S convention, and the lowercase `.s` was contradicting
  the very point being made.
- "for handing `#include`" → "for handling `#include`".
- "a general tool can is used by other languages" → "a general tool
  used by other languages" (extra "can is" was clearly a mid-edit
  remnant).

Substantive corrections:

- The linker description listed ".dlls on Windows" as an example of
  a statically-linked library file. DLLs are the canonical dynamic
  linking format on Windows; static on Windows is .lib. The sentence
  now correctly separates the two categories: `.a` (Linux) and `.lib`
  (Windows) for static, `.so` (Linux) and `.dll` (Windows) for
  dynamic.
- The "Twenty twenty three marks Perry's 19th year teaching..."
  paragraph was three years stale and referenced an ongoing count
  that had since ended. Replaced with a year-agnostic retirement
  statement summing the nineteen total years (ten UW Madison plus
  nine Carthage). The new phrasing will not age.
- Normalized "pre-processor" (hyphenated) to "preprocessor" (one
  word) throughout the "C Preprocessor" subsection, matching the
  four unhyphenated uses that appeared earlier in the same document
  and aligning with common modern style. Section heading updated to
  match.

Expanded author bio:

- Added a new paragraph in "About The Author" surfacing credentials
  directly relevant to this book's systems/assembly audience: the
  undergraduate V6 Unix kernel study on a PDP-11/60, the subsequent
  Bell Labs Unix-internals teaching role, priority on the earliest
  known software keylogger, the 1985 appearance on Fred Fish Disk #1
  (the first volume of the longest-running public-domain software
  library in personal-computing history), named references to the
  ASDG / TAD / ADPro / Elastic Reality commercial lineage, and the
  "Loaders → Operators → Savers" architectural throughline that has
  now evolved into the "Sensor → Operator → Emitter" pipeline in
  the author's current open-source GlowUp project (home automation
  broader than just lighting). The GlowUp repo at
  github.com/pkivolowitz/lifx is linked.

Rejected alternatives:

- Rolling the "19th year" numbers forward to 2026 rather than
  switching to the retirement framing — rejected because the count
  is no longer ongoing and any year-pinned phrasing will age the
  same way again.
- A Front-Matter-level authorship / biography section rather than
  an addition to the existing "About The Author" section — rejected
  as tonally too heavy; biography belongs where biography already
  lives.
- Fixing the DLL/static-linking text by simply renaming "statically
  linked" to "dynamically linked" for the .dll example — rejected
  because the surrounding sentence teaches the concept of library
  linking and benefits from showing both categories side by side.

No test coverage applies; this is prose.
2026-04-19 03:05:38 -05:00
Perry Kivolowitz
fd674539a0 Add authorship note disclosing AI-assisted revisions
New subsection "A Note on Authorship and AI Assistance" at the end of
"About The Author" states that as of 19 April 2026 the author has
begun using an AI assistant as a writing and editing aid on this
book, and that all material preceding that date was produced unaided.
Points the reader at git history and the scripts/ and .github/
tooling landed around the same time as the durable markers for
distinguishing AI-assisted from unaided work going forward.

Placement rationale: "About The Author" is already the section
carrying author-identity and first-person voice, so the disclosure
lives where a reader with any interest in authorship provenance
naturally scrolls. The alternative (a Front Matter subsection) was
considered and rejected as tonally too heavy for a note that exists
mainly to answer a future question, not to front-load caveats ahead
of the book's self-description.

No test coverage applies; this is prose.
2026-04-19 02:35:23 -05:00
Perry Kivolowitz
52bf6eccd9 Clarify PUSH_P / PUSH_R / POP_P / POP_R naming at first encounter
Part of #33.

The v6.S listing in the hello_world chapter introduces the PUSH_P,
PUSH_R, POP_P and POP_R macros without explicitly telling the reader
what the _P and _R suffixes stand for. For a reader reading the
chapter in order, the mapping is derivable: the book established
stp = "store pair" about 260 lines earlier, and the _R suffix falls
out by parallel with str. But a reader who jumped straight to v6.S
without reading the stp explanation (as Atcold did in issue #33) has
no such anchor and is left guessing.

One sentence at the "The push and pop macros simply save typing"
paragraph closes the gap: it names the _P / _R suffixes, connects
them to the already-taught stp / str convention, and costs a skimmer
nothing. The macro names themselves are unchanged; they were already
fine for an in-order reader, and renaming would have churned every
.S file in the book.
2026-04-19 02:26:19 -05:00
Perry Kivolowitz
3144bc6dbb Enforce macro canonical-vs-chapter-copy identity via sync script and CI
The repository ships a copy of apple-linux-convergence.S in each
chapter directory that demonstrates assembly (11 copies at last count,
plus the canonical one in macros/) so that readers browsing or
downloading a single chapter from GitHub have the macros sitting
right next to the sources that use them. That self-containment is
worth keeping. Manual synchronization of 12 copies on every macro
edit is not: all 11 are currently byte-identical to the canonical,
but the first drift is a matter of when, not if, and diagnosing
"which chapter broke when I added a new macro" after the fact is
a bad time.

This commit turns "the copies are in sync" from a hope into a
machine-enforced invariant:

- scripts/sync-macros.sh: walks macros/*.S, finds every file with
  the same basename anywhere else in the repo (excluding .git/ and
  macros/ itself), and overwrites any copy that differs. Idempotent;
  prints only the files it actually changed plus a summary. Uses
  only POSIX tools (find, cmp, cp, basename) plus bash builtins
  under a #!/usr/bin/env bash shebang. Verified working under both
  macOS bash 3.2.57 and zsh 5.9 on clean-tree and drift-repair
  paths.

- .github/workflows/check-macros.yml: runs the sync script on every
  push and pull request, then fails the job if git diff --exit-code
  shows the script produced any uncommitted change. The failure
  message tells the author exactly what to do (run the script
  locally, commit the result).

- macros/README.md: new "Source of truth" section marking the
  chapter copies as derived artifacts, pointing editors at the
  sync script, and stating that CI enforces the invariant.

Rejected alternatives:

- Symlinking each chapter copy to macros/apple-linux-convergence.S.
  Cheapest option (zero infrastructure) and git handles symlinks
  natively, but Windows checkouts without Developer Mode replace
  the symlink with a plain-text file containing the target path.
  This book's audience is overwhelmingly Linux and Apple Silicon,
  so the Windows hazard is mostly theoretical, but a sync-and-check
  approach works in every clone environment and makes the
  source-of-truth relationship explicit rather than implicit in a
  filesystem feature.

- Having each chapter .include the canonical file via a relative
  path. Breaks the "self-contained chapter" property the copies
  exist to preserve; a reader who downloads one chapter gets a
  broken build because macros/ is not beside it.

- Making the copies build-time artifacts (generated by make, not
  committed). Same problem: a reader browsing one chapter on
  GitHub no longer sees the macro file they need.

Tests:

- ./scripts/sync-macros.sh run on the current tree reports
  "macros already in sync (11 chapter copies checked)" and exits 0.
- Injecting a trailing-line perturbation into a chapter copy and
  re-running the script: detects the drift, reports "synced: <path>",
  and restores the file to canonical. Verified under both bash and
  zsh, both paths.
2026-04-19 02:20:34 -05:00
Perry Kivolowitz
88c8f496c4 Document hex dump display convention in alignment chapter
Closes #22.

The alignment chapter's hex dump examples (e.g. "0011 eeff ccdd aabb"
for a little-endian long initialized to 0xaabbccddeeff0011) are correct
under the default hexdump(1) output convention: bytes grouped into
16-bit little-endian words, each word printed most-significant byte
first. But the chapter never told the reader which convention was in
use, so a reader reproducing the example with xxd or hexdump -C (both
byte-oriented, showing raw memory order) would get a different-looking
result and conclude the book had an endianness bug. That is exactly
what issue #22 reported, and it is also part of what the #33 filer
flagged as "there are no instructions about how to do such a thing"
for hex dumps in this chapter.

Fix: one new subsection "A Note on Hex Dumps" placed before Example 1,
stating the convention explicitly and warning xxd / hexdump -C users
that the bytes within each pair will appear swapped relative to the
examples. The examples themselves are unchanged; they were already
self-consistent under the word-oriented convention.

Rejected alternative: rewriting all the examples in byte-oriented
(xxd) form. That would have matched what most modern readers reach
for, but would also have required regenerating every hex dump in the
chapter and losing continuity with any reader who already absorbed
the current notation. A single explanatory paragraph is less invasive
and teaches the distinction, which is useful in its own right.

No test coverage applies; this is prose.
2026-04-19 02:20:10 -05:00
d
19c5986111 Modify assembly file 2025-02-28 21:44:04 -08:00
d
7faf3ca119 Add pdf 2025-02-28 12:58:50 -08:00
d
89d8a1fe9b Fix csel instruction use to match intended ternary operator 2025-02-28 12:55:17 -08:00
Silicon27
8e8c700b48
Typos fixed, and reformulated a bit (#31) 2025-01-20 12:32:49 -06:00
Perry Kivolowitz
43c188951c corrected sense of compare for error filed almost one year ago and in a different life 2025-01-14 20:56:13 -06:00
Perry Kivolowitz
08406598eb corrected broken link for register interlude. 2025-01-14 20:51:02 -06:00
Perry Kivolowitz
d0fe067eac removed link for Jishnu as it turned into a gambling sitegit add . 2025-01-14 20:40:56 -06:00
Perry Kivolowitz
4c4e8e37fd incorporated gitonthescene feedback 2024-07-04 12:32:47 -05:00
pkivolowitz
784db03bdf
Update working.md 2024-07-03 15:08:39 -05:00
Perry Kivolowitz
f1dd2bea49 changed tabs to spaces in nine_args.s 2024-06-21 11:22:57 -05:00
Perry Kivolowitz
73bad628b4 corrected text to conform to corrected code in nine_args 2024-06-21 11:18:22 -05:00
Perry Kivolowitz
c5143f19db corrected error induced by post/pre increment to stack 2024-06-21 10:54:55 -05:00
Perry Kivolowitz
326fd2ea90 greatly expanded explanation 2024-05-05 10:39:40 -05:00
Perry Kivolowitz
320f77b04b I guess I didn't sleep well, corrected the corrected gammar 2024-05-05 10:04:33 -05:00
Perry Kivolowitz
c2e75eb0ab grammar 2024-05-05 10:03:41 -05:00
Perry Kivolowitz
5a95744437 up 2024-05-05 10:02:15 -05:00
Perry Kivolowitz
966862042a corrected user name 2024-05-05 09:58:55 -05:00
Perry Kivolowitz
6243dc9b49 correction due to arne 2024-05-05 09:55:48 -05:00
Perry Kivolowitz
88d0bf495a corrected a link 2024-05-03 18:53:46 -05:00
pkivolowitz
27705340d1
Update ldr.md
AVE changed to SVE
2024-05-03 18:45:21 -05:00
Perry Kivolowitz
cdf98ea9a5 added pdf version 2024-05-02 09:30:52 -05:00
Perry Kivolowitz
bce4e339e2 added M series code without macros 2024-05-02 09:29:44 -05:00
Perry Kivolowitz
630812d99a added M series code without macros 2024-05-02 09:27:33 -05:00
Perry Kivolowitz
054a5deaa5 most of the way there on precomputation. 2024-04-13 14:24:55 -05:00
Perry Kivolowitz
32fe3b3b94 begun precomputation chapter 2024-04-12 13:27:44 -05:00
Perry Kivolowitz
17f0773d7c added example.S and added comments to test.s 2024-04-04 10:27:40 -05:00
Perry Kivolowitz
d1e57f7c50 updates 2024-03-05 09:05:41 -06:00
Perry Kivolowitz
776ebc0545 improvements to text 2024-02-28 16:40:12 -06:00
Perry Kivolowitz
144acfb9d6 improved text 2024-02-28 16:12:29 -06:00
Perry Kivolowitz
7c896ef362 adde pdf 2024-02-28 10:48:54 -06:00
Perry Kivolowitz
697a9c0e87 WTF was I thinking before? 2024-02-28 10:47:55 -06:00
Perry Kivolowitz
c020675cd7 wrote apple-exit.c and s 2024-02-20 13:59:39 -06:00
Perry Kivolowitz
73a4abfb8d something changed 2024-02-17 16:17:36 -06:00
Perry Kivolowitz
a7e89718b1 corrected layout of floats for AARCH64 2024-02-15 13:14:59 -06:00
pkivolowitz
d099c79c1d
Update working.md
typo something
2024-02-13 13:28:27 -06:00
pkivolowitz
4c66af132d
Update working.md
the float registers show are for 32 bit arm - must be fixed.
2024-02-13 13:27:46 -06:00
Perry Kivolowitz
29791113ae additions to hello world - provided addition for loop implementation 2024-02-05 10:54:54 -06:00
Perry Kivolowitz
d9f4ff4c17 added section header to kickstart 2024-01-31 20:22:07 -06:00
Perry Kivolowitz
652f593ca4 more changes to kick 2024-01-31 07:55:32 -06:00
Perry Kivolowitz
dcd6f4505b added to kickstart text 2024-01-31 07:42:22 -06:00
Perry Kivolowitz
1f6f214778 added kick start 2024-01-30 18:30:04 -06:00
Perry Kivolowitz
d3fea6487b updated markdownlint problems plus error in while 2024-01-25 16:08:01 -06:00