SLIDE 4 13
Example: print product, sum of two doubles
Bl helperGetDouble // result in D0 stur d0, [sp, #8] bl helperGetDouble // result in D0 stur d0, [sp, #16] // Reload values where I want them ldur d2, [sp, #8] ldur d3, [sp, #16] // Print product fmul d0, d2, d3 bl helperPrintDouble // prints value in d0 // Reload values, print sum ldur d2, [sp, #8] ldur d3, [sp, #16] fadd d0, d2, d3 bl helperPrintDouble // prints value in d0
14
Stored Program Concept
- 1. Instructions represented in binary,
just like data
- 2. Instructions and data stored in
memory Implications:
- Programs can operate on programs
– e.g., compilers, linkers, …
- Binary compatibility allows compiled
programs to work on different computers
– Standardized ISAs
15
- ARM philosophy – small number of fast, simple operations
– Name: – Others: ARM, Alpha, RISC-V, SPARC
– Name: – provide more powerful operations – goal is to reduce number of instructions executed – Example VAX: minimize code size, make assembly language easy instructions from 1 to 54 bytes long! – Others: x86, Motorola 68000 – Danger?
- Virtually all new instruction sets since 1982 have been
Alternative Architectures
16
A dominant architecture: x86
- See your textbook for a more detailed description
- Complexity:
– Instructions from 1 to 15 bytes long – one operand must act as both a source and destination – one operand can come from memory – complex addressing modes e.g., “base or scaled index with 8 or 32 bit displacement”
– Hardware: the most frequently used instructions are… – Software: compilers avoid the portions of the architecture… “what the x86 lacks in style it rectifies with market size, making it beautiful from the right perspective” (pg 162)