Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MIPS and ARM differences

I just started learning architecture and I have some confusions between MIPS and ARM architectures.

I came to know that the MIPS predominantly has two instruction formats: I and R (J as well). I read about these representation formats, rs, rt, opcode and related stuff. I also had a look at COA book of Patterson (Edition-IV) which focuses on ARM ISA. The instruction representation is different in that edition. Are these differences due to the varying architectures? And the ARM assembly code is slightly varying with the book I used with MIPS ISA.

eg. Patterson' edition IV says

LDR r5,[r3,#32]
STR r1,[r4,#48]

while the other MIPS one I read says

lw r5,[r3,#32]
sw r1,[r4,#48]

Is the difference due to the ISA they follow or they are two different versions of the same ISA? Could you also explain the key differences between MIPS and ARM?

like image 973
Mail Avatar asked Nov 02 '14 06:11

Mail


People also ask

What is the difference between MIPS and Assembly?

MIPS is a company that makes processors and the name of the ISA and the name of the Assembly Language and the processors will all bear the name MIPS. Just like Intel processors, Assembly Language and instruction set can be properly called Intel (although we also see x86 and other variations).

What is the difference between MIPS and RISC?

MIPS is RISC (Reduced Instruction Set Chip) architecture. Reduced (RISC) architectures tend to be simpler and have a small number of operations. Complex (CISC) architectures like x86 have more instructions, some of which take the place of a sequence of RISC instructions.

What is the difference between ARM and RISC?

ARM is based on proprietary IP, and the companies sell and/or license their products. RISC-V is an open specification and platform; it is not an open-source only processor. Open-source RISC-V cores are available, as well as there are also commercially licensed cores.

Is MIPS same as x86?

x86 have more complex instructions than MIPS. So there is probably a single instruction for common sequences in MIPS (most notably memory addressing).


1 Answers

Yes lw and sw are load and store word for mips. ldr and str are load and store a word for arm. and for x86 you use mov.

Mips typically has a syntax that uses $0-$31 or the even more disgusting $v0, etc. Arm and many others use r and a number r0-rn, (some folks are trying to uglify that as well with alias names).

ARM and MIPS are competitors, they are not the same company not the same architectures. MIPS machine encoding falls into the few categories you mentioned, ARM has many for whatever reason good or bad, these are both well documented in the MIPS or ARM documentation.

So as far as instruction encoding that is determined by the inventors of the instruction set for whatever reasons they choose, good, bad, or otherwise, it is their thing they can do what they want.

AS far as the assembly language syntax, the isa inventor generally creates one to go along with the documentation for the instruction set and they typically create or hire someone to make an assembler. But the assembler (the software that takes the assembly language and makes machine code from it) authors ultimately dictate the assembly language syntax, and they dont have to conform to the syntax in the isa documentation. And there is no reason for any two separately created assemblers to use the same syntax. Over time for example hex numbers had a dollar sign $12 or a trailing h 12h, but now you often see C syntax supported or preferred 0x12. Sometimes you see indirect plus an offset as 12(r3) or [r3,#12] or to describe the exact same thing.

like image 109
old_timer Avatar answered Oct 15 '22 08:10

old_timer