CMSC 311 Exam 2 Flashcards

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

1/85

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:44 PM on 4/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

86 Terms

1
New cards

LC-3 Address Space (LC-3 Basics)

2¹⁶ = 65,536 memory locations

2
New cards

LC-3 Word Size (LC-3 Basics)

16 bits

3
New cards

Number of General Purpose Registers (LC-3 Basics)

8 (R0–R7), each 16 bits

4
New cards

Number of LC-3 Instructions (LC-3 Basics)

15

5
New cards

Instruction Size (LC-3 Basics)

16 bits

6
New cards

Opcode Size (LC-3 Basics)

4 bits

7
New cards

Opcode Behavior (LC-3 Basics)

Each opcode interprets operand bits based on its instruction type

8
New cards

Immediate Addressing (Addressing Modes)

Operand value is inside the instruction

9
New cards

Register Addressing (Addressing Modes)

Operand is stored in a register

10
New cards

PC-Relative Addressing (Addressing Modes)

Address = PC + offset

11
New cards

Indirect Addressing (Addressing Modes)

Instruction points to a memory location that contains the address

12
New cards

Base+Offset Addressing (Addressing Modes)

Address = Base register + offset

13
New cards

PC-Relative (Data Movement)

Used in LD/ST

14
New cards

Indirect (Data Movement)

Used in LDI/STI

15
New cards

Base+Offset (Data Movement)

Used in LDR/STR

16
New cards

NZP Flags (NZP)

Condition codes: Negative, Zero, Positive

17
New cards

NZP Behavior (NZP)

Set based on result of last operation

18
New cards

Purpose of NZP (NZP)

Used for conditional branching

19
New cards

Operate Instructions (Instruction Types)

Perform calculations (ADD, AND, NOT)

20
New cards

Data Movement Instructions (Instruction Types)

Load/store data

21
New cards

Control Instructions (Instruction Types)

Change program flow (BR, JMP)

22
New cards

Input/Output Instructions (Instruction Types)

Handle I/O (TRAP)

23
New cards

LD (Load Operations)

Loads from PC-relative address

24
New cards

LDI (Load Operations)

Loads from address found in memory (indirect)

25
New cards

LDR (Load Operations)

Loads using base register + offset

26
New cards

ST (Store Operations)

Stores to PC-relative address

27
New cards

STI (Store Operations)

Stores indirectly

28
New cards

STR (Store Operations)

Stores using base register + offset

29
New cards

Conditional Branch (Branching)

Depends on NZP flags

30
New cards

Unconditional Branch (Branching)

Uses all flags (BRnzp) or always executes

31
New cards

Label (Assembly)

Symbolic name representing a memory address

32
New cards

Pseudo-op (Assembly)

Instruction for assembler only (not machine code)

33
New cards

Purpose of Pseudo-ops (Assembly)

Help define data and structure program

34
New cards

.ORIG (Pseudo-ops)

Starting address

35
New cards

.END (Pseudo-ops)

End of program

36
New cards

.FILL (Pseudo-ops)

Stores a value in memory

37
New cards

.BLKW (Pseudo-ops)

Reserves block of memory

38
New cards

.STRINGZ (Pseudo-ops)

Stores string ending with x0000

39
New cards

Pass 1 (Assembly Process)

Assign addresses to labels

40
New cards

Pass 2 (Assembly Process)

Convert instructions to machine code

41
New cards

Why Two Passes? (Assembly Process)

Labels must be known before encoding

42
New cards

Assembly to Machine Code (Assembly Process)

Converts symbolic instructions into binary

43
New cards

Subroutine (Subroutines)

Reusable block of code

44
New cards

Caller (Subroutines)

Code that calls subroutine

45
New cards

Callee (Subroutines)

Subroutine being called

46
New cards

JSR (JSR vs JSRR)

Uses PC-relative addressing

47
New cards

JSRR (JSR vs JSRR)

Uses base register

48
New cards

Common Feature (JSR vs JSRR)

Both store return address in R7

49
New cards

RET (RET Instruction)

Returns using address in R7

50
New cards

Why ā€œFakeā€ (RET Instruction)

Actually implemented as JMP R7

51
New cards

Caller Save (Saving Registers)

Caller saves registers before call

52
New cards

Callee Save (Saving Registers)

Subroutine saves registers

53
New cards

Stack (Stack Basics)

LIFO (Last In First Out) structure

54
New cards

Stack Pointer (SP) (Stack Basics)

Points to top of stack

55
New cards

Where SP is Stored (Stack Basics)

Typically R6

56
New cards

Stack Behavior (Stack Basics)

Grows/shrinks via pointer, memory doesn’t move

57
New cards

Push (Stack Operations)

Decrement SP, store value

58
New cards

Pop (Stack Operations)

Load value, increment SP

59
New cards

Stack Overflow (Errors)

Stack exceeds memory bounds

60
New cards

Stack Underflow (Errors)

Removing from empty stack

61
New cards

String Format (Strings)

ASCII characters ending with x0000

62
New cards

Privilege (Privilege & Priority)

Level of access to system resources

63
New cards

Priority (Privilege & Priority)

Determines which interrupt is handled first

64
New cards

User Mode (Modes)

Limited access

65
New cards

Supervisor Mode (Modes)

Full system access

66
New cards

PSR (PSR)

Stores privilege bit, priority, condition codes

67
New cards

User Space (Memory Spaces)

Accessible by user programs

68
New cards

System Space (Memory Spaces)

Reserved for OS

69
New cards

Two Stacks (Stacks)

User stack + Supervisor stack

70
New cards

Each Stack (Stacks)

Has its own SP

71
New cards

Memory-Mapped I/O (I/O)

Devices accessed like memory

72
New cards

Polling (Polling)

Continuously checking device status

73
New cards

Why Inefficient (Polling)

Wastes CPU cycles

74
New cards

KBDR / DDR (Device Registers)

Hold input/output data

75
New cards

KBSR / DSR (Device Registers)

Status registers

76
New cards

Why System Calls Needed (System Calls)

User programs can’t directly access hardware

77
New cards

TRAP (TRAP Instruction)

Switches to supervisor mode and runs service routine

78
New cards

RTI (RTI Instruction)

Returns from interrupt, restores state

79
New cards

Interrupt-Driven I/O (Interrupts)

CPU reacts only when needed

80
New cards

Why Efficient (Interrupts)

No constant checking

81
New cards

Condition 1 (Interrupt Conditions)

Device requests interrupt

82
New cards

Condition 2 (Interrupt Conditions)

Interrupts enabled

83
New cards

Condition 3 (Interrupt Conditions)

Priority is high enough

84
New cards

INT Line Check (INT Line)

Checked after each instruction

85
New cards

If Active (INT Line)

Processor handles interrupt

86
New cards

Interrupted Program Awareness (Interrupts)

Program doesn’t know it was interrupted because state is restored

Explore top flashcards

flashcards
CĆ“ Yįŗæn 5/12/2024
22
Updated 480d ago
0.0(0)
flashcards
EXAM 2 - part 6
22
Updated 250d ago
0.0(0)
flashcards
Einheit 1 Freunde
75
Updated 229d ago
0.0(0)
flashcards
Biology Honors Evolution
51
Updated 1096d ago
0.0(0)
flashcards
Matiekos egzas
73
Updated 819d ago
0.0(0)
flashcards
Livy 2.10 Vocab
20
Updated 1215d ago
0.0(0)
flashcards
CĆ“ Yįŗæn 5/12/2024
22
Updated 480d ago
0.0(0)
flashcards
EXAM 2 - part 6
22
Updated 250d ago
0.0(0)
flashcards
Einheit 1 Freunde
75
Updated 229d ago
0.0(0)
flashcards
Biology Honors Evolution
51
Updated 1096d ago
0.0(0)
flashcards
Matiekos egzas
73
Updated 819d ago
0.0(0)
flashcards
Livy 2.10 Vocab
20
Updated 1215d ago
0.0(0)