new to assembly

Reply

Join Date: Jan 2009
Posts: 62
Reputation: homeryansta is an unknown quantity at this point 
Solved Threads: 0
homeryansta homeryansta is offline Offline
Junior Poster in Training

new to assembly

 
0
  #1
Jun 26th, 2009
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.

  1. .text
  2. .globl _start
  3. _start:
  4.  
  5. la $a0, prompt
  6. li $v0, 4
  7. syscall
  8.  
  9. li $v0, 5
  10. syscall
  11.  
  12. mul $t0, $v0, 9
  13. div $t0, $t0, 5
  14. addi $t0, $t0, 32
  15.  
  16. la $a0, ans1
  17. li $v0, 4
  18. syscall
  19.  
  20. move $a0, $t0
  21. li $v0, 1
  22. syscall
  23.  
  24. la $a0, endl
  25. li $v0, 4
  26. syscall
  27.  
  28. li $v0, 10
  29. syscall
  30.  
  31.  
  32. .data
  33. prompt: .asciiz "enter the temperature in celcius: "
  34. ans1: .asciiz "The temperature in F is: "
  35. endl: .asciiz "\n"
Last edited by homeryansta; Jun 26th, 2009 at 1:30 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: new to assembly

 
0
  #2
Jun 26th, 2009
Have you tested the installation, by writing the "hello world" program?

A simple print string and halt.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 62
Reputation: homeryansta is an unknown quantity at this point 
Solved Threads: 0
homeryansta homeryansta is offline Offline
Junior Poster in Training

Re: new to assembly

 
0
  #3
Jun 26th, 2009
Originally Posted by Salem View Post
Have you tested the installation, by writing the "hello world" program?

A simple print string and halt.
yes I have, and it works fine
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: new to assembly

 
0
  #4
Jun 26th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 62
Reputation: homeryansta is an unknown quantity at this point 
Solved Threads: 0
homeryansta homeryansta is offline Offline
Junior Poster in Training

Re: new to assembly

 
1
  #5
Jun 26th, 2009
ok, I'm an idiot. double underscore is require for _ _ start
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC