Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Under the Hood of Rust Language with Assembly - Rust Programming Tutorial

Chris Hay via YouTube

Overview

This course aims to help learners understand the inner workings of Rust programming by delving into the assembly code generated by Rust during compilation. By the end of the course, students will be able to generate assembly from Rust, comprehend stack memory allocation in Rust programming, and interpret Rust code represented in assembly. The course teaches skills such as analyzing assembly language statements, registers, stack and memory storage, and provides a walkthrough of Rust-generated assembly. The teaching method involves converting a simple Rust program to assembly on various platforms, using tools like godbolt for better comprehension. This course is intended for individuals looking to advance their expertise in Rust programming and gain a deeper understanding of the language through assembly analysis.

Syllabus

- introduction
- create our rust project
- target folder and rust compile
- emitting rust assembly during compile
- cross compiling rust from apple silicon arm to x64 assembly
- emitting x64 assembly
- cargo show asm
- emitting rust assembly interleaved with rust using cargo show asm
- generating x64 intel assembly using rust and godbolt
- understanding stack frame memory allocation, stack pointer, rsp and sub
- variable assignment, mov and virtual registers
- assembly multiplication using imul
- storing local variables in the stack / stack frame memory for later use
- overflow checks and panickibng
- more calculations and some compiler optmizations
- understanding stack memory and primitive sizes and fixed memory
- jmp's are goto's in disguise
- more stack memory and compiler optimizations
- printing the result
- To Be Continued

Taught by

Chris Hay

Reviews

Start your review of Under the Hood of Rust Language with Assembly - Rust Programming Tutorial

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.