Questions tagged [jasmin]

Jasmin is an assembler for the Java Virtual Machine. It takes ASCII descriptions of Java classes, written in a simple assembler-like syntax using the Java Virtual Machine instruction set. It converts them into binary Java class files, suitable for loading by a Java runtime system.

Jasmin is an assembler for the Java Virtual Machine. It takes ASCII descriptions of Java classes, written in a simple assembler-like syntax using the Java Virtual Machine instruction set. It converts them into binary Java class files, suitable for loading by a Java runtime system.

Jasmin was originally created as a companion to the book "Java Virtual Machine", written by Jon Meyer and Troy Downing and published by O'Reilly Associates. Since then, it has become the de-facto standard assembly format for Java. It is used in dozens of compiler classes throughout the world, and has been ported and cloned multiple times. For better or worse, Jasmin remains the oldest and the original Java assembler.

The O'Reilly JVM book is now out of print. Jasmin continues to survive as a SourceForge Open Source project.

83 questions
0
votes
1 answer

Inconsistent stack height 1 !=2

so I'm trying to make a simple for loop in Jasmin that prints out hello world everytime it goes through the loop. The problem is whenever I try to increment it by adding one I get this error that says, "Error: Unable to initialize main class…
Paul Dann
  • 3
  • 4
0
votes
2 answers

Is it possible to integrate the JVM's assembly language into standard high level Java code?

I am trying to merge the Java assembly code (using Jasmin (an assembler interface in java)) with standard Java code.Like this public class SomeClass{ public void testPrinting(){ System.out.println("Hello World"); } .method…
zaree
  • 641
  • 2
  • 6
  • 15
0
votes
1 answer

Jasmin NoSuchMethodError when converting to binary Java class

I am trying to use Jasmin to convert Jasmin assembly code to a Java class file. Using the Hello World example from here. The following error is returned: Exception in thread "main" java.lang.NoSuchMethodError: jasmin.parser.parse()V at…
Felipe Sulser
  • 1,185
  • 8
  • 19
0
votes
1 answer

Setting array references equal jasmin assembler

I am having some problems figuring out how to assign to arrays equal to each other in jasmine. I wish to compile code like the following array a[1]; array b[1]; a = b; Now I want an actual copy of b not assigning them to the same thing. Suppose a…
Vladimir_314159
  • 1,457
  • 1
  • 9
  • 21
0
votes
1 answer

Jasmin assembler using array assignment satements

var a int[1]; var aa int[1]; aa = a; Suppose we wanted to compile something like this in java jvm. It would seam that one would just do a ldc 1 newarray int astore 0 ldc 1 newarray int astore 1 aload 0 istore 1 However this is not…
Vladimir_314159
  • 1,457
  • 1
  • 9
  • 21
0
votes
0 answers

Jasmin throwing an error for incorrect agruments for iastore

I am currently writing a compiler for a given language that should compile to the java virtual machine. I am currently getting arrays to work and I have come to the following problem for the following code in my language package foo func main() { …
Vladimir_314159
  • 1,457
  • 1
  • 9
  • 21
0
votes
0 answers

Butchers algorithm in Jasmin

I keep getting errors and I have been trying to print this forever it seems. Ive looked for info on Jasmin and as far as I can tell there really isn't a lot of information. Any help with my code would be greatly appreciated. I'm supposed to use…
Jessica
  • 11
  • 1
0
votes
2 answers

Jasmin ByteCode Storing a String

I am trying to store a String in Jasmin Bytecode. After allot of research I could not find if this was possible and if it was, how it should be done. I could only find out how I could print it out(this is how I print a string). I also thought of…
shiteatlife
  • 57
  • 2
  • 12
0
votes
1 answer

Assembly language in Jasmin - getting syntax error

In putty I am attempting to create a Jasmin program that, when assembled and ran as a Java program, will output the integer "431". When I attempt to assemble the program the console says there is a syntax error on line 11. I am having trouble…
Darien Springer
  • 467
  • 8
  • 17
0
votes
1 answer

Intermediate Code Generation

I started using ANTLR 4 for my compiler course and I already created my grammar. ANTLR gives me the Lexer and the Parser but how can I generate an intermediate code? Someone told me to use Jasmin but I did't know how to use it. NB: ANTLR gives me…
Tadesse
  • 76
  • 2
  • 4
0
votes
1 answer

Useless store causing crash

I have this jasmin assembly, which is the equivalent of the simplification of JVM assembly produced by a bytecode rewriter I am writing. It crashes when run, but works if I remove the sipush and the first store. .method public simple()V .limit…
user1937198
  • 4,987
  • 4
  • 20
  • 31
0
votes
1 answer

Java bytecode with Jasmin: why is the message not printed on the screen?

I recently became interested in Java bytecode and I created the following Hello World program. The "Hello World" is printed, however I can't figure out why "Creating awesome object" isn't printed. Can you help me figure out what I'm doing…
Aviv Cohn
  • 15,543
  • 25
  • 68
  • 131
0
votes
1 answer

Getting a ClassFormatError in Jasmin

I'm trying to create a program that would print some text using jasmin. This is a piece of the whole code: zfor: 1 iload 3 ; pushes z to stack 2 iload 1 ; pushes i to stack 3 if_icmpge nextfor ; if (z>=i) goto nextfor …
rookie
  • 3
  • 4
0
votes
1 answer

Format output of jasmin with ANTLR in java

int addr = gen_address(); $code.addr = addr; $code.append( ldc(44), istore(addr), "getstatic java/lang/System/out Ljava/io/PrintStream;", iload(addr), …
boudi
  • 682
  • 1
  • 8
  • 19
0
votes
1 answer

How can I convert Java code to Jasmin without compiling?

I need to convert some pieces of a class into Jasmin (or if possible, Smali) and mix new codes with disassembled ones together. What I want to know is: Is that possible? and if yes, How? (I have diff patches of java files but don't have source code…
Hadi77
  • 127
  • 8