Contacts

Programming: assembler language. The basics of the assembler language. Data Format and Team Structure Assembler Language Assembler

On the destination, you can select commands (in parentheses are examples of mnemonic codes of operations of the IBM PC Type PC Type Assembler Operations):

l performing arithmetic operations (Add and Adc - addition and additions with transfer, sub and SBB - subtraction and subtraction with borrowing, MUL and IMUL - Multiplication without sign and with sign, div and idiv - division without sign and with sign, CMP - comparisons etc.);

l performing logical operations (OR, AND, NOT, XOR, TEST, etc.);

l shipping (MOV - to send, XCHG - exchange, in - enter into the microprocessor, OUT - output from the microprocessor, etc.);

l control transmission (program branches: JMP - unconditional transition, Call - Call procedure, RET return from procedure, j * - conditional transition, LOOP - cycle control, etc.);

l Processing Character Line (MOVS - Shipping, CMPS - Comparison, LODS - Downloads, SCAS - Scanning. These commands are usually used with the prefix (repetition modifier) \u200b\u200bREP;

l Program interrupts (int - program interrupts, INTO - conditional interrupt when overflow, IRET - return from interrupt);

l control of the microprocessor (ST * and CL * - installation and reset flags, HLT - stop, Wait - expectations, NOP - idling, etc.).

With a complete list of assembler commands, you can get acquainted in the works.

Data transfer commands

l MOV DST, SRC - Data Shipment (Move - Send from SRC to DST).

Sends: one byte (if SRC and DST have a byte format) or one word (if SRC and DST have a word format) between register or between register and memory, and also records direct value to the register or in memory.

DST and SRC operands must have the same format - bytes or word.

SRC can be type: R (Register) - Register, M (Memory) - Memory, I (Impedance) - Direct value. DST can be type R, m. It is impossible to use operands in one command: RSEGM together with I; Two Operand type M and two RSEGM type operands). Operand I may be a simple expression:

mOV AX, (152 + 101B) / 15

The expression calculation is performed only when broadcast. Flags do not change.

l Push SRC - Word Covering Stack (Push - pinched Record on the stack of İsrc). It places the contents of SRC in the top of the stack - any 16-bit register (including segment) or two memory cells containing a 16-bit word. Flags do not change;

l POP DST - extracting words from stack (POP - push out; count from stack in DST). Removes the word from the top of the stack and places it in DST - any 16-bit register (including segment) or in two cells of memory. Flags do not change.

Topic 1.4 Assembler Mnemonic. Structure and formats of commands. Types of addressing. Microprocessor team system

Plan:

1 Assembler language. Basic concepts

2 Symbols of the assembler language symbols

3 Types of assembler operators

4 Assembler directives

5 processor command system

1 J.zyK assembler. Basic concepts

Assembler language - This is a symbolic presentation of the machine language. All processes in the machine at the lowest, hardware level are driven only by commands (instructions) of the machine language. It is clear that, despite the general name, the assembler language for each type of computer.

The assembler program is a combination of memory blocks, called memory segments.The program may consist of one or more such block segments. Each segment contains a set of language suggestions, each of which occupies a separate line of the program code.

Assembler offers are four types:

1) commands or instructions, Presenting symbolic analogs of machine commands. In the process of broadcasting, the assembler instructions are transformed into the corresponding commands of the microprocessor command system;

2) macrocomands -decorated in a certain way of the text proposals of the program, replaced during broadcast by other proposals;

3) directivesan indication of the assembler translator to perform certain actions. Directives have no analogues in the machine representation;

4) rows of comment containing any characters, including the letters of the Russian alphabet. Comments are ignored by the translator.

­ Program structure on assembler. Assembler syntax.

The proposals that make up the program may be a syntactic design, a corresponding team, Macrokomand, Directive, or a comment. In order for the assembler's translator to recognize them, they must be formed by certain syntactic rules. To do this, it is best to use a formal description of the syntax of the language like the rules of grammar. The most common ways of such a description of the programming language - Syntactic charts and extended Bakusa Naura forms. For practical use more convenient syntactic charts.For example, the assembler suggestions syntax can be described using syntactic diagrams shown in the following figures 10, 11, 12.

Figure 10 - assembler offer format


­ Figure 11 - Format Directives

­ Figure 12 - Team format and macros

On these drawings:

­ name Tags - the identifier, the value of which is the address of the first byte of that proposal of the source text of the program, which it denotes;

­ name - The identifier distinguishing this directive from other directives of the same names. As a result of the processing assembler, a specific directive can be assigned to certain characteristics;

­ operation code (CPA) and directive - These are mnemonic designations of the relevant machine team, macros, or translator directives;

­ operands - Parts of the team, macro commanders or assembler directives denoting objects over which actions are made. Assembler operands are described by expressions with numeric and text constants, marks and identifiers of variables using operations and some reserved words.

Syntactic diagrams help find and then go through the way from the login of the chart (left) to its exit (right). If this path exists, the proposal or design is syntactically correct. If there is no such path, it means that the compiler will not accept this design.

­ 2 Assembler Language Symbols

Permissible symbols when writing text texts are:

1) all Latin letters: A-Z., A-Z.. In this case, the capital and lowercase letters are considered equivalent;

2) numbers from 0 before 9 ;

3) signs ? , @ , $ , _ , & ;

4) dividers , . () < > { } + / * % ! " " ? = # ^ .

Assembler offers are formed from lexemerepresenting the syntactically inseparable sequences of permissible symbols of the language that make sense to the translator.

Lexemes are:

1) identifiers - Sequences of permissible characters used to designate such object objects such as operation codes, variable names and label name. The identifier recording rule is as follows: the identifier may consist of one or more characters;

2) chains of symbols - sequences of symbols enclosed in single or double quotes;

3) whole bulwa of one of the following surcharge systems : binary, decimal, hexadecimal. The identification of numbers when recording them in the assembler programs is made according to certain rules:

4) Decimal numbers do not require any additional characters to identify any additional characters, for example 25 or 139. To identify in the source text of the program binary numbers It is necessary after recording zeros and units included in their composition, put Latin " b.", For example 10010101 b..

5) hexadecimal numbers have more conventions at their record:

First, they consist of numbers 0...9 , lowercase and capital letters of the Latin alphabet a., B., c., D., E., F. or A., B., C., D., E., F..

