Closed Dmunch04 closed 4 years ago
I would recommend reading the JVM bytecode specification. Then compile a couple simple classes and disassemble them with Krakatau to see how things work in practice.
If you have any questions after that, feel free to ask on Stack Overflow. I watch the [bytecode] tag on Stack Overflow, so I should see them there as well.
Here's the latest bytecode specification. https://docs.oracle.com/javase/specs/jvms/se14/jvms14.pdf
Yes. I've read the specs and I also know about SO. It would just be easier if there was some kind of direct chat (Like Gitter, Discord, Slack, etc.). Thanks anyway
Also Jasmin doesn't support SE14. It doesn't even have ldc2
Sorry, I don't have any sort of Gitter/Discord/Slack community.
As for Jasmin, Jasmin is old and lacking in features, which is one of the reasons I originally wrote the Krakatau assembler in the first place. I don't think there's any reason to use Jasmin nowadays.
The reason I chose to target Jasmin over Krakatau, was because they had proper docs instead of a cluttered txt file. Might use Krakatau but those docs are so hard to read.
Sorry about that. Do you have suggestions on how to improve them?
Well just making it into a markdown file would help a lot. If you wanted you could then generate those markdown files into HTML docs. And perhaps more examples in the docs? Haven't read them fully so might be wrong
Do you have examples of markup to use? What format would you like to see the documentation in? Perhaps you could provide examples?
Maybe something like this (Most content is taking from the Jasmin user guide): It's just an idea for a way to lay it out.
Krakatau files start by giving information on the class being defined in the file - such as the name of the class, the name of the source file that the class originated from, the name of the superclass, etc.
Typically, a Krakatau file starts with the two directives:
.class <access-spec> <class-name>
.super <class-name>
Which uses the following parameters:
<class-name>
:
The full name of the class, including any package names. An example could be foo/baz/MyClass
<access-spec>
:
Defines the access permissions and other attributes for the class. This is a list of zero or more of the following keywords: public
, final
, super
, interface
, abstract
An example of a class definition, could be:
.class public MyClass
.super java/lang/Object
After .class
and .super
, you can list the interfaces that are implemented by the class you are defining, using the .implements directive. The syntax of .implements
is:
.implements <class-name>
Where <class-name>
has the same format as was used by .class
and .super
. For example:
.class foo
.super java/lang/Object
.implements Edible
.implements java/lang/Throwable
That only covers two directives though, and only the most basic ones.
Perhaps you could write a rough draft for the documentation and then I can look it over, make corrections, and then merge it?
Well it would be a Lot of work. But I can take a look at it when I get home
Hi.
I'm quite new to Jasmin/Krakatau and the JVM, and was wondering if you had a Discord server/Gitter chat, or know some other similar community chat where I can get help with such things?