CSE 2421 Final Exam Review

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/136

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

137 Terms

1
New cards

A 64 bit register the CPU uses to put addresses for memory accesses on the address bus

Memory Address Register (MAR)

2
New cards

A 64 bit register which the CPU uses to put data on the data bus for writes, or to retrieve data from the data bus for reads from memory

Memory Data Register (MDR)

3
New cards

A collection of intertwined hardware and systems software that must cooperate in order to achieve the ultimate goal of running application programs

System

4
New cards

A directive needed by the linker for symbol resolution, followed by the name of the function

.globl

5
New cards

A logic element that does not store state, the output depends only on the current input

Combinatorial Logic Element

6
New cards

A logic element that is capable of storing state, has memory and can store prior states

Sequential (clocked) Logic Element

7
New cards

A method of optimizing a processor by predicting what instructions will be computed next

Speculative execution

8
New cards

A requirement of the x86-64 ABI, should be satisfied prior to any call.

stack alignment

9
New cards

A value too large for representation

overflow

10
New cards

A value too small to be represented, not as serious because it's comparable to a loss of precision, which can be approximated by zero.

underflow

11
New cards

Address displacement syntax

displacement (src, index, scale)

12
New cards

Adds first argument to second argument

add

13
New cards

Allows a name to be assigned to the assembly language source code file

.file

14
New cards

Arithmic logic unit, sets the condition flags

ALU

15
New cards

.byte data size

1 byte (byte)

16
New cards

Changes or sets the current section to the data section

.data

17
New cards

Changes or sets the current section to the text (or code) section

.text

18
New cards

changing a given bit pattern to a related one

Data Transformation

19
New cards

Computes address math, does not touch memory or affect condition codes

lea

20
New cards

Computes bitwise NOT

not

21
New cards

Computes bitwise OR

or

22
New cards

Computes bitwise XOR

xor

23
New cards

Computes biwise AND

and

24
New cards

Data called by the program that is likely to be called again, EX: indexes in for loops

Temporal Locality

25
New cards

Do displacements require dollar signs?

No

26
New cards

Does the stack grow towards higher or lower addresses?

Lower

27
New cards

Dynamic Ram, slow memory dense needs constant refresh

DRAM

28
New cards

faster than addq one

inc

29
New cards

faster than subq one

dec

30
New cards

Holds static variables in the file scope

Heap

31
New cards

How do you access a member of a structure?

use leaq to find the address, imulq may be needed

32
New cards

How do you access an array that is a member of a structure?

use leaq to find the address, displacement is needed for index

33
New cards

How do you allocate space on the stack?

Subtract from rsp

34
New cards

How do you call malloc in assembler?

put size in rdi and call malloc

35
New cards

How do you go to the value that a memory expression points to in x86-64 ASM?

Use () (this is a memory reference)

36
New cards

How does call figure out what the return address is?

call pushes the return address of the next call instruction

37
New cards

How does lea compute addresses?

lea uses displacement(base,index,scale) formula

38
New cards

How does someone allocate space on the stack?

Move the stack pointer (subq $40, %rsp)

39
New cards

How many registers are in a 64 bit architecture?

16

40
New cards

If a particular piece of data is accessed, nearby addresses are also likely to be accessed. Ex: arrays

Spatial Locality

41
New cards

If we don't ______, we don't know what.

Measure

42
New cards

If we don't ______, we don't know where.

Profile

43
New cards

In what order are multidimensional (nested) arrays created?

Row major order

44
New cards

increment a register

inc

45
New cards

Keeps track of what instruction being executed

Program Counter (PC)

46
New cards

Keyboards, mouse, etc

I/O Devices

47
New cards

Larger memory sizes take more time to access and vice versa.

Memory Hierarchy

48
New cards

.long data size

4 bytes (.long)

49
New cards

Memory that can maintain its value without power

Non-Volatile Memory

50
New cards

Moves a value onto the stack, subtracts quad value to rsp

push

