CS3140 Low-level Programming II

Assembly language is used as the vehicle to introduce students to the principles of program construction at the machine code and assembly language levels. Students will be exposed to assembly languages as formally documented by CPU designers. By studying real-world processors, the differences between complex and reduced instruction set are illustrated. Students will study the use of assemblers, linkers, and loaders in the program creation process. Common executable file formats are studied as well as standard calling conventions used to interface assembly language functions with high order languages, viz. C, functions and operating system services. The theory of disassembly and tools for disassembling executable files are covered for the purpose of analyzing binary programs.

Prerequisite

CS3040 or Consent of Instructor.

Lecture Hours

3

Lab Hours

2

Course Learning Outcomes

The student will be able to:

  • Describe the programmer’s model of the Intel x86 64-bit processor architecture.
  • Describe the x86 instruction set architecture in terms of memory addressing modes, instruction classes, and data types.
  • Explain the toolchain and use the tools, i.e., assembler, disassembler, linker, debugger, and system-call tracer, to create executable programs from source code written in assembly language.
  • Describe different calling conventions that assembly programs use to interface with Linux system library and GNU C library.,
  • Create a set of library functions that use the C calling convention (cdecl) defined in the x86_64 Application Binary Interface (ABI) specification.
  • Develop an assembly program that mimics the Linux “cat” utility using basic terminal I/O operations.
  • Implement a command-line utility that uses operating systems services, i.e., process creation, file descriptor duplication, and socket I/O operations, to read and write data across network connections using the TCP protocol.