rss
twitter
facebook

Home

Temperatura

.data

prompt: .asciiz "\n Introduzir Temperatura:" #string
confirm: .asciiz "\n Em Fahrenheit é : " #String
display1: .asciiz "\n Em centígrado é:" #string


fhtTemp: .word 0 #var1
CentiTemp: .word 0 #var2

.text
.globl main

main:
li $v0,4 #teste a primeira
la $a0,prompt #String
syscall #apresenta no ecra

li $v0,5
syscall
sw $v0,fhtTemp

li $v0,4
la $a0,confirm
syscall

li $v0,1
lw $a0,fhtTemp
syscall


#convert

lw $t1,fhtTemp
li $a1,32
sub $t2, $t1, $a1
li $a1,5

mult $t2,$a1
mflo $t3
li $a1,9
div $t4, $t3, $a1

#end

li $v0,4
la $a0, display1
syscall

li $v0,1
move $a0,$t4
syscall

li $v0,10
syscall

0 comentários:

 
Powered by Blogger