commit 84812d7664ebc64fa593aeb95dfb34cd8169e127 Author: PlexSheep Date: Sun Dec 10 14:00:11 2023 +0100 initial commit diff --git a/bin/Hello.class b/bin/Hello.class new file mode 100644 index 0000000..431ada1 Binary files /dev/null and b/bin/Hello.class differ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..29b1e4e --- /dev/null +++ b/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e +if [ -z "$1" ] +then + echo "specify the project name to build" +else + jasmin -d bin src/$1.jas + ls -lah bin/$1.class + echo -e "executing ================================================\n" + cd bin + java $1 +fi diff --git a/src/Hello.jas b/src/Hello.jas new file mode 100644 index 0000000..dbfc752 --- /dev/null +++ b/src/Hello.jas @@ -0,0 +1,17 @@ +.class public Hello +.super java/lang/Object + +.method public ()V + aload 0 + invokenonvirtual java/lang/Object/()V + return +.end method + +.method public static main([Ljava/lang/String;)V + .limit locals 1 + .limit stack 2 + getstatic java/lang/System/out Ljava/io/PrintStream; + ldc "Hello World!" + invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V + return +.end method