Public paste
ASM
By: microhaxo | Date: Jun 26 2009 20:24 | Format: None | Expires: never | Size: 1.07 KB | Hits: 478

  1. The goal of this lab is to read a series of numbers from a block of contineous memory, three numbers at a time.  Upon obtaining the three numbers, the program will add the three numbers together and store the result back into a second contineous block of memory.
  2.  
  3. The program flow will look like this:
  4.  
  5. START (Label)
  6.  
  7.     Call a "function"(1) named "ReadThree" to Read the next three numbers into registers %r1, %r2, and %r3.
  8.     The ReadThree function should use a memory label "INPUT", plus an offset that you store in %r10 to load the values.  %r10 should be incremented appropriately.
  9.     When you have loaded the values into the registers, return using the JMPL command with %r15 as the destination address.
  10.    
  11.  
  12. CODE that i HAVE SO FAR:
  13.  
  14. .begin
  15. .org 2048
  16. ReadThree:
  17.        
  18.  
  19. INPUT:    10  (2)
  20.           10
  21.           10
  22.           20
  23.           20
  24.           20
  25.           30
  26.           30
  27.           30
  28.           40
  29.           40
  30.           40
  31.           0
  32.           0
  33.           0
  34. OUTPUT:   0
  35.           0
  36.           0
  37.           0
  38.           0
  39.                
  40. .end