Unit 3 Flashcards

1
Q

The vocabulary of commands understood by a given architecture

A

Instruction set

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

The idea that instructions and data of many types can be stored in memory as numbers and thus be easy to change, leading to the stored-program computer.

A

Stored-program concept

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

The sum of b and c is placed in a

A

ADD a, b, c

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

Similarly to the add instruction, blank computes b - c and puts the result in a

A

SUB a, b, c

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

C, or Java, or Legv8 - requires most lines of source code

A

Legv8

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

C, or Java, or Legv8 - requires 2nd most lines of source code

A

C

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

C, or Java, or Legv8 - requires least lines of source code

A

Java

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

LEGv8 operands how many fast data registers

A

32 registers X0…X30, XZR

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

LEGv8 operands how many memory doublewords

A

262 memory doublewords Memory[0], Memory [4], …, Memory[4,611,686,018,427,387,904]

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

assembly language for X1 = X2 + X3

A

ADD X1, X2, X3

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

assembly language X1 = X2 - X3

A

SUB X1, X2, X3

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

assembly language X1 = X2 + 20

A

ADDI X1, X2, 20

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

assembly language X1 = X2 - 20

A

SUBI X1, X2, 20

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

assembly language X1 = Memory[X2 + 40]

A

LDUR X1, [X2, 40]

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

assembly language Memory[X2 + 40] = X1

A

STUR X1, [X2, 40]

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

assembly language X1 = X2 & X3

A

AND X1, X2, X3

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

assembly language X1 = X2 | X3

A

ORR X1, X2, X3

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

assembly language X1 = X2 ^ X3

A

EOR X1, X2, X3

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

assembly language if (X1 == 0) go to PC + 4 + 100

A

CBZ X1, 25

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

assembly language if (X1 != 0) go to PC + 4 + 100

A

CBNZ X1, 25

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

assembly language if (condition true) go to PC + 4 + 100

A

B.cond 25

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

assembly language go to PC + 4 + 10000

A

B 2500

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

assembly language go to X30

A

BR X30

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

assembly language X30 = PC + 4; PC + 4 + 10000

A

