Chapter 2 Flashcards

1
Q

What are the Character Values of the following?
ASCII, LATIN-1, UNICODE,
A) 128, 256, 32
B) 256,128,32
C)32,128,256

A

A

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

Load byte (lb)

A

Loads a byte from memory, placing it in the right most 8 bits

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

Store byte (sb)

A

takes a byte from the right most 8 bits of a register and writes it to memory

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

Example For (lb) and (sb)
Memory address below
2000: 65
2001: 66
2002: 67
2003: 68

What represents a string of ASCII Characters based on the above?
A) abcd
B) ABCD
C) 6783
D) 9837

A

A

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

Example For (lb) and (sb)
Memory address below
2000: 65
2001: 66
2002: 67
2003: 68

If $t1 holds 2000, what is $t2 after: lb $t2, 0($t1)
A) 2000
B) 65
C) low byte 65, rest is unknown

A

B

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

Example For (lb) and (sb)
Memory address below
2000: 65
2001: 66
2002: 67
2003: 68

Suppose $t1 holds 3000, and $t2 hold 97 (in decimal) after
lw $t2, 0($t1) suppose writing to address 3000prints a character to the screen, what is printed after sb $t2,0(t1)

A) c
B) 3000
C) a

A

C

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

Example For (lb) and (sb)
Memory address below
2000: 65
2001: 66
2002: 67
2003: 68

If $t1 holds 2000, what is $t2 (in decimal) after lw $t2,0($t1)?

A)65
B) 65 + 66 + 67 + 68
C) a very large number

A

C

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

Load Half (lh)

A

loads a half word from memory, placing it in the rightmost 16 bits of the register

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

Load Halfword Unsigned (lhu)

A

Works with unsigned variables which is the most popular of the two (Load half)

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

Store Half (sh)

A

takes a halfword from the rightmost 16 bits of a register and writes it to memory

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

String is a single-dimension array of characters in C and Java
True or False

A

True

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

String in C takes about half the memory as the same string in Java
True or False

A

True

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

Strings in C and Java use Null (0) to mark the end of a string
True or False

A

False

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

Operations on strings, like length, are faster in C rather than in Java
True or False

A

False

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

Which type of variable that can contain 1,000,000,000 base 10 takes the most memory space

A) int in C
B) string in C
C) string in Java

A

C

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

Load upper immediate (lui)

A

specifically to set the upper 16 bits of a constant in a register, allowing a subsequent instruction to specify the lower 16 bits of the constant.

17
Q

Given lui $s0, 7. How is the immediate operand 7 represented in the instruction?

A) 0000 0000 0000 0111
B) 0000 0000 0000 0000 0000 0000 0000 0000 0111

A

B

18
Q

What is $s0 after:
lui $s0, 7
ori 4s0,$s0, 8

A) 0000 0000 0000 0111 0000 0000 0000 1000
B) 0000 0000 0000 0000 0000 0000 0000 1000
C) 0000 0000 0000 1000 0000 0000 0000 0111

A

A

19
Q

PC- Relative Addressing

A

Addressing regime in which the address is the sum of the program counter (PC) and a constant in the instruction

20
Q

Immediate Addressing

A

operand is a constant within the instruction itself

21
Q

Register Addressing

A

operand is a register

22
Q

Base Addressing/Displacement addressing

A

operand is at the memory location whose address is the sum of the register and a constant in the instruction

23
Q

Pseudodirect Addressing

A

jump address is the 26 bits of the instruction concatenated with the upper bits of the PC

24
Q

Addressing Mode

A

one of the several addressing regimes delimited by their varied use of operands and/or addresses

25
Q

Decode 00af8020
find OP,RS,RT,RD,SHAMT,FUNCT

A

0000 0000 1010 1111 1000 0010 000
op - 000000
rs - 00101
rt - 01111
rd - 10000
shamt - 00000
funct - 100000

26
Q

00…0101 00…0101
-00…0100 + 11…dcba
————— —————-
s00…zyww

A