51
New cards

moving data from one system component to another, or within a given component

Data Movement

52
New cards

movq %rsp, %rbp; pop %rbp

leave

53
New cards

Needed by the linker to identify the label as one associated with a function, as opposed to data

.type

54
New cards

Needed by the linker to identify the size of the text for the program

.size

55
New cards

older version of call, not really all that useful because it's slower than other instructions that do the same thing

enter

56
New cards

opcode conditional move

cmov

57
New cards

opcode for unconditional jump

jmp

58
New cards

opcode to jump when equal

je

59
New cards

opcode to jump when not equal

jne

60
New cards

opcode to move and sign extend as it moves

movs

61
New cards

opcode to move and zero extend as it moves

movz

62
New cards

opcode to move data from one register to another

mov

63
New cards

opcode to shift in the sign bit

sar

64
New cards

opcode to shift left

shl

65
New cards

opcode to shift right, add in 0's

shr

66
New cards

Parameter order for registers

rdi, rsi, rdx, rcx, r8, r9

67
New cards

.quad data size

8 bytes (q)

68
New cards

Registers that push values to the stack to be used later

callee-saved register

69
New cards

Removes a value from the stack, adds quad value to rsp

pop

70
New cards

Scratch pad register that will get trashed at function calls

caller-saved register

71
New cards

Sets the flags for SF, ZF, and PF, discards result of bitwise AND

test

72
New cards

Sets the flags, subtracts first argument from second argument

cmp

73
New cards

Similar to preprocessor directives in C, provides information helpful to execution of the file

Assembler Directives

74
New cards

Specifies that the characters enclosed in quotation marks are to be stored in memory, terminated by a null byte

.string

75
New cards

Specifies that the following data is to be placed in the read only memory portion of the executable

.rodata

76
New cards

Static ram, fast, memory intensive

SRAM

77
New cards

Storage held within processor

Cache

78
New cards

storing digital data in a form which balances considerations of cost, reliability, and access speed

Data Storage

79
New cards

Subtracts first argument from second argument

sub

80
New cards

Temp storage for applications being exceuted. SRAM and DRAM

Main Memory

81
New cards

The abstraction of hardware, what our software must comply with

Instruction Set Architecture (ISA)

82
New cards

The execution of a computer program using one or more threads

Process

83
New cards

The style used for floating point math

IEEE 754

84
New cards

This file format combines .o, .out, and .so into a single linking file

Executable Linkage Format (ELF)

85
New cards

This is used by the OS to manage each process in the system

Process Control Block (PCB)

86
New cards

This kind of memory storage is used for the stack, does not allow for direct memory access.

LIFO storage

87
New cards

This makes the specified section the current section

.section (this is important!!)

88
New cards

This register keeps track of the current instruction

Instruction Register (IR)

89
New cards

This storage location has no direct memory access

Stack

90
New cards

Transfers control to a function, uses the parameters in the parameter registers to execute the function as needed

call

91
New cards

Transfers control to the return address located on the stack. This address is usually placed on the stack by a call instruction. This transfers control to the calling function at the instruction following the call.

ret

92
New cards

transfers data between system components or within system components

Bus

93
New cards

This opcode is used for scales not in 1, 2, 4, or 8 bytes.

imul

94
New cards

We have a struct s with members:

{

char name[23];

int age;

int stuff[2];

double height;

int friends;

}

What's the size of the struct?

56 bytes

95
New cards

What are the stack housekeeping calls after a function body is executed?

leave, ret

96
New cards

What are the stack housekeeping calls before a function body is executed?

pushq %rbp, followed by movq rsp, rbp. this makes our stack frame

97
New cards

What coding style is pipeline friendly?

branchless code

98
New cards

What do you have to do with rax before using printf?

set rax to 0 because of floating points, printf

99
New cards

What do you have to do with rax before using scanf?

set rax to 0 because of floating points, scanf

100
New cards

What does the CF flag do?

carry flag. for carrying bits