This is program calculates the area of a circle for the given radius using MIPS assembly language. MIPS assembly language is a low-level programming language for a computer and embedded devices in which there is a very strong correspondence between the language and the architecture’s machine code instructions. MIPS based micro-processors are getting famous and their use in mobile devices is increasing. Following program demonstrates how to use MIPS assembly language using floating point numbers. Floating point number are processed in a separate co-processor in MIPS processor.

input:	.asciiz		"Enter Radius of a circle: "
radius:	.asciiz		"Radius is: "
output:	.asciiz		"\nArea of circle is: "
pi:	.float 3.14

.globl main


	la $a0,	input
	li $v0, 4
	li $v0,6
	mov.s $f12,$f0
	la $a0,	radius
	li $v0, 4
	li $v0,2
	mov.s $f5,$f12
	mul.s $f3,$f5,$f5
	l.s $f2,pi
	mul.s $f4,$f3,$f2
	la $a0,	output
	li $v0, 4
	mov.s $f12,$f4
	li $v0,2
Tagged with: MIPS AssemblySource Code

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Related News Feeds

Set your Twitter account name in your settings to use the TwitterBar Section.