Learn assembly (machine) language and compilation to assembly — updated

Author: amintimany

Created: 2021-12-07 03:28am

Edited: 2021-12-07 03:44am

Keywords: Compilation, STREAM

Derived from: Learn assembly (machine) language and compilation to assembly

Description:

This learning design pertains to a portion of the course "compilation" that I am co-teaching this semester. As part of this course students have to learn the assembly language (the machine language — it is essentially a human-readable version of the binary code that the machine executes). This activity is centered around the lecture. The students familiarize themselves with the topic before coming to the lecture. During the lecture the students are presented with the theory and the practical aspects of generating assembly code from higher-level code. The students also the tool x64emu which they can use better understand x86-64. After the lecture, students will implement the code-generation phase of the their course project. Students can use x64emu for testing the code generated by their compiler.

As part of the lecture, the instructor poses questions to get students to think about different aspects of the problem. Students are encouraged think together with their peers. They will submit their answers online, e.g., on Mentimeter, or an image sharing platforms (in some cases, students have to produce code for a short code snippet (one line of code) which they will have to take a picture of and upload to share with the class).

The course's Birghtspace page plays a crucial role in this design. The students will find the material there, they will be able to participate in discussions with their peers, the TAs, and the instructor.

This learning design follows STREAM model. The Birghtspace discussions that students have with their peers, TAs, and the instructor informs the instructor as to what exactly to focus on during the lecture — this is why lecture slides are only made available to students shortly before the lecture starts as the instructor tries to adjust them to students' needs. Moreover, the discussions the students have regarding their project, and the progress they make on it gives feedbacks to the instructor on how to adapt the up-coming lectures.

Intended Learning Outcomes:

  • Students will be able to describe and analyze the structure of programs in Intel X86-64 assembly
  • Students will be obtain the skill to write programs in Intel X86-64 assembly
  • Students will be able to identify and describe the process of generating assembly code from the high-level code
  • Students will be able to implement the code generation phase of a realistic compiler
Resources Tasks Supports

Before-class activities

Text book, the Intel CPU manual, course notes, TAs and the instructor

Read the available resources & become familiar with basic concepts of the code-generation process.

Student discussions in dedicated forum on course's Brightspace page, TAs and the teacher (available during the study cafe)

In-class activities

Lecture slides (available to students before the class starts), the Textbook, X64emu

Students participate actively in the lecture. The instructor presents the basic concepts and the emulation tool X64emu

Live interaction with the instructor

Mentimeter, (other online platforms for uploading images during the class), peers in the class

Questions posed in the class which students have to think together about and answer online

Peers to think together, the instructor to help them reflect and finally discuss their conclusions and presenting the right anwer

After-class activity

Textbook, the Intel CPU manual, course notes, lecture videos, peers (students work in groups of three), TAs, the instructor, X64emu

Implement code generation phase of the compiler as part of the course project

TAs and the instructor support students, e.g., in study cafes, Brightspace discussion forum, etc.