Secondly, the translator may have difficulties with the recognition of hexadecimal numbers due to the fact that they can consist of some numbers 0 ... 9 (for example, 190845), so begin with the letter of the Latin alphabet (for example, eF15). In order to "explain" the translator that this lexeme is not a decimal number or identifier, the programmer must specially allocate a hexadecimal number. To do this, at the end of the sequence of hexadecimal numbers, which make up a hexadecimal number, write the Latin letter " h.". This is a prerequisite. If the hexadecimal number begins with the letter, the leading zero is recorded before him: 0 eF15 h.

Almost every proposal contains a description of the object over which or with which some action is performed. These objects are called operanda. They can be identified like this: operands. These are objects (some values, registers or memory cells) to which instructions or directives operate, or these objects that define or specify the operation of instructions or directives.

It is possible to carry out the following classification of operands:

­ constant or direct operands;

­ address operands;

­ transferred operands;

address meter;

­ register operand;

­ basic and index operands;

­ structural operands;

Entries.

Operands are elementary components from which part of the machine command is formed, denoting objects over which the operation is performed. In a more general case, operands may include as part of more complex education, called expressions.

Expressions there are combinations of operands and operators considered as a whole. The result of the calculation of the expression may be the address of a certain memory cell or some constant (absolute) value.

­ 3 Types of assembler operators

We list the possible types assembler operators and syntactic rules for the formation of assembler expressions:

­ arithmetic operators;

­ shift operators;

­ comparison operators;

­ logical operators;

­ index operator;

­ type redefinition operator;

­ operator redefinition of the segment;

­ naming Operator Type of Structure;

­ operator of obtaining the segment component of the address of the expression;

­ operator to obtain an expression displacement.

1 Assembler directives

­ Assembler directives are:

1) segmentation directives. During the previous discussion, we found all the basic rules for recording teams and operands in the assembler program. The question remained the question of how to create a sequence of commands correctly, so that the translator can process them, and the microprocessor is to execute.

When considering the microprocessor architecture, we learned that it has six segment registers, through which it can simultaneously work:

­ with one code segment;

­ with one stack segment;

­ with one data segment;

­ with three additional data segments.

A physically segment is a memory area, occupied by commands and (or) data, whose addresses are calculated relative to the value in the corresponding segment register. The syntactic description of the segment on the assembler is a design shown in Figure 13:


­ Figure 13 - Syntax description of the segment on the assembler

It is important to note that the functional purpose of the segment is somewhat wider than the simple breaking of the program on blocks of code, data and stack. Segmentation is part of a more general mechanism associated with concept of modular programming. It involves the unification of the design of object modules created by the compiler, including from different programming languages. This allows you to combine programs written in different languages. It is for the implementation of various options for such an association and operands in the Segment directive are intended.

2) Listing management directives. Listing management directives are divided into the following groups:

­ general Listing Management Directives;

­ output directives in the listing of files included;

­ conditional assembly blocking directives;

­ output directives in the listing of macrocomand;

­ listing information on cross-references listing;

­ listing format change directives.

2 Processor command system

The processor command system is presented in Figure 14.

Consider the main groups of teams.

­ Figure 14 - Classification of assembler commands

Teams are:

1 data transfer commands. These commands occupy a very important place in the system of commands of any processor. They perform the following major functions:

­ saving in memory of the content of internal processor registers;

­ copying content from one memory area to another;

­ writing to I / O devices and read from I / O devices.

In some processors, all these functions are performed by one single team.MOV. (for byte shipments -Movb. ) but with various methods of addressing operands.

In other processors, in addition to the teamMOV. There are several more commands to perform listed functions. Also, the data transfer commands include information sharing commands (their designation is based on a wordExchange. ). There may be an exchange of information between internal registers, between two half of one register (Swap ) or between the register and the memory cell.

2 Arithmetic teams. Arithmetic teams consider operand codes as numeric binary or binary-decimal codes. These commands can be divided into five main groups:

­ fixed semicolons (addition, subtraction, multiplication, division);

­ floating semicolons (addition, subtraction, multiplication, division);

­ cleaning commands;

­ commands of increment and decrement;

­ compare command.

3 Fixed semicolons operate commands work with codes in processor registers or in memory as conventional binary codes. Floating communion (point) operations commands use the format of representation of numbers with order and mantissa (usually these numbers occupy two consecutive memory cells). In modern powerful processors, a set of floating semicolons is not limited to four arithmes, and contains many other more complex commands, for example, the calculation of trigonometric functions, logarithmic functions, as well as complex functions necessary when processing sound and images.

4 Cleaning commands are designed to write a zero code into a register or memory cell. These commands can be replaced by zero-code shipping commands, but special cleaning commands are usually faster than shipping commands.

5 Increment teams (increasing per unit) and decrement

(Reducing per unit) are also very comfortable. They can be in principle to replace the summation commands with a unit or subtraction of a unit, but the increment and decrement are faster than the summation and subtraction. These commands require one input operand, which is both the output operand.

6 The comparison command is designed to compare two input operands. In essence, it calculates the difference of these two operands, but the output operand does not forms, but only changes the bits in the processor state register according to the result of this subtraction. The following command to the comparison command (usually this is a transition command) will analyze bits in the processor status register and perform actions depending on their values. Some processors provide a chain comparison commands of two sequences of operands in memory.

7 logical commands. Logical commands are performed on operands logical (bitwise) operations, that is, they consider operand codes not as a single number, but as a set of individual bits. They differ from the arithmetic teams. Logical commands perform the following basic operations:

­ logical and, logical or, addition of module 2 (excluding or);

­ logical, arithmetic and cyclic shifts;

­ check bits and operands;

­ installing and cleaning bits (flags) of a processor state register (PSW).

Logic operation commands allow you to braidly calculate the basic logic functions from two input operands. In addition, the operation and is used to forced cleaning the specified bits (as one of the operands, the mask code is used, in which the discharges that require cleaning are set to zero). Operation or applied to forced installation of specified bits (as one of the operands, the mask code is used in which the discharges that require installation per unit are equal to one). Operation "Excellenging or" is used to invert the specified bits (as one of the operands, the mask code is used, in which the bits that are subject to inversions are set per unit). Commands require two input operands and form one output operand.

8 Shifts commands allow you to blend the operand code to the right (towards younger discharges) or left (in the direction of senior discharges). The shift type (logical, arithmetic or cyclic) determines which will be the new value of the older bit (when the shift to the right) or the younger bit (during the shift to the left), and also determines whether the oldest value of the older bit (when the shift to the left) is saved somewhere or younger bit (when shifting to the right). Cyclic shifts allow you to move the bits of the operand code in a circle (clockwise when the shift is right or counterclockwise when the shift left). At the same time, the shift ring can enter or not enter the transfer flag. In the transmission flag bit (if used), the value of the older bit is recorded during the cyclic shift to the left and the younger bit during the cyclic shift to the right. Accordingly, the value of the transfer flag bit will correspond to the lowest discharge during the cyclic shift to the left and in the senior discharge during the cyclic shift to the right.

9 commands of transitions. Complaus teams are designed to organize all kinds of cycles, branches, calls to subroutines, etc., that is, they violate the serial progress. These commands are recorded in the command register a new meaning and thereby call the processor transition not to the next command, but to any other command in the memory of the programs. Some commands of transitions provide further return back to the point from which the transition was made, others do not provide for this. If the refund is provided, then the current processor parameters are stored in the stack. If the refund is not provided, then the current processor parameters are not saved.

Compare commands without refund are divided into two groups:

­ unconditional transitions;

­ common crossing teams.

In the designations of these commands are used wordsBranch (branching) and Jump (jump).

The commands of unconditional transitions cause the transition to a new address, regardless of anything. They can call the transition to the specified displacement value (forward or backward) or to the specified memory address. The displacement value or the new address value is indicated as an input operand.

Conditional transition commands cause the transition is not always, but only when performing the specified conditions. As such conditions, flag values \u200b\u200bin the processor state register are usually acting.PSW. ). That is, the transition condition is the result of the previous operation changing the values \u200b\u200bof flags. Total transition conditions can be from 4 to 16. Several examples of conditional transition teams:

­ transition, if zero;

­ transition, if not zero;

­ transition if there is an overflow;

­ transition if there is no overflow;

­ transition if more zero;

­ transition, if less than or equal to zero.

If the transition condition is executed, it is downloaded to the new value command register. If the transition condition is not executed, the command meter is simply increasing, and the processor selects and performs the following command in order.

Especially for checking the transition conditions, the comparison command (SMR) is applied preceding the conditional transition command (or even several conventional transition teams). But flags can be installed and any other command, such as a data transfer command, any arithmetic or logical command. It should be noted that the flag transition commands themselves do not change that it makes it possible to put several transition commands one after another.

A special place among the transition teams are occupied by interrupt commands. These commands as an input operand require interrupt number (vector address).

Output:

The assembler language is a symbolic presentation of the machine language. Assembler language for each computer type. The assembler program is a set of memory blocks called memory segments. Each segment contains a set of language suggestions, each of which occupies a separate line of the program code. Suggestions of the assembler are four types: teams or instructions, macros, directives, comment lines.

All Latin letters are permissible when writing the text of the programs: A-Z., A-Z.. In this case, the capital and lowercase letters are considered equivalent; Figures OT 0 before 9 ; signs ? , @ , $ , _ , & ; dividers , . () < > { } + / * % ! " " ? = # ^ .

The following types of assembler operators and syntactic rules for the formation of assembler expressions are used. Arithmetic operators, shift statements, comparison operators, logical operators, index operator, type redefinition operator, segment redefinition operator, structure type naming operator, operator of obtaining a segment component of an expression address, an expression displacement operator.

The command system is divided into 8 major groups.

­ Control questions:

1 What is an assembler language?

2 What characters can be used to record commands on the assembler?

3 What are the labels and their appointment?

4 Calculate the structure of the assembler commands.

5 List 4 types of assembler suggestions.

National University of Uzbekistan named after Mirzo Ulugbek

Faculty of computer technology

On the topic: Semantic analysis of the exe file.

Performed:

Tashkent 2003.

Preface.

Assembler language and team structure.

EXE -File structure (semantic analysis).

The structure of the COM file.

The principle of action and spread of the virus.

Disassembler.

Programs.

Preface

The profession of programmer is amazing and unique. Nowadays, science and life cannot be submitted without the newest technology. All that is associated with human activity does not do without computing technology. And this contributes to its high development and perfection. Let the development of personal computers begins not so long ago, but during this time there were colossal steps on software products and for a long time these products will be widely used. The area associated with computers knowledge has undergone an explosion, as well as the corresponding technology. If you do not take a commercial party in consideration, then we can say that there are no professional activities in this area of \u200b\u200bprofessional activity. Many are developing programs not for the sake of benefit or earnings, but according to their own will, by passion. Of course, this should not affect the quality of the program, and in this matter, so to speak "business" there is a competition and demand for the quality of execution, in stable work and meets all the requirements of modernity. Here it is also worth noting the appearance of microprocessors in the 60s, which came to replace the large number of lamps. There are some varieties of microprocessors that are very different from each other. These microprocessors are different from each other of the discharge and built-in system teams. The most common such as: Intel, IBM, Celeron, AMD, etc. All of these processors are related to the developed architecture of Intel processors. The spread of microcomputers was the reason for revising the attitude towards the assembler language for two main reasons. First, programs written in the assembler language require significantly less memory and execution time. Secondly, the knowledge of the assembler language and the resulting machine code gives an understanding of the architecture of the machine, which is unlikely to be provided when working in a high level language. Although most software specialists are developing in high-level languages, such as Pascal, C or Delphi, which is easier when writing programs, the most powerful and efficient software is fully or partially written in the assembler language. High-level languages \u200b\u200bwere designed to avoid special technical features of specific computers. And the assembler language, in turn, is designed for specific processor specifics. Consequently, in order to write a program in the assembler language for a particular computer, you should know its architecture. In the present day, the type of main software is the EXE file. Given the positive aspects of this, the author of the program can be confident in its integrity. But often sometimes it is not so. There is also a disassemblybler. With the help of a disassembler, you can learn interrupts and program codes. A person who disassembled in the assembler will not be difficult to remake the entire program to their taste. Perhaps hence the most unresolved problem - the virus. Why do people write a virus? Some ask this question with surprise, some with angrily, but nevertheless people continue to exist, who are interested in this task not from the point of view of causing some harm, but as interest to systemic programming. Wrises write for various reasons. One like system challenges, others improve their knowledge in the assembler. I will try to set out about all this in my course work. It also said not only about the structure of the EXE file, but also about the assembler language.

^ Assembler language.

It is interesting to trace, starting from the time of the appearance of the first computers and ending with today's day, for the transformation of the ideas about the assembler language from programmers.

Once the assembler was tongue, without knowledge of which it was impossible to make a computer to do something useful. Gradually, the situation changed. More convenient means of communicating with a computer appeared. But, unlike other languages, the assembler did not die, so he could not do this in principle. Why? In search of the answer, we will try to understand what kind of assembler language is in general.

