home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1995 December
/
SOFM_Dec1995.bin
/
pc
/
win
/
edu
/
easi_ps
/
qs28.sdy
< prev
next >
Wrap
Text File
|
1995-10-31
|
3KB
|
70 lines
"Org Chpt 3 - MIPS assm lang"
"name 2 key points about arithmetic instructions on MIPS "
" 1. always have 3 operands
2. arithmetic operations occur only ON registers "
"Name the 4 underlying principles of hardware design "
" 1. Simplicity favours regularity.
2. Smaller is faster.
3. Good design demands compromise.
4. Make the common case fast.
GMSS - as in games"
"Define 'spilling' registers "
" The process of putting less commonly used variables
( or those needed later ) into memory.
ie saving regs as procs call procs that call procs etc."
"Why use registers ? "
" 1. Faster.
2. Easier to use.
(arith instr can read 2 regs, operate on them, write result.
data xfer instr reads or writes only 1 operand,
without operating on it) "
"What are the 2 principles of the 'stored-program' computer ? "
" 1. the use of instructions that are indistinguishable from numbers.
2. the use of alterable memory for programs. "
"Define assembly language "
"A symbolic representation of instructions "
"What are pseudoinstructions ? "
" common variations of machine language instructions that are not
part of the machine architechture, but which the assembler accepts
and converts into the machine language equivalent."
"What's the difference between a computer and a simple calculator ? "
" The ability to make decisions. (Programmability)"
"Describe the 'at' register "
" Reg $1 (at) is reserved for the assembler to use as a temp reg
while working on pseudoinstructions so as not to corrupt regs
used by the program."
"What is 'lui' ? "
" load upper immed - set the upper 16 bits of a 32-bit const in a reg
( fills lower 16 with 0's )
a subsequent 'addi' sets the lower 16 bits
Note: breaking up large constants is another time the
assembler makes use of 'at', in addition to expanding
the set of 'branch' instructions accepted."
"What are the MIPS addressing modes ? "
" 1. Register - operand is a reg
2. Base or Displacement - operand is at mem loc whose
addr = addr_field + reg
3. Immediate - operand is constant within the instruction
4. PC-relative - address = PC + constant_in_instruction"
"3 General steps in translating 'C' to 'asm'..."
" 1. Allocate regs to program variables
2. Code the body of the proc
3. Preserve regs across proc call "
"Describe 'twos complement' representation"
"1. MSB is 0 for all positive numbers, 1 for negative
2. Only 1 zero
3. 1000 0000 ... is the most negative number ( -2 e (bits-1) )
ie for a 32-bit 1000 0000 0000 0000 = -2e31
4. To read a negative:
(b31 * -2e31) + (b30 * 2e30) + (b29 * 2e29) ...
^ all others positive "
"2 shortcuts for two's complement numbers "
"1. to negate a binary number:
invert every bit, then add 1 to the result
2. to convert a binary number of n bits to a bigger representation
'sign extension' - copy number to larger field, then
replicate MSB to all bits left of it. "