MIPS Items Flashcards
CPU Instruction
binary pattern of 0’s and 1’s.
Instruction Set (ISA)
the vocabulary of commands understood by a given architecture
CPU arch
collection of general specifications that CPU follows
Specification about CPU Architecture
instruction set, number and size of registers, word size, address size and etc.
Assembly Language
a symbolic representation of machine instruction
Requires programmer to write one line for every instruction that the computer will follow
What are the main properties of assembly languages?
- closely represent CPU instructions
- Assembly languages are architecture specific
List ex of Assembly Lang
MIPS for some old classic CPUs
x86 for Intel-style CPUs
ARM 8 for smartphone CPUs
What are pseudo-instructions
structions do not directly correspond to a single machine instruction in the MIPS instruction set
How many general-purpose registers do MIPS CPU have
32 general purpose register
each register is 4 bytes (word)
Can a register store nothing at all? Can some bits in a register store nothing at all?
NO a register cannot hold nothing even a pattern of all zero’s is still storing something
Name some MIPS general purpose registers.
$s0 - $s7, $t0 - $t7, $zero
What is stored in the register $zero? Are we allowed to change it’s content?
Constant value - and you are NOT allowed to change it
Immediate value in ADDI
Constant
Where is a variable stored?
IN RAM
What is loading the register?
Copying word of data from RAM to CPU register
SW
Copies the data from a register to memory.
Endianess. Big-endian and little-endian.
Computers either use the address of the leftmost or “big end” byte as the word address and those that use the rightmost or “little end” byte. MIPS uses big-endian.
What should we do to use the value of a variable?
load it from RAM to register
2’s complement representation of signed integers.
PRACTICE
Unsigned integer representation.
Practice
Know how to determine numeric limits for both 2’s complement and unsigned representations when given the number of bits.
General Range for n-bit Unsigned Integer:
0 - (2^n)-1
ex: 8 bits
0 - 255
2’s Complement:
Minimum value: -2^(n-1)
Maximum Value: 2^(n-1)-1
ex: 8 bits
-128 - 127
How do we specify memory address in loading and storing instructions?
offset($baseRegister)
What is the difference between lh and lhu, between lb and lbu?
Sign-extends
Why we don’t need separate signed and unsigned versions for storing instructions.
copying the bit pattern from a register to a memory location.