Announcement

Collapse
No announcement yet.

Vettori - Doppie condizioni

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vettori - Doppie condizioni

    Code:
    #vet a 10 ele
    #
    #
    #
    #end = 0
    #somma = 0
    #for ( i=0;i<10 && end ==0;i++)
    #    if (a[i] <0 )
    #        end=1
    #    else
    #        somma = somma + a[i]
    #
    #
    #$1=i
    #$2= spiaz i
    #$3= somma
    #$4= end
    #$5= i<10,a[i]
    #$6= slt a[i]<0
    %veta = 1152
    %start = 1400
    
    
                    add $3,$0,$0 # somma =0
                    add $4,$0,$0 # end = 0
                    add $1,$0,$0 #i=0
                    add $2,$1,$1 #spiaz i 
                    add $2,$2,$2
    inizio_for:     slti $5,$1,10 #i<10
                    beq $5,$0,fine_for
                    bne $4,$0,fine_for
    inizio_if:      addi $5,$2,1152
                    lw $5,0($5)
                    slt $6,$5,$0
                    beq $6,$0,else_if
                    addi $4,$0,1
                    j fine_if
    else_if:        add $3,$3,$5
    fine_if:        addi $1,$1,1
                    add $2,$1,$1
                    add $2,$2,$2
                    j inizio_for
    fine_for:       add $0,$0,$0
    | VFX Artist, C++ Programmer, HW Overclocker | Web: xgiovio.com Email: xgiovio@gmail.com Twitter: @xgiovio
Working...
X

Google Profile


My name is Giovanni Di Grezia, but people call me xgiovio.

Here is my homepage:.

I'm a VFX Artist and Software Developer.

Giovanni Di Grezia