Do we need an assembler for an assembler?

Asked 2 years ago, Updated 2 years ago, 121 views

Background

While studying C language compilers, I learned that there was a bootstrap problem, such as Compilers for Compiling C Language…, and that the earliest compilers were implemented in the assembly language.Now I have the following questions:

Question

  • If the assembler is software that converts from assembly language to machine language, I thought that it would lead to a cycle of 'I need a lower layer assembly to move the assembler, and I need a lower layer assembly…'
  • How does the earliest machine/assembly language contact work?

compiler

2022-09-30 17:47

2 Answers

In fact, the very early computer, or CPU evaluation kit, had hardware that allowed programmers to see and rewrite memory content directly. TK-80 is a typical example, but not just this.Because it was implemented only in hardware, the program could be entered and executed without any software.

When it comes to the beginning, I guess it's about this time.It was purely human work until I wrote an assembler program in my notebook and converted it into binary (hexadecimal), and I entered the resulting hexadecimal number and when it didn't work, I carefully reviewed the assembler I wrote in my notebook and found a bug...

In the next generation, it comes with built-in software that looks and rewrites memory (also known as monitor mode).Additionally, some come with a simple inline assembler function (simple functionality that translates to C9 when you type RET).

Now that I've come this far, I don't think I can call it the beginning anymore.And it feels like we're going to the present day.


2022-09-30 17:47

In the early days of the 1960s and 1970s, there was no assembly language.

In addition, there were no functions or procedures that I knew today.
Furthermore, I couldn't use my name or name tag (label).

As a result, it was difficult to change the street number at first when loading.
Therefore, there is no concept of relocatable.
In the first place, the capacity of the main memory was small, so even the assembler probably couldn't do it in one pass.

Apart from the old days, you can write assemblers, but don't you think it's better to use less code when you write because you can write assembly language processors in C, C++, C#, Java, PHP, Purl, Ruby, etc.?


2022-09-30 17:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.