Print "Hello World" and printing integer || float || double numbers in Assembly language(MIPS) on Mars
How to print in MIPS on MARS
Task 1:Write a program to print an Integer on Mars Simulator.
.data
num:.word 10
.text
li $v0,1
lw $a0,num
syscall
Task 2:
Write a program to print a character on Mars Simulator.
.data
a:.byte 'a'
.text
li $v0,4
la $a0,a
syscall
Task 3:
Write a program to print a float number on Mars Simulator.
.data
numf:.float 1.5
.text
li $v0,2
lwc1 $f12,numf
syscall
Task 4:
Write a program to print a double number on Mars Simulator.
.data
numd:.double 11.5587
.text
li $v0,3
ldc1 $f12,numd
syscall
Task 5:
Write a program to print a message: “I Love Pakistan” on Mars Simulator.
.data
abc:.asciiz "i love pakistan"
.text
li $v0,4
la $a0,abc
syscall
Comments
Post a Comment