kneefer

AK - SPARC

Mar 30th, 2015
673
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .global _start
  2.  
  3.  
  4. _start:
  5.     MOV %g0, %l0        ! wyzerowanie local[0]
  6.     MOV 1, %l1      ! local[1] = 1
  7.     ST %l1, [%l0]      
  8.     ADD %l0, 4, %l0
  9.     ST %l1, [%l0]
  10.  
  11.     MOV %g0, %l2
  12.     ADD %l2, 8, %l2
  13.     MOV %l0, %l1
  14.     MOV %g0, %l0
  15.    
  16. recur:
  17.     LD [%l0], %l4
  18.     LD [%l1], %l3
  19.    
  20.     MOV %l4, %o0
  21.     MOV %l4, %o1
  22.     CALL multiply  
  23.     NOP
  24.  
  25.     ADD %l3, %o0, %l3
  26.     ADD %l3, %o0, %l3
  27.     ADD %l3, %o0, %l3
  28.     ADD %l3, %o0, %l3
  29.     ADD %l3, %o0, %l3
  30.     ST %l3, [%l2]
  31.  
  32.     ADD %l0, 4, %l0
  33.     ADD %l1, 4, %l1
  34.     ADD %l2, 4, %l2
  35.    
  36.     BA recur
  37.     NOP
  38.  
  39. multiply:
  40.     SAVE %sp, -96, %sp 
  41.    
  42.     MOV %g0, %l0
  43.     MOV %i1, %l1
  44.  
  45. loop:
  46.     ADD %i0, %l0, %l0
  47.     SUB %l1, 1, %l1
  48.     CMP %l1, 0
  49.     BG loop
  50.     NOP
  51.    
  52.     MOV %l0, %i0
  53.  
  54.     RET
  55.     RESTORE
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×