Fiesta Fan Forums

Fiesta Fan Forums (http://www.fiestafan.com/forums/index.php)
-   M O S (http://www.fiestafan.com/forums/forumdisplay.php?f=25)
-   -   So FF is back online! (http://www.fiestafan.com/forums/showthread.php?t=28940)

Belaslav 02-08-2011 03:21 AM

So FF is back online!
 
:cutielove:

cillia 02-08-2011 04:24 AM

withdrawal symptoms were imminent.

A_Forever 02-08-2011 04:25 AM

LOL. Just IM'd Cillia on FB about it. Ha

Good timing <3

Blaaaaaaaah 02-08-2011 05:30 AM

-sighs with relief-

a.L 02-08-2011 08:05 AM

Oh good, I was just about to go on a rampage with a chainsaw...

Sparkeh 02-08-2011 09:40 AM

It was down? I thought it was my internet, I called my ISP and got a free day 4MB LOL.

Rightclaw 02-08-2011 03:03 PM

Bela was slamming his head on F5 all day long.

Loveless 02-08-2011 07:53 PM

Quote:

Originally Posted by Rightclaw (Post 435705)
Bela was slamming his head on F5 all day long.

Lol

Belaslav 02-08-2011 08:33 PM

Hmm, the server went offline several times during the day. Just curious...

Besides, if you had to choose between assemply programming and surfing FF, the choice would be obvious. Here's some assemply coding to show you what I mean.

The main program:
Quote:

.globl Fraction
.globl getNumerator
.globl getDenominator
.globl adding
.globl setNumerator
.globl setDenominator
.text

Fraction:
#--------------------------------------------
add "$"t0, "$"0, "$"a0 # t0 = numerator
add "$"t1, "$"0, "$"a1 # t1 = denominator

x: addi "$"v0, "$"0, 9 # service #9 - specify num of bytes in "$"a0
addi "$"a0, "$"0, 8 # a0 = 8(block of bytes to be allocated in the heap)
syscall

sw "$"t0, 0("$"v0) # store t0 (num) at v0 (starting address)
sw "$"t1, 4("$"v0) # store t1 (denom) at 4 bytes down from v0 (starting address in mem)

jr "$"ra


# store the attributes somewhere in memory and
# return a reference to where they are

getNumerator:
#---------------------------------------------

lw "$"v0, 0("$"a0)
jr "$"ra

# retrieve the numerator of this
# fraction and return it in "$"v0

getDenominator:
#---------------------------------------------

lw "$"v0, 4("$"a0)
jr "$"ra

# retrieve the numerator of this
# fraction and return it in "$"v0

adding:
#---------------------------------------------

lw "$"t0, 0("$"a0) # numerator first fraction
lw "$"t1, 4("$"a0) # denominator first fraction
lw "$"t2, 0("$"a1) # numerator second fraction
lw "$"t3, 4("$"a1) # denominator second fraction

mult "$"t0, "$"t3
mflo "$"t0

mult "$"t1, "$"t2
mflo "$"t2

add "$"t0, "$"t0, "$"t2

mult "$"t1, "$"t3
mflo "$"t1
j x

setNumerator:
#---------------------------------------------

add "$"t0, "$"0, "$"a0 # t0 = numerator
sw "$"t0, 0("$"v0) # store t0 (num) at v0 (starting address)
jr "$"ra

#---------------------------------------------

setDenominator:
#---------------------------------------------

add "$"t1, "$"0, "$"a1 # t0 = numerator
sw "$"t1, 4("$"v0) # store t0 (num) at 4 bytes down v0 (starting address)
jr "$"ra

#---------------------------------------------

And the client:
Quote:

.text

#-----------------------------------------------
main: sw "$"ra, 0("$"sp) # store ra(return address) in sp(Stack Pointer)
addi "$"sp, "$"sp, -4 # decrement stack pointer by 4 bytes

addi "$"a0, "$"0, 3 # a0 = 3 (argument0)
addi "$"a1, "$"0, 8 # a1 = 8 (argument1)
jal Fraction # jump and link to Fraction
add "$"s0, "$"0, "$"v0 # s0 holds address stored in v0 (3/8)

addi "$"a0, "$"0, 1 # a0 = 1 (argument0)
addi "$"a1, "$"0, 2 # a1 = 2 (argument1)
jal Fraction
add "$"s1, "$"0, "$"v0 # s1 holds address stored in v0 (1/2)

add "$"a0, "$"0, "$"s0
add "$"a1, "$"0, "$"s1
jal adding
add "$"s2, "$"0, "$"v0

#-----------------

add "$"a0, "$"0, "$"s0
jal getNumerator
add "$"a0, "$"0, "$"v0 # store the numerator from v0 in "$"a0 (temp)

addi "$"v0, "$"0, 1
syscall

addi "$"v0, "$"0, 11
addi "$"a0, "$"0, '/'
syscall

add "$"a0, "$"0, "$"s0
jal getDenominator
add "$"a0, "$"0, "$"v0

addi "$"v0, "$"0, 1
syscall

#------------------

addi "$"v0, "$"0, 11
addi "$"a0, "$"0, 10
syscall

#------------------

add "$"a0, "$"0, "$"s1
jal getNumerator
add "$"a0, "$"0, "$"v0 # store the numerator from v0 in "$"a0 (temp)

addi "$"v0, "$"0, 1
syscall

addi "$"v0, "$"0, 11
addi "$"a0, "$"0, '/'
syscall

add "$"a0, "$"0, "$"s1
jal getDenominator
add "$"a0, "$"0, "$"v0

addi "$"v0, "$"0, 1
syscall

#------------------

addi "$"v0, "$"0, 11
addi "$"a0, "$"0, 10
syscall

#------------------

add "$"a0, "$"0, "$"s2
jal getNumerator
add "$"a0, "$"0, "$"v0 # store the numerator from v0 in "$"a0 (temp)

addi "$"v0, "$"0, 1
syscall

addi "$"v0, "$"0, 11
addi "$"a0, "$"0, '/'
syscall

add "$"a0, "$"0, "$"s2
jal getDenominator
add "$"a0, "$"0, "$"v0

addi "$"v0, "$"0, 1
syscall

#------------------

add "$"v0, "$"0, "$"s1
addi "$"a0, "$"0, 7 # a0 = 7 (argument0)
addi "$"a1, "$"0, 9 # a1 = 9 (argument1)
jal setNumerator
jal setDenominator

#------------------

addi "$"v0, "$"0, 11
addi "$"a0, "$"0, 10
syscall

#------------------
add "$"a0, "$"0, "$"s1
jal getNumerator
add "$"a0, "$"0, "$"v0 # store the numerator from v0 in "$"a0 (temp)

addi "$"v0, "$"0, 1
syscall

addi "$"v0, "$"0, 11
addi "$"a0, "$"0, '/'
syscall

add "$"a0, "$"0, "$"s1
jal getDenominator
add "$"a0, "$"0, "$"v0

addi "$"v0, "$"0, 1
syscall

#------------------

addi "$"sp, "$"sp, 4
lw "$"ra, 0("$"sp)

jr "$"ra
All this does is print:

3/8
1/2
14/16
7/9

....No really.

EDIT: Had to to put "" around dollar signs, otherwise variables wouldn't parse properly.

Hraesvelg 02-08-2011 10:31 PM

Ugh. I hated assembly.


All times are GMT. The time now is 06:07 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.