Starry + RL = head asplode

Going to be gone for a long time? Just got back from a trip? Keep us in the know here!

Moderators: Mystic Dragon, Xalia, Shard

Post Reply
User avatar
StarFyre
Ancient Dragon
Posts: 3246
Joined: Wed Jul 06, 2005 10:44 am
Location: Middle of Nowhere
Contact:

Starry + RL = head asplode

Post by StarFyre »

This is a warning for the people who I owe stuff too around this time.

I'm in CS320, Computer Design. We got handed a lab last Friday which is due this Wednesday.

What're we supposed to program? Oh, nothing really, we just have to write a program that will accept an array size, then accept that number of inputs, then turn around, examine all of those inputs, and output the largest of the batch.

Sounds easy, right? Everyone's now snickering at how the silly programmer is calling haitus to write a program that will take about ten seconds to write in C or Java or... well, any high level language.

Catch: High level language.

Catch: I'm writing this in Assembly.

For those of you who don't know what that is, this is a chunk of Assembly I wrote for homework.
add $12, $11, $11
add $12, $12, $S12
add $13, $12, $10
lw $5, 16($13)
addi $5, $5, 10
sw $5, -12($13)
addi $11, $11, 5
add $12, $11, $11
add $12, $12, $12
add $13, $12, $10
lw $5, 0($13)
sw $5, 8($10)
What does that translate to in a high level language? Glad you asked.
A = A[i+4] +10;
i=i+5;
A[2] = A;


What does that translate in real-people language? Glad you asked.

There is an array called A.
There is a number, referenced earlier in the program, called i. "i" is usually a counting number.
What we want to do is access the number that's in cell "i + 4", add ten to it, then assign that to the cell "i - 3".
After that, we add 5 to i and reassign that new number back to i.
After that, we want to access the number that's in cell "i" and place that number into cell 2.


Now. I have to write an entire program... in assembly.

Excuse me while I go put my head into a vise. I think that'll be less painful.
User avatar
Shard
Great Wyrm
Posts: 8950
Joined: Wed Jul 06, 2005 11:21 am
Location: San Diego CA
Contact:

Post by Shard »

Gaaaaaaah! o.o I thought we had robots to write assembly :)

Good working to you, I'm sure you'll be fine, just .... don't go crosseyed staring at the screen looking for the one symbol you forgot lol :D
Author of Repurposed
kshau-protectorate.com
User avatar
StarFyre
Ancient Dragon
Posts: 3246
Joined: Wed Jul 06, 2005 10:44 am
Location: Middle of Nowhere
Contact:

Post by StarFyre »

We do. They're called compilers.

But way back in the day, programmers wrote Assembly.

Apparently, a lot of people think it's a Brilliant Idea to throw CS majors (who, by the way, have only learned Java up to this point, if you're in the US) into the deep end of the pool and tie weights around their feet, and tell them to swim.

Sure what it feels like.
Guest

Post by Guest »

Man... Assembly... I hated using that program. I'm a CS Major myself but sadly, I gladly forgot about Assembly and Pascal... and those other tedious programs. I'm more a VB programmer now though I probably need to update my knowledge base on that now. Last I used VB is was still 6.0 I don't know what version it is right now. *sigh* That's what sucks with programming, you need to keep updated or your knowledge goes obsolete. :(
User avatar
StarFyre
Ancient Dragon
Posts: 3246
Joined: Wed Jul 06, 2005 10:44 am
Location: Middle of Nowhere
Contact:

Post by StarFyre »

So, I actually managed to get that piece of work done in a decent amount of time, but I feel like I've been put through the wringer a couple of times.

Course, that's not everything I need to finish, but it's a good chunk of it. And, of course, it didn't leave me with much facility to actually do anything but stare at the ceiling going "buhbuhbuh..."

I hate this class... and it's only going to get worse...
User avatar
Dray
Dracolich
Posts: 9386
Joined: Wed Jul 06, 2005 11:16 am

Post by Dray »

*hugs Starfyre and massages her brain* Take some time to... meditate! That's the next best thing to ceiling!Buh AND I hear it's supposed to be good for you! :P
Post Reply