assign.bc

来自「Practical Java也是一本和J2ME手机游戏开发相关的书」· BC 代码 · 共 24 行

BC
24
字号
 0 iconst_5           //Push 5 on the stack.
 1 istore_1           //Pop 5 and store it at index 1 of the local
                      //variable table(x).
 2 iload_0            //Push index 0(N).
 3 newarray int       //Pop N and create a new array of length N.
                      //Push reference to this array(a).
 5 astore_2           //Pop a and store at index 2.
 6 iconst_0           //Push 0.
 7 istore_3           //Pop 0 and store at index 3(i).
 8 goto 22            //Jump to location 22.
11 aload_2            //Push the object reference at index 2(a).
12 iload_3            //Push the value at index 3(i).
13 aload_2            //Push the object reference at index 2(a).
14 iload_3            //Push the value at index 3(i).
15 iaload             //Pop i and a. Push the ith element of a.
16 iload_1            //Push index 1(x).
17 iadd               //Pop the top two values and push their sum.
18 iastore            //Pop the top three values(sum, i, a). Store
                      //sum at the ith element of a.
19 iinc 3 1           //Increment i stored at index 3 by 1.
22 iload_3            //Push index 3(i).
23 iload_0            //Push index 0(N).
24 if_icmplt 11       //Pop i and N. Jump to location 11 if i is
                      //less than N.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?