Nt1310 Unit 1 Lab Report

Words: 790
Pages: 4

#---------------------------------
# Lab 5: Pixel Conversion
#
# Name: (-- removed HTML --)
#
# --------------------------------
# Below is the expected output.
#
# Converting pixels to grayscale:
# 0
# 1
# 2
# 34
# 5
# 67
# 89
# Finished.
# -- program is finished running --
#---------------------------------

.data 0x0 startString: .asciiz "Converting pixels to grayscale:\n" finishString: .asciiz "Finished." newline: .asciiz "\n" pixels: .word 0x00010000, 0x010101, 0x6, 0x3333, 0x030c, 0x700853, 0x294999, -1

.text 0x3000

main: ori $v0, $0, 4 # System call code 4 for printing a string ori $a0, $0, 0x0 # address of startString is in $a0 syscall # print
…show more content…
# addu $t4, $a3, $a2 # blue + green addu $t4, $t4, $a1 # red + blue + green addi $a0, $0, 3 # load 3 so you can