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 ...
user avatar
  • 25.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.
user avatar
  • 25.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 ...
user avatar
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 ...
user avatar
  • 29.2k
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 ...
user avatar
  • 1,805
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 ...
user avatar
  • 1,549
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 ...
user avatar
  • 25.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 ...
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 ...
user avatar
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, ...
user avatar
  • 169
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 ...
user avatar
  • 25.4k
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 ...
user avatar
  • 143k
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/...
user avatar
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 ...
user avatar
  • 1,549
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 ...
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)...
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 ...
user avatar
  • 6,940
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 ...
user avatar
  • 157
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 ...
user avatar
  • 25.4k
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 ...
user avatar
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 ...
user avatar
  • 1,121
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 ...
user avatar
  • 626
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)...
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'...
user avatar
  • 2,977
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 ...
user avatar
  • 25.4k
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 ...
user avatar
  • 917
2 votes

RAM and ROM confusion

"ROM" stands for "read only memory". This usually means that you can read any location in ROM, but you can't change what is already in ROM. (Data in ROM is written when the ROM chip is constructed, ...
user avatar
  • 686
2 votes

CPU Registers and Computation

The CPU has direct access to registers. If A and B are already in the registers then the CPU can perform the addition directly (via the Arithmetic Logic Unit) and store the output in one of the ...
user avatar
2 votes
Accepted

Why can't we compile 8086 Assembily for all OSs from any OS?

Porting to a different operating system is about a lot more than the particular assembly language you use. Different operating systems have different system calls, different libraries, and different ...
user avatar
  • 143k
2 votes

Addressing mode in 8086

Well, x86 hasn't the simplest instruction format... And similar addressing modes can be named differently for different CPUs. In most CPUs (particularly RISCs and simple 8bits CPUs), there is only ...
user avatar
  • 1,766

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