win64

Is it possible to output a string to the console in C without including the standard library?

半腔热情 提交于 2021-01-28 21:46:56
问题 I'm trying to get better understanding of how assembly and machine code works. So I'm compiling this simple snipet with gcc : #include <stdio.h> int main(){ printf("Hello World!"); return 0; } But this includes the default library. I would like to output hello world without using printf but by inlining some assembly in the C file, and adding -nostdlib and -nodefaultlibs options to gcc. How can I do that ? I'm using Windows 10 and mingw-w64 with Intel core i7 6700 HQ (laptop processor). Can I

Is it possible to output a string to the console in C without including the standard library?

时光怂恿深爱的人放手 提交于 2021-01-28 21:16:41
问题 I'm trying to get better understanding of how assembly and machine code works. So I'm compiling this simple snipet with gcc : #include <stdio.h> int main(){ printf("Hello World!"); return 0; } But this includes the default library. I would like to output hello world without using printf but by inlining some assembly in the C file, and adding -nostdlib and -nodefaultlibs options to gcc. How can I do that ? I'm using Windows 10 and mingw-w64 with Intel core i7 6700 HQ (laptop processor). Can I

Exceptions ignored in form_load for x64

删除回忆录丶 提交于 2020-01-15 06:56:06
问题 When I throw an exception from form_load in my C# application it doesn't work when the platform is x64. (it acts as expected for x86) When I step through the code, I get to the line where the exception it thrown, then it immediately jumps to timer_Tick. When I create a new project and add this line to form_load: throw new System.Exception("oops!"); For x86 it crashes as expected. For x64 it doesn't crash. Is there some way to get an application to actually throw from form_load on 64-bit? 回答1:

How to detect if the Windows DWORD_PTR type is supported, using an ifdef?

可紊 提交于 2020-01-11 09:52:08
问题 There are some new integer types in the Windows API to support Win64. They haven't always been supported; e.g. they aren't present in MSVC6. How can I write an #if condition to detect if these types are supported by <windows.h> ? (My code needs to compile under many different versions of Microsoft Visual C++, including MSVC6. So I need to provide my own definitions of these types, with an #if to disable them in newer compilers). (For searchers, the full list of types is: DWORD_PTR, INT_PTR,

C/C++ returning struct by value under the hood

落花浮王杯 提交于 2020-01-02 07:04:41
问题 (This question is specific to my machine's architecture and calling conventions, Windows x86_64) I don't exactly remember where I had read this, or if I had recalled it correctly, but I had heard that, when a function should return some struct or object by value, it will either stuff it in rax (if the object can fit in the register width of 64 bits) or be passed a pointer to where the resulting object would be (I'm guessing allocated in the calling function's stack frame) in rcx , where it

psql: FATAL: password authentication failed for user windows 8

限于喜欢 提交于 2020-01-02 01:03:49
问题 I installed postgresql on windows and while the installation it asks to make a user for the account.This made a new windows user in my computer called postgres, I have created a password for it as well. Now I want to run psql on windows command line, it asks for a password (without mentioning the user) and always gives me back the error: psql: FATAL: password authentication failed for user "Ash". Even though I have put my accounts password many times. using pgadmin I changed the user

psql: FATAL: password authentication failed for user windows 8

淺唱寂寞╮ 提交于 2020-01-02 01:03:10
问题 I installed postgresql on windows and while the installation it asks to make a user for the account.This made a new windows user in my computer called postgres, I have created a password for it as well. Now I want to run psql on windows command line, it asks for a password (without mentioning the user) and always gives me back the error: psql: FATAL: password authentication failed for user "Ash". Even though I have put my accounts password many times. using pgadmin I changed the user

How do you compile OpenSSL for x64?

↘锁芯ラ 提交于 2019-12-28 03:51:08
问题 After following the instructions in INSTALL.W64 I have two problems: The code is still written to the "out32" folder. I need to be able to link to both 32-bit and 64-bit versions of the library on my workstation, so I don't want the 64-bit versions to clobber the 32-bit libs. The output is still 32-bit! This means that I get "unresolved external symbol" errors when trying to link to the libraries from an x64 app. 回答1: To compile the static libraries (both release and debug), this is what you

With python: intervals at x:00 repeat

為{幸葍}努か 提交于 2019-12-24 09:48:23
问题 How do I sched a repeat timer for 5 min intervals. Which fire at 00 seconds, then repeat at 00. Ok, not hard real-time but as close as possible with sys lags. Trying to avoid a build up in lags and get near 00. Lang: Python, OS: WinXP x64 System has 25ms resolution. Any code would be helpful, tia 回答1: I don't know how to do it any more accurately than with threading.Timer. It's "one-shot", but that just means the function you schedule that way must immediately re-schedule itself for another

How to compile existing posix code for 64-bit Windows?

耗尽温柔 提交于 2019-12-20 15:46:28
问题 I'm ok with using Cygwin or MinGW, but I need to end up with 64-bit code, not 32-bit. This is because I will be calling the DLL from 64-bit managed C#. I can't seem to find and good references for setting up those tools to create 64-bit binaries. Also, it would be nice if the GCC was version 4, not version 3 as came with my Cygwin install. An alternative would be some form of interprocess communication. I will research that, but what I laid out above is what I really want. 回答1: The 64-bit