4 Replies - 456 Views - Last Post: 06 September 2013 - 04:20 PM

#1 axel1994  Icon User is offline

  • D.I.C Head

Reputation: 83
  • View blog
  • Posts: 167
  • Joined: 27-May 13

Assembly on different processors

Posted 26 August 2013 - 02:25 AM

So, I have a pretty newbie question.

My university (computer science 1st year) starts in 2 months. And for the past couple months I have been busy trying to study some courses already.

I have studied math on my own, some programming languages.
But now on the menu is assembly.

I know we will be using SPIM.
And I do have a book/guide. And I know that my next question is going to be taught/answered in the courses itself, together with more knowledge about microprocessors, ect.

But I was wondering, if you would want to use assembly on another processor or something, does the actual code change a lot?

Is This A Good Question/Topic? 0
  • +

Replies To: Assembly on different processors

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,281
  • Joined: 28-March 11

Re: Assembly on different processors

Posted 26 August 2013 - 07:19 AM

SPIM is a MIPS simulator. code written for MIPS Is not the same as SPARC, x86, or ARM. Each processor has its own set of instructions. you would have to rewrite the code to run on and use each different cpu mnuemonics
Was This Post Helpful? 3
  • +
  • -

#3 axel1994  Icon User is offline

  • D.I.C Head

Reputation: 83
  • View blog
  • Posts: 167
  • Joined: 27-May 13

Re: Assembly on different processors

Posted 26 August 2013 - 07:37 AM

View PostGunnerInc, on 26 August 2013 - 07:19 AM, said:

SPIM is a MIPS simulator. code written for MIPS Is not the same as SPARC, x86, or ARM. Each processor has its own set of instructions. you would have to rewrite the code to run on and use each different cpu mnuemonics


alright, thank you for your response
Was This Post Helpful? 0
  • +
  • -

#4 DoNotWant  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 59
  • Joined: 03-November 11

Re: Assembly on different processors

Posted 26 August 2013 - 01:11 PM

You should also know that you have to think in different ways depending on CPU, not only different instructions. CPUs have different addressing modes, different amount of registers, status flags reacting differently to op-codes, e.t.c.
Was This Post Helpful? 1
  • +
  • -

#5 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 615
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: Assembly on different processors

Posted 06 September 2013 - 04:20 PM

This reply is a bit late, sorry. Architectures can vary quite a bit, but you will find many similarities between almost all of them. For example, a register which stores the address of the current instruction, a set of registers used to hold temporary data for instructions to operate on, and generic types of instructions such as arithmetic, logic, branch and compare. However, since architectures are designed with a goal in mind, they will often differ in their exact implementation. Read some technical manuals (e.g. PPC, x86/IA-32, MIPS, SH4) on various architectures to get a more specific idea on what those differences might be.

This post has been edited by Aphex19: 06 September 2013 - 04:21 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1