If briefly, the assembler language is a symbolic presentation of the machine language. All processes in the machine at the lowest, hardware level are driven only by commands (instructions) of the machine language. It is clear that, despite the general name, the assembler language for each type of computer. This applies to the appearance of programs written in the assembler, and ideas, the reflection of which this language is.

To truly solve the problems associated with the equipment (or even, moreover, depending on the equipment, as, for example, improving the speed of the program), it is impossible without the knowledge of the assembler.

A programmer or any other user can use any high-level tools, up to the programs for building virtual worlds and, perhaps, not even suspect that the computer actually does not perform the language commands on which his program is written, and their transformed presentation in the form of boring and sad Communication sequences of a completely different language - machine. And now we will imagine that such a user has a non-standard problem or simply did not hold something. For example, its program should work with some unusual device or perform other actions requiring knowledge of the principles of computer equipment. No matter how smart is a programmer, no matter how good the language in which he wrote his wonderful program, without knowing the assembler, he could not do. And it's not by chance that almost all compilers of high-level languages \u200b\u200bcontain the means of communication of their modules with modules on the assembler or support the access to the assembler programming level.

Of course, the time of computer universal has already passed. As they say it is impossible to argue the immense. But there is something in common, a kind of foundation on which any serious computer education is being built. This knowledge of the principles of the computer, its architecture and the assembler language as a reflection and embodiment of these knowledge.

A typical modern computer (based on i486 or Pentium) consists of the following components (Fig. 1).

Fig. 1. Computer and peripheral devices

Fig. 2. Structural scheme of a personal computer

From the figure (Fig. 1) it can be seen that the computer is made up of several physical devices, each of which is connected to one block called the system. If you argue logically, it is clear that it plays the role of a certain coordinating device. Let's look inside the system unit (you do not need to try to penetrate inside the monitor - there is nothing interesting, besides it is dangerous): open the case and see some boards, blocks, connecting wires. To understand their functional purpose, let's look at the structural scheme of a typical computer (Fig. 2). It does not claim unconditional accuracy and is intended to show the purpose, the relationship and the typical composition of the elements of the modern personal computer.

Let's discuss the scheme in Fig. 2 in several unconventional style.
It is typical, meeting with something new, look for some associations who can help him know the unknown. What associations is a computer? I have, for example, the computer is often associated with the person himself. Why?

Man creating a computer somewhere in the depths of herself thought that he would create something like himself. The computer has the perception of information from the outside world - is a keyboard, a mouse, storage devices on magnetic disks. In fig. 2 These organs are located on the right of the system tires. The computer has the "digestive" organs the information received is a central processor and RAM. And finally, the computer has speech organs that outstand the results of processing. These are also some of the devices on the right.

Modern computers, of course, far to a person. They can be compared with creatures interacting with the outside world at the level of a large, but limited set of unconditional reflexes.
This set of reflexes forms a system of machine commands. On whatever high level you do not communicate with the computer, ultimately everything comes down to the boring and monotonous sequence of machine commands.
Each machine team is a kind of irritant to excite one or another unconditional reflex. The reaction to this stimulus is always unambiguous and "sewn" in the microcomand block in the form of a firmware. This firmware implements actions to implement the machine command, but already at the signal level submitted to certain logic circuits of the computer, thereby driving various computer subsystems. This is the so-called firmware management principle.

Continuing the analogy with a person, we note: In order for the computer to eat correctly, many operating systems are invented, compilers of hundreds of programming languages, etc. But all of them are, in fact, only a dish, on which food (Programs) is delivered by definite rules Stomach (computer). Only the stomach of the computer loves the dietary, monotonous food - give him information structured, in the form of strictly organized sequences of zeros and units whose combinations and make up the machine language.

Thus, externally, being a polyglot, the computer understands only one language - the language of machine commands. Of course, to communicate and work with a computer, it is not necessary to know this language, but almost any professional programmer sooner or later faces the need to study. Fortunately, the programmer does not need to try to comprehend the value of various combinations of binary numbers, since in the 50s the programmers began to use the symbolic analogue of the machine language for programming, which was called the assembler language. This language accurately reflects all the features of the engine language. That is why, in contrast to high-level languages, the assembler language for each type of computer is yours.

Of all the above, we can conclude that, since the assembler language for the computer "native", then the most effective program can only be written on it (provided that it writes a qualified programmer). There is one small "but": it is very laborious, requiring great attention and practical experience in the process. Therefore, in fact, the assembler is written in the main program that should ensure efficient work with the hardware. Sometimes the assembler is written by the time of execution or spending memory. Subsequently, they are drawn up in the form of subroutines and are combined with the code in the high-level language.

To study the assembler language of any computer makes sense to start only after finding out which part of the computer is left visible and accessible to programming in this language. This is the so-called computer software model, part of which is a microprocessor software model that contains 32 registers to one way or another available for use by the programmer.

These registers can be divided into two large groups:

^ 16 user registers;

16 system registers.

In the programs in the assembler language, the registers are used very intensively. Most registers have a definite functional purpose.

As the name follows, the user registers are called because the programmer can use them when writing its programs. These registers include (Fig. 3):

Eight 32-bit registers that can be used by programmers for storing data and addresses (they are also called general purpose registers (Ron)):

six segment registers: CS, DS, SS, ES, FS, GS;

status and Management Registers:

EFLAGS / FLAGS flags register;

EIP / IP pointer pointer register.

Fig. 3. User registers of microprocessors I486 and Pentium

Why many of these registers are shown with an inclined separation feature? No, these are not different registers are parts of one large 32-bit register. They can be used in the program as individual objects. This is done to ensure the performance of programs written for the younger 16-bit models of Intel microprocessors, starting with I8086. I486 and Pentium microprocessors have mostly 32-bit registers. Their number, with the exception of segment registers, the same as in I8086, but the dimension is larger, which is reflected in their designations - they have
prefix E (extended).

^ General Registers
All registers of this group allow you to contact our "younger" parts (see Fig. 3). Considering this drawing, notice that it is possible to use for self-addressing only the younger 16 and 8-bit parts of these registers. The older 16 bits of these registers as independent objects are not available. This is done as we noted above, for compatibility with the younger 16-bit models of Intel microprocessors.

We list the registers belonging to the general purpose registers group. Since these registers are physically located in a microprocessor inside an arithmetic and logical device (Allu), they are also called registers by Allu:

eAX / AX / AH / AL (Accumulator Register) - battery.
It is used to store intermediate data. In some teams, the use of this register is required;

