0

hello everyone! i usually hang around the c++ area, but I'll need to learn assembly for computer architecture 2 in the fall so here it is. I wrote a simple program to convert temperatures from C to F. PCspim doesn't like it for some reason.

here are my codes, it just won't run.

.text
	.globl _start
_start:

	la $a0, prompt   
	li $v0, 4
	syscall

	li $v0, 5	
	syscall

	mul $t0, $v0, 9 
	div $t0, $t0, 5  
	addi $t0, $t0, 32	

	la $a0, ans1
	li $v0, 4
	syscall

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

	la $a0, endl
	li $v0, 4
	syscall

	li $v0, 10
	syscall


	.data
	prompt:  .asciiz  "enter the temperature in celcius: "
	ans1:	 .asciiz  "The temperature in F is: "
	endl:	 .asciiz  "\n"
2
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by homeryansta
0

Have you tested the installation, by writing the "hello world" program?

A simple print string and halt.

0

Have you tested the installation, by writing the "hello world" program?

A simple print string and halt.

yes I have, and it works fine :)

0

OK, so it's just divide and conquer to move from something which works, to something which doesn't.

li $v0, 5
syscall
Does this actually return an integer result in a register?
Or did it assume a pointer to a string.

Imagine that I don't have the manual for your psim syscall's.

1

ok, I'm an idiot. double underscore is require for _ _ start

Votes + Comments
Thanks for the feedback answer :)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.