Optimizing SBCL Assembly: Fixing Wasteful Machine Code Encoding in the F18 NEXT Sequence
By
yacin
A baker's-dozen of insight crammed into one ring.
Summary
A technical blog post examining SBCL (Steel Bank Common Lisp) as an assembly code breadboard, focusing on low-level optimization of the NEXT sequence used in the F18 Forth processor implementation. The author discusses machine code encoding inefficiencies, specifically how effective addresses with index registers but no base register were being encoded wastefully, and shows how a fix reduced the instruction size from 14 bytes to 9 bytes.
Key quotes
· 3 pulledEDIT: Lutz Euler points out that the NEXT sequence (used to) encode an effective address with an index register but no base.
The mistake doesn't affect the meaning of the instruction, but forces a wasteful encoding.
As usual with Chuck Moore's work, it's hard to tell the difference between insanity and mere brilliance ;)
You might also wanna read
The Evolution of Lisp Editing in Vim: From 2004 to 2019
Susam Pal reflects on the evolution of Lisp editing in Vim over the past 15 years. In 2004, there were no good plugins for structured editin
NVIDIA Announces "Hack for Impact" London Event for Autonomous AI Agent Development
NVIDIA is hosting a "Hack for Impact" event in London, challenging participants to build autonomous agentic applications using open-source m
Four practical steps to control Azure Foundry token costs for agentic AI workloads
This article provides practical guidance on controlling token costs in Microsoft Azure Foundry, particularly for agentic AI workloads where
MerLean-Prover: A Recursive Agent Harness for Lean 4 Theorem Proving Outperforms Baselines
MerLean-Prover is an end-to-end Lean4 theorem prover that replaces 'sorry' declarations with kernel-checkable proofs using three agent types
Why small pull request policies can backfire on software quality
The article critiques a common software engineering policy that limits pull requests (PRs) to small sizes (e.g., 500 lines, few files). Whil
apenwarr.ca·6h agoHow Anthropic contains Claude's expanding access across its products
Anthropic describes how it has evolved its approach to granting Claude, its AI assistant, increasingly broad access to internal systems over