eBX / BX / BH / BL (BASE REGISTER) - Basic register.
It is used to store the basic address of some object in memory;

eCX / CX / CH / CL (Count Register) is a register meter.
Used in commands that produce some repeatable actions. Its use is often implicitly and hidden in the algorithm of the relevant team.
For example, the LOOP cycle organization, in addition to transmitting the command management, located at some address, analyzes and reduces the value of the ECX / CX register;

eDX / DX / DH / DL (DATA REGISTER) - data register.
Just like the EAX / AX / AH / AL register, it stores intermediate data. In some teams, its use is mandatory; For some commands, this is implicitly.

The following two registers are used to support the so-called chain operations, that is, operations producing sequential processing of chains of elements, each of which can have a length of 32, 16 or 8 bits:

eSI / SI (Source Index Register) - source index.
This register in chain operations contains the current address of the element in the source chain;

eDI / DI (DESTINATION INDEX REGISTER) - receiver index (recipient).
This register in the chain operations contains the current address in the receiver chain.

In the microprocessor architecture, such a data structure is supported on the software and hardware level as the stack. To work with a stack in the microprocessor command system, there are special commands, and in the microprocessor software model there are special registers:

eSP / SP (STACK POINTER REGISTER) - stack pointer register.
Contains the stack vertex in the current stack segment.

eBP / BP (Base Pointer Register) - Stack frame base pointer register.
Designed to organize arbitrary access to the data inside the stack.

The stack is called the program area for temporary storage of arbitrary data. Of course, the data can also be saved in the data segment, but in this case it is necessary to start a separate named memory cell during this time, which increases the size of the program and the number of names used. The convenience of stack is that its area is used repeatedly, and saving them from there using efficient PUSH and POP commands without specifying any names.
The stack is traditionally used, for example, to save the contents of the registers used by the program, before calling the subroutine, which, in turn, will use the processor registers "for their personal purposes". The initial content of the registers is projected from the stack after returning from the subroutine. Another common reception is the transfer of the subprogramme of the parameters required by it through the stack. The subroutine, knowing, in what order are placed on the stack of parameters, can pick them out from there and use when performing it. A distinctive feature of the stack is the peculiar order of the sample of the data contained in it: only the upper element is available on the stack at any time, i.e. The element loaded into the stack last. Unloading from the stack of the upper element makes the following element available. The stack elements are located in the memory area allotted under the stack, starting from the bottom of the stack (i.e., from its maximum address) on consistently decreasing addresses. The address of the upper, available element is stored in the SP stack indicator register. Like any other area of \u200b\u200bthe program memory, the stack must enter some segment or form a separate segment. In any case, the segment address of this segment is placed in the SS stack segment register. Thus, a pair of registers SS: SP describe the address of an affordable stack cell: the segment address of the stack is stored in SS, and in SP - the displacement of the latter stored in the stack of this (Fig. 4, a). Please note that in the initial state, the SP stack pointer indicates a cell under the bottom of the stack and not included in it.

Figure 4. Stack organization: A - initial state, B - after loading one element (in this example - the contents of the register ah), in - after loading the second element (the contents of the DS register), g - after unloading one element, D - after unloading Two elements and return to its original state.

Loading the stack is carried out by a special command of working with Push stack (push). This command first reduces the contents of the stack pointer to 2, and then places the operand at the address in SP. If, for example, we want to temporarily save the contents of register ah on the stack, you must execute the command

The stack goes to the state shown in Fig. 1.10, b. It can be seen that the stack pointer is shifted to two bytes up (towards smaller addresses) and this address records the operand pushing command. Next download command on the stack, for example,

will the stack in the state shown in Fig. 1.10, c. The stack will now store two elements, and only the upper one will be affordable, which indicates the SP stack pointer. If, after some time, we needed to restore the original contents saved in the stack of registers, we must execute unloading commands from the POP stack (push out):

pop DS.
pop AX.

What size should be the stack? It depends on how intensively it is used in the program. If, for example, it is planned to store an array of 10,000 bytes in the stack, then the stack should be no less than this size. At the same time, it should be borne in mind that in some cases the stack is automatically used by the system, in particular, when executing the INT 21H interrupt command. According to this command, the processor first places the return address on the stack, and then DOS sends the same register contents there and other information related to the interrupted program. Therefore, even if the program does not use the stack at all, it should still be present in the program and have no less than several tens of words. In our first example, we took under the stack of 128 words, which is definitely enough.

^ Program structure on assembler

The assembler program is a set of memory blocks called memory segments. The program may consist of one or more such block segments. Each segment contains a set of language suggestions, each of which occupies a separate line of the program code.

Assembler offers are four types:

commands or instructions that are symbolic analogues of machine commands. In the process of broadcasting, the assembler instructions are transformed into the corresponding commands of the microprocessor command system;

macrocomands - the definite proposal of the program's text proposals that are replaced during broadcast by other proposals;

directives that are an indication of an assembler translator for performing certain actions. Directives have no analogues in the machine representation;

rows of comments containing any characters, including the letters of the Russian alphabet. Comments are ignored by the translator.

^ Assembler syntax

The proposals that make up the program may be a syntactic design, a corresponding team, Macrokomand, Directive, or a comment. In order for the assembler's translator to recognize them, they must be formed by certain syntactic rules. To do this, it is best to use a formal description of the syntax of the language like the rules of grammar. The most common ways of such a description of the programming language are syntactic charts and extended forms of Bakusa Naur. For practical use, syntactic diagrams are more convenient. For example, the assembler suggestions syntax can be described using syntactic diagrams shown in the following figures.

Fig. 5. assembler offer format

Fig. 6. Format Directive

Fig. 7. Command format and macros

On these drawings:

the name of the label is the identifier, the value of which is the address of the first byte of the proposal of the source text of the program, which it denotes;

the name is an identifier that distinguishes this directive from other directives of the same name. As a result of the processing assembler, a specific directive can be assigned to certain characteristics;

operation code (CPC) and directive is mnemonic designations of the relevant machine team, macros, or translator directives;

operands - parts of the team, macro commanders or assembler directives denoting objects over which actions are made. Assembler operands are described by expressions with numeric and text constants, marks and identifiers of variables using operations and some reserved words.

^ How to use syntactic charts? It is very simple: for this you just need to find and then go through the way from the login of the chart (left) to its exit (right). If this path exists, the offer or design is syntactically correct. If there is no such path, it means that the compiler will not accept this design. When working with syntactic charts, we pay attention to the direction of the bypass, indicated by the arrows, since among the paths there may be those for which you can go to the right left. In essence, the syntactic charts reflect the logic of the translator when the program's input proposals isolate.

