47
votes
Accepted
Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code
I can only quote from the manual of a rather primitive CPU, a 68020 processor from around 1986: "Calculating the exact runtime of a sequence of instructions is difficult, even if you have precise ...
33
votes
Accepted
Assembly writer vs compiler in VLIW architecture
The "assembly writer" in that book is a human software developer who writes code in assembler language.
30
votes
Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code
You cannot do this in general, but in some senses, you very much can, and there have been a few historical cases in which you indeed had to.
The Atari 2600 (or Atari Video Computer System) was one of ...
19
votes
Accepted
Why is static recompilation not possible?
Static recompilation from a binary is hard, because it is challenging to reconstruct the structure of the program. It is hard to statically figure out the location of all instructions that will be ...

D.W.♦
- 152k
15
votes
Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code
There are two aspects at play here
As @gnasher729 points out, if we know the exact instructions to execute, it's still difficult to estimate the exact runtime because of things like caching, branch ...
10
votes
Assembly writer vs compiler in VLIW architecture
In VLIW architecture, the compiler/and or assembly writer chooses instructions that can be executed in parallel
The meaning of this sentence is that in VLIW architecture, assembler (machine) code ...
9
votes
Accepted
Essential difference between Assembly languages to all other programming languages
The two most obvious characteristics of an assembly language are:
It is specific to a particular CPU architecture.
There is a one-to-one correspondence between assembly language commands and machine ...
5
votes
Does assembly language get translated to binary code? If so, is assembly language portable across machines?
Assembler code describes instructions for one particular architecture. It is slightly helpful by allowing you to use human-readable names for instructions, names for memory addresses, doing some ...
5
votes
Essential difference between Assembly languages to all other programming languages
The essential difference between assembly language and every other programming language is that assembly language specifies the sequence of instructions directly, whereas in any other language, the ...
5
votes
How does a CPU do function calls?
Note that Turing machines don't have any function calls, and they work just fine as Turing machines. Function calls are not a necessity for Turing-completeness. All non-recursive function calls can ...
4
votes
Essential difference between Assembly languages to all other programming languages
(Warning, this historical account of increasing abstraction and declarative programming may annoy, confuse, or upset you:)
Hello, world!
By far and large, programing languages happen on a continuum, ...
4
votes
Accepted
Do compilers of high programming languages always compile them directly to machine code?
I've seen compilers that compile directly to object code.
I've seen compilers that compile to assembler code.
I've seen compilers that compile to byte code for a virtual machine.
I've seen ...
4
votes
Why is static recompilation not possible?
Static recompilation is used, for example it is central in Apple's Rosetta 2 emulator. But there are challenges that make it difficult to apply.
Most importantly, all jump targets are not readily ...
3
votes
Are assembly languages untyped?
Assembly language is normally untyped, in the sense that there is no type-checking. Adding type-checking is a non-trivial research challenge (hence the papers you see). Papers on typed assembly ...

D.W.♦
- 152k
3
votes
Are assembly languages untyped?
Can we say that assembly is generally untyped?
If you mean "assembly" as, e.g. x86 assembly language, then I think yes, to some degree. Types are some constraints that we can statically checked/...
3
votes
Why do compilers produce assembly code?
Usually compilers work internally with sequences of instructions. Each instruction will be represented by a data structure representing it's operation name, operands and so-on. When the operands are ...
3
votes
Why do compilers produce assembly code?
Even platforms that use the same instruction set may have different relocatable object file formats. I can think of "a.out" (early UNIX), OMF, MZ (MS-DOS EXE), NE (16-bit Windows), COFF (UNIX System V)...
3
votes
Accepted
The instructions a Stack Machine has
There are dozens and dozens of stack machines out there in the wild, and they all have different instruction sets. So there's no single correct answer.
Some people might consider using ...
3
votes
How is an Assembly Language Processed by a CPU's Circuitry?
An assembler is a program that reads assembly language commands and translates then into a sequence of binary instructions, addresses and data values that is called machine code. The machine code is ...
3
votes
How does a CPU do function calls?
Is there a return address stack on the CPU (limited to memory on chip), or is it emulated in software at the assembler using regular RAM?
Yes.
Some processors do not have a stack (and need to ...
3
votes
In theory, is it impossible, or possible (although ridiculously impractical), to inline recursive functions?
I think you're conflating two different problems here.
One is "inlining" (the elimination of a method call), the other is "loop unrolling" (the elimination of a jump instruction).
...
2
votes
How is an Assembly Language Processed by a CPU's Circuitry?
The CPU only understands machine code. Assembly language has to be compiled to machine code in order for the CPU to execute it.
Machine code isn't very user friendly. While the very first computers ...
2
votes
How is an Assembly Language Processed by a CPU's Circuitry?
That translation isn’t done by the CPU when it executed the instructions. It is done a lot earlier, when a program called “assembler” translates the assembler instructions into sequences of bits that ...
2
votes
Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code
Back in the era of 8-bit computers, some games did something like that. Programmers would use the exact amount of time it took to execute instructions, based on the amount of time they took and the ...
2
votes
Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code
Would the choice of "computer system" happen to include microcontrollers?
Some microcontrollers have very predictable execution times, for example the 8 bit PIC series have four clock cycles per ...
2
votes
Essential difference between Assembly languages to all other programming languages
It makes sense to pay attention to formal grammars when talking about programming languages. Typical program in assembly language has very simple grammar, consisting mainly of following productions (I'...
2
votes
Essential difference between Assembly languages to all other programming languages
In an assembly language, you specify the sequence of instructions of your code. In other languages that are compiled, you specify the effect of these instructions, not the instructions themselves. The ...
2
votes
Are assembly languages untyped?
Many assembly languages do have certain features that could be considered static typing. Most often this is for making programming easier, rather than type checking.
In many assembly languages you ...
2
votes
Names of power-of-two bit operations on bitsets that would not assume any number interpretation
You can think of a bitvector as a set, by giving names to the various bits. For example, if we name the bits in an 8-bit integer using the numbers $0,\ldots,7$ (where $0$ is the LSB and $7$ is the MSB)...
2
votes
Accepted
Can a 32-bit processor work with a 64-bit size word?
Just what makes a processor a 32-bit processor?
And what would 64-bit word/32-bit halfword mean in the context?
There are processors allowing a single instruction ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
assembly × 55computer-architecture × 17
compilers × 6
cpu × 6
operating-systems × 4
memory-access × 4
mips × 4
algorithms × 3
memory-hardware × 3
binary × 3
terminology × 2
arithmetic × 2
integers × 2
cpu-pipelines × 2
stacks × 2
turing-machines × 1
computability × 1
optimization × 1
programming-languages × 1
recursion × 1
approximation × 1
strings × 1
discrete-mathematics × 1
cpu-cache × 1
virtual-memory × 1