SHARE
TWEET

Untitled

a guest Sep 19th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mov r1,2
  2. .loop1:
  3.   mov r4,0
  4.   mov r2,1
  5.   .loop2:
  6.     add r3,r2,1
  7.     mul r5,r2,r2
  8.     mul r5,r5,r2
  9.     .loop3:
  10.       mul r6,r3,r3
  11.       mul r6,r6,r3
  12.       add r7,r6,r5
  13.       cmp r7,r1
  14.       beq.foo2
  15.       .foo3:
  16.       add r3,r3,1
  17.       mul r6,r3,r3
  18.       mul r6,r6,r3
  19.       cmp r1,r6
  20.       bgt.loop3
  21.   add r2,r2,1
  22.   mul r5,r2,r2
  23.   mul r5,r5,r2
  24.   cmp r1,r5
  25.   bgt.loop2
  26. cmp r4,2
  27. beq.foo1
  28. add r1,r1,1
  29. b.loop1
  30. .foo1:
  31.   exit
  32. .foo2:
  33.   add r4,r4,1
  34.   b.foo3
  35.  
  36. //Smallest ramanujan number will be stored in register r1 //
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top