Advertisement
Guest User

magic

a guest
Nov 2nd, 2015
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Icon 1.03 KB | None | 0 0
  1. .constant
  2. OBJREF 0x30
  3. .end-constant
  4.  
  5. .main
  6. .var
  7.     a
  8.     b
  9.     temp
  10.     des
  11.     simt
  12. .end-var
  13.  
  14. start:  IN
  15.     DUP
  16.    
  17.     BIPUSH 0x2B
  18.     IF_ICMPEQ goto
  19.     DUP
  20.    
  21.     BIPUSH 0x2D
  22.     IF_ICMPEQ goto3
  23.     DUP
  24.    
  25.     BIPUSH 0x2A
  26.     IF_ICMPEQ goto4
  27.     DUP
  28.    
  29.     BIPUSH 0x3D
  30.     IF_ICMPEQ goto2
  31.     GOTO start
  32.  
  33. goto:   POP
  34.     INVOKEVIRTUAL sudek
  35.     GOTO start
  36. goto3:  POP
  37.     INVOKEVIRTUAL atimk
  38.     GOTO start
  39.    
  40. goto4: 
  41.     INVOKEVIRTUAL daugink
  42.     GOTO start
  43. goto2:  POP
  44.     OUT
  45.     HALT
  46. .end-main
  47.  
  48. .method sudek(a, b)
  49.         ILOAD a
  50.         BIPUSH 0x30
  51.         ISUB
  52.         ISTORE a
  53.         ILOAD b
  54.         BIPUSH 0x30
  55.         ISUB
  56.         ISTORE b
  57.         ILOAD a
  58.         ILOAD b
  59.         IADD
  60.         IRETURN
  61. .end-method
  62.  
  63. .method atimk(a, b)
  64.         ILOAD a
  65.         BIPUSH 0x30
  66.         ISUB
  67.         ISTORE a
  68.         ILOAD b
  69.         BIPUSH 0x30
  70.         ISUB
  71.         ISTORE b
  72.         ILOAD a
  73.         ILOAD b
  74.         ISUB
  75.         IRETURN
  76. .end-method
  77.  
  78. .method daugink(a, b, temp)
  79.         ILOAD a
  80.         BIPUSH 0x30
  81.         ISUB
  82.         DUP
  83.         ISTORE a
  84.        
  85.         ILOAD b
  86.         BIPUSH 0x30
  87.         ISUB
  88.         ISTORE temp
  89.         IINC temp -1
  90. start:  ILOAD temp
  91.         IFEQ end
  92.         ILOAD a
  93.         IADD
  94.         IINC temp -1
  95.         GOTO start
  96. end:    IRETURN
  97. .end-method
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement