Assembler commands for beginners low-level programmers

Date:

2019-05-31 23:20:19

Views:

751

Rating:

1Like 0Dislike

Share:

Table of contents:

All commands can be executed only with the help of machine language. Assembler-commands – symbolic representation of that language. With it, write a small but a very fast program. But despite their size, the writing process is very labor intensive. Team assembler Therefore the Assembly instructions used to interact with a hardware component, or when the program doesn't have memory. Therefore, the Assembly code is executed in the form of subroutines and integrates code of high level. Since the assembler may vary depending on the type of architecture, it is necessary to consider his specific case, this article is the architecture of the Win. But the description of commands of the assembler usually does not change much, and they can be used in microcontrollers and other electronics devices that use an assembler.assembler commands

Arithmetic commands used in Assembly language

Despite such a paradox, as the universality, only 4 arithmetic Assembly instructions there are and can be used by programmers. Nevertheless, through them and created a high-level programming languages that run computers, appliances, cell phones, smartphones, laptops, etc. you can Work with them, and very successfully. The list of commands assembler takov:

  • Slojenie;
  • Wikimania;
  • Umnojeniya;
  • Delanie.

Zlozenie

Arithmetic, known since school. You need to take into account only the feature addition, which is associated with the representation of the numbers to add in the memory of the computer. General view of the operation is as follows:

Recommended

How to get out of

How to get out of "Skype" on the "Android" and not only

How to get out of "Skype" "Android"? This question bothers many users. The thing is that the messenger is not so difficult. But there are features that are only for mobile versions. To log out of Skype in this case more difficult than it seems. But i...

Kingo ROOT: how to use the program to gain administrative rights on Android

Kingo ROOT: how to use the program to gain administrative rights on Android

The Gadgets on the platform Android regained the lion's share of the market. Developers are continually perfecting the OS, trying to fit the needs of the users, but from year to year admit palpable mistake: forbid the owner to "stuffing" of his gadge...

How to get from Stormwind to Tanaris: practical tips

How to get from Stormwind to Tanaris: practical tips

World of Warcraft is an iconic MMORPG, uniting millions of players around the world. There are many locations and puzzles, secret trails and larger, but rather dangerous paths. Sooner or later, every player chose the side of the Alliance, we have to ...

ADD <Ячейка1/Регистр1> <Ячейка2/ - Range2>

Command takes the number of cells, adds them together and writes the “Ячейку1”. Now about the conditions of the operation: both the number of cells must have the same size. If first is the case, then it is possible to add on all. If first comes the cell, then it is possible to add or immediate operand or register.description of the Assembly instruction

The Description of Assembly instructions and their implementation requires a more comprehensive approach than can provide one article. According to the Assembly instructions, in spite of their meager number, written so many books that have hundreds of pages. Therefore, despite the apparent ease, we recommend you to see more details describing the team's work, which will allow you to learn all the nuances for different architectures.

Subtraction

This operation is executed according to the same algorithm as the previous one. Even the record type commands like:

SUB <Ячейка1/Регистр1> <Ячейка2/ - Range2>

arithmetic Assembly instructionsThe Principle of counting is that of the number 1 is subtracted No. 2, and recorded at site # 1. Conditions of operation are the same as the conditions of passage of the addition operation.

Multiplication

If division and addition have the same commands as for unsigned and for signed numbers, then the multiplication and division for them, there are various algorithms. So, to multiply unsigned numbers, use a command such as:

MUL <operand>

list of Assembly instructionsSpecified in the command operand is one of the factors. The place of the second factor and place the result of the operation are recorded in advance, depending on the size of the MUL in bytes. Their location – the subject of a separate article. For signed multiplication, use the command:

IMUL<operand No. 1>, <operand No. 2>

You Can find other variants of implementation, but this is more understandable and familiar. We specify two factor, and the result is the operand number 1. Thus as the operand No. 1 is definitely the register, and the operand number 2 – register or memory cell. But other options will also be described:

IMUL<operand No. 1>

IMUL<operand No. 1>> <operand No. 2>, <immediate operand>

IMUL<operand No. 1>, <immediate operand>

The First option is similar to the MUL on the device, so the rules for him can be attributed here. The second option allows you to explicitly specify the location – as a result, and cofactor. The third option specifies the register that will be the first factor in which will be placed the result of the multiplication. Under the immediate operand is implied by not specifying a particular register, and the number by which to multiply the operand.

