Questions tagged [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.

43 questions
0
votes
0 answers

Assembly DIV operation with prior value in edx

I'm so new to assembly and I had this example in the book i'm learning from %include "io.inc" section .text global CMAIN CMAIN: mov ebp, esp; ;write your code here mov eax, 444444447h mov ebx, 22222222h mov edx, 44h div ebx …
0
votes
1 answer

Java: How to populate a variable in subclass?

So this is not a assignment but one of my lecture slide did not make it clear and when I try to code something similar myself, I run into a problem. I can't figure out how to populate a variable that is in my subclass. here's my test code thus…
duhNooby
  • 27
  • 7
0
votes
3 answers

Enumerate allocated objects

How do I enumerate all allocated objects (allocated by the new operator) (not only those which have their own memory mappings, but those which are on the heap, too?) in C++? I need this to find memory leaks. Platform: Linux, gcc, i386,AMD_K64…
Ohnemichel
  • 324
  • 2
  • 9
0
votes
1 answer

How write platform driver in linux

I started to write linux driver and i am confident on it now, but my interest now is to write lower-level driver (platform driver) for spi or USB or i2c controller. Is there any i can start writing to practice platform driver on linux PC. Can some…
kar
  • 2,505
  • 9
  • 30
  • 32
0
votes
1 answer

Writing a full-line accepted from standard-input to a file with low-level C i/o

I am writing a program that concatenates a line input from standard-input with a seperate file, and writes the combined text to an output file. For some reason when I type a full line of text into standard input, only the first word before…
user2942181
0
votes
4 answers

How can I write a string to a file using the low-level write() function?

For example, I am able to write the contents of an input file to and output file with: char buffer[1024]; // character buffer char userInput[1024]; // for user input char *p; char *q; int n; int input_file1; // file descriptor for file 1 int…
Chips
  • 15
  • 1
  • 4
0
votes
1 answer

machine code instructions for a program

how do we put the program instruction c = a-b; in machine code instructions? i've been provided with op-codes, memory address for a=80, b=81, c=82 and program counter = 30 hex. instructions are 16 bits long with 4bit op-code, 4bit for register and…
Raaman Rai
  • 215
  • 5
  • 15
0
votes
4 answers

Looking for learning materials for low-level programming languages

I wish to study bare-metal programming for writing drivers and firmware and other operating system stuff, but I cannot for the life of me find any good learning materials for learning those languages. The gems I found for asm were few and…
Dylan LaCoursiere
  • 493
  • 1
  • 8
  • 18
0
votes
2 answers

use read() to take user input instead of scanf

Im trying to use the read() function to take user input but the only thing I can find in the documentation is regarding reading from files, this is in Linux c language. I also want to use write() do display something to the console. Does anyone have…
Ryan Thompson
  • 61
  • 2
  • 4
-1
votes
1 answer

Machinecode and hardware

first of all hello to all hope you are good and safe. well i have some questions about machine code and hardware and operating system. 1- i was search about how is pure machine code and i find somethings in here and net but not enough to answer my…
-1
votes
2 answers

if (n!=0) n=0; v/s n=0; Which is more efficient and why?

While typing a program as a high level programmer, n = 0; looks more efficient and clean. But is n = 0; really more efficient than if (n != 0) n = 0;? when n is more likely to be 0. when n is less likely to be 0. when n is absolutely…
-1
votes
1 answer

default __init__ for code objects

I found code objects in Python. I'm curious as to what each of the variables in the constructors do. There is not much information on them in the builtin help function all I got was: class code(object) | code(argcount, nlocals, stacksize, flags,…
tox123
  • 318
  • 9
  • 21
-1
votes
1 answer

Correct MIPS code for loop?

I'm trying to code the MIPS code equivalent of this high level language code: i = 0; n = str2; //supplied by user from console while(i < n) { System.out.println(str1); //str1 is supplied by user from console i++; } System.exit(0); This is…
1 2
3