1; Example JVM assembly
2; Tested with JasminXT 2.4
3
4.bytecode 49.0
5.source HelloWorld.java
6.class public final enum HelloWorld
7.super java/lang/Object
8.implements java/io/Serializable
9.signature "Ljava/lang/Object;Ljava/io/Serializable;"
10.enclosing method hw/jasmin.HelloWorldRunner.run()V
11.deprecated
12.annotation visible HelloWorld
13    I I = 0
14.end annotation
15.debug "Happy debugging!"
16
17.inner interface public InnerInterface inner 'HelloWorld$InnerInterface' outer HelloWorld
18.inner class public InnerClass inner HelloWorld$InnerClass outer 'HelloWorld'
19
20.field public volatile transient I I
21.field static protected final serialVersionUID 'J' signature "TJ;" = 2147483648
22.field annotation protected 'protected' [[[Lcom/oracle/util/Checksums;
23	.deprecated
24	.signature "[[[Lcom/oracle/util/Checksums;"
25	.attribute foo "foo.txt"
26	.attribute 'foo' "foo.txt"
27.end field
28.field public newline I
29.field public static defaultString 'Ljava/lang/String;'
30
31.method public <init>()V
32    .limit stack 3
33.line 7
34    .var 0 is self LHelloWorld; from 0 to 1
35    aload_0
36    invokenonvirtual java/lang/Object/<init>()V
37    return
38.end method
39
40.method static public main([Ljava/lang/String;)V
41    .limit locals 7
42    .limit stack 10
43    .throws java.lang/RuntimeException
44    .catch java/lang.ClassCastException from cast to 'extra_l' using /extra
45    .signature "([Ljava/lang/String;)V"
46    .stack
47        offset /Input
48        locals Object java/lang/String
49        locals Uninitialized 'End'
50        locals Uninitialized 0
51        locals Top
52        locals Integer
53        locals Float
54        locals Long
55        locals Double
56        locals Null
57        locals UninitializedThis
58        stack Object java/lang/String
59        stack Uninitialized End
60        stack 'Uninitialized' 0
61        stack 'Top'
62        stack Integer
63        stack Float
64        stack Long
65        stack Double
66        stack Null
67        stack UninitializedThis
68    .end stack
69    .stack use 1 locals
70        offset 'extra'
71    .end stack
72    .stack use locals
73    .end stack
74.line 0xd
75    .var 0 is args [Ljava/lang/String;
76    aload_w 0
77    arraylength
78    ifne /Input
79    iconst_1
80    anewarray java/lang/String
81    checkcast [Ljava/lang/String;
82    astore_0
83    aload_0
84    iconst_0
85    ldc "World"
86    dup
87    putstatic HelloWorld.defaultString Ljava/lang/String;
88    aastore
89/Input:
90    iconst_2
91    iconst_3
92    multianewarray [[C 2
93    astore_1
94    aload_1
95    iconst_0
96    aaload
97    astore_2
98    aload_1
99    iconst_1
100    aaload
101    astore_3
102
103<<o:
104    aload_3
105    iconst_0
106    invokestatic HelloWorld/int()I
107    castore
108
109<<\u0020:
110    aload_3
111    dconst_1
112    dconst_0
113    dsub
114    d2i
115    invokestatic HelloWorld/double()D
116    d2i
117    castore
118
119<<!:
120    aload_3
121    lconst_0
122    dup2
123    lxor
124    lconst_1
125    dup2
126    ladd
127    lsub
128    lneg
129    l2i
130    invokestatic HelloWorld/long()J
131    l2i
132    castore
133
134<<H:
135    aload_2
136    fconst_0
137    fconst_1
138    fconst_2
139    dup_x2
140    fdiv
141    fmul
142    f2l
143    l2i
144    swap
145    invokestatic HelloWorld/float(F)F
146    f2i
147    castore
148
149<<e	:
150    aload_2
151    iconst_1
152    i2s
153    i2c
154    i2b
155    iconst_1
156    newarray short
157    dup
158    iconst_0
159    iconst_1
160    newarray byte
161    dup
162    iconst_0
163    sipush 0x65
164    bastore
165    iconst_0
166    baload
167    sastore
168    iconst_0
169    saload
170    int2short
171    int2char
172    int2byte
173    castore
174
175 <<l :
176    aload_2
177    iconst_2
178    bipush 0x1b
179*2:
180    iconst_1
181    ishl
182    dup
183    lookupswitch
184        0: '/lookupswitch'
185        0x6c: /lookupswitch
186        default: *2
187/lookupswitch:
188    castore
189
190    ldc2_w 2
191    dup2
192    lcmp
193    .set i 4
194    .set 'j' 5
195    .var 4 is i I from 'i++' to End
196    .var 5 is j I signature "I" from i++ to End
197    istore 4
198    goto 1
199i++:
200    iinc 4 1
2011:  iconst_0
202    istore_w 5
203    goto_w 2
204j++:
205    iinc_w 5 1
2062: getstatic java/lang/System/out Ljava/io/PrintStream;
207    aload_1
208    iload 4
209    aaload
210    iload_w 5
211    caload
212    invokevirtual java/io/PrintStream/print(C)V
213    iload 5
214    iconst_1
215    if_icmpne $+6
216    jsr extra
217    iload 5
218    iconst_2
219    if_icmplt j++
220    iconst_1
221    iload 4
222    if_icmpgt i++
223
224<<\u00a0:
225    getstatic java/lang/System/out Ljava/io/PrintStream;
226    invokestatic HelloWorld/get"example()LHelloWorld;
227    getfield HelloWorld/newline I
228    invokevirtual java/io/PrintStream/print(C)V
229End:
230    return
231
232extra:
233    astore 6
234    iload 4
235    tableswitch 0 1
236        extra_l
237        extra_string
238        default: 'End'
239    nop
240extra_string:
241    getstatic java/lang/System/out Ljava/io/PrintStream;
242    aload 0
243    iconst_0
244    aaload
245    invokevirtual java/io/PrintStream/print(Ljava/lang/String;)V
246cast:
247    ldc java/lang/String
248    checkcast java/lang/Class
249    pop
250    ldc Ljava/lang/String;
251    checkcast Ljava/lang/Class;
252    pop
253    iconst_1
254    dup
255    newarray boolean
256    checkcast [Z
257    pop
258    newarray 'int'
259    checkcast HelloWorld
260    checkcast LHelloWorld;
261    pop
262extra_l:
263    getstatic java/lang/System/out Ljava/io/PrintStream;
264    dup
265    ldc "\123.\456.\u006c.\n.\r.\t.\f.\b.\".\'.\\"
266    iconst_5
267    invokeinterface java/lang/CharSequence/charAt(I)C 2
268    invokevirtual java/io/PrintStream/print(C)V
269/extra:
270    pop
271    ret 6
272.end method
273
274.method private static get"example()LHelloWorld;
275    .limit locals 3
276    .limit stack 4
277    .catch all from 7 to 53 using 59
278    aconst_null
279    dup
280    dup
281    astore_w 0
282try:
283    goto $+0x11
284finally:
285    astore_w 2
286    putfield HelloWorld/newline I
287    ret_w 2
288    nop
289    aload_0
290    areturn
291    ifnonnull $-2
292    ifnull $+3
293    new HelloWorld
294    dup
295    dup
296    invokespecial HelloWorld/<init>()V
297    astore 0
298    aload 0
299    monitorenter
300    monitorexit
301    new java/lang/RuntimeException
302    dup
303    invokespecial java/lang/RuntimeException/<init>()V
304    athrow
305    aconst_null
306/try:
307    dup
308    aconst_null
309    if_acmpeq $+3
310    areturn
311catch:
312    jsr $+10
313    aload_0
314    dup
315    aconst_null
316    if_acmpne /try
317    areturn
318    astore_1
319    aload_0
320    ldc 10
321    jsr_w finally
322    ret 1
323'single\u0020quoted\u0020label': ; Messes up [@ below if lexed sloppily
324.end method
325
326.method varargs private static int()I
327    .annotation invisible HelloWorld
328        [@ [@ WhatIsThis??? = .annotation ; name, type, exttype
329            I I = 1 ; name, type
330            another-I I = 2
331            Enum e Ljava/util/logging/Level; = FINE
332        .end annotation
333        .annotation
334            s s = "foo"
335            another-s s = "bar"
336            Enum [e Ljava/util/logging/Level; = FINE FINE 'FINE' FINE
337        .end annotation
338        float F = 123.456
339    .end annotation
340    .annotation visibleparam 1 LHelloWorld;
341        x [I = 0x01 0x02 0x03
342        y I = 2
343    .end annotation
344    .annotation invisibleparam 255 HelloWorld
345        a F = 1.2
346        b D = 3.4
347    .end annotation
348    .annotation default
349        I = 0
350    .end annotation
351    .limit locals 4
352    .limit stack 20
353    iconst_1
354    newarray int
355    dup
356    dup
357    instanceof [Z
358    bipush 0x9
359    bipush 0xB
360    iand
361    iconst_5
362    iconst_4
363    dup_x1
364    iconst_m1
365    iadd
366    bipush +-111
367    ineg
368    swap
369    idiv
370    dup_x2
371    dup
372    ishr
373    ishl
374    imul
375    ior
376    bipush -73
377    ixor
378    isub
379    dup
380    iconst_1
381    iadd
382    irem
383    iastore
384    iconst_0
385    iaload
386    istore_0
387    iload_0
388    istore_1
389    iload_1
390    istore_2
391    iload_2
392    istore_3
393    iload_3
394    dup
395    dup
396    dup2_x1
397    if_icmpeq $+33
398    dup
399    dup
400    if_icmpge $+28
401    dup
402    dup
403    if_icmple $+23
404    dup
405    ifle $+19
406    dup
407    ifeq $+15
408    dup
409    iflt $+11
410    dup
411    ifgt $+7
412    dup
413    ifge $+3
414    ireturn
415.end method
416
417.method static private fpstrict double()D
418    .limit locals 7
419    .limit stack 11
420    dconst_1
421    dconst_0
422    dcmpg
423    newarray double
424    dup
425    dconst_0
426    dup2
427    dcmpl
428    ldc2_w 128.
429    ldc2_w -240.221d
430    dneg
431    ldc2_w 158.d
432    dup2
433    dadd
434    dup2_x2
435    drem
436    ddiv
437    pop2
438    dconst_1
439    dmul
440    d2f
441    f2d
442    d2l
443    l2i
444    iconst_2
445    iushr
446    i2d
447    dastore
448    iconst_0
449    daload
450    dstore_0
451    dload_0
452    dstore_1
453    dload_1
454    dstore_2
455    dload_2
456    dstore_3
457    dload_3
458    dstore 4
459    dload 4
460    dstore_w 5
461    dload_w 5
462    dreturn
463.end method
464
465.method static long()J
466    .limit locals 7
467    .limit stack 11
468    iconst_1
469    newarray long
470    dup
471    iconst_0
472    ldc2_w 5718613688
473    ldc2_w 3143486100
474    ldc2_w 0x3
475    ldiv
476    lmul
477    ldc2_w -10000000000
478    lrem
479    ldc_w 0x60
480    i2l
481    lor
482    ldc 0x33
483    i2l
484    land
485    dup2
486    iconst_1
487    lshl
488    iconst_3
489    lshr
490    iconst_3
491    lushr
492    ladd
493    l2d
494    d2l
495    l2f
496    f2l
497    lastore
498    iconst_0
499    laload
500    lstore_0
501    lload_0
502    lstore_1
503    lload_1
504    lstore_2
505    lload_2
506    lstore_3
507    lload_3
508    lstore 4
509    lload 4
510    lstore_w 5
511    lload_w 5
512    lreturn
513.end method
514
515.method private static float(F)F
516    .limit locals 6
517    .limit stack 9
518    iconst_1
519    newarray float
520    dup
521    fload_0
522    dup
523    fcmpg
524    fload_0
525    dup
526    dup
527    dup
528    dup2_x2
529    fadd
530    fsub
531    fneg
532    frem
533    ldc 70
534    i2f
535    fadd
536    fadd
537    swap
538    pop
539    fastore
540    fload_0
541    dup
542    fcmpl
543    faload
544    fstore_0
545    fload_0
546    fstore_1
547    fload_1
548    fstore_2
549    fload_2
550    fstore_3
551    fload_3
552    fstore 4
553    fload 4
554    fstore_w 5
555    fload_w 5
556    freturn
557.end method
558
559.method abstract bridge synthetic 'acc1()V'
560    breakpoint
561.end method
562
563.method native synchronized acc2()V
564.end method
565