diff options
Diffstat (limited to 'anim/scenes/zoom.zig')
| -rw-r--r-- | anim/scenes/zoom.zig | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/anim/scenes/zoom.zig b/anim/scenes/zoom.zig index 1f23c05..426d3a3 100644 --- a/anim/scenes/zoom.zig +++ b/anim/scenes/zoom.zig @@ -7,8 +7,9 @@ //! row fires in the disassembly, the registers it changed strike, then //! the stack, and the mark walks down the listing. The camera goes //! nearer once, announced (its target framed, the rest cleared first), -//! for the call: the eight bytes of the way back, and the frame built -//! under them; then back, and the line is where it was, one call deeper. +//! for the call: the instructions and the stack's words in one view, the +//! eight bytes of the way back and the frame built under them; then back, +//! and the line is where it was, one call deeper. const anim = @import("anim"); const canim = @import("canim"); const recordings = @import("recordings"); @@ -39,17 +40,22 @@ fn frame(s: *anim.Frame) void { at.walk(s, .moment, call.enter - 1); says.line(s, "`call` writes eight bytes on the stack: the way back."); - // Nearer, for the bytes: the stack alone, twice the size. - cam.go(s, split.stack, 2, .{ ctx.source, ctx.disasm, ctx.registers, ctx.backtrace }); - // Under the camera the stack holds still: six free words above rsp for the new frame. + // The stack holds still under the camera, set before it moves: six free + // words above rsp for the new frame (rsp-30 to rsp+8). ctx.stage.holdStack(s, at.moment(s), 6); + // Nearer, cause and effect in one view: the instructions as they run + // (mnemonics, operands, what each leaves) and the stack's words they + // write with their chains and roles (`fib+42`, `saved rbp`, `n`): from + // the mnemonics to the roles' end is all the stage holds at x1.16 (at + // x1.5 the stack's names and roles are off it); the rest cleared. + cam.go(s, .{ .x = 190, .y = 342, .w = 1525, .h = 480 }, 1.16, .{ ctx.source, ctx.registers, ctx.backtrace }); at.walk(s, .moment, call.enter); // The frame built under them, under a caption of its own (12 s at most). says.line(s, "The new frame saves `rbp` under them,\nthen stores its own `n`."); at.walk(s, .moment, call.enter + 4); s.wait(canim.theme.time.beat); ctx.stage.releaseStack(s); - cam.back(s, .{ ctx.source, ctx.disasm, ctx.registers, ctx.backtrace }); + cam.back(s, .{ ctx.source, ctx.registers, ctx.backtrace }); says.line(s, "Nine instructions and three words of stack later\n`fib(4)` begins: the same lines, one call deeper."); at.walk(s, .line, end); |
