Sunday 15 June 2014

assembly - MIPS program! need help- i m not sure if i m doing it right -


Trying to write MIPS program which can check the set of ten single digit numbers (positive, zero, or negative), which can

Below is my MIPS program

 . Data signals: .asciiz "Input Score:". Different 2 HR_Neg: .asciiz "\ n Negative Score:" 2 Align HR_Pos: .asciiz "\ n Positive Score:". Different 2 HR_Negsc: .asciiz "\ nNumber of Negative Score:". 2 HR_ Posc: .asciiz "\ nNumber of positive scores:". 2 align: hr_coma: .asciiz "," .different2hrrrrrk: .asciiz "\ n \ n" .line 2 neg: space 10 .control2 position: .space10. Global Chief Text Main: li $ t0, 0 la $ t1, no, $ t2, 0a $ t3, position $ t4, 0l $ t5, 0l $ t6, 0 loop: li $ v0, 4 Add $ 1, $ T1, $ 4, $ T0, $ T, 1BL_and F: $ 1, $ 1, $ 100, SW $ v0, Add 0 ($ T3) $ T3, $ T3, 4 ADI $ T2, $ T2, 1 L_end: ADI $ T4, $ T4, 1 BLTU $ T4, 15, Loop # Output numbers li $ v, 4 dollar IN0, hr_ngc csll $ v 0, add 1 $ a0, $ t, 0 sscll $ v, 4a $ a0, hrpose system Mas $ v0, add 1 $ a0, $ t2, 0 syscall #output negative score, $ v0, 4 la $ a0, hr_ neg syscall la $ t1, neg lw $ a0, 0 ($ t1) li $ v0, 1  

Please enter some comments in your code, interested can try to understand what to do Is trying.

In addition, there is a typo in the code in which you have a reference to a label HR_NJCC and HR_NGC, from which I think that when you say "it does not run" you really mean that it is not

Step 2 - Actually get it to execute

Step 3 - Now you can start debugging

Some such terrain You can see:

how much room you have. The place you told, is this enough?

What are you using to evaluate bltu instruction + ve and -ve right?

How does your program end? - Does something look missing?

The following comment:

Hey, with the details of the problem, I suspect that some of the code written by you is saved in this project. I am referring to numbers 15 and 50.

You know, when we can estimate how much you know and do not know, then it is very difficult to provide useful help. More detailed questions, more answers can be answered. And in response to that other question some advice is clearly still applicable.


No comments:

Post a Comment