- Back to Home »
- Assembly Language (X86 -MASM) »
- Introduction to x86 Assembly Language
CIS-77 Home http://www.c-jump.com/CIS77/CIS77syllabus.htm
Introduction to x86 Assembly Language
- Advantages of High-Level Languages
- Why program in Assembly ?
- Here is why...
- Speed, Efficiency, Debugging, Optimization...
- Why MASM ?
- Introduction to 80x86 Assembly Language
- Materials on the Web
- Useful books, in no particular order
- Fundamental Concepts
- Software Environment
- Runtime Environment
- M1.ASM
- Assembly and C Code Compared
- More Assembly and C Code
- Assembly vs. Machine Language
- Controlling Program Flow
- Conditional Jumps
- General-Purpose Registers
- Typical Uses of General-Purpose Registers
- x86 Registers
- x86 Registers, Cont
- x86 Control Registers
- MOV, Data Transfer Instructions
- Ambiguous MOVes: PTR and OFFSET
- INC and DEC Arithmetic Instructions
- ADD Arithmetic Instruction
- ADD vs. INC
- SUB Arithmetic Instruction
- SUB vs. DEC
- CMP instruction
- Unconditional Jumps
- Conditional Jumps
- Conditional Jumps, Cont
- Conditional Jumps, Cont
- LOOP Instruction
- Logical Instructions
- Logical Instructions, Cont.
- Shift Instructions
- SHL and SHR Shift Instructions
- Shift Instructions Examples
- Rotate Instructions
- ROL and ROR, Rotate Without Carry
- RCL and RCR, Rotate With Carry
- EQU directive
- EQU Directive Syntax
Bristol Community College
Computer Information Systems Department
CIS-77 Home http://www.c-jump.com/CIS77/CIS77syllabus.htm
CIS-77 Introduction to Computer Systems
- Welcome!
- ________________________________________________________
- Posted Dec 29:
- Please make sure that your read carefully and
understand course policies and formats.
Catalog Description
This course is an introduction to major components of computer systems. The course introduces fundamental concepts of computing systems such as binary arithmetic and data representation, the Von Neumann model for processing computer programs, the operation of memory, instruction set, and machine and assembly language programming. It systematically presents the levels of transformations from machine language to assembly language to high-level language. The course studies the role of such systems software components as assemblers, compilers, linkers, loaders, and operating systems. The course has a strong project component. Three class hours and two lab hours per week.
Igor.Kholodov@bristolcc.edu
Office: K211
Telephone: 508-678-2811 ext. 3328
Course Objectives
Upon completion of this course, the students should be able to do the following:
- Identify and describe different types of computing machines
- Describe distinguishing components of Von-Neumann Architecture
- Describe how computing machines are organized internally
- Identify and explain the design trade offs between different computing machines
- Describe how computers perform calculations
- Understand principals of machine language and program in assembly.
- Describe the relation between high level languages and assembly.
- Define systematic sequence of transformations between layers of abstraction.
- Explain how bits and bytes are organized to represent data electronically.
- Describe how digital logic is used to build circuits to process information
- Indicate program organization in memory
- Understand program stack, stack frames, procedure calls, and parameters
Course Outline
- Week 1. Number systems, Bits, Data Types, and Operations.
- Presentation: Introduction to Computer Systems (handout)
- Presentation: Bits, Numbers, and Binary Data Representation (handout)
Assignment A01: Pages 17-20, Exercises 1.4, 1.9, 1.10, 1.15-17, 1.21 and 1.23
Reading: Textbook Chapters 1 and 2.
Week 2. Digital Logic Structures- Presentation: Digital Logic (handout)
- Presentation: Arithmetic Operations and Logical Functions (handout)
Lab L01: Pages 43-50, Exercises 2.10-11, 2.13-14, 2.17 (interpret bits as signed
numbers, use calculator, sign-extend to 8 or 16 bit quantities as necessary), 2.18-19, 2.30, 2.32-35, 2.43 and 2.45-50 (use calculator as necessary), 2.53-54
Reading: Textbook Chapter 3.
Week 3. Memory and Sequential Logic Circuits- Presentation: Storage Elements (handout)
- Presentation: Sequential Logic Circuits (handout)
Lab L02: Using Digital Works- Download: Digital Works
- Assignment A02: Pages 43-50, Exercises 2.1-3, 2.5, 2.8, 2.12, 2.15, 2.21 (hint:
refer to the "Overflow Condition" described in first week's lecture), 2.23. 2.27-29, and 2.31
Reading: Textbook Chapter 4.
Week 4. The Von Neumann Model- Presentation: The von Neumann Computer Model (handout)
Lab L03: Two's Complement Adder/Subtractor- Assignment A03: Pages 82-91, Exercises 3.1, 3.10, 3.13-14, 3.23, and 3.32
Reading: Intel Basic Architecture Volume 1, Chapter 2, Introduction to the Intel Architecture.
Week 5. Introduction to x86 Assembly Language- Presentation: Introduction to x86 Assembly Language (handout)
- Presentation: The Assembly Process (handout)
Discussion: Overflow Detection Circuits (handout)- Lab L04: Overflow Detector
- Assignment A04: Pages 111-114, Exercises 4.1-4, 4.5a, 4.5b.1, 4.5b.2, 4.5b.4, and 4.9.
Reading: Intel Basic Architecture Volume 1, Chapter 3, Basic Execution Environment.
Week 6. Instruction Set Architecture Design- Presentation: Instruction Format Design (handout)
- Presentation: Encoding Real x86 Instructions (handout)
- Presentation: The Instruction Cycle (handout)
Quick Reference: x86 Instructions by Opcode- Quick Reference: x86 Instructions by Mnemonic
- Quick Reference: Brief x86 Instruction Set Reference
Lab L05: Design of a 4-bit Magnitude Comparator- Assignment A05:
- Install Visual Studio.
- Use Visual C++ Development Environment (handout) to assemble and debug a do-nothing program M1.ASM
Reading: Intel Instruction Set Reference Volume 2, Chapter 2, Instruction Format.
Week 7. Language Components of MASM- Presentation: Language Components of MASM (handout)
Registers, EFLAGS, Addressing Modes, Effective Address.
Lab L06: Boolean Algebra Theorems and Sum of Products
Reading: Intel Instruction Set Reference Volume 2, Appendix B, Instruction formats and encodings.
- Presentation: Language Components of MASM (handout)
Week 8. Data Types and Memory Allocation- Presentation: Data Types and Memory Allocation (handout)
Endianness, Integer Formats, Copying Data.
Reference: Intel Volume 1, Basic Architecture in HTML format,
or download single 1.9 MB ZIP archive.- Reference: Intel Volume 2, Instruction Set Reference in HTML format,
or download single 4.2 MB ZIP archive.
Lab M07: Opcode Analysis using OllyDbg
- Presentation: Data Types and Memory Allocation (handout)
Week 9. CPU Flags and Data Manipulation- Presentation: CPU Flags and Data Manipulation (handout)
ADD, INC, SUB, DEC, NEG, Carry Flag, Overflow Flag, SHL, SHR, and SAR
Quick Reference: Intel Basic Architecture Volume 1,
Appendix A: EFLAGS cross-reference
Appendix B: EFLAGS condition codes
Lab M08: Console Input/Output (slide version)
- Presentation: CPU Flags and Data Manipulation (handout)
Week 10. Controlling Program Flow- Presentation: Controlling Program Flow (handout)
Lab M09: Data Arrays, Windows API Calls (slide version)
Week 11. Modes of Memory Addressing on x86 and Logical Segments- Presentation: Modes of Memory Addressing on x86 (handout)
Reading: Intel System Programing Guide Volume 3, Chapter 3, Protected-mode memory management.
Lab M10: Integer Arithmetic Part 1: High-speed Multiplication by Powers of 2 (slideversion)
Week 12. Memory Protection, Paging, and Memory Model Directives- Presentation: Memory Protection (handout)
- Presentation: Logical Segments and Memory Model Directives (handout)
Reading: Intel System Programing Guide Volume 3, Chapter 4, Memory protection.
Lab M11: Integer Arithmetic Part 2: Extended Precision Techniques (slide version)
Week 13. Instruction Operand Addressing on x86- Presentation: Instruction Operand Addressing on x86 (handout)
Reading: Intel Basic Architecture Volume 1, Chapter 5, Data Types and Addressing Modes.
Lab M12: Step-by-step execution analysis (slide version)
Week 14. The Program Stack and Procedures- Presentation: The Program Stack (handout)
- Presentation: Procedures (handout)
Reading: Intel Basic Architecture Volume 1, Chapter 4, Procedure Calls, Interrupts, and Exceptions.
Lab M13: Building Your Own Stack Machine, Final Project (slide version)
Week 15. Final Project Review
Required Text
Authors: Sanjay J. Patel, Yale Patt
Title: Introduction to Computing Systems: From Bits and Gates to C and Beyond. See also: Student Resources. Publisher: McGraw-Hill, 2nd Edition, 2004. ISBN-13: 9780072467505 ISBN-10: 0072467509 |
Reference Materials
- Reference: Intel Volume 1, Basic Architecture in HTML format (or 1.9 MB ZIP)
- Reference: Intel Volume 2, Instruction Set Reference in HTML format (or 4.2 MB ZIP)
- Quick Reference: x86 Instructions by Opcode
- Quick Reference: x86 Instructions by Mnemonic
- Quick Reference: Brief x86 Instruction Set Reference
File M00.zip contains DOS batch files that used in class to assemble small ASM programs. To build your program, simply drag and drop your ASM file on top of- _release_build.bat - to build a program.
- _debug_build.bat - to build a program with debug info;
Same ASM file in M00project.zip added to MSVC 2005 project, which can be used to to assemble, link, and debug the program.
Another MSVC 2005 project, M08project.zip, can be used as a starting point for M08lab, Console Input/Output.
OllyDbg Debugger for Microsoft Windows: a debugger that emphasizes binary code analysis. Download OllyDbg 1.10 (final version).
Any opinions, findings, conclusions, and recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation (NSF).