The MASM Forum

64 bit assembler => Assembly languages for non-x86 ISAs => Topic started by: Kyobreck on June 15, 2016, 10:45:08 PM

Title: Anyone have exerpience with mips?
Post by: Kyobreck on June 15, 2016, 10:45:08 PM
Apparently it's another assembly langauge? I'm gonna play with it, anyone have any experiences.
Title: Re: Anyone have exerpience with mips?
Post by: mineiro on June 16, 2016, 02:31:02 AM
Only a noob inside of my part sir Kyobreck.
Mips is another architecture (processor), so yes, it have their own assembly language.
I have played a little to guide you, but, have simulators around the net (the way that I have started). You can use Qemu as a virtual machine, or you can use a more friendly simulator as "spim" (to windows and linux), look details about:
"Emulates a MIPS R2000/R3000 processor in software. Useful for students who are taught MIPS R2000/R3000 assembly.

SPIM S20 is a software simulator that runs assembly language programs for the MIPS R2000/R3000 RISC computers. SPIM can read and immediately run files containing assembly language statements. SPIM is a self-contained system for running these programs and contains a debugger and interface to the operating system."

Follows a simple code to you get started:
.data
msg1: .asciiz "\nType a number :"
msg2: .asciiz "Factorial is:"
msg3: .asciiz "Number outside scope, getting out\n"
lf:   .asciiz "\n"

.text
main:
#this is a comment, echo on output standart device: "type a number"
li $v0,4
la $a0,msg1
syscall

#read of input device an interger
li $v0,5
syscall
#this "call" returns value on register v0

#saving return value on another register to later action
move $s0,$v0
#number is behind 1 and 19? case yes, go on, if not goto forafaixa
#ps, factorial of number 20 is not allowed
blt $v0,1,forafaixa
bgt $v0,19,forafaixa

#lets multiply by 1, the valid start number
li $v0,1


#if number 1, it's done, if not, multiply by saved value on acumulator acumulador
#and sub 1 of acumulator, repeat while
novamente:
beq $s0,1,feito
mul $v0,$v0,$s0
sub $s0,$s0,1
j novamente
feito:

#move value to other register
move $s0,$v0

#echo 2nd message
li $v0,4
la $a0,msg2
syscall

#echo an interger number
li $v0,1
move $a0,$s0
syscall

#echo a new line
li $v0,4
la $a0,lf
syscall

#return control to system, get out
li $v0,10
syscall

forafaixa:
li $v0,4
la $a0,msg3
syscall
li $v0,10
syscall
Title: Re: Anyone have exerpience with mips?
Post by: anunitu on June 16, 2016, 02:33:50 AM
Found this,but not clear just where this chip is used.

MIPS (originally an acronym for Microprocessor without Interlocked Pipeline Stages) is a reduced instruction set computer (RISC) instruction set architecture (ISA) developed by MIPS Technologies (formerly MIPS Computer Systems, Inc.). The early MIPS architectures were 32-bit, with 64-bit versions added later.
Title: Re: Anyone have exerpience with mips?
Post by: anunitu on June 16, 2016, 02:36:27 AM
There is this,but not sure they are used that much.

http://stackoverflow.com/questions/2635086/mips-processors-are-they-still-in-use-which-other-architecture-should-i-learn (http://stackoverflow.com/questions/2635086/mips-processors-are-they-still-in-use-which-other-architecture-should-i-learn)
Title: Re: Anyone have exerpience with mips?
Post by: mineiro on June 16, 2016, 02:46:39 AM
computers like Silicon Graphics, devices with Windows Ce, Cisco routers, playstation and nintendo 64, ... .
Title: Re: Anyone have exerpience with mips?
Post by: anunitu on June 16, 2016, 03:31:41 AM
So,at least a real chance for perhaps a gig working with it. So maybe my PS3 is done in mips?...Interesting,I may look into the whole idea of learning it.
Title: Re: Anyone have exerpience with mips?
Post by: mineiro on June 16, 2016, 05:12:54 AM
Have a chance to be if it is retrocompatible, my read about say yes, but I do not have sure.
Like x86 to x86-64, but not itanium64 to personal computers.
They probably have inserted more instructions into ps3 processor "Cell Broadband Engine". Their O.S. is XrossMediaBar.
Title: Re: Anyone have exerpience with mips?
Post by: Kyobreck on June 16, 2016, 05:56:07 AM
Thanks for the replies guys. I haven't had time to really look over them because I'm in school right now for another 3 hours