phoron_asm 1.0.2

A Jasmin-compatible Assembler for the JVM
Documentation
; create a small array of integers and confirm its type using `instanceof`

.class public CheckArrayType
.super java/lang/Object

.method public <init>()V
  aload_0
  invokespecial java/lang/Object/<init>()V
  return
.end method

.method public static main([Ljava/lang/String;)V
  .limit stack 2
  .limit locals 3

  bipush 5
  newarray int  ; make an array of 5 ints
  astore_1 ; store reference in local 1

  getstatic java/lang/System/out Ljava/io/PrintStream;
  aload_1
  instanceof [I ; check if the reference is an int array, 1 - yes, 0 - no
  invokevirtual java/io/PrintStream/println(I)V

  bipush 10
  newarray char ; array of 10 chars
  astore_2

  getstatic java/lang/System/out Ljava/io/PrintStream;
  aload_2
  instanceof [I
  invokevirtual java/io/PrintStream/println(I)V ; this should print 0

  return
.end method