How can I split an array in MIPS?

39 views Asked by At

In order to display an image in the BitMap display of MARS I am trying to loop through an array of Hex values placed in a txt file. The values in the txt file are in the following manner:

0x40E6, 0x40E6, 0x40E6, 0x40E6, 0x40E6, 0x40E6, 0x40E6, 0x40E6,...

How can I loop through it and take each Hex value separately to use it and color the BitMap display?

This is what I have done so far. It reads the whole file and prints the content.

# Getting File
        li $v0, 13
        la $a0, bgFile
        li $a1, 0
        syscall
        move $s0, $v0
    ####################################################
    # Read File
        li $v0, 14
        move $a0, $s0
        la $a1, fileWords
        la $a2, 24576
        syscall
    #####################################################   
    # Print File Content
        #li $v0, 4
        #la $a0, fileWords
        #syscall
    #####################################################
    # Close File
        li $v0, 16
        move $a0, $s0
        syscall
    #####################################################
    # Close Program
        li $v0, 10
        syscall
0

There are 0 answers