Comments (12)
Hi Pyves !
We found that this way is not practical for our requirement, because we eventually have to end up in re writing 18 Assembly programs that was built on COBOL Zos architecture to be compatible Windows just for sake of local testing and then it cannot be put them back into production.
We proceeded my manually coding the logic in Java and plug off the old Assembly codes
But your tweak i will test it soon and comment the results !
from javassembly.
Hello @rinilnath,
It should work on Windows as well, even though I haven't actually tried. The NASM assembler is also distributed on Windows and I would suggest giving MinGW a try rather than Clang/native GCC. Let me know if you manage to get things running! 😉
Cheers,
Pyves
from javassembly.
Hi There!
I tried with GCC , the .SO file got generated, but on running the Java program.
I am getting the EXCEPTION_ACCESS_VIOLATION. I have attached the log and error screen shot.
hs_err_pid6632.log
Have you ever seen this before, please help !
from javassembly.
Interesting. In the build script, did you replace elf64
by win64
?
from javassembly.
yes.. i did it . :)
I made another correction in gcc
gcc -shared -o libArraySum.so ArraySum.o
because for my windows -z and -noexecstack was throwing invalid parameters errors
so i removed both. I dont know what it specifically does though
from javassembly.
I'll try to find some time to give a try on my Windows machine over the weekend.
from javassembly.
Thanks Much, please do let me know. I guess the problem is with the file object loading that library arraysum.so,
from javassembly.
I wondered does that .so file shared object is only meant to Linux world and not used in windows.
It needs to be like .dll right ?
Will that gcc can make that object file into the dll library. What you think ?
from javassembly.
Yes, it probably needs to be a .dll, but I wouldn't expect the GCC command to be much different.
Not needed when using MinGW on Windows.
from javassembly.
I tried in DLL , still same error
from javassembly.
Okay, mystery solved! For some reason, I had the idea that calling conventions for registers were architecture-specific. Turns out they're also OS-specific. On Windows, one must follow the conventions as documented here. In particular:
- arguments are passed in
rcx
,rdx
,r8
,r9
and subsequent ones on the stack rather thanrdi
,rsi
,rdx
,rcx
,r8
,r9
and subsequent ones on the stack. - a four-parameter stack space must be allocated and the stack must be 16-bit aligned before performing a JNI function call.
In others words, when run on Windows, the assembly was trying to perform function calls at pretty much random positions in memory, hence the EXCEPTION_ACCESS_VIOLATION
errors you were getting.
I've committed a slightly different version of the assembly code alongside a small .bat script, it runs successfully on my Windows machine. Let me know if this makes sense and if the revised Windows code works for you as well!
from javassembly.
Any luck with my help @rinilnath?
from javassembly.
Related Issues (2)
- FASM. Some error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javassembly.