Division

As mentioned above, are used to divide the two teams. For unsigned numbers use:

DIV <operand>

For signed integers, use the command:

For idiv <operand>

A Feature of the use of teams in the division is that use only the operand-the divisor, which acts as a register or a memory cell. Numerator the number always has a definite location that depends on the size of the number. Your place has, and the result of the operation.

According to the search definition, you can say the same thing about multiplication: requires a separate article, as the amount of information is very significant.

Useful conclusion

Also in the category of "relatively useful the Assembly instructions" should also include the command NEG <Cell/Register>. She takessign in the number that is in the operand. That's all, I hope that article has helped you understand arithmetic Assembly instructions.

Useful and the operations increment and decrementing (increasing or decreasing the operand by one). To increment the operand, you must specify the following command:

INC <operand>

For decremental, you should write:

DEC <operand>

The operand may be a memory cell or register. Exclusive benefits from these operations is that they take up less space than the same Assembly instructions offered by addition or subtraction.


Article in other languages:

AR: https://tostpost.com/ar/computers/17506-assembler-commands-for-beginners-low-level-programmers.html

BE: https://tostpost.com/be/kamputary/33700-asembler-kamandy-dlya-pachatko-ca-n-zka-zro-nevyh-pragram-sta.html

DE: https://tostpost.com/de/computer/33377-assembler-befehle-f-r-anf-nger-low-level-programmierer.html

ES: https://tostpost.com/es/equipos/33255-ensamblador-equipo-para-principiantes-de-bajo-nivel-de-los-programador.html

HI: https://tostpost.com/hi/computers/19143-assembler-commands-for-beginners-low-level-programmers.html

JA: https://tostpost.com/ja/computers/17161-assembler-commands-for-beginners-low-level-programmers.html

KK: https://tostpost.com/kk/komp-yuterler/34013-assembler-komandasyny-bastaushy-ba-darlamashylar-nizkourovnevyh.html

PL: https://tostpost.com/pl/komputery/35063-asembler-polecenia-dla-pocz-tkuj-cych-niskiego-poziomu-programist-w.html

PT: https://tostpost.com/pt/computadores/34860-assembler-comandos-para-iniciantes-baixo-n-vel-de-programadores.html

TR: https://tostpost.com/tr/bilgisayarlar/30430-assembler-komutlar-yeni-ba-layanlar-i-in-d-k-seviyeli-programc-lar.html

UK: https://tostpost.com/uk/komp-yuteri/34227-asembler-komandi-dlya-pochatk-vc-v-program-st-v-niz-kor-vnevih.html

ZH: https://tostpost.com/zh/computers/13991-assembler-commands-for-beginners-low-level-programmers.html






Alin Trodden - author of the article, editor
"Hi, I'm Alin Trodden. I write texts, read books, and look for impressions. And I'm not bad at telling you about it. I am always happy to participate in interesting projects."

Comments (0)

This article has no comment, be the first!

Add comment

Related News

Describe the system storage files on disk. The file system organization

Describe the system storage files on disk. The file system organization

If you are looking for information on the theme “describe a system of storing files on disk”, then you are on the right track! Any data that are on the computer should be available in subsequent use. But how to impleme...

How to remove administrator password?

How to remove administrator password?

In any production and the execution of any work should take into account the human factor, which has a great influence on the whole course of the workflow. Computer technology in this regard is a separate category because the exac...

How to add a line in Excel: best practices, examples

How to add a line in Excel: best practices, examples

“Excel” from Microsoft Office – it is a powerful table editor that allows you to not only store data in rows and columns, but also to make complex calculations and present the results in graphical format.this art...

High-quality scanning of RAM

High-quality scanning of RAM

Before you begin to address the question about testing RAM, you need to clearly understand and realize what she is. So, RAM – it's such a non-volatile part of the system of a common computer memory which stores all instructi...

"Escape the room": the passing game

All users of smartphones and tablets ever heard about games of type "100 doors" - many even played in such projects, tried several similar and is now looking for something new. For those who do not know - these games represent a l...

Assassins Creed Rogue: playthrough of the game in Russian (full)

Assassins Creed Rogue: playthrough of the game in Russian (full)

the Action game Assassin's Creed Rogue, the passage which is the subject of today's review, occurs in the North Atlantic during the seven years ' war. The main character is called Shay Patrick Cormac. I must say that this characte...