Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7248213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:06:29+00:00 2026-05-28T22:06:29+00:00

I am trying to translate a C program into MIPS assembly code In my

  • 0

I am trying to translate a C program into MIPS assembly code

In my C code I have a line like this:

int base;
int count;

count = base;

In MIPS, how would I store the value of base inside of count? The only instructions I see for loading and storing are lw and sw and their prototypes only go from a register source -> ram destination or a ram source -> register destination.

Any help would be appreciated.

EDIT
I was hoping that this could be done in a single instruction, something like

move base acc

but apparently that is impossible (at least I found no example of an instruction similar to that), I opted for this:

lw $t0, base   //load base into $t0
sw $t0, count  //store the value of $t0 in count

If there is a one-line instruction to do this that would be better if anyone knows one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:06:30+00:00Added an answer on May 28, 2026 at 10:06 pm

    MIPS doesn’t support direct memory-to-memory moves. (Neither do most common CPUs, actually — even x86 doesn’t.) You’ll need to use lw/sw to move data around.

    Architecturally, this is because MIPS is designed to only perform a single memory access per cycle — doing a memory-to-memory move would require two accesses (one read, one write), or stall the pipeline.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to translate this code into Silverlight. Any suggestions for a replacement
Sometimes I still get stuck trying to translate procedural code into functional code. Is
I have some jquery code which I am trying to translate to YUI. I
I'm trying to convert Morse code into text. I have two text files to
I am trying to translate this into Linq and cannot figure it out: SELECT
Trying to translate some methods written in Python over into C#. The line looks
I'm trying to figure out how best to translate this: <Source><properties> .... <name>wer</name> <delay>
I have spent the afternoon trying to wrap my mind around how to translate
I have an issue right now with a program im trying to create. The
I'm trying to translate Brandon Kelly's AC.VR class (Prototype) into a jQuery plugin. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.