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
Load upper immediate (lui)
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.
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
B
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
PC- Relative Addressing
Addressing regime in which the address is the sum of the program counter (PC) and a constant in the instruction
Immediate Addressing
operand is a constant within the instruction itself
Register Addressing
operand is a register
Base Addressing/Displacement addressing
operand is at the memory location whose address is the sum of the register and a constant in the instruction
Pseudodirect Addressing
jump address is the 26 bits of the instruction concatenated with the upper bits of the PC
Addressing Mode
one of the several addressing regimes delimited by their varied use of operands and/or addresses
Decode 00af8020
find OP,RS,RT,RD,SHAMT,FUNCT
0000 0000 1010 1111 1000 0010 000
op - 000000
rs - 00101
rt - 01111
rd - 10000
shamt - 00000
funct - 100000
00…0101 00…0101
-00…0100 + 11…dcba
————— —————-
s00…zyww