CS2422 Assembly Language and System Programming - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

CS2422 Assembly Language and System Programming

Description:

10. ???????????????. Schedule of Watergates at Control Center. ?? Watergates. 1. 2. 3. 4 ... For graphics folks: the DirectX and OpenGL shading languages ... – PowerPoint PPT presentation

Number of Views:168
Avg rating:3.0/5.0
Slides: 27
Provided by: kipir
Category:

less

Transcript and Presenter's Notes

Title: CS2422 Assembly Language and System Programming


1
CS2422 Assembly Languageand System Programming
  • Department of Computer Science
  • National Tsing Hua University
  • September 16, 2008

2
Announcement
  • Two sessions for this course
  • CS2422-01 (?????) Rm 234
  • CS2422-02 (?????) Rm 236

3
Course Administration CS2422-01
  • Instruction Medium English
  • ???? ???
  • Email spoon_at_cs.nthu.edu.tw
  • ??? ???739 ?? 31308
  • ??
  • ??? Email g962508_at_oz.nthu.edu.tw
  • ??? Email g9762562_at_oz.nthu.edu.tw
  • ??? Email g9762519_at_oz.nthu.edu.tw
  • ????
  • ??? (Tue) 1520-1710 ???(Thu) 1520-1610
  • ???? ???234
  • ???? www.cs.nthu.edu.tw/spoon/courses/CS242
    201.htm

4
Textbooks
  • Kip Irvine, Assembly Language for Intel-Based
    Computers, 5th ed.
  • Leland Beck, System Software
  • Using the first 4 chapters
  • Other good reference books
  • Patterson and Hennesey, Computer Organization
    and Design (not Intel-based, textbook of CS4100)
  • The Art of Assembly (freely available online)

5
Honor Code
  • University code will be followed strictly to
    handle the cheating in assignments and exams.
  • You are allowed (and in fact encouraged) to
    discuss the assignments, but the work must be
    your own.

6
Grading (Subject to Change)
  • 1. Program Assignments 60
  • 2. Mid-term exam. 20
  • 3. Final exam 20
  • Early bonus 2 each day early, up to two days
  • Late penalty -20 each day (or partial day) late
  • The instructor reserves the right to normalize
    (including shift and scale) the scores for the
    purpose of achieving fair grade distribution
    within the class or across classes

7
Whats Next?
  • Basic concepts
  • What is assembly language, assembly program,
    and assembler?
  • How are they related to computers?
  • Why this course?

8
????????? How to irrigate the fields/farms?
????(water channels)
??(reservoir)
9
???? (Water Channels)
10
???????????How to divide into areas for watering?
?? Watergate
11
???????????????Schedule of Watergates at Control
Center
12
??????????????? Schedule of Irrigation Areas for
Officer
13
???????????Commands from Officer for Irrigation
  • Start irrigation from 9/17
  • Irrigate ????? on 9/17
  • Irrigate ???????? on 9/18
  • Take turns to irrigates areas from 9/19 to 9/24
    irrigate ????? for one day,
    irrigate ????? for another day .
  • Irrigate?? on 9/25
  • (????????)
  • ??????????????
  • How irrigation relates to computers?

14
Computer Analogy
Machine code
10110110 11101010 01010111 11011011 00100111
15
Computer Analogy
?????? Schedule of Irrigation Areas
Assembly program
????? Schedule for Watergates
?????? Schedule of Irrigation Areas
?
16
Computer Analogy
?????? Commands from Officer
High-level Language Program
?????? Commands from Officer
?
17
Assembly Language
  • Machine language
  • Machine instructions direct instructions to the
    processor
  • A numeric language understood by the processor
  • Assembly language
  • Statements (instructions) in short mnemonics and
    symbolic reference, e.g. ADD, MOV, CALL, var1, i,
    j, that have a 1-to-1 relationship with machine
    instructions
  • Understood by human

18
From C to Assembly
C
x (ab) c
Assembly
MOV AX, a ADD AX, b MUL c MOV x, AX
C compiler
19
From Assembly to Binary
Assembly
MOV AX, a ADD AX, b MUL c MOV x, AX
Assembler
00000000101000010000000000011000
00000000100011100001100000100001
10001100011000100000000000000000
10001100111100100000000000000100
10101100111100100000000000000000
10101100011000100000000000000100
00000011111000000000000000001000
Machine code
20
Different Levels of Abstractions
temp vk vk vk1 vk1 temp
High Level Language Program
Compiler
  • MOV AX, a
  • ADD AX, b
  • MOV x, AX

Assembly Language Program
more elaborated later in Sec. 1-2 Virtual
Machine Concept
Assembler
0000 1001 1100 0110 1010 1111 0101 1000 1010 1111
0101 1000 0000 1001 1100 0110 1100 0110 1010
1111 0101 1000 0000 1001 0101 1000 0000 1001
1100 0110 1010 1111
Machine Language Program
Machine Interpretation
Control Signal
ALUOP03 lt InstReg911 MASK

21
Comparing Assembly to High-Level Languages
22
System Programming
  • Programming of system software
  • Programs that support operation of a computer
    itself, rather than any particular application
  • Examples text editor, compiler, loader or
    linker, debugger, macro processor, operating
    system, database management systems, .

23
System Programming
  • Assembler
  • A computer program to translate an assembly
    program into the processors object code
  • Translates assembly instruction mnemonics into
    opcodes, and resolves symbolic names for memory
    locations and other entities
  • Linker
  • A program that takes one or more objects
    generated by compilers/assemblers and assembles
    them into a single executable file
  • Loader
  • A program to load executables into memory,
    preparing them for execution and executing them
  • Usually a part of operating system

24
Whats Next?
  • Basic concepts
  • What is assembly language, assembly program,
    and assembler?
  • How are they related to computers?
  • Why this course?

25
Why This Course?
  • A great way to learn how a computer works
  • To talk in the languages of the processors
  • To see how a computer talks to other devices
  • To write very efficient code (size speed)
  • To build solid background for other courses
  • Computer Architecture, Compilers, Operating
    Systemsetc.

26
Even More Important Now
  • A few examples
  • The SOC (System-On-Chip) and embedded system
    trend
  • The era of ubiquitous computing
  • For graphics folks the DirectX and OpenGL
    shading languages
  • The hardware/software boundary is blurring
Write a Comment
User Comments (0)
About PowerShow.com