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
1
vote
0 answers

Soot version of Jasmin failing to assemble Jasmin assembly files

I have both the version of Jasmin 2.4 from the Jasmin SourceForge and the version of Jasmin 2.4 from the Soot project (at sable.mcgill.ca, labeled "jasminclasses"), and the Soot version (which I need) does not seem to be working properly. I have…
Loduwijk
  • 1,950
  • 1
  • 16
  • 28
1
vote
1 answer

Jasmin JVM setup on Mac OSX

I have downloaded Jasmin JVM for my assembly language course at university. I am currently having some difficulties. How do I write .j files: - I have tried writing the files in textedit and eclipse and saving it as a .j file and then moving it…
rheak
  • 21
  • 1
  • 1
  • 4
1
vote
1 answer

Java ByteCode on String Array [Bad Type in putstatic]

I'm trying to write JVM bytecode for the class equivalent to the following: public class foo { static String[] crr; public static void printString(String str) { System.out.println(str); } public static void main(String[] args) { …
1
vote
2 answers

Java class into Jasmin assembly code

import java.util.Scanner; public class Sample { public static void main(String []args){ Scanner scan = new Scanner(System.in); int intAge; intAge = scan.nextInt(); System.out.println("Your age is " + lol + " years…
1
vote
1 answer

Jasmin array of Strings declaration/initialization error

I'm writing a compiler that generates Jasmin code and want to create an array declaration as follows: string[] name = { "asd", "asd" }; This currently generates the following code: ldc 2 ; array size newarray char ; create new…
appel
  • 517
  • 2
  • 7
  • 19
1
vote
1 answer

If javap output is inappropriate for jasmin, what's the alternative?

I need something to replace only one method in a class. jd-gui/jad often produce broken code, that may even compile, but have undefined behavior. This is why I need something to decompile classes into assembly language suitable for jasmin, so after…
basin
  • 3,949
  • 2
  • 27
  • 63
1
vote
2 answers

What is the advantage of generating Jasmin j file over Java source file?

.j file converts to .class file and .java file converts to .class file. So Why will I choose Jasmin over javac? Is there any performance cost? Or any other reason for preferring Jasmin.
kazisami
  • 168
  • 9
1
vote
1 answer

Howto use invokedynamic with Jasmin?

Here it says: Since 2.1 : [..] added the invokedynamic instruction Thus I suppose that it is possible to write instruction code containing invokedynamics with jasmin. However I could not find any documentation on the jasmin syntax and I just…
yankee
  • 38,872
  • 15
  • 103
  • 162
1
vote
1 answer

Error executing a file .classes generated by Jasmin

I have a grammar Gram.ge I have to test it with Jasmin. The folder directory contains: Gram.g CodeGenerator.java Instruction.java Main.java Opcode.java SymbolTable.java Type.java jasmin.jar Library directory that contains some programs…
user3590729
1
vote
1 answer

FPC/Java error: "JAS Error: reference from line 10039 exceed size for short."

I'm compiling a piece of Delphi code with Free Pascal with a JVM backend. On an off chance that someone who's involved in porting Free Pascal to the JVM back-end is reading this, here's a compilation error message I'm getting: MyFile.j:379326: JAS…
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
1
vote
0 answers

How to create a Hashmap in jasmin?

I want to create a HashMap inside a class in a Jasmin, it's equivalent Java would be : class grammar { Hashmap memory= new Hashmap ; } Something to do with Ljava/util/HashMap Any help would be appreciated
Sami Farhat
  • 1,164
  • 8
  • 12
1
vote
1 answer

Integrating Jasmin into Ant and Eclipse

I'm working on a Java project for which I need a very specific testing code, which I create in Jasmin, the JVM assembly. The project is built with Ant and has a nice directory structure, namely: root /src /classes /tests /build …
david.brazdil
  • 133
  • 1
  • 1
  • 4
1
vote
1 answer

How to handle field named as keywords in jasmin

I'm writing a compiler for a subset of java, and I'm almost done. The one thing I have problems with is handling classes, fields and method that are named like jasmin-keywords. For example: class Test { public static void main(String[] args) { …
Torandi
  • 1,615
  • 2
  • 9
  • 12
0
votes
1 answer

Difference between iload with '_' and without

I hava a question about the iload instruction of jasmin. Is it correct to do iload 1 or it has to be iload_1? Or when is a number between 1 and 3 we have to use the '' and the others we have to not use the ''? I m generating jasmin code. First i…
0
votes
0 answers

angular jasmin test on service

I have a service similar to the below code: allCustomerList = [] getCustomerList() { return new Observable((observer) => { const local = localStorage.getItem('customerList'); this.allCustomerList = local ? JSON.parse(local) :…
abolfazl_mehdi
  • 179
  • 2
  • 12