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 ...
gnasher729's user avatar
  • 27.4k
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.
gnasher729's user avatar
  • 27.4k
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 ...
TheHans255's user avatar
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.'s user avatar
  • 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 ...
jmite's user avatar
  • 29.5k
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 ...
Bulat's user avatar
  • 1,825
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 ...
gandalf61's user avatar
  • 1,559
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 ...
gnasher729's user avatar
  • 27.4k
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 ...
Yuval Filmus's user avatar
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 ...
user253751's user avatar
  • 1,617
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, ...
J D's user avatar
  • 181
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 ...
gnasher729's user avatar
  • 27.4k
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 ...
jpa's user avatar
  • 449
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.'s user avatar
  • 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/...
Ta Thanh Dinh's user avatar
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 ...
Peter Green's user avatar
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)...
Damian Yerrick's user avatar
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 ...
Draconis's user avatar
  • 7,018
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 ...
gandalf61's user avatar
  • 1,559
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 ...
Jasen's user avatar
  • 157
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). ...
Steve's user avatar
  • 454
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 ...
Yuval Filmus's user avatar
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 ...
gnasher729's user avatar
  • 27.4k
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 ...
Davislor's user avatar
  • 1,191
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 ...
Oliver Broad's user avatar
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'...
HEKTO's user avatar
  • 3,060
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 ...
gnasher729's user avatar
  • 27.4k
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 ...
Artelius's user avatar
  • 646
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)...
Yuval Filmus's user avatar
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 ...
greybeard's user avatar
  • 948

Only top scored, non community-wiki answers of a minimum length are eligible