This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: mult r1, r2 => r1 loadAI r0, @z => r2 sub r1, r2 => r1 loadAI r0, @w => r2 add r1, r2 => r1 Only two registers for needed to perform the computation (without counting r0). 3. Three-Address Code (ILOC) loadI 0 => r1 storeAI r1 => r0, @i storeAI r1 => r0, @sum HEAD: nop loadAI r0, @i => r2 loadI 10 => r3 cmp_LT r2, r3 => r4 cbr r4, BODY, EXIT BODY: nop loadAI r0, @i => r5 multI r5, 4 => r6 addI r6, @a => r7 loadAO r0, r7 => r8 addI r8, 1 => r9 storeAO r9 => r0, r7 loadAI r0, @sum => r10 add r10, r7 => r11 storeAI r11 => r0, @sum addI r5, 1 => r12 storeAI r12 => r0, @i jump HEAD EXIT: nop loadAI r0, @sum => r13 loadI 0 => r14 store r13 => r14 output 0...
View Full Document
This note was uploaded on 10/29/2010 for the course CS 198:415 taught by Professor Kremer,u. during the Spring '10 term at Rutgers.
- Spring '10