Skip to main content
Filter by
Sorted by
Tagged with
82 votes
8 answers
55k views

Any portable code that uses bitfields seems to distinguish between little- and big-endian platforms. See the declaration of struct iphdr in linux kernel for an example of such code. I fail to ...
Leonid99's user avatar
  • 1,317
128 votes
7 answers
48k views

I'm trying to get a deeper understanding of how the low level operations of programming languages work and especially how they interact with the OS/CPU. I've probably read every answer in every stack/...
Christoph's user avatar
  • 28.4k
24 votes
4 answers
3k views

In the Javadoc for Object.hashCode() it states As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically ...
Peter Lawrey's user avatar
42 votes
8 answers
82k views

I understand that arrays in C are allocated in row-major order. Therefore, for a 2 x 3 array: 0 1 2 3 4 5 Is stored in memory as 0 1 2 3 4 5 However, what if I have a 2 x 3 x 2 array: 0 1 2 3 ...
robintw's user avatar
  • 28.8k
10 votes
2 answers
2k views

Consider the following example taken from Wikipedia, slightly adapted, where the steps of the program correspond to individual processor instructions: x = 0; f = 0; Thread #1: while (f == 0); ...
Ignorant's user avatar
  • 2,761
27 votes
7 answers
16k views

If you had read my other question, you'll know I've spent this weekend putting together a 6502 CPU emulator as a programming exercise. The CPU emulator is mostly complete, and seems to be fairly ...
FlySwat's user avatar
  • 176k
3 votes
1 answer
425 views

I already learned that on the x86-64 platform using any 64-bit register would need a REX prefix, and any address less than 64 bits would require an address-size prefix. On x86-64 bit: E3 rel8 is jrcxz ...
Ex-Kyuto's user avatar
45 votes
3 answers
13k views

I read the following statement: The x86 architecture includes a specific segment type called the Task State Segment (TSS), to store hardware contexts. Although Linux doesn't use hardware ...
smwikipedia's user avatar
6 votes
1 answer
2k views

When we run a code, the compiler after compile "detects" the necessary amount of Stack memory? And with this, each program has its own "block" of stack memory. Or the stack memory ...
Vitor de oliveira's user avatar
71 votes
5 answers
42k views

I'm really wanting to learn assembly. I'm pretty good at c/c++, but want a better understanding of what's going on at a lower level. I realize that assembly related questions have been asked before, ...
10 votes
6 answers
6k views

I'm looking for an equivalent of LWARX and STWCX (as found on the PowerPC processors) or a way to implement similar functionality on the x86 platform. Also, where would be the best place to find out ...
Grant Peters's user avatar
  • 7,875
5 votes
9 answers
30k views

Inspired by this question How can I force GDB to disassemble? I wondered about the INT 21h as a concept. Now, I have some very rusty knowledge of the internals, but not so many details. I remember ...
Stefano Borini's user avatar
-1 votes
1 answer
1k views

I am writing a 64-bit application in C (with GCC) and NASM under Linux. Is there a way to specify, where I want my heap and stack to be located. Specifically, I want all my malloc'ed data to be ...
RuRo's user avatar
  • 370
40 votes
4 answers
31k views

How does the computer calculate Square roots ? I mean what is going on there! How does it process it!! Does it use some mathematical ways like Newton's method? What about Trigonometric Functions? And ...
Loers Antario's user avatar
22 votes
12 answers
21k views

Well, there are at least two low-level ways of determining whether a given number is even or not: 1. if (num%2 == 0) { /* even */ } 2. if ((num&1) == 0) { /* even */ } I consider the second ...
rmn's user avatar
  • 2,359
13 votes
4 answers
14k views

Coming from a high-level programming background, I am interested in learning about low-level programming. I want to know how a compiler is compiled? After looking at some articles in wiki, Numerical ...
wtsang02's user avatar
  • 18.9k
10 votes
5 answers
12k views

Which version is faster: x * 0.5 or x / 2 ? I've had a course at the university called computer systems some time ago. From back then I remember that multiplying two values can be achieved with ...
lhk's user avatar
  • 30.7k
5 votes
2 answers
8k views

My question is Gui libraries like Qt and lets say for Windows operating systems how do they create all those graphical user interfaces(windows etc). Does each operating system gives API's or ...
Lan Pac's user avatar
  • 375
0 votes
1 answer
1k views

I just wanted to ask: why is it that when I write : MOV DL, [BX] it works, but when I write: MOV DL, [AX] it doesn't?
Yasmine11's user avatar
8 votes
2 answers
9k views

I found this keyboard hook code, which I'm trying to slightly modify for my purposes: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx As an overview, I want to have the user press a key, ...
ck_'s user avatar
  • 3,829
6 votes
5 answers
9k views

What win32 calls can be used to detect key press events globally (not just for 1 window, I'd like to get a message EVERY time a key is pressed), from a windows service?
dicroce's user avatar
  • 47.1k
5 votes
8 answers
888 views

Is the difference between integer multiply(temporarily forgetting about division) still in favor of shifting and if so how big is the difference? It simply seems such a low level optimization, even ...
Roman A. Taycher's user avatar
3 votes
1 answer
5k views

I'm creating a custom keyboard layout. As the beginning step, I want to have the user press a key, have my keyboard hook intercept it, and output a different key of my choosing. I found this ...
ck_'s user avatar
  • 3,829
2 votes
6 answers
1k views

I was wondering that computers store all the info in the form of 1s and 0s/low and high voltage, yada yada...but then when we compile the program, it - or just any data stored on the comp - is in ...
Parth Thakkar's user avatar
2 votes
1 answer
7k views

I'm curently trying to initialise and configure FDCAN on the STM32U575 microcontroller to communicate with a microchip CAN Bus Analyzer. All coding is done with Keil uVision studio in low level ...
Valeri Stoyanov's user avatar