Skip to content

Strings Above, Pointers Below

Exercise: 49k_exec · Tue Dec 1 · Length: 6:18 · Lecture: Week 15 · argc and argv, on the new stack · Explainer: Strings Above, Pointers Below

A narrated walk through the explainer, for after the Nov 24 lecture and before Tuesday's session (Dec 1): exec copies the command line onto the new program's stack from the top down, each string below the last, then an array of pointers to them, and the program finds its arguments through that array. The video reads the two kinds of data that end up on the stack page, then steps through the given push_argv on an example command typed under cargo run, one string at a time and then the array, with the stack page as the lab read it back, byte for byte. One entry follows, with the two addresses of the string it leads to, and the given code's limits. The video ends on what you write and what the test checks. It shows no solution code: push_argv is given, and the video shows only the stack page's bytes and the array's entries at each step, with example words, or the test's own.

Download the video (MP4, 8 MB) · Captions (WebVTT) · All eleven Week 15 videos