Permissible symbols when writing text texts are:

All Latin letters: A-Z, A-Z. In this case, the capital and lowercase letters are considered equivalent;

Numbers from 0 to 9;

Signs?, @, $, _, &;

Dividers ,. ()< > { } + / * % ! " " ? \ = # ^.

Suggestions of the assembler are formed from the lexeme, which are syntactically inseparable sequences of permissible symbols of the language that make sense to the translator.

Lexes are:

identifiers - sequences of permissible characters used to refer to such object objects such as operation codes, variable names and label name. The identifier recording rule is as follows: The identifier may consist of one or more characters. As characters, you can use the letters of the Latin alphabet, numbers and some special signs - _,?, $, @. The identifier cannot start the digit symbol. The identifier length can be up to 255 characters, although the translator perceives only the first 32, and the rest ignores. You can adjust the length of possible identifiers using the MV command prompt option. In addition, there is an opportunity to specify the translator to distinguish between the uppercase and lowercase letters or ignored their difference (which is done by default).

^ Assembler commands.

Assembler commands disclose the ability to transfer their requirements to the computer, the management mechanism in the program (cycles and transitions) for logical comparisons and software organization. However, programmable tasks are rarely so easy. Most programs contain a number of cycles in which several commands are repeated until a certain requirement to achieve, and various checks that determine which of several actions should be performed. Some commands can transmit control by changing the normal sequence of steps directly modify the offset value in the command pointer. As mentioned earlier, there are various teams for various processors, we will consider a number of some commands for processors 80186, 80286 and 80386.

To describe the status of flags after performing some team, we will use the sample from the table reflecting the EFLAGS flag structure:

At the bottom line of this table, the values \u200b\u200bof the flags are given after executing the command. At the same time, the following notation is used:

1 - After executing the command, the flag is set (equal to 1);

0 - After executing the command, the flag is reset (equal to 0);

r - the value of the flag depends on the result of the work of the team;

After executing the command, the flag is not defined;

space - After executing the command, the flag does not change;

To represent operands in syntactic diagrams, the following notation is used:

r8, R16, R32 - operand in one of the byte size registers, word or double word;

m8, M16, M32, M48 - Operand in memory byte size, word, double word or 48 bits;

i8, i16, i32 - direct operand byte size, word or double word;

a8, A16, A32 - relative address (offset) in the code segment.

Teams (alphabetical order):

* These commands are described in detail.

Add.
(Addition)

Addition

^ Team diagram:

add receiver, source

Purpose: Addition of two operands Source and receiver byte, word or double word.

Work algorithm:

fold the operands source and receiver;

record the result of adding to the receiver;

install flags.

Flag status after executing the command:

Application:
The Add command is used to add two integer operands. The result of the addition is placed at the address of the first operand. If the result of the addition is over the border of the operand receiver (overflow), then consider this situation by analyzing the CF flag and the subsequent possible application of the ADC command. For example, lay values \u200b\u200bin the AX register and the memory area CH. When adding, you should consider the possibility of overflow.

Register plus register or memory:

| 000000dw | ModRegr / Rm |

Register AX (AL) plus direct value:

| 0000010w | --Data-- | Data, if w \u003d 1 |

Register or memory plus direct value:

| 100000sw | Mod000R / M | --Data-- | Data, if bw \u003d 01 |

Call
(Call)

Call procedure or task

^ Team diagram:

Purpose:

transfer of the control of a close or long-term procedure with memorization in the return point address stack;

switching tasks.

Work algorithm:
determined by the type of operand:

Messenger label - The contents of the EIP / IP command pointer is entered into the stack and the new address value is loaded into the same register, the address corresponding to the label;

Label label - the contents of the EIP / IP and CS command pointer is entered into the stack. Then, the same registers are loaded with new values \u200b\u200bof addresses corresponding to the long-tag;

R16, 32 or M16, 32 - determine the register or memory cell containing offsets in the current command segment where control is transmitted. When controlling control, the contents of the EIP / IP command pointer is entered;

Memory pointer - defines a memory cell containing 4 or 6-byte pointer to the called procedure. The structure of such a pointer 2 + 2 or 2 + 4 bytes. The interpretation of such a pointer depends on the mode of operation of the microprocessor:

^ Flag statla After executing the command (except for switching task):

execution of the team does not affect flags

When you switch the task, the flag values \u200b\u200bare changed in accordance with the EFLAGS register information in the TSS status segment of the task to which switching.
Application:
The call command allows you to organize a flexible and multivariate control to the subroutine while saving the return point address.

ABOUT D (four formats):

Direct addressing in the segment:

| 11101000 | DISP-LOW | DIEP-HIGH |

Indirect addressing in the segment:

| 11111111 | MOD010R / M |

Indirect addressing between segments:

| 11111111 | MOD011R / M |

Direct addressing between segments:

| 10011010 | Offset-Low | Offset-high | SEG-LOW | SEG-HIGH |

Cmp
(Compare Operands)

Comparison of operands

^ Team diagram:

cMP Operand1, Operand2

Purpose: Comparison of two operands.

Work algorithm:

perform subtraction (operand1 operand2);

depending on the result, install flags, operand1 and operand2 not to change (that is, the result is not memorized).

Application:
This command is used to compare the two operands by subtracting, while the operands do not change. According to the results of the command, flags are installed. The CMP command applies to the conditional transition commands and the byte installation command by the SETCC value.

ABOUT K O D (three formats):

Register or register memory:

| 001110dw | MODREGR / M |

Direct value with register AX (AL):

| 0011110W | --Data-- | Data, if w \u003d 1 |

Direct value with register or memory:

| 100000sw | Mod111R / M | --Data-- | Data, if SW \u003d 0 |

DEC
(Decrement Operand By 1)

Reducing operand per unit

^ Team diagram:

dec Operand

Purpose: Reducing the operand value in memory or register by 1.

Work algorithm:
the command deducts 1 from the operand. Flag status after executing the command:

Application:
The DEC command is used to reduce the value of bytes, words, double words in memory or register per unit. At the same time, notice that the command does not affect the CF flag.

Register: | 01001REG |

^ Register or memory: | 1111111W | MOD001R / M |

Div
(Divide unsigned)

Decision unsaluable

Team diagram:

div divider

Purpose: Perform the operation of dividing two binary unsigned values.

^ Work algorithm:
For the command, it is necessary to specify two operands - divide and divider. The dividend is defined implicitly and its size depends on the size of the divider, which is specified in the command:

