Assembly Language
Chapter 1: Basic Concepts

NTNU 組合語言

Back to Note Overview
Back to Assembly Language
tags: NTNU CSIE 選修 Assembly Language


1.1 Welcome to Assembly Language

  • Some representative types of applications
    • Business application for single platform
    • Hardware device driver
    • Business application for multiple platforms
    • Embedded systems & computer games

Comparing ASM to High-Level Languages

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

1.1.3 Section Review

1.2 Virtual Machine Concept

1.2.1 Section Review

  • Tanenbaum: Virtual machine concept
  • Programming Language analogy
    • Each computer has a native machine language (language L0) that runs directly on its hardware
    • A more human-friendly language is usually constructed above machine language, called Language L1
  • Programs written in L1 can run two different ways:
    • Interpretation
      • L0 program interprets and executes L1 instructions one by one
    • Translation
      • L1 program is completely translated into an L0 program, which then runs on the computer hardware

Virtual Machines

Translating Languages

  • English: Display the sum of A times B plus C
  • C++
    ​​​​ cout << A * B + C;
  • Assembly Language
    ​mov eax, A ​mul B ​add eax, C ​call WriteInt
  • Intel Machine Language
    ​A1 00000000 ​F7 25 00000004 ​03 05 00000008 ​E8 00500000

Specific Machine Levels

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • Level 4 - High-Level Language
    • Application-oriented languages
      • C++, Java, Pascal, Visual Basic . . .
    • Programs compile into Level 3(assembly language)
  • Level 3 - Assembly Language
  • Level 2 - Instruction Set Architecture (ISA)
    • Also known as conventional machine language
    • Executed by Level 1(Digital Logic)
  • Level 1 - Digital Logic
    • CPU, constructed from digital logic gates
    • System bus
    • Memory
    • Implemented using bipolar transistors

1.3 Data Representation

1.3.1 Binary Integers

  • Translating between binary and decimal
  • MSB - most significant bit
  • LSB - least significant bit

1.3.2 Binary Addition

沒什麼重點

1.3.3 Integer Storage Sizes

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

1.3.4 Hexadecimal Integers

  • Translating between decimal and hexadecimal

1.3.5 Hexadecimal Addition

1.3.6 Signed Binary Integers

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

1.3.7 Binary subtraction

1.3.8 Character Storage

Boolean Operations