-
10
pages
-
English
-
Documents
Description
Crash Course in C and assembly(v.2006-08-04)Zeljko VrbaThese notes are intended to serve as coding guidelines for the Operating Systems course at theUniversity of Oslo. The text focuses on subjects that students have most trouble with while codingtheir solutions.1 Introduction 1 D. E. Knuth: “Premature optimization is2 Variables 2 the root of all evil (or at least most of it) in3 Calling convention 3 programming.” You are graded for cor-4 Pointers. 4 rectness, NOT performance! Leave all5 Bit- elds 5 optimizations for the competition.6 Arrays 57 Ring bu er 6 Do not do more than is required by the as-8 Linked lists 6 signment. Always try to nd out the min-9 Bit-vector 8 imum needed to correctly accomplish the10 Inline assembler 8 assignment task. Less code – less de-11 Memory operands. 9 bugging. Code for fun onlyafter you have12 Literature 9 completely implemented the assignment. Do not use inline assembly unless you abso-lutely have to (and you don’t). If you still1 Introductionthinkthatyouabsolutelydoneedit, youareprobablytryingtodosomethingcontrarytoA word of warning: these notes are not a “cod-the previous points.ing cookbook”. There is very little code thatcan be directly used in the projects, and the ex- Use pointers instead of integers to deal withplanationsareoftenverybriefand, fortheinex-memory addresses.perienced C programmer, insucient for thor-ough understanding of the matter at hand. Error-checking is important, ...
-
Publié par
-
Langue
English