BL 2500

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
A natural unit of access in a computer, usually a group of 32 bits.
Word
26
The size of a register in the LEGv8 architecture is blank
64 bits
27
Another natural unit of access in a computer, usually a group of 64 bits; corresponds to the size of a register in the LEGv8 architecture.
Doubleword
28
One major difference between the variables of a programming language and registers is the limited number of registers, typically blank on current computers, like LEGv8
32
29
A very large number of registers may blank the clock cycle time simply because it takes electronic signals longer when they must travel farther.
increase
30
A command that moves data between memory and registers.
Data transfer instruction
31
A value used to delineate the location of a specific data element within a memory array.
Address
32
The data transfer instruction that copies data from memory to a register is traditionally called blank.
load
33
The U in LDUR stands for blank as opposed to scaled immediate, which we explain in COD Section 2.19 (Fallacies and Pitfalls).
unscaled immediate
34
In an LDUR instruction, a blank is the starting address of an array in memory
base address
35
A blank is a register that holds an array's base address
base register
36
A blank is a constant value added to a base address to locate a particular array element.
offset
37
Since LEGv8 addresses each byte, doubleword addresses are multiples of blank: there are blank bytes in a doubleword.
8
38
The instruction complementary to load is traditionally called blank
store
39
A requirement that data be aligned in memory on natural boundaries.
Alignment restriction
40
The process of putting less frequently used variables (or those needed later) into memory is called blank.
spilling registers
41
Also called binary bit. One of the two numbers in base 2, 0 or 1, that are the components of information.
Binary digit
42
The rightmost bit in an LEGv8 doubleword.
Least significant bit
43
The leftmost bit in an LEGv8 doubleword..
Most significant bit
44
Of a doubleword's 64 bits, what is the leftmost bit numbered
63
45
What is the largest base ten number representable in 4 bits (assuming the "natural" representation)?
15
46
What is the largest base ten number representable in 8 bits (assuming the "natural" representation)?
255
47
What is the largest base ten number approximately representable by 32 bits (assuming the "natural" representation)?
4 billion
48
How is the largest base ten number representable by 64 bits calculated (assuming the "natural" representation)?
2^64 - 1
49
Hardware can be designed to add, subtract, multiply, and divide these binary bit patterns. If the number that is the proper result of such operations cannot be represented by these rightmost hardware bits, blank is said to have occurred.
overflow
50
A blank is a signed number representation where a single bit is used to represent the sign, and the remaining bits represent the magnitude.
sign and magnitude representation
51
A signed number representation where a leading 0 indicates a positive number and a leading 1 indicates a negative number. The complement of a value is obtained by complementing each bit (0 → 1 or 1 → 0), and then adding one to the result (explained further below).
Two's complement
52
Signed versus unsigned applies to loads as well as to arithmetic. The function of a signed load is to copy the sign repeatedly to fill the rest of the register, known as a blank.
sign extension
53
A notation that represents the most negative value by 10 … 000two and the most positive value by 01 … 11two, leaving an equal number of negatives and positives but ending up with two zeros, one positive (00 … 00two) and one negative (11 … 11two). The term is also used to mean the inversion of every bit in a pattern: 0 to 1 and 1 to 0.
One's complement
54
A notation that represents the most negative value by 00 … 000two and the most positive value by 11 … 11two, with 0 typically having the value 10 … 00two, thereby biasing the number such that the number plus the bias has a non-negative representation.
Biased notation
55
How is 0 represented in two's complement?
All 0's
56
A machine instruction is composed of blank, each field having several bits and representing some part of the instruction.
fields
57
A form of representation of an instruction composed of fields of binary numbers.
Instruction format
58
Binary representation used for communication within a computer system.
Machine language
59
How many total bits is a machine instruction?
32
60
Numbers in base 16.
Hexadecimal
61
The field that denotes the operation and format of an instruction.
Opcode
62
A blank is a register that receives the result of an operation.
destination register
63
ADD is an blank instruction with 5 fields: opcode, Rm, shamt, Rn and Rd.
"R-type"
64
ADDI and SUBI is an blank rather than "R-type" instruction.
"I-type" (I for immediate)
65
DUR and STUR are blank with op2 as an extension of the opcode field.
"D-type" formats
66
Today's computers are built on what two key principles:
Instructions are represented as numbers. Programs are stored in memory to be read or written, just like data.
67
Instructions are represented as numbers. Programs are stored in memory to be read or written, just like data. These principles lead to the blank
stored-program concept
68
blank can contain the source code for an editor program, the corresponding compiled machine code, the text that the compiled program is using, and even the compiler that generated the machine code.
memory
69
One consequence of instructions as numbers is that programs are often shipped as files of binary numbers. The commercial implication is that computers can inherit ready-made software provided they are compatible with an existing instruction set. Such blank often leads industry to align around a small number of instruction set architectures.
"binary compatibility"
70
LSL
shift left
71
<<
LSL
72
LSR
shift right
73
>>
LSR
74
&
AND, ANDI
75
|
ORR, ORRI
76
~
NOT, EOR, EORI
77
A blank moves all the bits in a doubleword to the left or right, filling the emptied bits with 0s.
shift
78
Shifting left by i bits gives the same result as blank by 2^i
multiplying
79
A logical bit- by-bit operation with two operands that calculates a 1 only if there is a 1 in both operands.
AND
80
As you can see, AND can apply a bit pattern to a set of bits to force 0s where there is a 0 in the bit pattern. Such a bit pattern in conjunction with AND is traditionally called a blank, since the mask "conceals" some bits.
mask
81
A logical bit-by-bit operation with two operands that calculates a 1 if there is a 1 in either operand.
OR
82
A logical bit-by-bit operation with one operand that inverts the bits; that is, it replaces every 1 with a 0, and every 0 with a 1.
NOT
83
A logical bit-by-bit operation with two operands that calculates the exclusive OR of the two operands. That is, it calculates a 1 only if the values are different in the two operands.
EOR
84
This instruction means go to the statement labeled L1 if the value in register equals zero. The mnemonic CBZ stands for compare and branch if zero.
CBZ register, L1
85
It means go to the statement labeled L1 if the value in register does not equal zero. The mnemonic CBNZ stands for compare and branch if not zero. These two instructions are traditionally called conditional branches.
CBNZ register, L1
86
An instruction that tests a value and that allows for a subsequent transfer of control to a new address in the program based on the outcome of the test.
Conditional branch
87
A sequence of instructions without branches (except possibly at the end) and without branch targets or branch labels (except possibly at the beginning).
Basic block
88
the result that set the condition code had a 1 in the most significant bit;
negative (N)
89
the result that set the condition code was 0;
zero (Z)
90
the result that set the condition code overflowed
overflow (V)
91
the result that set the condition code had a carry out of the most significant bit or a borrow into the most significant bit.
carry (C)
92
EQ
(= or Equal)
93
HS
(≥ or Higher or Same).
94
HI
(> or Higher
95
LS
(≤ or Lower or Same)
96
LO
(< or Lower),
97
GE
(≥ or Greater than or Equal).
98
GT
(> or Greater Than)
99
LE
(≤ or Less than or Equal)
100
LT
(< or Less Than)
101
NE
(≠ or Not Equal)
102
Branch on minus
(B.MI): N=1;
103
Branch on plus
(B.PL): N=0;
104
Branch on overflow set
(B.VS): V=1;
105
Branch on overflow clear .
(B.VC): V=0
106
In LEGv8 assembly language, you simply append an blank to the end of one of these instructions if you want to set condition codes: ADDS, ADDIS, ANDS, ANDIS, SUBS, and SUBIS. The instruction name actually uses the term flag, so the proper name of ADDS is "add and set flags.
S
107
=
B.EQ
108
not equal
B.NE
109
<
B.LT or B.LO
110
<=
B.LE or B.LS
111
>
B.GT or B.HI
112
>=
B.GE or B.HS
113
How many bits are used to hold a condition code?
4
114
How is conditional branching performed in MIPS?
In MIPS, two registers are compared and the result of the comparison is stored in a third register.
115
Most programming languages have a blank statement that allows the programmer to select one of many alternatives depending on a single value.
case or switch
116
The simplest way to implement switch is via a sequence of conditional tests, turning the switch statement into a chain of blank
if-then-else statements.
117
Also called branch table. A table of addresses of alternative instruction sequences.
Branch address table
118
A stored subroutine that performs a specific task based on the parameters with which it is provided.
Procedure
119
eight parameter registers in which to pass parameters or return values.
X0-X7
120
one return address register to return to the point of origin.
LR (X30)
121
An instruction that branches to an address and simultaneously saves the address of the following instruction in a register (LR or X30 in LEGv8).
Branch-and-link instruction
122
The blank is needed because the same procedure could be called from several parts of the program.
return address
123
A link to the calling site that allows a procedure to return to the proper address; in LEGv8 it is stored in register LR (X30).
Return address
124
The program that instigates a procedure and provides the necessary parameter values.
Caller
125
A procedure that executes a series of stored instructions based on parameters provided by the caller and then returns control to the caller.
Callee
126
The register containing the address of the instruction in the program being executed.
Program counter (PC)
127
A data structure for spilling registers organized as a last-in- first-out queue.
Stack
128
A value denoting the most recently allocated address in a stack that shows where registers should be spilled or where old register values can be found. In LEGv8, it is register SP.
Stack pointer
129
Add element to stack.
Push
130
Remove element from stack.
Pop
131
temporary registers that are not preserved by the callee (called procedure) on a procedure call
X9 - X17
132
saved registers that must be preserved on a procedure call (if used, the callee saves and restores them)
X19 - X28
133
Procedures that do not call others are called blank.
leaf procedures
134
The register that is reserved to point to the static area.
Global pointer
135
Also called activation record. The segment of the stack containing a procedure's saved registers and local variables.
Procedure frame
136
A value denoting the location of the saved registers and local variables for a given procedure.
Frame pointer
137
The segment of a UNIX object file that contains the machine language code for routines in the source file.
Text segment
138
Most computers today offer 8-bit bytes to represent characters, with the blank being the representation that nearly everyone follows.
American Standard Code for Information Interchange (ASCII)
139
blank loads a byte from memory, placing it in the rightmost 8 bits of a register.
Load byte (LDURB)
140
blank takes a byte from the rightmost 8 bits of a register and writes it to memory.
Store byte (STURB)
141
blank is a universal encoding of the alphabets of most human languages.
Unicode
142
The LEGv8 instruction set has explicit instructions to load and store such 16- bit quantities, called blank.
halfwords
143
blank loads a halfword from memory, placing it in the rightmost 16 bits of a register.
Load half (LDURH)
144
blank takes a halfword from the rightmost 16 bits of a register and writes it to memory.
Store half (STURH)
145
The LEGv8 instruction set includes the instruction blank and blank specifically to set any 16 bits of a constant in a register.
move wide with zeros (MOVZ) move wide with keep (MOVK)
146
blank = Register + Branch offset
Program counter
147
An addressing regime in which the address is the sum of the program counter (PC) and a constant in the instruction.
PC-relative addressing
148
The operand is a constant within the instruction itself
Immediate addressing
149
The operand is a register
Register addressing
150
The operand is at the memory location whose address is the sum of a register and a constant in the instruction
Base addressing / displacement addressing
151
The branch address is the sum of the PC and a constant in the instruction
PC-relative addressing
152
One of several addressing regimes delimited by their varied use of operands and/or addresses.
Addressing mode
153
Two memory accesses form a blank if they are from different threads to same location, at least one is a write, and they occur one after another.
Data race
154
A symbolic language that can be translated into binary machine language
Assembly language
155
A common variation of assembly language instructions often treated as if it were an instruction in its own right.
Pseudoinstruction
156
A table that matches names of labels to the addresses of the memory words that instructions occupy.
Symbol table
157
A blank converts a high-level program, such as a C program, into an assembly language program.
compiler
158
An blank is used to convert an assembly language program to a machine language program.
assembler
159
Also called link editor. A systems program that combines independently assembled machine language programs and resolves all undefined labels into an executable file
Linker:
160
There are three steps for the linker:
Place code and data modules symbolically in memory. Determine the addresses of data and instruction labels. Patch both the internal and external references.
161
A functional program in the format of an object file that contains no unresolved references. It can contain symbol tables and debugging information. A "stripped executable" does not contain that information. Relocation information may be included for the loader.
Executable file:
162
A systems program that places an object program in main memory so that it is ready to execute.
Loader
163
Library routines that are linked to a program during execution.
Dynamically linked libraries (DLLs):
164
An executable file is executed after a blank places the file into main memory.
loader
165
Instruction from an instruction set designed to interpret Java programs.
Java bytecode
166
The program that interprets Java bytecodes.
Java Virtual Machine (JVM)
167
168
The name commonly given to a compiler that operates at runtime, translating the interpreted code segments into the native code of the computer.
Just In Time compiler (JIT)
169
When translating from C to assembly language by hand, we follow these general steps:
Allocate registers to program variables. Produce code for the body of the procedure. Preserve registers across the procedure invocation.
170
By convention, LEGv8 uses blank registers for parameter passing allocation.
8
171
Sequential doubleword addresses are blank apart, therefore a variable index needs to be multiplied by 8 before adding the variable index to the address.
8 bytes
172
Reads in a source program and translates the program to an intermediate representation.
front end
173
The blank checks the syntax and semantics, reporting detected errors. Via different blanks, a program may even have parts written in different languages, each read into the intermediate representation and then processed by subsequent phases.
front end
174
Relatively-big changes to a program that yield the same function, but may optimize a program's performance or other metric.
high-level optimization
175
An example of a high-level optimization is blank, which replaces a procedure call (which can be slow) with the procedure's actual instructions (which may yield more instructions overall, but faster performance). Another example is loop-unrolling, which replaces a loop with groups of statements, each group corresponding to a particular loop iteration.
procedure inlining
176
Global and local optimizations.
Global optimizer
177
Makes changes to instructions that may yield less code or better performance, such as not computing an expression like (9/5)C + 32 twice, but instead reusing the result.
Global optimizer
178
Converts the optimized intermediate representation into a processor's machine instructions.
code generator
179
The last compiler phase outputs the actual processor-specific program. Much of the compiler's optimizations are independent of any particular processor, meaning most of the sophisticated software of a compiler can be used for any processor.
code generator
180
A technique to get more performance from loops that access arrays, in which multiple copies of the loop body are made and instructions from different iterations are scheduled together.
Loop-unrolling
181
A Java keyword that allows a method to be invoked by any other method.
Public
182
A Java keyword that restricts invocation of a method to other methods in that package.
Protected
183
Basically a directory that contains a group of related classes.
Package
184
A method that applies to the whole class rather to an individual object. It is unrelated to static in C.
Static method
185
In contrast to C, Java explicitly stores an extra item in every array indicating the array's blank
upper bound
186
In contrast to C, Java calls the appropriate method (procedure) based on the ____ of the calling object.
type
187
A register that can be used for addresses or for data with virtually any instruction.
General-purpose register (GPR)
188
Unconditional jump
jmp
189
Load ES register and a GPR from memory
les
190
Copy string from source to destination
movs
191
Jump if not zero
jnz
192
Move data between two registers
move
193
Load a byte, word, or doubleword of a string into the EAX register
lods
194
Total number of ARMv8 integer machine language instructions
250
195
Total number of ARMv8 SIMD/Vector assembly language instructions.
245
196
ARMv8 assembly language registers used for 32-bit operations.
W0, W1...
197
Number of branch instructions in LEGv8
6
198
Return from subroutine instruction
RET
199
Number of branch instructions in ARMv8
23
200
Branch register instruction
BR
201
T/F Using standard instructions can result in higher performance than using powerful instructions crafted specifically for an architecture.
True
202
T/F Assembly language programs are not easily portable because of the many different architectures of current and future computers.
True
203
Archaic term for register. On-line use of it as a synonym for "register" is a fairly reliable indication that the user has been around quite a while
Accumulator
204
Also called register-register architecture. An instruction set architecture in which all operations are between registers and data memory may only be accessed via loads or stores.
Load-store architecture
205
No registers architecture
stack architecture
206
register-register architecture
load-store architecture
207
Single register architecture
Accumulator architecture
208
Programming language-based architecture
High-level-language-based architecture
209
Reduced instruction set computer architecture
RISC architecture
210
An _________ processor powered the Apple Newton personal digital assistant.
ARM
211
The first microprocessors were precursors to the _________ architecture.
X86
212
The 8088 processors were used to power _________ computers in the 1980s.
IBM PC
213
_________, developed for use in business settings, employs English vocabulary and punctuation.
COBOL
214
_________, developed for IBM's 704 computer in 1954, was one the first widely used programming languages.
FORTRAN
215
In the 1970s, Bell Labs built the UNIX operating system using the _________ language.
C
216
_________ was invented as a way to express algorithms more naturally than its predecessors, with less focus on coding.
Algol
217
Dynamic data structures and pointers were major contributions of _________.
LISP
218
_________ is currently the most popular language to teach in schools and is the standard language for business data processing applications.
Java
219
ex and yacc were developed as a part of the blank operating system,
UNIX
220
In early compilers, processes such as parsing and scanning consisted of ad hoc approaches. These processes were replaced by tools derived from blank
automata theory
221
Blank, unlike RISC architectures, do not use registers and therefore remove the need for register allocation.
Stack architectures