Machine Level Programming
FIT-ISUAcad. year: 2018/2019
Numeral systems: signed and unsigned integer binary representation, binary arithmetic, real numbers in the IEEE-754 format. Assembly language: assembler, basic functions of a central processing unit (CPU). Specific CPU architecture: registers, memory organization, addressing, interrupt system, coprocessors, instruction set and instruction format. Programming in assembler: common control structures, compilation and linking of the code. Relation to the high level programming languages: calling conventions, operating system services. Coprocessor: real number format, instruction set, programming of the floating point unit.
Learning outcomes of the course unit
Students acquaint with one specific processor architecture. They learn how to use the most important instructions of the processor and its coprocessor, programming of the control structures and they develop learn to develop simple applications (compilation and linking). They learn about calling conventions, some basic operating system services and how to call them. They learn how to practically use this knowledge.
Students learn about processor architecture form the low level programming point of view, which is one of the very basic skills of an IT professional. They learn how to develop simple applications or libraries in assembler and how to connect them to high level programming language applications.
Basic knowledge of the C language programming.
Recommended optional programme components
Recommended or required reading
- Marek, R.: Assembler pro PC - učíme se programovat v jazyce, Computer Press, 2003, ISBN 80-7226-843-0
- Carter, P.: Assembly language tutorial, http://www.drpaulcarter.com/pcasm/, 2002
- Intel Architecture Software Developer's Manual,Volume 2: Instruction Set Reference https://www.fit.vutbr.cz/study/courses/IAS/private/24319102
- The Netwide Assembler: NASM, Quick reference Guide, 2012, http://www.nasm.us/xdoc/2.10.05/nasmdoc.pdf
Planned learning activities and teaching methods
Assesment methods and criteria linked to learning outcomes
- mid-term written test
- tests in computer exercises
At least 20 points earned during semester.
To successfully pass the course students must earn at least 25 points from the final examination.
Language of instruction
- Syllabus of lectures:
- Introduction, numerical systems, arithmetic.
- Machine code (language), assembly language, assembler.
- Real mode of Pentium processors: registers, operands, instruction formats, memory addressing, interrupts.
- Pentium processor instruction set. Integer instructions.
- Integer instructions, continuation.
- Integer instructions, continuation.
- Principles of programming in machine language, typical control constructions.
- Assembly language.
- Assembly language, continuation.
- Modules, libraries, operational system services. Procedures and functions, standard control transfer and passing of parameters.
- FPU of Pentium processors.
- FPU instruction set.
- Principles of symbolic language programming.
- Simple programs in assembly language.
- NASM assembler and LINK linker.
- Operation system services. Programming of PC peripherals.
- Standard control transfer and passing of parameters in procedures and functions.
- Individual more complex programs.
- FPU programming.
Syllabus of computer exercises:
To acquaint students with computer programming at the lowest level with focus at chosen processor architecture. To introduce and teach how to actively work with numeral systems, representation of the signed and unsigned numbers, arithmetic in the binary numeral system and representation of the real numbers. To familiarise with a specific processor architecture, its instruction format and addressing modes. To teach to actively work with the common control structures in assembler using given instruction set. To show connection of programming at low level and high level programming via libraries and operating system services. To teach how to use floating point unit to calculate with real numbers.
Specification of controlled education, way of implementation and compensation for absences
- tests in the computer exercises missed by a valid proved reason (health issues or other valid reasons) will be compensated within the next computer exercise or another date set by the guarantor of the course
Type of course unit
39 hours, optionally
Teacher / Lecturer
- Introduction, numeral systems, number specification, binary arithmetic.
- Basic functions of a processor, machine language, symbolic language, assembler.
- Processor architecture - registers, operand, instruction format, memory addressing, interrupts.
- Processor architecture - transfers, arithmetical and logical instructions.
- Processor architecture - shifts and rotations, control transfer.
- Processor architecture - other instructions.
- Mid-term written test.
- Basics of low level programming, elementary control structures.
- Functions and calling conventions.
- Modular programming, libraries, operating system services.
- Coprocessor FPU - architecture, real number format, instruction set.
- Coprocessor FPU - instruction set, programming, examples.
- Compiler for assembler - pseudoinstructions, directives, expressions, operators, operands and macros.
Exercise in computer lab
26 hours, compulsory
Teacher / Lecturer
- Numeral systems (numeral system conversions), number representation (signed integers).
- Compilation, linking and execution of an application in a command line environment. Debugging in an Integrated Development Environment (IDE) and in a standalone debugger.
- Working with registers and memory (variables, arrays).
- Arithmetical instruction.
- Logical instructions, shifts and rotations, jump instructions.
- Function calling and parameter passing via registers. Library for basic input/output operations.
- Basic control structures (if-then-else, while, do-while, for, switch-case).
- String instructions for array manipulation.
- Function calling and calling conventions. Calling of services and functions of the operating system, calling of functions from the high level language libraries.
- Programming of the FPU coprocessor.
eLearning: currently opened course