In general, for int num, num++ (or ++num), as a read-modify-write operation, is not atomic. But I often see co
Following links explain x86-32 system call conventions for both UNIX (BSD flavor) & Linux: http://www.int
While writing an optimized ftol function I found some very odd behaviour in GCC 4.6.1. Let me show you the cod
I tried to compare the performance of inline assembly language and C++ code, so I wrote a function that add tw
I've been contemplating how to protect my C/C++ code from disassembly and reverse engineering. Normally
Background: While optimizing some Pascal code with embedded assembly language, I noticed an unnecessary MOV i
I've been reading about div and mul assembly operations, and I decided to see them in action by writing a
What is the difference between object code, machine code and assembly code? Can you give a visual example of
Using this example coming from wikipedia, in which DrawSquare() calls DrawLine(), (Note that this diagram h
Is a switch statement actually faster than an if statement? I ran the code below on Visual Studio 2010's
In order to mitigate against kernel or cross-process memory disclosure (the Spectre attack), the Linux kernel1
A friend of mine downloaded some malware from Facebook, and I'm curious to see what it does without infec
I am working on some Java code which needs to be highly optimized as it will run in hot functions that are inv
I was wondering how to use GCC on my C source file to dump a mnemonic version of the machine code so I could s
How can the theoretical peak performance of 4 floating point operations (double precision) per cycle be achiev
I wrote these two solutions for Project Euler Q14, in assembly and in C++. They implement identical brute forc
I was looking for the fastest way to popcount large arrays of data. I encountered a very weird effect: Changin