Machine Level and Systems Programming, ICS 312
This page is
http://www.ics.hawaii.edu/~esb/1998fall.ics312/index.html
Office is in POST 303B, telephone 956-3891, e-mail esb@hawaii.edu. Office hours are
Monday and Wednesday from 2pm to 3pm, or by appointment.
Office is in POST 305B, telephone 956-3487, e-mail sunx@hawaii.edu. Office hours are
Tuesday and Thursday from 3pm to 4pm.
Goals
In this course, students will:
- learn to program computers at the machine/assembly level.
- learn SPARC and Intel x86 (Pentium) assembly language programming.
- get an introduction to systems programs such as compilers and
debuggers.
Organization
This course has
- lectures
- homeworks (approximately 40% of the grade)
- pop quizzes (approximately 20% of the grade)
- midterm and final (each approximately 20% of the grade)
The exact grade assignment will be determined by the instructor at the
end of the course, but performance at the 90% level should be
sufficient for an A, and at the 80% level for a B.
Homeworks are generally assigned on Wednesday and due the
following Wednesday. Homeworks MUST be done individually unless
otherwise indicated. Pop quizzes will be at the beginning of class
and if missed cannot be made up.
There are two "textbooks" and one additional reference.
- (SPARC) "SPARC Architecture, Assembly Language Programming, and C", by
Richard P. Paul (Prentice Hall, 1994), available at the UH bookstore.
- (Vol. 2) "Intel Architecture Software Developer's Manual, Volume
2: Instruction Set Reference". This can be found at
http://developer.intel.com/design/pentium/MANUALS/243191.HTM or
purchased from the UH Duplicating Services in EQ 31C. If you download
from the web, please note the following:
- DO NOT print the manual on ICS printers -- you will be subject to
penalties for the inappropriate use of printers. ITS in Keller Hall
provides printing facilities in which you can use your own paper.
- check the legal notice before downloading. I am not a lawyer,
but as I understand it, downloading for personal use and instruction
is permitted.
- (Vol. 1) We will also be using Chapter 3 from the "Intel
Architecture Software Developer's Manual, Volume 1: Basic
Architecture" ,
http://developer.intel.com/design/pentium/MANUALS/243190.HTM .
The same notes apply as for Volume 2.
- An assembler for the PC can be found
here
(look at the end of the web page).
The course meets MWF at 10:30-11:20am in Watanabe 112.
Tentative Schedule
This schedule is subject to change. In general, for Chapters 3-13, we
will be learning the SPARC and the Intel architectures in parallel.
Overheads from the lectures are in two equivalent formats: dvi and
html. Html should be compatible with any browser you choose to use.
Follow this
link for help on displaying DVI files.
- Aug 24. Introduction. Calculators. SPARC pages 1-9.
Overheads: dvi, html,
- Aug 26. Computer Architectures. SPARC pages 17-32.
Overheads: dvi, html,
Homework (Due Sep 2nd): Exercises 1-9 and 1-10. Turn in hardcopy of C source,
input, and output. Also, sign up to ICS312-L by sending mail to
listproc@hawaii.edu with the body "subscribe ICS312-L your name".
- Aug 28. Macro processors and Assemblers. SPARC pages 9-17 and 32-39.
Overheads: dvi, html.
- Aug 31. SPARC architecture: registers, pipelining. SPARC pages 43-54.
Overheads: dvi, html.
- Sep 2. SPARC architecture: delay slots, branches, and gdb. SPARC
pages 54-66.
Overheads: dvi, html.
Homework (Due Sep 9th): Exercises 2-1 and 2-6. Turn in hardcopy of
m4/assembler source and the answer to 2-6 (the first value of x,
between 10 and 0, for which y = 0).
- Sep 4. SPARC architecture: control statemements. SPARC pages 66-78.
Overheads: dvi, html.
- Sep 9. Intel Architecture: overview, general-purpose registers.
Vol. 1, pages 3-1 to 3-7.
Overheads: dvi, html.
Homework (Due Sep 16th): Exercise 2-4. Turn in hardcopy of
m4/assembler source and state whether you were able to get your
program to work satisfactorily.
- Sep 11. Intel Architecture: special-purpose registers, data types.
Vol. 1, pages 3-7 to 3-15.
Overheads: dvi, html.
- Sep 14. Intel Architecture: operands. Vol. 1, pages 3-7 to 3-15.
Number Bases: SPARC pages 81-89.
Overheads: dvi, html.
- Sep 16. ASCII. Bit-wise logical operations. Binary Addition.
SPARC pages 89-103.
Homework (Due Sep 23rd): Exercise 3-4, 3-5, 3-7. (Note for 3-5, convert
6709 to hex, showing your work; for 3-7, convert 372 and 281 to base
3, subract them, and convert the result back to decimal, showing your work.)
Overheads: dvi, html.
- Sep 18. Intel assembler, complement representation, arithmetic.
SPARC pages 103-107.
Overheads: dvi, html.
- Sep 21. Signed and Unsigned tests, Multiplication
SPARC pages 106-117.
Overheads: dvi, html.
- Sep 23. Division, Extended Arithmetic.
SPARC pages 118-128.
Overheads: dvi, html.
Homework (Due Oct 7th).
- Sep 25. The stack.
SPARC pages 129-139.
Overheads: dvi, html.
- Sep 28. Stack Usage, Arrays.
SPARC pages 139-156.
Overheads: dvi, html.
- Sep 30. Multidimensional Arrays. Multiplication by constants.
SPARC pages 159-167.
Overheads: dvi, html.
- Oct 2. Structures. Tagged arythmetic and tagged types.
SPARC pages 168-177.
Overheads: dvi, html.
- Oct 5. Subroutine calls.
SPARC pages 177-206.
Overheads: dvi, html.
- Oct 7. Subroutine calls continued.
SPARC pages 177-206.
Overheads: dvi, html.
Homework (Due Oct 14th): Exercises 5-3, 5-6, 6-5, 7-9 (for 7-9, the
book doesn't specify explicitly, so use m4+assembly).
- Oct 9. Subroutine calls continued. Intel subroutine calls.
Intel, instructions CALL, RET, PUSH, POP, PUSHA, PUSHD.
Overheads: dvi, html.
- Oct 12. Review.
Overheads: dvi, html.
- Oct 14. Midterm.
- Oct 16. Chapter 8: machine code. Format one, format three instructions.
Overheads: dvi, html.
Homework (Due Oct 23rd): Exercise 7-9 for the Intel.
- Oct 19. Chapter 8: machine code. Format two, branch, sethi.
Overheads: dvi, html.
- Oct 21. Chapter 9: SPARC segments.
Overheads: dvi, html.
- Oct 23. Chapter 9: switch statements, linking, relocation, makefiles,
command line arguments.
Overheads: dvi, html.
Homework, due Wednesday, November 4th: exercises 8-1, 9-4 on the SPARC,
9-4 on the Intel (for the Intel, you may use constants for the numbers, you
do not need to read them from the command line), and exercise 9-2.
- Oct 26. Chapter 10: devices, programmed I/O, interrupts.
Overheads: dvi, html.
- Oct 28. Chapter 10: Unix and Intel I/O.
Overheads: dvi, html.
- Oct 30. Intel I/O.
Chapter 11: floating point number representation.
Overheads: dvi, html.
- Nov 2.
Chapter 11: floating point coprocessors.
Overheads: dvi, html.
- Nov 4.
Chapter 11: floating point formats and operations, SPARC and Intel.
Chapter 12: processor state.
Homework, due Friday, November 13th: exercise 11-3 on the SPARC.
Overheads: dvi, html.
- Nov 6.
Chapter 12: traps and exceptions.
Overheads: dvi, html.
- Nov 9. Chapter 13: SPARC virtual memory: virtual to physical translation.
Overheads: dvi, html.
- Nov 13. Chapter 13: SPARC virtual memory: translation lookaside buffer,
cache, context switches.
Overheads: dvi, html.
Homework (Due Nov 30th).
- Nov 16. Chapter 14: context switch, PDP-11 architecture.
Overheads: dvi, html.
- Nov 18. Chapter 14: VAX-11 architecture.
Overheads: dvi, html.
- Nov 20. Chapter 14: MIPS architecture. Operating Systems introduction.
Overheads: dvi, html.
- Nov 23. Operating Systems: scheduler basics
Overheads: dvi, html.
- Nov 25. Operating Systems: specialized schedulers
Overheads: dvi, html.
- Nov 30. Operating Systems: resource management
Overheads: dvi, html.
- Dec 2. Operating Systems: context switch, resource protection
Overheads: dvi, html.
- Dec 4. Operating Systems: resource protection, I/O, and APIs
Overheads: dvi, html.
- Dec 7. Operating Systems: Unix API, buffering, course evaluation
Overheads: dvi, html.
- Dec 9. Review
Overheads: dvi, html.
- Dec 18, 9:45am - 11:45am, final exam.
Feedback
I appreciate feedback! Please send me mail at esb@hawaii.edu with any comments, or
if you notice any mistakes, or if you have problems accessing any of
these links.