Computer Organisation 2006
Assembly level programming
Prabhas Chongstitvatana
office: Engineering building 4, floor 18, room 13, phone
02-218-6982
Aim
Behavioural goals
Lecture note
Assessment
Reading
Tools
etc
What's new
7 July S2
ISA Assembly
language History
Example from the class
...
Aim
1. Discuss the basic components in a computer system
2. Teach one assembly language
Announcement
...
Assessment
Assembly language programming is 10% of the whole score
Lecture Note
1 Introduction
to computer organization
2 Abstraction level of assembly
language (from an assembly language programmer or compiler point of
view)
1.1 S2
ISA : addressing mode, instruction format
programmer's view
machine code (dec notation, hex
notation)
Register vs Memory
Jump
and Call
1.2 Writing an assembly level program
hand assemble
meta commands
symbolic names
1.3 Using
simulator and assembler of S2
3 Relationships
between a high level language and an assembly language
2.1 Assignment statements: Reg to Mem,
addressing
mode
2.2 Expression: Reverse
Polish
Operations
2.3 Control flow: if...then,
while loop
2.4 Function call: parameter
passing, local variables, call/return
More examples
on function call : fibonacci
2.5 Example from the class
Behavioural goals
- Students can write a short assembly language, for example, solve
arithmetic
expression, perform simple loop
- Students can write an assembly language corresponded to a given
simple
high level language program.
- Students can use tools such as an assembler, a simulator to
develop a
program
in an assembly language.
- Students can analyse and improve performance of a code sequence
in
assembly
level.
Reading
P. Chongstitvatana, Computer Architecture: A synthesis, 2001.
- Chapter
1 Introduction, performance, history
- Chapter
2 Instruction Set Architecture
- Chapter
3 Computer
arithmetic
Tools
S2 assembly level tools set
S2
assembler and simulator (executable) with some examples
S2 assembler and simulator (source code)
Homework to practice your skill
Write S2 assembly language programs for the following tasks:
1 Find maximum value of element in an array
2 Reverse the order of elements in an array
3 A subroutine to square a number
4 Count the occurrence of x in an array
5 Draw a circle by computing x,y that
satisfy x^2 + y^2 = r^2
6 Do GCD by Euclid method
7 Do some decision tree that composed of
nested if..then..else
last update 7 July 2006