summaryrefslogtreecommitdiff
path: root/anim/src/ties.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-12 11:32:59 -0300
committerGabriel Schneider <[email protected]>2026-11-12 13:19:32 -0300
commiteab50d1c040774351f332a1568fa332c377860bd (patch)
tree0e727f9bf323e49aa6a2f55bb4fabd166aa9a492 /anim/src/ties.zig
parent38971edd9b49a802e6e726fb51d162df1bf58b83 (diff)
downloadcomputeranim-eab50d1c040774351f332a1568fa332c377860bd.tar.gz
computeranim-eab50d1c040774351f332a1568fa332c377860bd.zip
canim: the introduction as one video, with a chapter on registers
From the user. One scene, intro, in four chapters: memory, registers, the stack, code and meaning (210 s). The registers chapter builds the panel before the stack needs it: sixteen rows with their chains, rip pinned on the code band and rsp and rbp on the stack's, rdi opened into its parts as mov edi changes one byte, a call to malloc stepped over with its result in rax, the registers a scene never changes folded. The chapters join at seams that say their title and keep it as the clock's label; one recording (from push(9), no agent, the heap from --heap) and one clock. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/ties.zig')
-rw-r--r--anim/src/ties.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/anim/src/ties.zig b/anim/src/ties.zig
index 3048e32..f746f97 100644
--- a/anim/src/ties.zig
+++ b/anim/src/ties.zig
@@ -186,13 +186,18 @@ pub fn strikeDelay(now: cursors.Now, i: usize) f32 {
const pin = [2]?f32{ now.pinLands(0), now.pinLands(1) };
if (i == cursors.sp_index) if (pin[0]) |land| return land - now.plan.at[0];
if (i == cursors.bp_index) if (pin[1]) |land| return land - now.plan.at[0];
+ // A call stepped over: its result (rax) in the CPU's slot, the others in a wave after it.
+ const over = now.plan.result >= 0;
+ if (over and i == cursors.rax_index) return 0;
var before: f32 = 0;
for (theme.metric.all_registers[0..16]) |name| {
const k = @import("context.zig").index(name).?;
if (k == i) break;
if ((k == cursors.sp_index and pin[0] != null) or (k == cursors.bp_index and pin[1] != null)) continue;
+ if (over and k == cursors.rax_index) continue;
if (now.registerAge(k) == 0) before += 1;
}
+ if (over) return now.plan.result - now.plan.at[0] + before * time.continue_wave;
if (now.plan.wave) return before * time.continue_wave;
return @min(before * cursors.write_apart, time.cascade) + @import("syscalls.zig").crossingDelay(now);
}