Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What does the offset do in MIPS? I don't understand what is happening here or why it is important? Loading and Storing Bytes MIPS provides

What does the offset do in MIPS? I don't understand what is happening here or why it is important?

image text in transcribedimage text in transcribed

Loading and Storing Bytes MIPS provides special instructions to move bytes lb $t0, 1($s3) #load byte from memory sb $t0, 6 ($s3) #store byte to memory 0x28 | 19 | 8 1 6 bit offset What 8 bits get loaded and stored? load byte places the byte from memory in the rightmost 8 bits of the destination register what happens to the other bits in the register? store byte takes the byte from the rightmost 8 bits of a register and writes it to a byte in memory what happens to the other bits in the memory word? Memory Operand Example 1 C code: g = h + A[8]; . g in $81, h in $s2, base address of A in $s3 Compiled MIPS code: - Index 8 requires offset of 32 4 bytes per word lw $t0, 32($s3) # load word add $81,$s2,1 $t0 offset base register Loading and Storing Bytes MIPS provides special instructions to move bytes lb $t0, 1($s3) #load byte from memory sb $t0, 6 ($s3) #store byte to memory 0x28 | 19 | 8 1 6 bit offset What 8 bits get loaded and stored? load byte places the byte from memory in the rightmost 8 bits of the destination register what happens to the other bits in the register? store byte takes the byte from the rightmost 8 bits of a register and writes it to a byte in memory what happens to the other bits in the memory word? Memory Operand Example 1 C code: g = h + A[8]; . g in $81, h in $s2, base address of A in $s3 Compiled MIPS code: - Index 8 requires offset of 32 4 bytes per word lw $t0, 32($s3) # load word add $81,$s2,1 $t0 offset base register

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions