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

Pages: 1-4041-

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 20:58

Couldn't find anything else helpful online
http://www.mips.com/products/architectures/mips32/#specifications
Now get the fuck out.

Name: Anonymous 2011-02-19 21:00

MIPS is cool and much cleaner than ugly x86. CISC failed.

Name: Anonymous 2011-02-19 22:43

ARM kicks your MIPS ass.

Name: Anonymous 2011-02-19 22:44

>>4
haha imagine Lisp on ARM. dead language on dead platform.

long live x86, faggots

Name: Anonymous 2011-02-19 22:49

>ARM ... dead platform
>cell phones all around me

exCUUUUUUUUUUUUUUUUUUUUUUUUUUSEEE ME?

Name: Anonymous 2011-02-19 22:56

>>5
haha imagine C++ on x86. bloated language on bloated platform.

long live SHard, faggots

Name: Anonymous 2011-02-19 23:14

Thats really easy. My prof made us do a skyscrapper problem and print out a visual representation of the board...this is simple.

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.

Name: Anonymous 2011-02-19 23:23

Windows 8 will have a general-purpose ARM desktop/laptop distribution. The fact that Microsoft has finally caved in after all of these years just shows that they know ARM is going to become much more important in the near future. Ignoring ARM now is suicide.

Name: Anonymous 2011-02-19 23:24

>>9
PowerVR SGX540
¡Viva la nvidia!

The only reason I'd buy ARM shit would be to reverse engineer the shit out of the SGX drivers.

Name: Anonymous 2011-02-19 23:26

>>11
Fuck your Tegra shit, eats batteries alive compared to PowerVR.

PowerVR is getting OpenCL in another couple of months, so there's no point for nVidia. Also, Img Tech is acquiring Caustic Graphics, developer of real-time ray tracing GPUs.

Name: Anonymous 2011-02-19 23:34

>>12
I was just making a parallel between Img Tech and nVidia in that they both refuse to publish specs or open source drivers; I wasn't at all saying that Tegra is better than PowerVR. Sorry for the misunderstanding. If PowerVR does become more and more popular, someone will eventually start a Nouveau-like project for it, and I'll give in and buy one of those cheap devboards just to RE on it.

Name: Anonymous 2011-02-19 23:36

>>9-10
First I heard of this. I guess the death of x86 is finally at hand. The only thing holding things back now would be software backwards compatibility. All of those custom enterprise systems mostly run on x86 hardware, and the original developers are long gone and management doesn't care to fix something that ain't broke.

Name: Anonymous 2011-02-19 23:42

>>13
I stand corrected, I thought you were an nVidia fan boy. Please accept my apologies for my harsh critique.

I agree. Img Tech needs to be forced into open sourcing their specs, much like ATI/AMD was. nVidia, well, until their current executive team is gone, they won't change.

Thing is, Img Tech is probably safe from light community pressure, they operate like ARM Holdings does in licensing their architecture, so anyone can purchase a license to the PowerVR specs, no one is barred from being a partner. But the barrier for entry is just to great for individuals or an open source foundation though.

Name: Anonymous 2011-02-19 23:51

>>9
It has a very relaxed cache coherency model
Interesting, may I request a URL with more information about that?

Name: Anonymous 2011-02-20 0:42

>>16
http://infocenter.arm.com/help/topic/com.arm.doc.genc007826/Barrier_Litmus_Tests_and_Cookbook_A08.pdf

It almost has a one-to-one mapping with the new fine-grained C1x and C++0x memory models for C and C++, with the exception of no bidirectional fencing.

http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2007/n2324.html

But on the other hand, ARM is future proofed for NUMA and heterogeneous computing environments, allowing you to isolate memory fences to the scope of NUMA nodes. In fact, OMAP5 from TI will be a NUMA design, with dual-core ARM Cortex A15s and dual-core ARM Cortex M4s for dedicated DSP and vector processing [single-precision floating point SIMD].

x86/x86-64 is quite fucked in this regard, and it's one of the reasons why Larrabee never delivered the performance it promised.

Name: Anonymous 2011-02-20 0:42

>>9

It has a VERY RELAXED ANUS

Name: Anonymous 2011-02-20 0:48

>>17
Thank you very much.

Name: Anonymous 2011-02-20 0:50

>>17

C++0x

8==D~

Name: Anonymous 2011-02-20 1:06

Oh, the other thing to mention is that while ARM doesn't have bidirectional fences, adding in additional instructions for them is still possible as regular loads and stores have no implicit fencing, without breaking compatibility.

With x86/x86, if Intel were to change the memory model to remove the implicit fences, it would break everything. Existing OS kernels for x86/x86-64 would be worthless.

Name: Anonymous 2011-02-20 1:13

<-- check 'em

Name: Anonymous 2011-02-20 9:00

See -> clang -> LLVM IL -> llc -march=mips -> MIPS assembly.

Was it that hard, [bbcode]faggot[/bbcode]?

Name: Anonymous 2011-02-20 13:11

>>23
not solving the problem
loutish imageboard language
go away

Name: Anonymous 2011-02-20 14:24

>>24
not solving the problem
Forget it, it's NP-complete.

Name: Anonymous 2011-02-20 17:07

>>24
Oh, you polecat!

Name: Anonymous 2011-02-21 6:48

>>11
Take a look at the poulsbo drivers. While crappy, Intel licensed the 3D acceleration IP from ImgTech. I've confirmed that some of the registers in the Poulsbo driver are there on a OMAP3530

Name: Anonymous 2011-02-21 9:43

>>24

not solving the problem
Only if your retard can not code in See. Or LLVM IL for that matters.

loutish imageboard language
What? IHBT? Considering that it comes from greentext/quote wannabe who can not multiquote, IHBT hard.
Well, at least 二十四-san used sage, so it could be worse.

Name: Anonymous 2011-02-21 11:45

>>28
>taking seriously an imageboardfag
>he put a newline after the quote
>mfw
inb4 back2/g/

Name: Anonymous 2011-02-21 12:30

>>28
Good, good.  Pretend to understand a few more memes and I'm sure you'll fit in.

Name: Anonymous 2011-02-21 12:45

>>29
use
proper
multiquote
``faggot''

Name: Anonymous 2011-02-21 14:01

>>29
>mfw i read your post
wtfamireading.jpg

Name: Anonymous 2011-02-21 14:01

<-- that's cool and all, but check my doubles over there

Name: Anonymous 2011-02-21 14:05

>>31
There's nothing proper about “multiquoting”, retard.  A single quote block is only valid when quoting a single block of text.

Name: Anonymous 2011-02-21 14:22

1
2
3

Name: Anonymous 2011-02-21 14:23

1
2
3


1
2
3

Name: Anonymous 2011-02-21 14:26

>>35,36
1
2
3
4
5
6
7
8
9
m
y
a

n

u

s

Name: Anonymous 2011-02-21 18:38

>



>



>
>

Name: Anonymous 2011-02-22 4:36

>>34
All I see:
>"
>I'm
>faggot
>who
cannot

multiquote

oh fuck it! I'm giving up"

Name: ( ͡° ͜ʖ ͡°) 2012-12-08 15:55

( ͡° ͜ʖ ͡°)

Name: Anonymous 2012-12-08 16:30

>>1
loops, and arrays to walk the character. Obviously the index will yield the longest. In C, this is way too easy.

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