Offload int[] to byte[].
[SquirrelJME.git] / modules / cldc-compact / src / test / resources / lang / interfaces / TestInvokeInterfaceAB.j
blobc58544c64b653efbc6be01a9a7e7e7da7f11404c
1 ; -*- Mode: Jasmin; indent-tabs-mode: t; tab-width: 4 -*-
2 ; ---------------------------------------------------------------------------
3 ; SquirrelJME
4 ; Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 ; ---------------------------------------------------------------------------
6 ; SquirrelJME is under the Mozilla Public License Version 2.0.
7 ; See license.mkd for licensing and copyright information.
8 ; ---------------------------------------------------------------------------
10 .class public lang/interfaces/TestInvokeInterfaceAB
11 .super net/multiphasicapps/tac/TestInteger
13 .method public <init>()V
14 aload 0
15 invokenonvirtual net/multiphasicapps/tac/TestInteger/<init>()V
16 return
17 .end method
19 .method public test()I
20 .limit stack 2
21 ; Allocate and initialize an implementation
22 new lang/interfaces/ImplementsAB
23 dup
24 invokespecial lang/interfaces/ImplementsAB/<init>()V
26 ; Duplicate for the second call
27 dup
29 ; Call the first, the result is on the stack
30 invokeinterface lang/interfaces/InterfaceA/methodA()I 1
32 ; Swap the two so the object is at the top then call again
33 swap
34 invokeinterface lang/interfaces/InterfaceB/methodB()I 1
36 ; Add both values together which becomes the result
37 iadd
38 ireturn
39 .end method