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
1
vote
4 answers

C code - a way to convert 5 to 7 and 7 to 5 without "if"

I want to write a function that gets a number X and if X=5 it returns 7 , if X=7 it return 5 otherwise, return something else. There is the trivial way - to use "if" blocks Another way - to use a map (5 mapped to 7, 7 mapped to 5) Third way - to…
ClimbingLung
  • 219
  • 2
  • 8
1
vote
1 answer

What is "complete error trapping"?

Write a program in C using only low-level I/O.. The program must have complete error trapping. In particular the program should use perror() to report system errors... In my program... test("checked argument count"); if((input_file1 =…
user2931210
1
vote
4 answers

C programming and error_code variable efficiency

Most code I have ever read uses a int for standard error handling (return values from functions and such). But I am wondering if there is any benefit to be had from using a uint_8 will a compiler -- read: most C compilers on most architectures --…
0
votes
1 answer

Event Processing based on different windows

I have a use case which for which i want to make my system scalable. Lets say some producers are pushing different events in a Message queue. Event 1,Event2, Event3 etc. In backend consumer I want to create configurations for these events, for…
0
votes
0 answers

Unable to access main during debug mode on uvision / no problem with mcuxpresso

This might be a newbie question, but I am going crazy already haha. symptom I am having an issue with the lpcxpresso54102 Dev Board, where I am not able to access main.c during debug session, but if I check on the disassembly window I can see the…
0
votes
0 answers

PEB X86 wrong address

So here is my question : I wanted to get PEB from x64 and x86 without calling NtQueryProcessInformation. I use ASM from this question : How to use NtCurrentTeb() without Windows header files? ASM Code for X64 : byte[] asm = new byte[] {…
Arsium
  • 1
  • 2
0
votes
1 answer

How to Organize the classes of a low level design in code blocks IDE

I am having an interview where I have to do low level design coding in an IDE which I have choosed to do in code blocks IDE . So I have question of how to organize different classes of that design. My point of asking is if I have 10 classes should…
user10112169
  • 101
  • 2
  • 8
0
votes
1 answer

How to assign value to std_logic_vector in VHDL?

I am trying to assign value to OUTPUT std_logic_vector in the below code, but it gives me errors that COMP96 ERROR COMP96_0143: "Object "OUTPUT" cannot be written." "design.vhd" 20 18 COMP96 ERROR COMP96_0143: "Object "OUTPUT" cannot be…
0
votes
1 answer

Nand2tetris Project4- Test failed - of Fill.asm: Comparison failure at line 3

Not mentioning much about the Nand2tetris course and uploading the assembly file which interacts with the keyboard. Basically what this program does is when a key is pressed on the keyboard the screen turns black i.e. every pixel of the screen is…
kirti purohit
  • 401
  • 1
  • 4
  • 18
0
votes
2 answers

Fastest way to spread 4 bytes into 8 bytes (32bit -> 64bit)

Assume you have a 32-bit unsigned integer, where the bytes are organized like this: a b c d. What is the fastest way to spread these bytes into a 64-bit unsigned integer in this fashion: 0 a 0 b 0 c 0 d? It is for the x86-64 architecture. I would…
HueHue
  • 31
  • 3
0
votes
0 answers

MIPS Assembly Language Code To Use ASCII Values For Name

I am new to MIPS and this assignment is a little confusing for me because the requirement is to calculate the ASCII values of each character in one's name, and to print the name in Last, First format, along with one's student ID number, whose digits…
EAP
  • 31
  • 1
  • 8
0
votes
2 answers

Interlock Objects with Integer

I have a bunch of objects, and each object has an unique ID. I need to interlock the objects so that only one of the objects are allowed to perform a certain operation at a time. I got an idea to define an integer that all of the objects have access…
krakers
  • 111
  • 10
0
votes
0 answers

Computer programs from the point of view of CPU

This might sound a bit naive, but, I'm unable to find an appropriate answer to the question in my mind. Let's say there is an algorithm X, which is implemented in 10 different programming languages. After the bootstrap stage for every program, each…
Andy_Jake
  • 134
  • 1
  • 11
0
votes
0 answers

Tasm Assembly Code - Terminating a Repeating Program

In this assembly program code, I'd like to keep entering 'Y'/Yes in the input, and after atleast 3 times of Yes/Y, the program will terminate itself or will jump to endmain, how do I do it? I'd want this display: Do you want to try again?: Y Do you…
stevenjake
  • 23
  • 6
0
votes
0 answers

Mips Matrix multiply wrong answer

I have been trying to complete this program for the last 13 hours. I have tried everything and nothing seems to work. For some reason it works when I take input from the user for 4x4 matrices and multiply them. It gives the wrong answer when I try…