Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .constant
- c 100
- .end-constant
- .method mul(x, y)
- .var
- i
- res
- .end-var
- ILOAD y
- ISTORE i
- BIPUSH 0
- ISTORE res
- lb_add: ILOAD res
- ILOAD x
- IADD
- ISTORE res
- IINC i -1
- ILOAD i
- IFEQ lb_done
- GOTO lb_add
- lb_done: ILOAD res
- IRETURN
- .end-method
- .method pow(x, y)
- .var
- i
- res
- .end-var
- ILOAD y
- ISTORE i
- BIPUSH 1
- ISTORE res
- lb_mul: BIPUSH 0
- ILOAD res
- ILOAD x
- INVOKEVIRTUAL mul
- ISTORE res
- IINC i -1
- ILOAD i
- IFEQ lb_done
- GOTO lb_mul
- lb_done: ILOAD res
- IRETURN
- IRETURN
- .end-method
- .main
- BIPUSH 0
- BIPUSH 2
- BIPUSH 4
- INVOKEVIRTUAL mul
- BIPUSH 0
- BIPUSH 2
- BIPUSH 4
- INVOKEVIRTUAL pow
- .end-main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement