CS2640 Exam 2 Flashcards

Focus on Macros & Functions (19 cards)

1
Q

Labels

A

User-defined functions i.e. “main” or “doubleIt”
Used by programmer to refer to specific lines in the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Instructions

A

Typically followed by operand or address
add, sub

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Operands

A

Addresses
Holds data/info to be used by instruction. More than 1 may follow an instruction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Comments

A

For user reference.
Specifies the purpose of a segment of code,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

2 Pass Assembler

A

Pass 1: Analysis - goes thru program step by step to look for symbols and literals.
Pass 2: Synthesis/combination - puts together the symbols, literals, and opcodes to make a binary/object code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Symbols

A

Variables and labels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Literals

A

Constants

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Pass 1 - Analysis

A

Passes thru instructions in sequence looking for symbol addresses
Creates symbol table and literal table.
Keep track of location counter
Deals with pseudo operations i.e. macros and directives.
Error checking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Macros

A

Named subroutines that can be used more than once. Makes programming easier and more modular.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Directives

A

Configuration instructions for assembler i.e. malloc. Not a program instruction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Pass 2 - Synthesis

A

If no errors are found in pass one, the second pass assembles the code into object code.
Symbolic addresses are replaced w/ absolute addresses.
Symbolic opcodes are replaced with binary opcodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Memory vs Register Operands

A

Memory Operands have long-term storage and are byte addressed.
1 word takes up 4 address spaces (register is 32-bit and address stores 8-bits)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Big Endian

A

MSB is stored at smallest address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Little Endian

A

Little byte, little address.
MSB stored at largest address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Accessing registers is faster than accessing memory

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

lw and sw are necessary to complete operations on data stored in memory

17
Q

Registers should NOT be treated as variables

A

FALSE, always use registers for variables.

18
Q

addi and subi can be used to add/subtract constants

A

FALSE, subi does not exist. Addi a negative constant instead.