6,123 questions
Best practices
1
vote
2
replies
89
views
Loading a byte: Partial register stall for intel cpus (r8 vs r64)
My assembly program reads characters in a text file by loading them one by one in register 'al'. However I sometime need to use rax fully, and I think this causes a partial register stall. Now I think ...
-1
votes
0
answers
69
views
Exception when calling C++/CLI Methods with arguments ByVal from 64 bit Excel
I'm trying to make a C++/CLI dll to wrap a managed assembly so it can be called from VBA inside Excel (I specifically want to avoid using COM). It shall only support 64 bit.
I have based my test code ...
0
votes
0
answers
72
views
Locate return address into EXE from DllMain
I'm writing a 64-bit Windows DLL that needs to locate, on the stack, the return address that belongs to the host EXE (the place in the EXE that called into my DLL). The EXE loads my DLL and eventually ...
8
votes
1
answer
230
views
How to specify x64 emulation flag (EC_CODE) for shared memory sections for ARM64 Windows?
I'm working on an application that uses shared memory sections between processes on Windows (for an IPC mechanism between processes, where one process generates code that is executed by another ...
1
vote
0
answers
163
views
How do I change exe's ico?
I did change in Form's properties, it change the icon in the taskbar but not the execuable file. I went to Project -> Options -> Application -> Icons did create a icon using art generator, as ...
1
vote
1
answer
159
views
LoadLibraryA fails loading "user32.dll" in assembly x64
I have a code in assembly x86_64 that gets the kernel32.dll base through accessing the PEB and bla bla bla, gets the GetProcAddress address, uses that for getting the LoadLibraryA function and then i ...
4
votes
0
answers
86
views
Constant value too large for OR but not for MOV on x64 [duplicate]
I am building assembly x64 functions, compiler microsoft ml64 which comes with VisualStudio. It comes that I can't do bitwise operation on 64 bit registers when I specify a value larger than 32 bit, ...
0
votes
0
answers
48
views
sqlite3 in fasm x64 on Windows
By using 64-bit DLL (x64) for SQLite version from here and documentation from here i'm trying to use Sqlite in Fasm for of course quite reasonable reasons.
When trying to sqlite3_open a new db file ...
0
votes
0
answers
26
views
do I have to add all the SEH stuff in the x64 windows calling convention
Writing a c compiler that generates MASM and uses ml64 to assemble and link. I read a lot about the x64 windows calling convention and it seemed that I did not have to add all the SEH plumbing, in ...
0
votes
1
answer
689
views
Error when using FFMpeg in a 64-bit .NET Framework 4.8 application with FFmpeg.AutoGen 7.0
I'm facing an issue when trying to use FFmpeg in my .NET Framework 4.8 application (64-bit) with FFmpeg.AutoGen 7.0. When I try to call any FFmpeg method, such as ffmpeg.av_version_info() in the ...
4
votes
2
answers
389
views
In C, is it true that PRId64 is defined if-and-only-if int64_t is available?
I want to portably work with 64-bit signed types in C. However - I know that int64_t is not guaranteed to be defined. I can use some preprocessor magic in my build system generation (e.g. CMake's ...
0
votes
0
answers
78
views
Why do 'long' and 'long long' types behave differently when both are 64 bits? [duplicate]
I'm compiling for the x86_64 architecture using Apple Clang (Xcode 14). In the following code:
#include <iostream>
#include <stdint.h>
static void foo( long v )
{
std::cout << v;...
3
votes
3
answers
197
views
C++ chrono: store and retrieve date and time in 64 bit format for 2038 rollover
2038 is coming...I have to think date time in 64 bit! I'm trying to understand how to do this in C++, with chrono library, but I'm failing miserably so far.
I will have to communicate a date time ...
0
votes
1
answer
175
views
Unable to set instrumentation callback on other processes
Im trying to set a instrumentation callback on another process but it gives me 0xc000000d (STATUS_INVALID_PARAMETER) but if I set it on the current process then it succeeds.
Does anyone know what I am ...
1
vote
2
answers
247
views
64 bit build acting like 32 bit program with memory
Our program is acting weird. Using Delphi 11, we are building a program where the target platform is 64 bit. Every setting we have checked would point to a 64 bit result. However, when we run the ...
1
vote
1
answer
93
views
How can I enable function level linking with a Windows 64 bit assembly file
I need to have several hundred functions written in assembler. They will be statically linked into an executable. I only want the functions that are actually referenced to be included in the ...
1
vote
0
answers
107
views
Rust auto vectorization of exp function
I am trying to get some good codegen for a Rust binary in x64 but it seems very hard to get simd operations for exp.
I have a simplified code example: https://godbolt.org/z/4MY34T1zj
The code should ...
2
votes
1
answer
92
views
Assembly 8086 program to sum two 64 bit numbers using 16bit arithmetic then display the result
when i sum two numbers like
(1111 1111 1111 1111)h + (1111 1111 1111 1111)h
it display the result is (2000 20000 2000 2000)h
where the true result is (2222 2222 2222 2222)h
;the code
.model small
....
1
vote
0
answers
99
views
VirtualAllocEx Returns Memory Marked as MEM_FREE/PAGE_NO_ACCESS
I am writing x64 assembly code to invoke VirtualAllocEx win32 API (as part of process injection lab, so I am injecting into explorer.exe) and seeing unusual (to me) behavior.
The documentation states ...
1
vote
0
answers
47
views
Analyzing Performance Differences in Assembly Code on x64 Architecture [duplicate]
comparing these two assembly instructions generated by compiler:
1.
mov ebx, 1
cmp edi, ebx
jl SHORT $LN3@main
npad 7
$LL4@main:
mov eax, edi
cdq
idiv ebx
test edx, edx
je ...
4
votes
0
answers
100
views
Negative zero in 64 bit VBA floating-point numbers
Disclaimer: I'm familiar with IEEE 754 floating point numbers and know that they have signed zeroes and other special values. That is not the question. If you enjoy language lawyering, read on.
We ...
1
vote
1
answer
62
views
Why does the VMCS ES selector have a index of 0 instead of 3?
I found that the ES selector field is 0x0800 but shouldn’t it be 0x0806 since it’s the 3rd index in the list CS, SS, DS, ES, FS, GS, LDTR, TR
I got the selector list from Volume 3C: System Programming ...
0
votes
1
answer
77
views
RET to the main flow after execution of a conditional
Is there any possibility to use RET function to go back from the conditional statement to the main function (_start) where it was called from and go on with the next instructions?
Right now, it's just ...
-1
votes
1
answer
405
views
Difference between comiss and comisd in x64 asm
I wrote some code to compare the value of xmm10 and xmm6 using:
comiss xmm10, xmm6 and then comisd xmm10, xmm6
The first one works, and the second one doesn't.
I tried using subss xmm10, xmm6 followed ...
0
votes
1
answer
38
views
Order in which instructions are printed/executed
Why the output is in diffrent order than it is declared?
Shouldnt the output be in this order?
aaaa
bbbb
cccc
Instead it is:
I assume the issue is in assigning "bbb" value to the text ...