Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

MIPS Assembly code

Name: Anonymous 2011-02-19 20:48

I've been handed an assignment that looks like this and I have no fucking clue how to even get started, it involves taking in a string and determining if it's the longest palindrome. Couldn't find anything else helpful online so thought I might as well come here.

To practice MIPS calling conventions, you must implement 3 functions called “get_to_end” “get_longest,” and  “is_ palindrome:”

•    get_to_end (30 points): It accepts one argument stored in $a0 which is the starting address of a string. It should return two values. In $v0, it should return the address of the last character of the string. In $v1 it should return the number of characters in this string. 
 
•    is_ palindrome (40 points): It accepts one argument stored in $a0, which is the starting address of a string. It should return two values. In $v0, it should return 0 if the string is not a palindrome, and 1 if it is a palindrome. In $v1 it should return the number of characters in this string. Inside it must call “get_to_end” (because obviously it is useful).

•    get_longest (30 points): It accepts two arguments stored in $a0, and $a1, respectively. $a0 is the starting address of an array of 32-bit numbers; $a1 is the number of elements in this array. Each element in this array is the starting address of a string (which may or may not be a palindrome). It should return one value in $v0 which is the starting address of the longest palindrome in the array. Inside it must call “is_ palindrome” for obvious reasons. It should not all “get_to_end.”

Name: Anonymous 2011-02-19 23:19

>>5
ARM
dead platform

HAHAHA No. ARM is strong-arming there way into the future. 64-bit ARM and quad-core and oct-core 2GHZ ARM SoCs have been announced.

ARM is fucking fantastic. It has a very relaxed cache coherency model, much better than x86/x86-64's shitty implicit acquire/release fence model, so ARM has better prospects for scalability in a shared memory systems.

Also, http://pandaboard.org/ dual-core ARM Cortex A9 MPcore SoC dev board with PowerVR SGX540, display port and HDMI out, 1GB of RAM, runs Linux for $179.

By 2020, I guarantee you every average person will have one or more ARM enabled devices, even in the developing world (which will be much closer to the first-world in wealth and technology in another decade).

Also, ARM assembly is nice to work with. It's RISC, and has nice stuff for atomic operations and floating-point SIMD. Also, if you have to ever work with the DMA controller, it's a breeze compared to x86-land DMA.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List