Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
Acmlm's Board - I3 Archive - Programming - Don't know how many are familiar with MIPS, but I'd thought I'd give it a shot... | New poll | | |
Add to favorites | Next newer thread | Next older thread |
User | Post | ||
Black Lord + Flurry Since: 11-17-05 From: Where indians still roam... Last post: 6432 days Last view: 6433 days |
| ||
So... I've got a little question...
I've got a 32-bit register, say $t3, and I want to store, bits 17 through 5 in the least significant bits of another 32 bit register, in MIPS. Also, only using two instructions to performe this task (yes this is my homework). What I'm thinking I can do is the following. sll $t0, $t3, 15 #ridding myself of the bits in front of bit 17 srl $t0, $t0, 19 #moving over the 15 i shifted before # and then 4 more to move bit 5 to the least significant bit I think this is correct, but I'm not for sure. I just started taking this class and it's really giving me a run for my money (the recursive algorthms really kicked my ass) |
|||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6431 days Last view: 6431 days |
| ||
That looks like it's correct, but there's a better way to mask off the high bits. I don't think I can very well tell you how to do your homework though. | |||
neotransotaku Sledge Brother Liberated from school...until MLK day Since: 11-17-05 From: In Hearst Field Annex... Last post: 6433 days Last view: 6431 days |
| ||
With my TA reputation on the line, I'd say that is 100% correct.
Recursion in MIPS is not that much different from recursion in any other language. The fundamental thing behind recursion is you need to finish another task first before you can complete your currenter iteration. Perhaps this lecture might shed light on recursion? |
|||
Black Lord + Flurry Since: 11-17-05 From: Where indians still roam... Last post: 6432 days Last view: 6433 days |
| ||
Yeah, I'm sure they're are better ways of doing it, but given the limited number of instructions we've gone over this one made the most sense to me to do. At least it makes sense of me, the rest of the class can't even wrap their heads around the sll and srl commands. Out of curiousity neo, where do you go to school? | |||
neotransotaku Sledge Brother Liberated from school...until MLK day Since: 11-17-05 From: In Hearst Field Annex... Last post: 6433 days Last view: 6431 days |
| ||
I go to U.C. Berkeley and I'm a Computer Science major. The class I typically TA deals with how to facilitate communication between software and hardware. In other words, that class answers the question of "how do we design an assembly language and build the hardware to run that language?". | |||
MathOnNapkins 1100 In SPC700 HELL Since: 11-18-05 Last post: 6431 days Last view: 6431 days |
| ||
Wait... they build the language first? I just figured processors were designed first, then the mnemonics / language were constructed. | |||
neotransotaku Sledge Brother Liberated from school...until MLK day Since: 11-17-05 From: In Hearst Field Annex... Last post: 6433 days Last view: 6431 days |
| ||
It could go either way. How you organize the processor lends itself how the assembly language is going to look like. Likewise, how you define the requirements of the assembly language is going to dictate how the processor is going to be designed. To be specific, when someone wants to design an assembly language or a processor, they are really designing an ISA -- instruction set architecture. |
Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - Programming - Don't know how many are familiar with MIPS, but I'd thought I'd give it a shot... | | |