Would it be necessary to have another programming language to create the Assembler?

Asked

Viewed 409 times

11

Would it be necessary to have another programming language to create the Assembler? If so, which one? If not, what could you do to get started?

I know that according to the years, right after the punched cards, came the language Assembly. But was the Assembly programming language and its Assembler compiler also programmed with another programming language? If so, what would it be?

  • Thank you! And guys, I’m sorry for the wrong assumptions. Is that when I was going to correct had already sent.

  • Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site;

3 answers

15

There are wrong premises in the question. Assembly (emphasis on capitalization) exists before punched cards which is actually just a data input. Assembler is not a compiler, although some people think so. It is even a form of compiler, but it is not complete, so it is considered only an assembler, as the name says.

There are questions that help you better understand this and about the first programming language:

Machine language is the binary code that the machine understands. It can even be written off the machine, but it is rare who does it. She doesn’t need to be turned.

Assembly is an "understandable" text by humans. Assembly exists outside the machine, after input into the computer needs a transformation, by Assembler. There is a 1 to 1 ratio between the Assembly code and the machine code.

The Assembler is a translation engine from Assembly to machine code, so it is software. So it needs to be developed in some language. The first one was certainly written in machine code. From then on it was possible, but not necessarily done so, this and other assemblers were used to write any kind of software, including compilers and other assemblers. Today it is possible to use a high level language to write an Assembler.

So strictly answering the question asked, yes, nowadays it is possible to write an Assembler with any programming language. In the 40’s it was necessary to use machine language.

Assembly is a programming language, so it’s just one specification.

Program binary in here.

2

Luana, a compiled program is code in a format supported by the processor architecture - Intel processors for example follow the CISC architecture - Each architecture has a set of own commands. Follow a link with the Z80 processor opcodes, a good processor to learn: Opcodes Z80

A compiler actually turns his lines of code into a series of equivalent opcodes. Now Assembly are the opcodes themselves, for example:

ld a, #1800  //Carrega o valor na posição de memória #1800 para o registrador a
adc a, #1802 //Soma o valor em a com o valor na posição #1802
ld #1804, a  // Grava o valor de a na posição #1804 da memória

This would be roughly equivalent to x = y + z;

The Assembler would only then be responsible for turning this into binary.

I hope you answered your question clearly.

0

If you were now creating a new processor and had no other machine available, you would have to write the first Assembler to it in direct machine code on a disc, tape, cards or even memory. And probably, this Assembler would have the minimum resources necessary for you to be able to write a next version with more features in Assembly or a higher-level language.

As today we have several languages of all levels you can choose the language that is most appropriate to generate Assembler, and C is usually the first best option.

  • 1

    If I were creating the world’s first computer, there would be no disk, no wound, no cards, no memory. For more than a decade there were only assemblers and many were no longer so simple. Most pure assemblers are still written in Assembly and machine code.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.