Questions tagged [low-level]

In terms of a computer system, low-level refers to the components that appears lower in the stack of system layers.

In terms of a computer system, low-level refers to the components that appears lower in the stack of system layers.

679 questions
127
votes
7 answers

How exactly does the callstack work?

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/heap related thread here on Stack Overflow, and…
Christoph
  • 26,519
  • 28
  • 95
  • 133
108
votes
3 answers

Why is vectorization, faster in general, than loops?

Why, at the lowest level of the hardware performing operations and the general underlying operations involved (i.e.: things general to all programming languages' actual implementations when running code), is vectorization typically so dramatically…
Ben Sandeen
  • 1,403
  • 3
  • 14
  • 17
94
votes
10 answers

How do I create a "spacer" in a C++ class memory structure?

The issue In a low level bare-metal embedded context, I would like to create a blank space in the memory, within a C++ structure and without any name, to forbid the user to access such memory location. Right now, I have achieved it by putting an…
J Faucher
  • 988
  • 6
  • 14
89
votes
30 answers

Why do you program in assembly?

I have a question for all the hardcore low level hackers out there. I ran across this sentence in a blog. I don't really think the source matters (it's Haack if you really care) because it seems to be a common statement. For example, many modern…
Tom Ritter
  • 99,986
  • 30
  • 138
  • 174
85
votes
9 answers

Which is faster: x<<1 or x<<10?

I don't want to optimize anything, I swear, I just want to ask this question out of curiosity. I know that on most hardware there's an assembly command of bit-shift (e.g. shl, shr), which is a single command. But does it matter (nanosecond-wise, or…
Armen Tsirunyan
  • 130,161
  • 59
  • 324
  • 434
75
votes
7 answers

Why bit endianness is an issue in bitfields?

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 understand why bit endianness is an issue at all. As far…
Leonid99
  • 1,227
  • 2
  • 12
  • 10
71
votes
5 answers

To learn assembly - should I start with 32 bit or 64 bit?

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, but I'm just looking for some direction that's…
Cam
  • 14,930
  • 16
  • 77
  • 128
61
votes
9 answers

Divide by 10 using bit shifts?

Is it possible to divide an unsigned integer by 10 by using pure bit shifts, addition, subtraction and maybe multiply? Using a processor with very limited resources and slow divide.
Thomas O
  • 6,026
  • 12
  • 42
  • 60
48
votes
25 answers

How are Operating Systems "Made"?

Creating an OS seems like a massive project. How would anyone even get started? For example, when I pop Ubuntu into my drive, how can my computer just run it? (This, I guess, is what I'd really like to know.) Or, looking at it from another angle,…
stalepretzel
  • 15,543
  • 22
  • 76
  • 91
43
votes
3 answers

Why doesn't Linux use the hardware context switch via the TSS?

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 context switches, it is nonetheless forced to set…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
42
votes
4 answers

How to run a C program with no OS on the Raspberry Pi?

I'd like to experiment using the Raspberry Pi for some different low level embedded applications. The only problem is that, unlike the AVR and PIC microcontroller boards available, Raspberry Pi typically runs an OS (like Raspbian) that distributes…
watswat5
  • 671
  • 1
  • 7
  • 19
41
votes
8 answers

How are 3D arrays stored in C?

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 4 5 and 6 7 8 9 10 11 How are these stored in…
robintw
  • 27,571
  • 51
  • 138
  • 205
40
votes
3 answers

How does CheatEngine's speed hack work?

Cheat Engine comes with a feature called speed hack which basically can slow down or increase speed of the game. Actually, not only games, if there is a software with clock ticking it can speed-en up that too. How does that work? I might imagine…
Shubham
  • 21,300
  • 18
  • 66
  • 89
38
votes
4 answers

How does the computer calculate Square roots?

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 almost all those Mathematical Functions . In the…
Loers Antario
  • 1,611
  • 6
  • 20
  • 24
35
votes
2 answers

Assembly - .data, .code, and registers...?

So this morning I posted a confused question about assembly and I received some great genuine help, which I really appreciate. And now I'm starting to get into assembly and am beginning to understand how it works. Things I feel I understand alright…
Cam
  • 14,930
  • 16
  • 77
  • 128
1
2 3
45 46