The ISA as a contract
Floating point finished Foundations: integers, characters and reals are bit patterns. The first topic showed the fetch–decode–execute loop. Which instructions exist, what each does, and how much of the machine a program may depend on?
Notation. Addresses and instruction words are 32-bit hex (0x00400018). Integer registers are x0–x31 with ABI names (a0, t1, …). pc is the program counter. , and are the factors of the performance equation.
Baseline. Early machines each had their own instructions; a new design threw software away. IBM System/360 (1964) made one ISA for a family and coined architecture as the programmer-visible attributes (Amdahl, Blaauw, Brooks). Software lives for decades; hardware turns over in years — without a stable interface, every improvement throws programs away.
Key idea. The ISA is a contract. Hardware promises every instruction does what the spec says on every implementation; software relies on nothing else — not clock rate, caches, or how many instructions run at once. The ISA fixes the 32 visible registers, the byte-addressable memory model, every encoding and effect (including corner cases), and error behaviour. Microarchitecture chooses physical register files, caches, pipelining, out-of-order width, clock and power.
Corner cases matter: RISC-V div by zero returns −1; rem by zero returns the dividend — no trap. ARMv8 sdiv returns 0; x86 idiv raises an exception. Three contracts. Beside the ISA sit microarchitecture (one implementation) and the ABI (software conventions: which register is ra, how arguments are passed). Different compilers interoperate only because they share one ABI.