Programming Assignments

153.9.220.145:8000/grader

Here is your workflow for programming assignments.

  1. come here to this page and find out what your program needs to do
  2. write and debug a solution in MARS
  3. next time you are on campus, go to the grading site, copy your code from MARS, paste it into the grading window, and push the "submit" button
  4. if you have properly debugged your program, that's it; log out and do something else

Here are some suggestions for doing the programs that involve subroutines.

.data
(your variables here)

################# for program 7 submit the part between this line and the next comment line ################
.text
.globl main
main:
       (your main program code here)
       li  $v0  10    # exit program
       syscall
############################## for program 8 submit the part below this line #####################

.globl inc3
inc3:
       (your code for inc3 here)
       jr  $ra

Here is the list of the programming assignments that are on the grading site.

  1. Load the value 1 into register $t0 and the value 2 into register $t1.
  2. Add the value in memory location x to the value in memory location y and put the answer into memory location z.
  3. Write a program that implements this python statement: z = a + b + c - d
  4. Due 18 March -- Write this in assembly language:
    if (x == y) {
        z = 14;
        w = 23;
    }
    u = x + 5;
            
  5. Due 20 March -- Write this in assembly language:
    if x == y:
        z = 21
        w = 15
    else:
        u = 17
    x = 29
            
  6. Due 20 March -- Write this in assembly language:
    if x == y:
        z = 21
        w = 15
    else:
        z = 15
        w = 21
    x = y = 76
            
  7. Due 23 March -- We have a function already written:
    public int inc3(int i)
    
    that adds 3 to its parameter and returns the result.
    
    Write this main program that calls it:
    
    int x = inc3(x);
            
  8. Due 27 March: Write a function inc5 that adds 5 to its parameter. I will call it.
  9. Due 1 April: Take the strcount1 program on OAKS and turn it into a function
  10. Due 4 April: Write a function that copies a string.
  11. Due 7 April: Write a program that makes y the same as x but with bit4 and bit10 set.
  12. Due 9 April: Write a program that makes y the same as x but with bit2 and bit14 cleared.
  13. Due 19 April: Write a function named clrfun that clears bit5, bit6, and bit11 in its parameter and returns the result.
  14. Due 19 April: Write a function named setfun that sets bit3, bit9, and bit14 in its parameter and returns the result.