low-level

Very low level question about Ruby and linking to libraries

I happen to be working in a sandboxed Ruby environment and have been trying to add libraries to it with mixed results. However, it has raised some interesting questions about how Ruby works. I'm looking to understand how Ruby links libraries and how it decides what to load when it starts up. What is going on when I do a require 'someLi...

The importance of learning a lower level language

Possible Duplicates: Am I wasting my time learning C and other low level stuff ? Is knowing some basic low-level stuff essential to all programmers? Lots of people recommend to me learning a low-level programming such as Forth, C, or even Assembler, but I'm still a little uncertain of the actual importance of learning a low-le...

GNU LD Script to catch C++ group / dynsym Sections

I'm maintaining a tool which can convert ELF32 relocatables to RDOFF2 format. For this process to work I need to pre-link the input files currently using the ld-script shown below: OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) FORCE_COMMON_ALLOCATION SECTIONS { .text : { /* collect .init / .f...

C++ class to access bytes/words of an unsigned integer

union LowLevelNumber { unsigned int n; struct { unsigned int lowByte : 8; unsigned int highByte : 8; unsigned int upperLowByte : 8; unsigned int upperHighByte : 8; } bytes; struct { unsigned int lowWord : 16; unsigned int highWord : 16; } words; }; This union allows me to access the unsigned integer byte or word...

Help understand C Stack

I am trying to understand low-level memory manager in C especially Stack. As I was told, when a function is called, a return address was push on a stack. Then local variables is located after that. So I write a small program to investigate this. Here is my program: #include <stdio.h> void TestStack(); void DoTestStack() { char x1...

How do memory mapped devices prevent RAM from responding to read operation?

Assume we have a memory mapped device taking a certain address space. The CPU tries to read something from the device, so it tries to read a certain word in that address space. What really happens? When the memory controller responds, it will cause contention on the bus since both RAM and the device are trying to respond to the same req...

Low-level keyboard hook issue : Keyboard state losed when application is not focused (Delphi)

Hello, I've been asked to develop a new application that will work along side the existing one. Both application will wait for a barcode reader input. I don't want our operator to scan a barcode twice: once for the existing application (16bit - clipper, no sources) and once for the new application. To solves this issue I've decided to u...

C memory management for Cross-platform VM.

Hi all, I asked a question about C-type sizes which I get a pretty good answer but I realized that I may not formulate the question very well to be useful for my purpose. My background was from Computer Engineer before moves to Software Engineer so I like computer architectures and always thinking about making VM. I've just finished an ...

Inline Assembler: What scratch registers can be used?

When inserting inline assembler into a function in a C-like language, what is the convention about what registers you're allowed to use for scratch? Is it the compiler's responsibility to save the values of all the registers it needs to save before entering the asm block? Is it the responsibility of the programmer to store the values i...

What is the purpose of the sorted bit vector field in the "~" Metadata header in a .NET assembly?

According to the Partition II metadata, it says that the valid field is a bitmask that notes which CLR metadata tables are present in a .NET executable--but what I can't figure out is what the "sorted" field is for--what is its significance, and what should I emit into this field when creating my own .NET portable executable images? ...

Can I put LowLevelMouseProc and LowLevelKeyboardProc in the main EXE?

Global Windows hooks must be in a DLL because the hook is going to be called in the context of a different process, so the hook procedure's code must be injected into that process. However, there are limitations: SetWindowsHookEx can be used to inject a DLL into another process. A 32-bit DLL cannot be injected into a 64-bit pro...

Dissertation about the Dangers of Modern Day Abstractions of Software Development

I am currently reading for a BSc. in Software Development, and the time has come for me to start thinking about a topic for my thesis. I have recently started learning C by myself and I now wish to base my dissertation on something that involves low level development. This is because I wish to get very familiar with low level fundament...

What's the most efficient way to compare two blocks of memory?

I need a comparison function for blocks of memory for doing binary searches on arrays of bytes in the D programming language. It does not need to have any useful semantics. It only needs to be fast and be a valid comparison function (one that produces a total ordering). The blocks of memory to be compared are already known to be the s...

Allocation latency seems high, why?

I have a (java) application that runs in a low latency environment, it typically processes instructions in ~600micros (+/- 100). Naturally as we've moved further into the microsecond space the things you see that cost latency change and right now we've noticed that 2/3 of that time is spent in the allocation of the 2 core domain objects...

Advice on implementing low-level libraries in D (as opposed to C/C++)

I need some advice on selecting the D programming language for a project. The project is a low-level library akin to a database with many associative containers and so forth. Hence efficiency is quite important to me. I need to provide a C API for the library for compatibility with other languages like C++ and Python and I also anticipa...

Need Assembly Programming Help (TASM) - Booth's Algorithm

I've written an algorithm to simulate Booth's Algorithm using only Add, Sub, and Logical Operators and return a hexadecimal value. My Tasm compiler keeps throwing me these errors. When I try to omodify the code, it still doesn't work. Could someone help me out please. (29) Extra characters on line (38) Illegal immediate (44) Ille...

What next generation low level language is the best bet to migrate the code base ?

Let's say you have a company running a lot of C/C++, and you want to start planning migration to new technologies so you don't end up like COBOL companies 15 years ago. For now, C/C++ runs more than fine and there is plenty dev on the market for it. But you want to start thinking about it now, because given the huge running code base a...

Tuturials for problems with Xilinx's microblaze IP Stack

Hello, My team is using the microblaze and we're having some trouble with the ip stack. I am usually not an embedded programmer but I would like to learn how to help. Are there any tutorials about IP stacks? What are they? How are they programmed? How can I troubleshoot problems in the IP stack? Basically any info would help me. Thank...

Would you use num%2 or num&1 to check if a number is even?

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 option to be far more elegant and meaningful, and that's the one I usually use. But it is not only a matter of taste; The actual performance ma...

How files are copying at the low level?

Hi everybody, I have a small question: For example I'm using System.IO.File.Copy() method from .NET Framework. This method is a managed wrapper for CopyFile() function from WinAPI. But how CopyFile function works? It is interacts with HDD's firmware or maybe some other operations are performed through Assembler or maybe something other....