{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Homework2 00

# Homework2 00 - Indexed addressing lw r1(r2 r3 r1 = MEM r2...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ! Indexed addressing. lw r1, (r2+r3) ! r1 = MEM[ r2 + r3 ]; sw (r2+r3), r4 ! MEM[ r2 + r3 ] + r4; ! Autoincrement addressing. lb r1, 3(+r2) ! r1 = MEM[ r2 + 3 ]; r2 = r2 + 1; lw r4, 8(+r5) ! r4 = MEM[ r5 + 8 ]; r5 = r5 + 4; sw 4(+r7), r8 ! MEM[ r7 + 4 ] = r8; r7 = r7 + 4; 1 Problem 3: Write a C program that does the same thing as the DLX program below. ! r2: Start of table of indices, used to retrieve elements ! from the character table. ! r4: Start of table of characters. ! r6: Location to copy characters to. ! r8: Address of end of index table. LOOP: lw r1, 0(r2) add r3, r1, r4 lb r5, 0(r3) sb 0(r6), r5 addi r2, r2, #4 addi r6, r6, #1 slt r7, r2, r8 bneq r7, LOOP Solution template available via: http://www.ee.lsu.edu/ee4720/2000f/hw02.c void untangle(int *r2, char *r4, char *r6, int *r8) { /* Put solution here. */ } Problem 4: Re-code the DLX program above using DLX-BAM, taking advantage of the new instructions. 2...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Homework2 00 - Indexed addressing lw r1(r2 r3 r1 = MEM r2...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online