if a divider in the bytes, then the dividend must be located in the AX register. After the operation, the private is placed in Al, and the residue in AH;

if the divider is the size of the word, then the dividend must be located in the pair of registers DX: AX, and the youngest part of the dividend is in AX. After the operation, the private is placed in AX, and the residue in DX;

if a dual-word divider, the divisible must be located in the EDX register pair: EAX, and the youngest part of the division is in EAX. After the operation, the private is placed in EAX, and the residue is in EDX.

^ Flag statla after executing the command:

Application:
The team performs an integer division of operands with the issuance of the result of dividing in the form of a private and residue from division. When performing a division operation, an exceptional situation may occur: 0 - division error. This situation occurs in one of two cases: the divider is 0 or private too large for its placement in the EAX / AX / AL register.

Oh k about d:

| 1111011W | MOD110R / M |

Int.
INTERRUPT)

Calling Interrupt Service Subprogram

^ Team diagram:

int number_name

Purpose: Calling an interrupt service subroutine with an interrupt number specified by the command operand.

^ Work algorithm:

write on the EFLAGS / Flags flags and return address. When recovering the return address, the contents of the CS segment register are first recorded, then the contents of the EIP / IP command pointer;

reset IF and TF in zero flags;

transfer control to the interrupt processing program with the specified number. The control mechanism depends on the mode of operation of the microprocessor.

^ Flag statla after executing the command:

Application:
As can be seen from the syntax, there are two forms of this command:

iNT 3 - has its own individual code of the 0CCH operation and takes one byte. This circumstance makes it very convenient for use in various software debuggers to install interrupt points by replacing the first byte of any command. The microprocessor, encountered in the command sequence command with the 0CCH operation code, causes a interrupt processing program with a vector number 3, which serves to communicate with the program debugger.

The second form of the command occupies two bytes, has a 0CDH operation code and allows you to initiate a call of the interrupt processing routine with a vector number in the range of 0-255. Features of the management of management, as noted, depend on the mode of operation of the microprocessor.

About the (two formats):

Register: | 01000REG |

^ Register or memory: | 1111111W | MOD000R / M |

JCC.
JCXZ / JECXZ.
(JUMP IF Condition)

(JUMP IF CX \u003d ZERO / JUMP IF ECX \u200b\u200b\u003d ZERO)

Transition if a condition is satisfied

Transition if CX / ECX is zero

^ Team diagram:

jCC Tag
jcxz label
jECXZ Tag

Purpose: The transition within the current command segment depending on some condition.

^ Commanding algorithm (except JCXZ / JECXZ):
Checking the status of flags depending on the code of the operation (it reflects the verifiable condition):

if the test condition is truly true, then proceed to the cell designated by the operand;

if the valid condition is false, then transfer the following command.

JCXZ / JECXZ team work algorithm:
Check the equality conditions zero the contents of the ECX / CX register:

if the verifiable condition

Course work

Under the discipline "System programming"

Topic №4: "Solving tasks for procedures"

Option 2.

East Siberian State University

Technology and management

____________________________________________________________________

Technological College

THE TASK

for coursework

Discipline:
Topic: Solving Tasks for Procedures
Artist (s): Glavinskaya Arina Aleksandrovna
Leader: DambaevaSeegma Viktorovna
Summary of work: Study of subprograms in the assembler language,
Solving tasks using subroutines
1. Theoretical part: Basic information about the assembler language (set
Teams, etc.), organization of subprograms, methods of transmitting drugs
in subroutines
2. Practical part: Develop two subprogrammes, one of which converts any given letter to the title (including Russian letters), and the other converts the letter to the line.
Converts any given letter to the title, and the other converts the letter to the line.
Converts the letter to the line.
Terms of execution of the project on schedule:
1. The theoretical part is 30% by 7 week.
2. Practical part - 70% by 11 week.
3. Protection - 100% by 14 week.
Requirements for registration:
1. The calculation and explanatory note of the exchange project should be presented in
electronic and solid copies.
2. The report of the report must be at least 20 typewritten pages without accounting applications.
3. RPZ is issued according to GOST 7.32-91 and signed by the manager.

Manager __________________

Artist __________________

Date of issue " 26 " september 2017 G.


Introduction 2.

1.1 Basic information about the assembler language. 3.

1.1.1 Set of commands. four

1.2 Organization of subroutines in the assembler language. four

1.3 Methods for transferring parameters in subroutines. 6.

1.3.1 Transfer of parameters through registers .. 6

1.3.2 Transfer of parameters through the stack. 7.

2 Practical section .. 9

2.1 Setting the problem. nine

2.2 Description of the problem of problem. nine

2.3 Testing the program .. 7

Conclusion. eight

References .. 9


Introduction

It is well known that it is difficult to program on assembler. As you know, there are many different languages. high levelthat allow you to spend much less effort when writing programs. Naturally, the question arises when the programmer may need to use the assembler when writing programs. Currently, you can specify two areas in which the use of the assembler language is justified, and often necessary.

First, these are the so-called machine-dependent system programs, usually they manage various computer devices (such programs are called drivers). These system programs use special machine commands that do not need to apply in ordinary (or as they say applied) Programs. These commands are impossible or very difficult to set in the high level language.

The second area of \u200b\u200bapplication of the assembler is associated with optimizing program execution. Very often, program-translators (compilers) with high-level languages \u200b\u200bgive a very inefficient program in the machine. This usually relates to a computational program, in which most of the time is performed very small (about 3-5%) of the program (main cycle). To solve this problem, the so-called multilingual programming systems can be used that allow you to record parts of the program in different languages. Typically, the main part of the program is recorded in the high-level programming language (Fartran, Pascal, C, etc.), and the critical execution time of the program is on the assembler. The speed of the entire program can increase significantly. Often this is the only way to make the program give the result for an acceptable time.

The purpose of this course work is to obtain practical skills to work programming in the assembler language.

Tasks of work:

1. To study the basic information about the assembler language (structure and components of the assembler program, team format, the organization of subroutines, etc.);

2. Examine the types of bit operations, the format and logic of the operation of logical assembly commands;

3. Solve the individual task of applying subroutines in the assembler;

4 .. Formulate the conclusion about the work done.

1 Theoretical section

Basic Information about Assmbler

Assembler is a low-level programming language, which is a format for recording machine commands, convenient for human perception.

The assembler language commands are one in one correspond to the processor teams and, in fact, are a convenient symbolic form of recording (mnemokode) of commands and their arguments. Also, the assembler language provides basic software abstractions: binding the parts of the program and data after tags with symbolic names and directive.

