https://github.com/pyvesb/javassembly
:floppy_disk: Calling Assembly from Java: simple example using the JNI and NASM.
https://github.com/pyvesb/javassembly
assembler assembly java jni nasm x86-64 yasm
Last synced: 7 months ago
JSON representation
:floppy_disk: Calling Assembly from Java: simple example using the JNI and NASM.
- Host: GitHub
- URL: https://github.com/pyvesb/javassembly
- Owner: PyvesB
- License: mit
- Created: 2017-05-11T20:05:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-14T18:22:10.000Z (over 6 years ago)
- Last Synced: 2025-04-04T06:41:29.847Z (10 months ago)
- Topics: assembler, assembly, java, jni, nasm, x86-64, yasm
- Language: Assembly
- Homepage:
- Size: 25.4 KB
- Stars: 35
- Watchers: 4
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**A simple example showing how assembly language can be called from Java using the Java Native Interface (JNI). The native function sums the elements of an array of integers and returns the result as a long.**
# Getting started
#### :heavy_check_mark: Requirements
To compile and run this project, you will need:
- the JDK
- an assembler such as NASM or Yasm
- a compiler such as GCC, Clang or MinGW-w64
The example and build scripts can easily be modified to accommodate other assembler or compiler requirements.
#### :cd: Running the code
Simply use the following commands:
```
git clone https://github.com/PyvesB/javassembly.git
cd JavAssembly
#Linux or macOS
./build nasm
#Windows
build nasm
java JNIArraySum
```
#### :earth_americas: Useful links
The following pages may be of interest:
- Related [DZone article](https://dzone.com/articles/pushing-the-jni-boundaries-java-meets-assembly)
- Related [StackOverflow answer](https://stackoverflow.com/questions/11632078/code-injecting-assembly-inlining-in-java/43926410#43926410)
- [Java JNI Functions](http://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html)
- Assembler manuals: [NASM](http://www.nasm.us/xdoc/2.13.01/html/nasmdoc0.html), [Yasm](http://www.tortall.net/projects/yasm/manual/html/index.html)
# Contributing
#### `$ code`
Want to make JavAssembly better, faster, stronger? Contributions are more than welcome, open a **pull request** and share your code! Simply **fork** the repository by clicking on the icon on the top right of this page and you're ready to go!
#### :speech_balloon: Support
Thought of a cool idea? Found a problem or need some help? Simply open an [**issue**](https://github.com/PyvesB/JavAssembly/issues)!
#### :star: Thanks
Find the project useful, fun or interesting? **Star** the repository by clicking on the icon on the top right of this page!
# License
MIT License