CSCI 2122 - Systems Programming - final


  • 作业标题:CSCI 2122 - Systems Programming - final
  • 课程名称:Dalhouse University CSCI 2122 Systems Programming
  • 完成周期:1天

1. Final Topics

Note: The listing of topics below assumes that you have reviewed the notes, the
examples within, the posted videos of problems and the assignment solutions.

The final exam is comprehensive - it will cover the entire course.
For the list of topics before the Mid-Term test, please see mid-termTopicsW22
available on Brightspace under Content -> Assignments.

Short version of the rest:
The rest of the material is made up of most of Ch. 3 (Sec 3.1-3.10) and part of Ch.
6 (6.2-6.5) from the text. See examples in notes for depth. Expect questions on
final similar to ones worked out in lectures (and of course assignment problems -
the expecttions is that you will have, at least, read the solutions).

x86-64 Assembly:
x86-64 register set. Basics of assembly instructions like mov; Addressing modes and
their uses. Address computation and the lea instruction; difference between lea v/s
mov. Arithmetic and logic operations. Data movement suffixes (movb,
movs…movsbl…)

Control Flow: Condition codes, accessing condition codes, jump instructions.
Implementing If-else structures with conditional control (PP 3.16 - 3.18).
Conditional moves (limited to simple problems like PP3.21)
Implementing loops with conditional control (PP 3.24- 3.28):
**Should be able to reverse engineer C code from assembly code for

Array Allocation and Access.
All problem is text (some done in lecture).

Heterogenous Data Structures (Structs and Unions)
All problems, all sections.

Buffer Overflows
Pinciple of locality
(see problems solved in lecture)

Writing Cache Friendly Code:
Problems 6.12-6.20

2. Questions

2.1. Question 2 (4 points)

Write code with the following prototype:
int div_by_pow2(int x, int k);
Where, the code returns x 2

with correct rounding. You may only use assignment,~,<<,>>,^,|, &, +,-. For full
credit, do not assume the size of int.

2.2. Question 3 (4 points)

Write a C-expression that evaluates to 1 when:
(i) Any bit of int x is 0. (ii) When any bit in the LSByte is 1.

。。。


文章作者: IT神助攻
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 IT神助攻 !
  目录