Comments (7)
I will try to solve this, but I would like to ask you for few things before:
- Pull the recent version from master (there are some improvements to make debugging easier)
- Name your variables (parameter after variable type)
I fixed some issues recently, but sure this is something else. Basically I don't know where the EAX/RAX comes from, it seems it was a return value of the function to me, but I'm not sure. Maybe also more code would help.
Thanks!
from asmjit.
; OP_MSR_CPSR ; REG_OFF mov eax, dword ptr [rbx+16] ; mov operand, [cpu_ptr+16] r.. w mov ecx, dword ptr [rbx+80] ; mov mode, [cpu_ptr+80] r.. .w and ecx, 31 ; and mode, 31 ... .x cmp ecx, 16 ; cmp mode, 16 ... .R je L4 ; je L4 ... . mov esi, dword ptr [rbx+16] ; mov mode, [cpu_ptr+16] r.. .w and esi, 31 ; and mode, 31 ... .x mov rdi, rbx ; [Move] cpu_ptr mov [rsp+12], eax ; [Save] operand call 5641104 ; r.. .R int 3 ; int 3 ... . mov ebx, dword ptr [r13+80] ; mov xPSR, [cpu_ptr+80] r.. . w mov r14d, [rsp+12] ; [Alloc] operand and r14d, -16776961 ; and operand, -16776961 ... x . and ebx, 16776960 ; and xPSR, 16776960 ... . x or ebx, r14d ; or xPSR, operand ... R x mov dword ptr [r13+80], ebx ; mov [cpu_ptr+80], xPSR r.. R jmp L5 ; jmp L5 ... L4: mov r13d, dword ptr [rbx+80] ; mov xPSR, [cpu_ptr+80] r.. . w and eax, -16777216 ; and operand, -16777216 ... x . and r13d, 16777215 ; and xPSR, 16777215 ... . x or r13d, eax ; or xPSR, operand ... R x mov dword ptr [rbx+80], r13d ; mov [cpu_ptr+80], xPSR r.. R mov r13, rbx ; [Move] cpu_ptr mov [rsp], r13 ; [Save] cpu_ptr L5: call 4525776 ; ... add ebp, 1 ; add total_cycles, 1 .x. add r12d, 4 ; add v3, 4 ..x
Different code, same error.
I've added some names here and there to aid debugging but the codebase is huge and it'll take some time to name them all. The int3 was added on purpose to help me trace the code flow.
The function that is called has a return address that is ignored (no setRet), can this interfere with the stack handling somehow ?
from asmjit.
Thanks, this is something I can play with a bit.
I have a suspicion that it's caused by the function argument 'u8'. I would try to use uint32_t in your case and see if the problem persists. Anyway I'm going to add more test cases and hopefully will be lucky.
from asmjit.
I think i have hit this issue or at least something similar. Will focus on test-cases and fixing today/tomorrow.
from asmjit.
Please check out branch issue9 and let me know if it fixes the issue completely since I did only limited testing.
from asmjit.
I've tested it for a couple of minutes and it seems to work fine!
I'll do more testing in the evening anyway :)
from asmjit.
Ok, I'm closing this one, if you find any other issue related to function-call please reopen.
from asmjit.
Related Issues (20)
- Shaping new JIT allocator API HOT 11
- CI Service for RISC-V port HOT 2
- How to call a external function with x86::Compiler?
- How can I convert a byte array to assembly code? HOT 3
- parse "faddp st1, st0" and "fsubp st1, st0" instruction failed HOT 1
- Unexpected error when load label address to register in AArch64 HOT 3
- InvalidDisplacement error when use loop instruction HOT 3
- Calling void function on a64 (android) not working HOT 2
- LAHF issue with x86_64 compiler HOT 2
- Return "Segmentation fault" when use std instruction HOT 4
- Jmp to label size HOT 3
- How to load the address of a label to a register? HOT 1
- "memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set" HOT 9
- No matter what I do. I am not able to get it working in my C++ CLI project. HOT 3
- Build Problem: Android Ndk build failed HOT 1
- Invalid movzx instruction generated by x86 EmitHelper::emitArgMove HOT 8
- Liveness analysis differs in Release mode vs Debug mode HOT 19
- calling names when use call instruction HOT 2
- Are the generated ISA databases still in the public domain? HOT 3
- Ports Meta Issue
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 asmjit.