Reputation: 19 Tradesman
- Active Members
- Active Posts:
- 60 (0.05 per day)
- 26-December 09
- Profile Views:
- Last Active:
- Feb 12 2013 08:31 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 6 Apr 2012Each processor is different with different hardware. The MIPS ISA is jut that, an instruction set. Things you are talking about like hazards are handled differently by different processors. For instance: there are different types of branch predictors with different success rates. If the predictor is correct, no nops are required. If it's incorrect well then it depends on the hardware. If it's a single-cycle processor, it won't really matter. If it's pipelined, it depends on how deep the pipeline is and how many bad instructions need to be flushed.
In summary: if you are trying to see the behavior of a specific chip, get it. There is no simulator which is universal because no two chips are the same and they do not have to handle these issues in the same manner.
Posted 25 Feb 2012Here's a little hint: ASCII is stored internally as a number already. So all you really need to do is to figure out how to convert from the ASCII number to the actual decimal number which you want. Here's a link to an ASCII chart which should help you out: http://www.asciitable.com/
Posted 7 Nov 2011If you are looking for a full ide, you could give LispWorks a try. It is free for private use and has a REPL and text editor. I believe it also does some good stuff like optimize tail recursive calls. The only drawback I have found with it is sometimes if you crash your code, the ide will crash as well and there is a time limit you can leave it open in the personal edition. Other than that, it's pretty good, it's free, and it doesn't have as steep a learning curve as emacs/slime.
Posted 10 Oct 2011In MIPS the first thing you should do is load the pointer(address) of your array into a register.
To do that, use the la command. This is how that line would look:
la $t0, DataThis loads the address of the first element in Data into the t0 register. Once you have done that, to access an element, you do this:
lw $t1, 0($t0)In that example, the assemlber will load a word of data into t1. The data which it loads into t1 is the first element pointed to by the address held in t0. If I want to access the next element, I need to apply the proper offset. Since it is a word, the offset is a multiple of four.
$lw $t2, 4($t0)This will load the second element pointed to by the address in t0 into t2.
If I wish to loop through the elements, I need to increment the pointer. Since I am dealing with words, I want to increment the pointer by 4 like this:
addi $t0, $t0, 4and then use
lw $t1, 0($t0)to access the new "first" element
Posted 28 Sep 2011Your base location is really just a pointer to a location in memory. If you have stored elements in an array, it is up to you to increment the pointer by however big each element is. If it is an array of dwords (32 bit), then you will have to increment the pointer by 4 bytes each time so that it will point to the next element in the array.
Offset is more like the amount you have to add to move to the next element in the array. If you want to access say the third element, you want to increment the pointer by x three times which would be the same as pointer = pointer + 3x where x is the size of the offset.
As a side note, pointer arithmetic is what makes it possible to have O(1) access time for array elements in higher level languages.
- Member Title:
- D.I.C Head
- Age Unknown
- Birthday Unknown
- Website URL:
nmeans73 hasn't added any friends yet.