⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 《java virtual machine》是研究jvm的一本书
💻
字号:
This contains three examples of using the assembler
from java and from the script

Look up http://www.blackdown.org/~kbs/jas.html for more
documentation. This only tells you how to run the examples.  The
documentation is very Unix centric, I apologize.... I have not had
time to set this up on the PC's yet.


simple.java:
simple.jas:

  Unexciting program that generates a do nothing class.

  Go up a directory and compile simple.java. Run the program,
  which generates the bytecode. Disassemble the bytecode

  % (cd ..; javac -d . examples/simple.java; java simple; javap -p -c out)

  Same thing, but using the script instead of java directly.

  % (cd ..;  java scm.driver examples/simple.jas; javap -p -c out)


hworld.java:
hworld.jas:

  Print a string in a loop.

  % (cd ..; javac -d . examples/hworld.java; java hworld; java out)

  As before, but use script instead.

  % (cd ..; java scm.driver examples/hworld.jas; java out)

exprcomp.java:

  Primitive runtime expression compiler. It translates arithmetic
  expressions into bytecode and loads it on the fly as a class, which
  is run to get the answer. test.inp is an example of the sort of
  arithmetic expressions it translates.

  % (cd ..; javac -d . examples/exprcomp.java; java exprcomp examples/test.inp)

exprcomp.jas:

   Primitive compiler for jas arithmetic expressions (in jas).
   jas is fairly expressive, thats about the only point of this
   exercise ;-) Unlike the java version, this gets written out
   into a file which you'll have to run to get the results.

  % (cd ..; java scm.driver examples/exprcomp.jas; java results)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -