Assembly Language Programming: CPSC 252 Computer Organization Ellen Walker, Hiram College
Assembly Language Programming: CPSC 252 Computer Organization Ellen Walker, Hiram College
Programming
CPSC 252 Computer
Organization
Ellen Walker, Hiram College
Instruction Set Design
• Complex and powerful enough to
enable any computation
• “Simplicity of equipment”
MIPS
• Microprocessor set (MIPS Technologies, Inc.)
• Used in “digital consumer and business
applications” made by companies such as
– Cisco
– Nintendo
– Sony
• “Typical of instruction sets designed since the
1980’s”
MIPS Assembler
• 3-address instructions
• Example:
add a,b,c #a = b+c
• How to compute d = a+b+c ?
Why 3 addresses?
• For a binary operation it’s natural:
– Two operands
– One result
• With fewer addresses:
– 2 address - fix result as one operand
– 1 address - fix one operand and result
– 0 address - fix locations of both operands
and results (stack)
Recall: CPSC 171 Assembler
• To add A and B and store in C
– LOD A (into accumulator)
– ADD B (accumulator has A+B)
– STO C (now stored in memory)