Assembler directives allow you to include data blocks in the program (described explicitly or read from the file); repeat a certain fragment of the specified number of times; compile a fragment by condition; set the execution address of the fragment, change the values \u200b\u200bof the labels during the compilation process; Use macro definitions with parameters and other.

Advantages and disadvantages

· The minimum amount of redundant code (use of a smaller number of commands and references to memory). As a result, high speed and smaller program size;

· Large code volumes, a large number of additional minor tasks;

· Poor readability code, support difficulty (debugging, adding features);

· The difficulty of implementing programming paradigms and any other complex conventions, the complexity of joint development;

· Less amounts of available libraries, their small compatibility;

· Immediate access to equipment: I / O ports, special processor registers;

· Maximum "fit" for the desired platform (the use of special instructions, technical features of "iron");

· Infections to other platforms (except binary compatible).

In addition to the instructions, the program may contain directives: commands that are not sent directly to machine instructions, and the compiler managers. The set and syntax will differ significantly and dependes not from the hardware platform, but from the compiler used (generating dialects of languages \u200b\u200bwithin one family of architectures). As a set, directives can be allocated:

· Determining data (constants and variables);

· Management of the program of the program in memory and parameters of the output file;

· Setting the compiler mode;

· All sorts of abstraction (i.e., elements of high-level languages) - from registration procedures and functions (to simplify the implementation of the paradigm of procedural programming) to conditional structures and cycles (for the structigm of structural programming);

· Macros.

Set of commands

The typical commands of the assembler language are:

· Data transfer commands (MOV etc.)

· Arithmetic teams (add, sub, imul, etc.)

· Logical and batch operations (OR, AND, XOR, SHR, etc.)

· Program execution management teams (JMP, LOOP, RET, etc.)

· Interrupt call commands (sometimes refer to control commands): int

· I / O commands in ports (in, out)

For microcontrollers and microcomputers are also characterized by commands checking and transition by condition, for example:

· JNE - Go if not equal;

· JGE - go, if more or equal.

In order for the machine to perform a person's teams at the hardware level, it is necessary to specify a certain sequence of actions in the language of "Nolikov and Units". Assistant in this business will be an assembler. This is a utility that works with the transfer of commands to the machine language. However, the writing of the program is a very time-consuming and complex process. This language is not intended to create lungs and simple actions. At the moment, any programming language used (assembler works fine) allows you to write special effective tasks that strongly affect the operation of the hardware. The main purpose is to create a microcomand and small codes. This language gives more opportunities than, for example, Pascal or C.

Brief description of assembler languages

All programming languages \u200b\u200bare divided from levels: low and high. Any of the syntactic system of the "family" of the assembler is different in that it unites at once some advantages of the most common and modern languages. With others, their relatives and the fact that the computer system can be fully used.

A distinctive feature of the compiler is simplicity to use. It differs from those that work only with high levels. If you take into account any such programming language, the assembler functions twice as fast and better. In order to write a light program in it, too much time will not need.

Briefly about the structure of the language

If we talk in general about the work and structure of the functioning of the language, you can say for sure that its commands fully correspond to the processor teams. That is, the assembler uses mnemokodes, the most convenient person to record.

Unlike other programming languages, the assembler uses certain tags to record the memory cells instead of addresses. They are translated into the so-called directives. These are relative addresses that do not affect the operation of the processor (not translated into the machine language), and necessary to recognize the programming environment itself.

For each line of the processor, there is its own with this situation correct will be any process, including translated

The assembler language has several syntaxes that will be discussed in the article.

Pluses of language

The most important and convenient adaptation of the assembler language will be that it is possible to write any program for a processor that will be very compact. If the code turns out to be huge, then some processes redirects to RAM. At the same time, they do everything quickly and without failures, unless of course, they control a qualified programmer.

Drivers, operating systems, BIOS, compilers, interpreters, etc. - This is all the program in the assembler language.

When using a disassembler, which makes a translation from the machine in one, it is possible to easily understand how one or another system task works, even if there is no explanation. However, this is possible only if the programs are light. Unfortunately, in nontrivial codes, it is rather difficult to understand.

Cons Languages

Unfortunately, novice programmers (and often professionals) are difficult to disassemble the language. Assembler requires a detailed description of the necessary command. Due to the fact that you need to use machine commands, the likelihood of erroneous actions and the complexity of execution is growing.

In order to write even the simplest program, the programmer must be qualified, and its level of knowledge is high enough. The average specialist, unfortunately, often writes bad codes.

If the platform for which the program is created is updated, then all commands must be copied manually - this requires the language itself. The assembler does not support the function of automatic regulation of the operation of the processes and replace any elements.

Teams of language

As already mentioned above, each processor has its own set of commands. The simplest elements that are recognized by any types are the following codes:


Use of directives

Programming microcontrollers in the language (assembler This allows and perfectly copes with the functioning) of the lowest level in most cases it is successfully ends. It is best to use processors with a limited resource. For 32-bit techniques, this language is well suited. Often in codes you can see directives. What is this? And what is used for?

To begin with, it is necessary to emphasize on the fact that directives are not transferred to the machine language. They regulate the performance of the compiler. Unlike commands, these parameters, having various functions, differ not due to different processors, but at the expense of another translator. Among the main directives can be allocated as follows:


origin of name

Due to the name of the language - "assembler"? We are talking about the translator and compiler, which also produce data encryption. From English Assembler means nothing but a collector. The program was not collected manually, an automatic structure was used. Moreover, at the moment, users and specialists have erased the difference between the terms. Often the assembler call programming languages, although it is just a utility.

Due to the generally accepted collecting name, some have an erroneous solution that there is a single low level language (or standard norms for it). In order for the programmer to understand what structure is about, it is necessary to specify, for which platform one or another assembler language is used.

Macrofs

Assembler languages \u200b\u200bthat are created relatively recently have macrosses. They facilitate both spelling and execution of the program. Thanks to their presence, the translator executes the written code at times faster. When creating a conditional choice, you can write a huge block of teams, and it is easier to use macros. They will quickly switch between actions, if the condition or non-fulfillment is fulfillment.

When using macro-language directives, the programmer receives assembler macros. Sometimes it can be widely used, and sometimes its functional features are reduced to one command. Their presence in the code facilitates work with it, makes it more understandable and visual. However, it should be attentive to be attentive - in some cases macros, on the contrary, worsen the situation.



Did you like the article? Share it