x86-64

error LNK2019: unresolved external symbol referenced in function main

ぐ巨炮叔叔 提交于 2019-12-23 12:24:43
问题 Am trying to run my simple assembly code in C++.I have only two files ".cpp" file and ".asm" file. On compiling it gives an error (see below ).I would appreciate if anyone could help...:) This is my "main.cpp" file #include <iostream> using namespace std; extern "C" int GetValueFromASM(); int main(int argc, char *argv[]){ cout<<"value is:"<<GetValueFromASM()<<endl; cin.get(); return 0; } Also i have a simple "asm.asm" file .code GetValueFromASM proc mov rax,3254 ret GetValueFromASM endp end

How can I instruct the MSVC compiler to use a 64bit/32bit division instead of the slower 128bit/64bit division?

谁说胖子不能爱 提交于 2019-12-23 12:19:49
问题 How can I tell the MSVC compiler to use the 64bit/32bit division operation to compute the result of the following function for the x86-64 target: #include <stdint.h> uint32_t ScaledDiv(uint32_t a, uint32_t b) { if (a > b) return ((uint64_t)b<<32) / a; //Yes, this must be casted because the result of b<<32 is undefined else return uint32_t(-1); } I would like the code, when the if statement is true, to compile to use the 64bit/32bit division operation, e.g. something like this: ; Assume

64-bit GCC mixing 32-bit and 64-bit pointers

▼魔方 西西 提交于 2019-12-23 09:59:06
问题 Although the code works, I'm baffled by the compiler's decision to seemingly mix 32 and 64 bit parameters of the same type. Specifically, I have a function which receives three char pointers. Looking at the assembly code, two of the three are passed as 64-bit pointers (as expected), while the third, a local constant, but character string nonetheless, is being passed as a 32-bit pointer. I don't see how my function could ever know when the 3rd parameter isn't a fully loaded 64-bit pointer.

ASP.NET application developed in 32 bit environment not working in 64 bit environment

拜拜、爱过 提交于 2019-12-23 05:35:16
问题 We have developed an ASP.NET website on a Windows 7 - 32 bit platform using Visual Studio 2008. This website is being hosted at a hosting company where we share a server with hundreds of other ASP.NET websites. We are in the process of changing our hosting to a dedicated Windows 2008 - 64 bit server. We have installed Visual Studio on this new server in order to debug our application. If we try to start the application on this new server using Visual Studios 2008's own web server (not IIS 7)

Xcode 8.0 beta missing required architecture x86_64 while building on simulator

元气小坏坏 提交于 2019-12-23 02:35:12
问题 When i tried to build the project on simulator xcode 8 throws error "missing required architecture x86_64" for most of the libraries like am using gdata, googleanalytics i did lipo -info for both libGDataTouchStaticLib.a : armv7 i386 arm64 libGoogleAnalytics.a : armv7 armv7s i386 Here gdata is throwing above error but googleanalytics works And when i tried to build on device with ios10 it build without errors 来源: https://stackoverflow.com/questions/38268219/xcode-8-0-beta-missing-required

Android 64 bit architecture support

[亡魂溺海] 提交于 2019-12-23 01:58:45
问题 As many of you know Aug 2019 onwards Google is making sure all apps are supported 64 bit architecture.https://developer.android.com/distribute/best-practices/develop/64-bit That brings up the point to support 64 bit architectures for arm and x86. For x86 I think no devices are available. It's only emulators who has x86 support. My application uses some native code. So my question is if my application is 64 bit compatible for arm and not for 86. Does google accepts my updates? Doe not

SSE2 shift by vector

人盡茶涼 提交于 2019-12-23 00:29:11
问题 I've been trying to implement shift by vector in SSE2 intrinsics, but from experimentation and the intel intrinsic guide, it appears to only use the least-significant part of the vector. To reword my question, given a vector {v1, v2, ..., vn} and a set of shifts {s1, s2, ..., sn}, how do I calculate a result {r1, r2, ..., rn} such that: r1 = v1 << s1 r2 = v2 << s2 ... rn = vn << sn since it appears that _mm_sll_epi* performs this: r1 = v1 << s1 r2 = v2 << s1 ... rn = vn << s1 Thanks in

Why does this function push RAX to the stack as the first operation?

别说谁变了你拦得住时间么 提交于 2019-12-23 00:29:06
问题 In the assembly of the C++ source below. Why is RAX pushed to the stack? RAX, as I understand it from the ABI could contain anything from the calling function. But we save it here, and then later move the stack back by 8 bytes. So the RAX on the stack is, I think only relevant for the std::__throw_bad_function_call() operation ... ? The code:- #include <functional> void f(std::function<void()> a) { a(); } Output, from gcc.godbolt.org , using Clang 3.7.1 -O3: f(std::function<void ()>): # @f

How does address operand affect performance and size of machine code?

左心房为你撑大大i 提交于 2019-12-22 18:13:11
问题 Starting with 32-bit CPU mode, there are extended address operands available for x86 architecture. One can specify the base address, a displacement, an index register and a scaling factor. For example, we would like to stride through a list of 32-bit integers (every first two from an array of 32-byte-long data structures, %rdi as data index, %rbx as base pointer). addl $8, %rdi # skip eight values: advance index by 8 movl (%rbx, %rdi, 4), %eax # load data: pointer + scaled index movl 4(%rbx,

What does this x86-64 addq instruction mean, which only have one operand? (From CSAPP book 3rd Edition)

让人想犯罪 __ 提交于 2019-12-22 11:14:10
问题 In the following instructions, how does the addq work? It only has one operand, the book claims that it increments %rdx, but %rdx is not in this instruction. I am so confused... This is from the book Computer Systems A Programmers Perspective, 3rd Edition. 回答1: As @Jester pointed out in the comment. It is indeed an error. I actually typed in the program and compiled it using gcc on linux. Below is the results. C program: badcnt.c /* * badcnt.c - An improperly synchronized counter program */