اسمبلی، ساختار و زبان ماشین

ترم اول ۹۷-۹۸

Assembly and Machine Language
Fall 2018

Instructor:

Teaching Assistants:

References:

Tools and Platforms:

Schedule, Lectures and Course Material


Topic

slides & resources

Week 1

  • Introduction to Machine Language, Assembly Language and Applications

  • x86 Architecture, Processor History, Registers, 16bit, 32bit and 64 bit architectures and basic commands

Lecture 1- Slides


Lecture 2- Slides

Week 2

  • Object files, Libraries, The compiler and the Linker

  • Compiling C to assembly

  • Linking assembly and C

  • Writing standalone assembly programs under linux

  • Linking assembly with C

Lecture 3- Slides

Lecture 3- Files


Week 3

  • Binary, decimal, hex and octal numbers, conversion between them

  • Signed integers, two's complement

  • Carry & Overflow, the FLAGS Register,

  • Extending bit size

Lecture 4- Slides

Week 4

  • Unconditional Jump, conditional jumps, comparisons

  • Signed and unsigned Comparisons, Loop instructions

Lecture 5- Slides

Lecture 5- Files

Week 5

  • Working with memory, implementing global variables

  • Little endian vs Big endian systems

  • Multiplication and Division

Lecture 6- Slides

Lecture 6- Files



Lecture 7- Slides

Lecture 7- Files


Week 6

  • CPU clock & frequency, clock cycles, and instruction timing

  • Bit operations

    • Shift and rotate operations,

    • Bitwise AND, OR, NOT, XOR

    • the test command

Lecture 8- Slides

Lecture 8- Files


Week 7

  • Introduction to subprograms/functions

  • Indirect addressing, indirect jump

  • The stack, the stack segment, the stack pointer register (ESP), push and pop commands

  • Argument passing,

  • call and ret commands

  • indirect call, implementing pointers to functions

Lecture 9- Slides

Lecture 9- Files

Week 8

  • Calling conventions, calling conventions in C

  • Implementing local variables on stack

  • The base register (EBP)

Lecture 10- Slides

Lecture 10- Files


Week 9

  • Modular Programming in C and assembly

  • Interfacing assembly with C

    • Calling assembly routines from C

    • Calling C routines in assembly

    • the AT&T syntax

    • Inline assembly

Lecture 11- Slides

Lecture 11- Files


Lecture 12- Slides

Lecture 12- Files


Lecture 13- Slides

Lecture 13- Files

Week 10

  • Recursion

  • The C Preprocessor and Macros

  • Netwide assembler Macros and Preprocessor

  • Calling software interrupts

  • System Calls

Lecture 14- Slides

Lecture 14- Files


Lecture 15- Slides

Lecture 15- Files

Week 11

  • Implementing arrays

  • General indirect addressing

  • Load Effective Address

  • Implementing 2D, 3D and N-D arrays, row-major vs column-major implementation

Lecture 16- Slides

Lecture 16- Files



Lecture 17- Slides

Lecture 17- Files

Week 12

  • Segmentation

  • string instructions

  • Introduction to Interrupts

  • Software vs Hardware interrupts

  • Writing interrupt routines

Lecture 18- Slides

Lecture 18- Files

Week 13

  • Introduction to floating point

  • The coprocessor, 8087 register stack, floating point instructions

Lecture 19- Slides

Lecture 19- Files

Lecture 20- Slides

Lecture 20- Files

Week 14

  • Introduction to reverse engineering

    • x86 instruction format

    • self modifying code

    • disassembling

    • debugging and reassembling

Assembly - Lecture RevEng

Week 15

  • C compiler optimization

  • Short review of other topics

    • IN/OUT comprogrammingmands

    • Real-mode

    • SIMD; MMX, SSE, AVX and FMA Instruction sets



Homework List
Project List
Exam List

Previous Offerings

Assembly and Machine Language, Spring 1397 (2018)

Assembly and Machine Language, Fall 1396 (2017)