Chapter 2 Flashcards
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
Load byte (lb)
Loads a byte from memory, placing it in the right most 8 bits
Store byte (sb)
takes a byte from the right most 8 bits of a register and writes it to memory
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
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
B
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
C
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
C
Load Half (lh)
loads a half word from memory, placing it in the rightmost 16 bits of the register
Load Halfword Unsigned (lhu)
Works with unsigned variables which is the most popular of the two (Load half)
Store Half (sh)
takes a halfword from the rightmost 16 bits of a register and writes it to memory
String is a single-dimension array of characters in C and Java
True or False
True
String in C takes about half the memory as the same string in Java
True or False
True
Strings in C and Java use Null (0) to mark the end of a string
True or False
False
Operations on strings, like length, are faster in C rather than in Java
True or False
False
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
C