Offload int[] to byte[].
[SquirrelJME.git] / modules / cldc-compact / src / test / resources / lang / interfaces / TestInvokeInterfaceABViaAB.j
blobed3d2a84a5e74b4ea618357e088f82793ffc13b9
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 ; ---------------------------------------------------------------------------
9 ; Same as TestInvokeInterfaceAB except it invokes the interface methods via
10 ; InterfaceAB and not InterfaceA+InterfaceB.
12 .class public lang/interfaces/TestInvokeInterfaceABViaAB
13 .super net/multiphasicapps/tac/TestInteger
15 .method public <init>()V
16 aload 0
17 invokenonvirtual net/multiphasicapps/tac/TestInteger/<init>()V
18 return
19 .end method
21 .method public test()I
22 .limit stack 2
23 ; Allocate and initialize an implementation
24 new lang/interfaces/ImplementsAB
25 dup
26 invokespecial lang/interfaces/ImplementsAB/<init>()V
28 ; Duplicate for the second call
29 dup
31 ; Call the first, the result is on the stack
32 invokeinterface lang/interfaces/InterfaceAB/methodA()I 1
34 ; Swap the two so the object is at the top then call again
35 swap
36 invokeinterface lang/interfaces/InterfaceAB/methodB()I 1
38 ; Add both values together which becomes the result
39 iadd
40 ireturn
41 .end method