low-level-code is used in its general meaning, such as in systems programming, which means that you are encouraged to accompany your questions with the tag of your custom programming environment.
Questions tagged [low-level-code]
43 questions
40
votes
6 answers
Learning about Java bytecode and the JVM
In a recent question asked recently my simple minded answer highlighted many of my misconceptions about Java, the JVM, and how the code gets compiled and run. This has created a desire in me to take my understanding to a lower level. I have no…

faceless1_14
- 7,382
- 9
- 31
- 33
12
votes
3 answers
How can I check to see if a file descriptor was closed?
In a POSIX environment when using system calls to manipulate text files (open(), close(), read(), write()), is there a way to to check to see if I actually closed a file descriptor when using close(file_descriptor)?
Example:
int main(int argc, char…
user2931210
7
votes
1 answer
ARM assembly using Qemu
Well i've searched whole internet for code that will run using arm-linux-gnueabi-as and qemu.
To print a integer value. From string. A routine will help.

Waqas
- 637
- 8
- 19
5
votes
4 answers
c++ difference between reinterpret cast and c style cast
Code:
char keyStr[50]={ 0x5F, 0x80 /* bla bla */ };
uint32_t* reCast = reinterpret_cast< uint32_t* >( &keyStr[29] );
uint32_t* reCast2 = ( uint32_t* )&keyStr[29];
if( reCast == reCast2 ){
cout << "Same Thing!";
}
Output:
Same Thing!
I wonder…

Fresco
- 289
- 3
- 13
3
votes
1 answer
.rodata relocation related question
I'm trying to write a C program for a machine with no virtual memory(or O.S. to be more precise), and I'm running into some difficulties with the .rodata section, or more precisely the stuff that goes there. The problem arises that although the…

skyel
- 713
- 1
- 6
- 20
3
votes
3 answers
Where can I find low level Sound Programming Theory Tutorials
I am an intermediate graphics programmer. I want to learn audio/sound processing theory from the ground up.
Just like how "A pixel" and its components R,G,B,A is the fundamental part of Graphics programming. I want to know about sound programming in…

Rajavanya Subramaniyan
- 2,155
- 19
- 39
3
votes
7 answers
How to split hex byte of an ASCII character
What basically i want to do is
For eg: 'a' hex equivalant is 0x61, can i split61 in to 6 and 1 and store them as '6' and '1' ?
A buffer is receiving data like this:
rx_dataframe.data[0] is H'00,'.'// H' is Hex equivalant and '' is ASCII…

User
- 619
- 1
- 9
- 24
2
votes
1 answer
Why is the pixel not showing when i turn its position into variables ? Assembly 8086 NASM
Im trying to make a ball with Assembly 8086 NASM using the INT 10H and DOSBOX, in UBUNTU
like this :
MOV AH, 0Ch ; function to write the pixel
MOV AL, 0Fh ; color of the pixel (set to white)
MOV BH, 00h ; the page number (0 because its the only…

haroun AGSOUS
- 23
- 3
2
votes
1 answer
How does software interact with hardware at the lowest level?
I'd love to know/see some example code from the lowest level. By this I mean the code that for example, sets the voltage to the speakers, or something equivalent. I can't imagine how this would look/work.
How could a piece of code possibly…

CS Student
- 1,613
- 6
- 24
- 40
2
votes
2 answers
C low-level standard-in to accept filename then printing file contents to stdout
I want to get a file name from a user via stdin, open the file with open() and assign it to a file descriptor, then print the contents of that file to stdout. This is my code, and it's not working properly.
Problems:
the printf("enter filename");…
user2942181
1
vote
2 answers
Shouldn't line 103 be LDR number instead of #0?
screenshot of textbook
(The code is an example of adding a list of numbers together and storing the
answer using a loop)
100 LDM #0 ; Load 0 into ACC
101 STO total
102 STO counter
103 LDR #0 ; Load 0 into IX
104 loop: …

Ryan
- 11
- 2
1
vote
1 answer
how to pack a section of machine code as a function in .o object file
GOAL: Given a section of machine code, which conatins RISC-V extended instructions, I want to wrap it as a function and create an .o object file.
The function is something like void foo(), there's no arguments with void return type. and it call no…

kai
- 1,141
- 3
- 15
- 25
1
vote
2 answers
Why is called?
I'm trying to see the disassembled binary of a simple C program in gdb.
C program :
int main(){
int i = 2;
if (i == 0){
printf("YES, it's 0!\n");
}else{
printf("NO");
}
return…

adenosinetp10
- 35
- 5
1
vote
2 answers
What does this syntax *((unsigned int *)(buffer+i)) mean in C
This is the code:
char *command, *buffer;
command = (char *) malloc(200);
bzero(command, 200);
strcpy(command, "./notesearch \'");
buffer = command + strlen(command);
for(int i=0; i < 160; i+=4) {
*((unsigned int *)(buffer+i)) = ret; // What…

c00l
- 60
- 1
- 6
1
vote
4 answers
How to form an ASCII(Hex) number using 2 Chars?
I have char byte[0] = '1' (H'0x31)and byte[1] = 'C'(H'0x43)
I am using one more buffer to more buff char hex_buff[0] .i want to have hex content in this hex_buff[0] = 0x1C (i.e combination of byte[0] and byte[1])
I was using below code but i…

User
- 619
- 1
- 9
- 24