assignment4.asm - .data array.space 40 name.asciiz"Prakhar...

This preview shows page 1 - 2 out of 2 pages.

.data array: .space 40name: .asciiz "Prakhar Praveen"prompt: .asciiz "Enter a number "newline: .asciiz "\n".text.globl mainmain:addi $sp, $sp, -4sw $a0, 0($sp)sw $ra, 4 ($sp)lui $a0, 0x1001addi $a0, $a0, 40addi $v0, $0, 4syscalljal readDatareadData:lui $a0, 0x1001addi $a0, $a0, 0addi $t0, $0, 0top:addi $a0, $a0, 56addi $v0, $0, 4syscalladdi $v0, $0, 5syscalladdi $t1, $v0, 0slti $t2, $t1, 10beq $t2, $t0, endaddi $t0, $t0, 1beq $t0, $0, emdj topaddi $v0, $t0, 0end:jr $rajal floatAveragefloatAverage:lui $a0, 0x1001addi $a0 $a0, 40addi $a1, $t0, 0addi $s0, $a0,0 addi $s1, $0, 0addi $s2, $0, 0top1:slti $t1, $s2, 10

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture