CS Exam 2 - Study Guide

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:11 AM on 4/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

14 Terms

1
New cards

Explain the difference between a macro and a function.

Macros copy past code and uses more space = less time. Functions reuse code and is only defined once = saves space and slower/more time.

2
New cards

Why or when should we use one over the other? (Macros v.s. Functions)

Functions is more portable and macros are limited to the file they are defined in.

3
New cards

Macros is good for _________

Low use procedure

4
New cards

Functions is good for _______

High use procedure

5
New cards

Why do we have a standard calling convention?

For portability and gives protection to data

6
New cards

What does it mean for a register to be preserved?

Save registers save the values before and after the function is called

7
New cards

Which registers do the first 6 integer arguments go in?

rdi, rsi, rdx, rcx, r8, r9

8
New cards

What are the integer registers?

RAX, RBX, RCX, RDX, RSI, RDI, RBP, RSP, R8, R9, R10, R11, R12, R13, R14, R15

9
New cards

What are the integer registers used for?

Integer arithmetic, addressing,indexing, and passing first 6 integer arguments

10
New cards

Where are arguments 7+ stored and how?

Arguments 7+ are placed on the stack because they are pushed right to left in a 8 byte slot for each one.

11
New cards

What is the integer register that gets the return value from a function?

RAX

12
New cards

What is the floating point register that gets the return value from a function?

xmm0

13
New cards

Explain in detail the 2 instructions that are required to implement linkage for functions.

call - push rip, jump to function definition

ret - pop rip

14
New cards

Explore top notes

note
APES Unit Review Packet
Updated 329d ago
0.0(0)
note
Cultural Psychology
Updated 170d ago
0.0(0)
note
Unit 4: Rhetorical Fallacies
Updated 1095d ago
0.0(0)
note
Chapter 10 Textbook
Updated 1175d ago
0.0(0)
note
The Columbian Exchange
Updated 1279d ago
0.0(0)
note
AP bio vocab quiz 6
Updated 1288d ago
0.0(0)
note
APES Unit Review Packet
Updated 329d ago
0.0(0)
note
Cultural Psychology
Updated 170d ago
0.0(0)
note
Unit 4: Rhetorical Fallacies
Updated 1095d ago
0.0(0)
note
Chapter 10 Textbook
Updated 1175d ago
0.0(0)
note
The Columbian Exchange
Updated 1279d ago
0.0(0)
note
AP bio vocab quiz 6
Updated 1288d ago
0.0(0)

Explore top flashcards

flashcards
LEC 9.3: Respirations | Vitals
24
Updated 331d ago
0.0(0)
flashcards
French Carnaval de Quebec
67
Updated 1141d ago
0.0(0)
flashcards
Interaction Design
93
Updated 821d ago
0.0(0)
flashcards
Exam 1
190
Updated 1147d ago
0.0(0)
flashcards
ENG Vocab 7-11
67
Updated 1145d ago
0.0(0)
flashcards
LEC 9.3: Respirations | Vitals
24
Updated 331d ago
0.0(0)
flashcards
French Carnaval de Quebec
67
Updated 1141d ago
0.0(0)
flashcards
Interaction Design
93
Updated 821d ago
0.0(0)
flashcards
Exam 1
190
Updated 1147d ago
0.0(0)
flashcards
ENG Vocab 7-11
67
Updated 1145d ago
0.0(0)