Questions tagged [assembly]
An assembly language is a low-level programming language for a computer, microcontroller, or other programmable device, in which each statement corresponds to a single machine code instruction.
172 questions
-2
votes
3
answers
354
views
What is beyond ordinary c++, when trying to optimize a function?
Backstory:
Writing a QImage to Sixel renderer.
Feel like I have optimized it the best I can using basic c++.
I have heard suggestions here or there that you can utilize things like GPU, SIMD, insert ...
3
votes
1
answer
310
views
Are shorter variants of machine instructions worth it?
I'm writing a JIT runtime, and I've started thinking about shorter variants of some instructions.
In x64 we can do at least two kinds of jumps: rel8 and rel32. The first one takes say 2 bytes (opcode +...
0
votes
0
answers
156
views
How To Share Code Between Assembly Files In A Modular Way
Recently, I started learning Arm64 assembly. The assembler I'm using is the GNU Assembler (GAS). The version of GAS I'm using is GNU assembler (GNU Binutils for Ubuntu) 2.42.
I want to make my code ...
0
votes
2
answers
369
views
Why does jl test for the second operand of cmp to be less than the first, instead of the other way around?
Something like this
cmp $0, %eax
jl exit
jumps to the exit: label if the content of register eax is less than 0.
So it's kind of jl applies the < operator to the operands of cmp, but in reverse ...
-1
votes
1
answer
135
views
Debugging miscompile [closed]
Recently I encountered an issue at work where a unit test written in C++ would crash only when being compiled with MSVC 2017 (MSVC 2019 and up are fine). I tried to debug this issue and it seems like ...
7
votes
3
answers
2k
views
How does a JIT compiler actually emit and then call the emitted native code?
Assuming that a VM runs a JIT compiler on otherwise "interpreted" code, such as a line by line interpreter or some form of bytecode/IL code and determines that it can create optimised native ...
-3
votes
1
answer
487
views
When making a compiler, what's the best way for compiling to machine code in the backend? [closed]
I know that a lot of compilers use an assembler to compile to machine code, to make an executable (compiled program).
Some people even made their own assemblers, or they just use an existing assembler,...
-5
votes
2
answers
193
views
Archival-quality future-proof pseudo-CPU architecture
Suppose we maintain a massive electronic library of texts/photos/videos etc., and want to ensure that these files are readable indefinitely long in the future. [Update] one of the major problems with ...
0
votes
2
answers
287
views
Where to put files (interfaces) that link two independent assemblies: Authentication and Main Program
I'm having an issue with dependencies in a C# app that I'm creating.
I have an assembly for my authentication process, and a separate assembly for starting up the main program once authentication is ...
2
votes
1
answer
445
views
How do these two ways of enforcing alignment work together?
In Computer Systems: a Programmer's Perspective,
Alignment is enforced by making sure that every data type is
organized and allocated in such a way that every object within the
type satisfies its ...
1
vote
3
answers
277
views
Is an assembly program a procedure itself and does it occupy a stack frame?
If I am correct, an assembly language uses the program stack to store data.
Is it correct that the program stack is partitioned to frames, each of which is for a call to a procedure? So there is no ...
-1
votes
1
answer
121
views
What specifies the agreement (i.e. the convention) of which registers are used to pass which arguments and to return which values?
In Computer Systems: a Programmer's Perspective:
procedure calls may involve
passing data as arguments, and returning from a procedure may also
involve returning a value. With x86-64, most of these ...
0
votes
2
answers
421
views
Do differences between ATT and Intel formats of assembly languages come from differences between their underlying machine languages?
From Computer Systems: a Programmer's Perspective, about assembly languages:
We see that the Intel and ATT formats differ in the following ways:
The Intel code omits the size designation suffixes. We ...
0
votes
3
answers
217
views
Does the assembler perform the same tasks as the translator from C to assembly?
When compiling C programs to assembly programs and then to machine programs, does the assembler (e.g. the one used in GCC or other popular C compilers) perform the same tasks as the translator from C ...
-3
votes
2
answers
241
views
Why will it take approximately 2 years for Apple to transition Mac to ARM? [closed]
Why will it take that long to transition all Mac software to ARM according to Apple? I thought all they would need to do is to recompile the source code of their apps and rewrite SIMD code from intel ...