# This is the contest file for CptS 260, programming project 4 # Version 1.0, 12/10/2008 # Carl Hauser # To run this code # jal contest # from your main program after doing any necessary setup for your own code .data image1: .word 0x0000ffff, 0xffffff00, 0x00ff0000, 0x00000000, 0x00ff0000, 0x00000000, 0x00ff0000, 0x00000000 .word 0x00ff00ff, 0xffffff00, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x0000ffff, 0xffffff00 image2: .word 0x0000ffff, 0xffff0000, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00 .word 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x0000ffff, 0xffff0000 image3: .word 0x0000ffff, 0xffffff00, 0x00ff0000, 0x00000000, 0x00ff0000, 0x00000000, 0x00ff0000, 0x00000000 .word 0x00ff0000, 0x00000000, 0x00ff0000, 0x00000000, 0x00ff0000, 0x00000000, 0x0000ffff, 0xffffff00 image4: .word 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00 .word 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x0000ffff, 0xffff0000 block1: .word image1, 8, 0, 8, 0, 8 block2: .word image2, 8, 0, 8, 0, 8 block3: .word image3, 8, 0, 8, 0, 8 block4: .word image4 8, 0, 8, 0, 8 .data 0x10010200 # exact address does not matter ; should be a multiple of 0x20 though image5: .space 1024 block5: .word image5, 32, 1, 8, 0, 8 block6: .word image5, 32, 1, 8, 8, 8 block7: .word image5, 32, 1, 8, 16, 8 block8: .word image5, 32, 1, 8, 24, 8 block9: .word image5, 32, 1, 8, 1, 31 block10: .word image5, 32, 0, 8, 0, 31 .text contest: # purposefully mysterious, hence lack of comments! addiu $sp, $sp, -4 sw $ra, 0($sp) la $a0, block3 la $a1, block5 li $a3, 0 jal byteblt la $a0, block2 la $a1, block6 li $a3, 0 jal byteblt la $a0, block4 la $a1, block7 li $a3, 0 jal byteblt la $a0, block1 la $a1, block8 li $a3, 0 jal byteblt # At this point you may be able to visually detect a message in image5 # Set a breakpoint to see it # Now, move it around a bit la $a0, block9 la $a1, block10 la $a3, 0 jal byteblt la $a0, block10 la $a1, block9 li $a3, 0 jal byteblt lw $ra, 0($sp) addiu $sp, $sp, 4