Low-level programming languages \u200b\u200bassembler. When was the assembler (assembler) and the machine language? Identifiers, integers, symbols, comments, equivalence

Programming language

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.

Each processor model, in principle, has its own set of commands and the appropriate language (or dialect) of the assembler.

Advantages and disadvantages

  • the minimum amount of redundant code (the 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 code readability, support difficulty (debugging, adding opportunities)
  • the difficulty of implementing programming paradigms and any other complex conventions, the complexity of joint development
  • fewer libraries available, their small compatibility
  • direct access to the equipment: I / O ports, special processor registers
  • the ability to write a self-modifying code (i.e. metaprogramming, and without the need for software interpreter)
  • maximum "fit" for the desired platform (use of special instructions, technical features of "iron")
  • the intolerance to other platforms (except binary compatible).

Syntax

The generally accepted standard for the syntax of the assembler languages \u200b\u200bdoes not exist. However, there are de facto standards - traditional approaches that most assembler's developers are adhere to. The main information standards are Intel-syntax and AT & T-syntax.

The general format for recording instructions is the same for both standards:

`[Tag:] OPCode [operands] [; Comment]`

The appearance is directly mnemonic instructions to the processor. Prefixes (repetitions, changes such as addressing, etc.) can be added to it. As operands, constants, register names, addresses in RAM, etc. Differences between Intel and AT & T standards concern are mainly the order of transferring operands and their syntax with different addressing methods.

The mnemonics used are usually the same for all processors of one architecture or family of architects (among well-known - mnemonics of processors and controllers Motorola, ARM, X86). They are described in processor specifications.

For example, the ZILOG Z80 processor inherited the Intel I8080 command system, expanded it and changed the mnemonics (and register designations) to their own way. For example, I changed Intel MOV on LD. Motorola Fireball processors inherited the Z80 command system, cutting it down. At the same time, Motorola officially returned to Intel mnemonics. and B. this moment Half assemblers for Fireball works with Intel mnemonics, and half with zilog mnemonics.

Directive

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:

  • defining data (constants and variables)
  • management of the organization's organization in memory and output file parameters
  • mode of operation of the compiler
  • all sorts of abstractions (i.e., elements of high-level languages) - from registration of procedures and functions (to simplify the implementation of the procedure programming paradigm) to conditional structures and cycles (for the structigm of structural programming)
  • macros

Origin and criticism of the term "assembler language"

This type of languages \u200b\u200breceived its name from the translator name (compiler) from these languages \u200b\u200b- assembler (eng. Assembler - collector). The name of the latter is due to the fact that there were no higher-level languages \u200b\u200bon the first computers, and the only alternative to the creation of programs using the assembler was programming directly in codes.

The assembly language in Russian is often called "assembler" (and something connected with it is "assembler"), which, according to the English translation of the word, is incorrect, but fits into the rules of the Russian language. However, the assembler itself (program) is also called simply "assembler", and not the "assembler language compiler", etc.

The use of the term "assembler language" can also cause an erroneous opinion on the existence of a single low level language, or at least a standard for such languages. When named the language on which a specific program is written, it is advisable to specify, for which architecture it is intended and on what dialect of the language is written.

Syntax elements:

Examples:

Hello, WORLD!

Example for versions of Intel x86 (IA32)

mOV AX, CS MOV DS, AX MOV AH, 9 MOV DX, OFFSET HELLO INT 21H XOR AX, AX INT 21H HELLO: DB "Hello World!", 13, 10, "$"

Hello, WORLD!

Example for versions of amiga

move. L #dos Move. L 4. W, A6 JSR - $ 0198 (A6); OldopenLibrary Move. L D0, A6 BEQ. s. Out Move. L #Helloworld, D1 a) Moveq # 13, D2 JSR - $ 03ae (A6); Writechars b) JSR - $ 03b4; Putstr Move. L A6, A1 MOVE. L 4. W, A6 JSR - $ 019e (A6); Closelibrary. Out RTS DOS DC. b "dos.library", 0 HelloWorld DC. B "Hello WORLD!" , $ A, 0

Hello, WORLD!

Example for versions of ATARIST

move. L #Helloworld, - (A7) Move # 9, - (A7) Trap # 1 Addq. L # 6, A7 Move # 0, - (A7) Trap # 1 HelloWorld: DC. B "Hello World!", $ 0d, $ 0a, 0

Hello, WORLD!

Example for versions of Intel x86 (IA32)

NASM Linux is used by Intel Syntax. Compilation and linking:

  • nASM -F Elf -o Hello.o Hello.asm
  • lD -O Hello Hello.o

Section. Data MSG DB "Hello, World!", 0xa Len Equ $ - MSG Section. Text Global _start _start :; Entry point MOV EAX, 4; "WRITE" System Call MOV EBX, 1 MOV ECX, MSG; Pointer to data MOV EDX, LEN; Amount of data int 0x80; Call core MOV EAX, 1; "_Exit" System Call MOV EBX, 0; Return 0 (all good) int 0x80; Call kernel

Hello, WORLD!

Example for versions of PDP-8

/ - Comments.

/ Hello World on Assembler for DEC PDP - 8 * 200 Hello, CLA CLL TLS / TLS Sets the print flag. TAD CHARAC / Creates a DCA IR1 index register / to receive TAD M6 characters / configure the meter for DCA Count / Enhance characters. NEXT, TAD I IR1 / get a symbol. JMS Type / its type. Isz Count / do something else? JMP Next / No, enter another character HLT Type, 0 / Type TSF JMP subroutine. - 1 TLS CLA JMP I Type Charac ,. / Used as the initial value IR1. 310 / H 305 / E 314 / L 314 / L 317 / O 254 /, 240/327 / W 317 / O 322 / R 314 / L 304 / D 241 /! M6, - 15 Count, 0 Ir1 \u003d $ 10

Hello, WORLD!

Example for versions of PDP-11

The program is written on the Macro-11 macroassembler to compile and run this program in the RT-11 OS command:

Macro Hello.

Errors Detected: 0

Link Hello - Link. Run Hello - Run

Title Hello World; Name. McAll. Ttyout ,. Exit Hello :: MOV #MSG, R1; The initial address of the string is $ 1: MOVB (R1) +, R0; We get the following BEQ Done symbol; If zero, come out from the cycle. Ttyout; Otherwise print the BR 1 $ symbol; Repeat cycle Done :. Exit MSG :. Asciz / Hello, WORLD! /; String Hello, WORLD! . End Hello; End of Hello program

Hello, WORLD!

Example for versions of System / 360, System / 370

IBM System / 360/370/390 Basic Assembler Language.

// Exec Assembly Start Main Balr 2, 0 USING *, 2 OPEN PRINT MVC BUF, HW PUT PRINT CLOSE PRINT EOJ HW DC CL132 "HELLO WORLD" BUF DS CL132 PRINT DTFPR IOAREA1 \u003d BUF, DEVADDR \u003d SYSLST, BLKSIZE \u003d 132, * Device \u003d 3203, Control \u003d Yes, Printov \u003d YES End Main / * // Exec Lnkedt // Exec / * / &

Hello, WORLD!

Example for versions of Apple II

* Hello World for 6502 Apple] [* ******************************** Strout Equ $ db3a Ldy #\u003e Hello Lda #< HELLO JMP STROUT HELLO ASC "HELLO WORLD !", 00

Hello, WORLD!

Example for versions of PDP-10

Chttyo - all input / output is carried out using I / O channels. It is best to make symbolic names for those channels that you use, and start them with CH. Define these names using the Midas operator \u003d\u003d.

Call is a symbolic designation to call a system call. Its format: .call.

Open opens input / output channel for use. Requires two parameters - channel number and device name in Sixbit.

Lose% LSFIL is a system call that prints an input / output error message if suddenly it happened.

IoT is a system call that is actually engaged in the input / output. As a parameter, you need to specify the channel and address containing the symbol code for the output. For example, "h represents h.

Title Printhello a \u003d 1 chttyo \u003d\u003d 1; Channel for output. Start :; Opening TTY Channel. . Call [Setz? Sixbit / Open / [. Uao, chttyo]? [Sixbit / Tty /] ((Setz))]. Lose% lsfil. IoT Chttyo, ["H]; Print Hello WORLD Symbol.. IoT Chttyo, [" E]. Iot Chttyo, ["L]. IoT Chttyo, [" L]. Iot chttyo, [O]. IoT Chttyo, [^ M]; symbol of a new line. Iot chttyo, [w]. Iot chttyo, [O]. IoT Chttyo, ["R]. Iot chttyo, ["L]. IoT chttyo, [" d]. Value; Program, stop :) End Start

Fibonacci numbers:

Example for versions of MIPS32

Mars emulator. Conclusion MARS Console:

The Fibonacci Numbers Are: 1 1 2 3 5 8 13 21 34 55 89 144 - Program Is FINISHED RUNNING -

The program displays 15 Fibonacci numbers. The number of numbers can be changed in section.data.

Data Space :.asciiz "" Head :.asciiz "The Fibonacci Numbers Are: \\ N" FIB: .word 0: 15 Size: .word 15 .text main: La $ T0, FIB La $ T5, Size LW $ T5, 0 ($ T5) Li $ T2, 1 Add.d $ F0, $ F2, $ F4 SW $ T2, 0 ($ T0) SW $ T2, 4 ($ T0) Addi $ T1, $ T5, - 2 Loop: LW $ T3, 0 ($ T0) LW $ T4, 4 ($ T0) Add $ T2, $ T3, $ T4 SW $ T2, 8 ($ T0) ADDI $ T0, $ T0, 4 Addi $ T1, $ T1, - 1 BGTZ $ T1, Loop La $ A0, FIB Move $ A1, $ T5 JAL Print Li $ V0, 10 Syscall Print: Add $ T0, $ Zero, $ A0 Add $ T1, $ Zero, $ A1 La $ A0, Head Li $ V0, 4 SYSCALL OUT: LW $ A0, 0 ($ T0) Li $ V0, 1 Syscall La $ A0, Space Li $ V0, 4 Syscall Addi Li $ V0, 1 La $ A0, ($ T2) Syscall La $ A0, String1 Li $ V0, 4 Syscall MULT $ T1, $ T2 MFLO $ T1 Li $ V0, 1 La $ A0, ($ T1) Syscall La $ A0, String2 Li $ V0, 4 Syscall Addiu $ T2, $ T2, 1 BEQ $ T2, 16, Endloop J Loop Endloop: Li $ V0, 10 Syscall



Assembler

Assembler - Low-level programming language. The language got its name from the word Assembler - a collector. There was another 50th. as a symbolic analogue of the machine language.
The assembler commands are one to one correspond to the processor commands and in fact, represent a convenient symbolic form of recording commands and arguments. Also, the assembler ensures the binding of the parts of the program and the data from the tags performed during the assembly (for each tag, the address is calculated, after which each entry of the label is replaced by this address).
Since microprocessor command systems differ, each processor has its own set of commands in the assembler language.
With the help of an assembler, you can write such programs that are impossible, or it is very difficult to write in other languages. For example: Key Generators (Keygen), System Monitors, Drivers for Equipment or Even oS.
High-level languages \u200b\u200b("C", "Pascal", "Delphi", etc.) do not provide reliable control over data streams, memory addresses or processor registers, as well as all of them were developed under a specific type of operating system, the assembler can Become the same assembler, but working on an unknown science platform, and making programs under this platform.
The programs on the assembler, in contrast to programs written in high-level languages, are carried out in tens of times less, and they work ten times faster. An example can serve as the MENUETOS operating system, which is written on Flat Assembler and fit on one diskette (1.44 MB), and the kit includes application programs, such as: an assembly code editor with backlit, work with a file system, 3D screensaver, some games, Picturesor of the pictures, compiler Flat Assembler, Terminal, CD Player and much more. The advantage is that it can be quickly downloaded from the Internet (even with a small connection speed).
At the moment, most software specialists are developing in high-level languages, such as Pascal or C, which is easier when writing programs, but the most powerful and efficient software Fully or partially written in the assembler language.

Literature
1. Peter Abel - Assembler. Language and programming for IBM PC - M., 1999.

Assembler

Assembler(From the English. Assembler - a collector) - the source text compiler of the program written in the assembler language, in the machine language.
Like the language itself, the assemblers are usually specific for a specific architecture, operating system and the syntax version of the language. At the same time, there are multiplatform or universal (more precisely, limited-universal, because in the low level language you cannot write hardware-independent programs) Assemblors that can work on different platforms and operating systems. Among the latter, you can also highlight a cross-assembler group capable of collecting machine code and executable modules (files) for other architectures and OS.
The assembly may not be the first and not last step on the way to obtain a program executive module. Thus, many compilers from high-level programming languages \u200b\u200bgive out the result in the form of a program in the assembler language, which the assembler processes in the future. Also, the resulting assembly may not be executed, and the object module containing the scattered blocks of the machine code and the program data from which (or from several object modules) in the future using the link editor can be obtained by an executable file.
Special memory cells located directly in the processor. Working with registers is performed much faster than with RAM cells, so the registers are actively used both in the programs in the assembler language and the compilers of high-level languages.
The names of the registers originate from their purpose:

EAX / AX / AH / AL (Accumulator Register) - battery;
EBX / BX / BH / BL (BASE REGISTER) -Register database;
ECX / CX / CH / Cl (Counter Register) - Counter;
EDX / DX / DH / DL (DATA REGISTER) - data register;
ESI / SI (source index register) - source index;
EDI / DI (DESTINATION INDEX REGISTER) - receiver index (recipient);
ESP / SP (STACK POINTER REGISTER) - stack pointer register;
EBP / BP (Base Pointer Register) - Stack frame base pointer register.

Row processing commands
To work with rows, or chains of symbols or numbers (i.e., simply speaking, with array of arbitrary data) in the MP there are a number of special commands:
mOVS - sending strings;
cMPS - comparison of two lines;
seas - search in the string of a given element;
lODS - battery loading (Al or Ah registers) from line;
sTOS - record element of a string from a battery (registers ah or Al).

Dignity

· Assembler language allows you to write the fastest and most compact code, which is generally possible for this processor.
· The speed of operation - by optimizing the computing algorithm and / or more rational access to RAM (for example, if all source data is stored in the processor registers, you can exclude unnecessary access to OP), redistribution of data, table computing functions;
· Code volume (including efficient use intermediate results). The reduction in code volume also often increases the speed of execution of the program.
· Ensuring the maximum use of specific capabilities of a specific platform, which also allows you to create more efficient programs, including less resource-intensive.
· Programming in the assembler language is possible direct access to the equipment, and, in particular, I / O ports, processor registers, etc. In many operating systems, direct contact from application programs for registers to registers peripheral equipment Blocked for reliability of the system and exceptions "freezes".
· Assembler language is often used to create hardware drivers and operating system kernels when temporary work agreement is important. peripheral devices from central processor.
· The assembler language is used to create "BIOS firmware".
· With the help of the assembler language, machine-dependent subprograms of compilers and high-level interpreters are often created, and the compatibility of platforms is implemented.
· With the help of the disassembler program, you can understand the operational algorithms of the program under study in the absence of listing on a high-level language, studying only machine codes, but in complex nontrivial programs it is very, very laborious.

disadvantages
· By virtue of a machine orientation ("low" level) of the assembler language, a person is more difficult to read and understand the program on it compared with high-level programming languages; The program consists of too "small" elements - machine commands, respectively, programming and debugging are complicated, the complexity and the likelihood of error making are growing.
· Increased programmer qualification is required to obtain a quality code: the code written by the average programmer in the assembler language is usually not better or even worse than the code generated by the optimizing compiler for comparable programs written in high level language.
· A high-level program can be recompiled with automatic optimization for the features of the new target platform, the program in the assembler language on the new platform can lose its advantage at speed without manual rewriting code.
· As a rule, fewer libraries available compared to modern industrial programming languages.
· There is no portability of programs on computers with another architecture and command system.

Compatibility
A program intended for one type of assembler cannot be compiled on another without radical alteration or automatic conversion! But even among the assemblers of "their" type there is a batch, disaginion and many differences: in keywords, in the rules for the design of the listing, in the supplied libraries and header files, etc. If only compatibility is not explicitly, it is necessary to broadcast the program with the same as an assembler for which it is intended. Otherwise, get ready for alterations (that is, to adoptation). Differences are often manifested in the most unexpected places. Some assemblers understand that "MOV EAX, X" is the same as "MOV EAX, [x]", some - no. They stumble and issue an error. But nothing else! Much worse when the translator silently interprets this design as "MOV EAX, OFFSET X", which is not exactly the same thing! So when transferring the program you have to be very and very careful.

Compatibility of operating systems. MS-DOS-oriented programs without not only are not transportable, but also intolerances. For them is characteristic direct interaction With the equipment available in NT only from the nuclear level, not to mention that the 16-bit code is called from 32-bit applications only through DPMI, and then not without truscy.

Thus, before broadcast an assembler program, it is necessary to identify for which translator and the operating system it is intended! With assembler fragments, caught from the "native" context, are even worse. Suppose, in some article, an interesting anti-loop reception is described and an assembler code is given, but how to embed it in its program - does not say. A familiar situation, isn't it? Direct broadcast is not possible - the translator is wildly fissile, but nothing says.

Soft assembly

Prepared text is the source data for special programs called assemblers. The task of assembler is to convert the text of the program to the form of binary commands that can be performed by a microprocessor. If syntax errors are detected, the resulting code will not be created. The process of creating an executable file occurs in two stages:

ASM -\u003e .obj -\u003e .exe / .dll / .com

In the first stage (.asm -\u003e .obj) from the assembler file by compilation, the intermediate object code files having an extension extension are obtained (additional Inc files can be used). File with extension.Obj contains optimized machine code provided that syntactic and semantic errors have not met. If errors are detected in the source file with the program in the assembler language, then the programmer provides a list of errors detected in which the errors are specified with the line number in which they are detected. The programmer cyclically performs the editing and compilation actions until all errors are eliminated in the source file. At this stage, it is already possible to obtain a ready-made program, but most often it lacks some components. If the compiler for any reason (incorrectly registered the path to such a file or the file is missing) cannot find an Inc file, then a warning is issued and the OBJ file is received.

Assembly, as a rule, takes place in two receptions. At the first pass, mnemonic commands, weekly numbers and symbols in the appropriate machine codes are translated, calculated how much the command is occupied by the location, detected names entered by the user (constants, tags, variables) Their type and numeric value is written to the table. In the same table, it is recorded, from which addresses the procedures, address of the labels, the addresses of the beginning / end of segments, etc., are substituted, the addresses of the start of the procedures are substituted with the second passage, the names of the labels are replaced.

As a result of the assembly, the so-called "object file" is obtained. As an additional feature, the assembler can create a program listing file.

Usually, to obtain object code files, you must perform the appropriate assembler program (Microsoft ML.EXE and Tasm.exe programs of the company BORLAND), indicating in command line File name with program text.

This challenge is minimally necessary. Except name text FileYou must specify the options for assembly. More information about the options of the assembly program should be sought in the documentation for these programs.

Layout program

Next stage (.obj -\u003e .exe / .dll / .com) is called linkage or layout and serves to replace character names used by a programmer to real addresses.

Compare hexadecimal content OBJ and EXE filewhich you got. The exe file has the same sequence of bytes as in the OBJ file. But other than this is still present: the name of the assembled file, the assembler version, the "own" segment, and so on.

This "service" information intended for those cases when your executable file you want to collect from several. When developing big applications The source text consists, as a rule, from several modules (files with source texts), because it is inconvenient to store all texts in one file - they are difficult to navigate.

Each module is compiled into a separate file with the object code. Each of these files are prescribed their code / data / stack segments, which then need to be combined into one. And the executable file we need to get only one - with a single code / data / stack segment. It is this link and does: completes the definition of address links and unites if it is required, several software modules in one. And this one with us is performed.

In addition, it is necessary to add machine code to our modules that implement various standard functions (for example, computing the SIN or LN mathematical functions). Such functions are contained in libraries (files with standard extension. LIB), which are either supplied with the compiler, or are created independently. Therefore, the preparation process necessarily includes the layout stage when all unknowns are defined when the address of the collapsed variables or functions is determined.

The process of combining object modules to one file is carried out by a special linker program or a collector (Link.exe program of Microsoft and Tlink.exe company Borland), which performs the binding of object modules and machine code of standard functions, finding them in libraries, and generates workable The application is an executable code for a specific platform.

The executable code is a complete program with the COM, DLL or EXE extension, which can be run on a computer with an installed operating system for which this program was created. The name of the executable file will be set by the first one .Obj file. For linking you need to dial on the command prompt:

link Prog1.obj Prog2.obj or Tlink Prog1.obj Prog2.obj

The contents of the object file is analyzed by a linker. It determines whether there is a program external linksThat is, whether the program call command program contains in one of the object module libraries (Link Library). The linker finds these links in the object file, copies the necessary procedures from libraries, combines them with the object file and creates an executable file (Executable File). As additional features The linker can create a cross-link file containing the plan of the received executable file.

Used sources
1. https://ru.wikipedia.org/
2. http://natalia.appmat.ru/
3. http://www.codenet.ru/
4. http://wasm.ru/
5. Norton P., Sauke D. Assembler Language for IBM PC. M.: Computer, 1992.

1. When and who was invented counting perforation machines? What tasks were solved on them?

2. What is an electromechanical relay? When was the relay computing machines created? What speed did they possess?
3. Where and when was the first computer built? What was it called?
4. What is the role of John von Neuman in creating a computer?
5. Who was the designer of the first domestic computer?
6. On what element base Created first generation machines? What were their main characteristics?
7. On which elementary database created the second generation machines? What are their advantages compared to the first generation of computer?
8. What is an integrated circuit? When were the first computers on integrated circuits? What were they called?
9. What are the new areas of application of the computer arose with the appearance of third-generation machines?
10. What is a microprocessor? When and where was the first microprocessor created?
11. What is a microevm and personal computer?
12. What types of PC are most common in the world?
13. What is a supercomputer?
14. What is clustered PC systems?
15. What is the feature of the fifth generation computers?

Name the first computing device. Aback calculator arithmometer Russian scores which idea put forward in the middle

19th century English mathematician Charles Babbage?

The idea of \u200b\u200bcreating software managed counting machinehaving an arithmetic device, control device, as well as an input and printing device

The idea of \u200b\u200bcreating cell phone

The idea of \u200b\u200bcreating robots managed by a computer

What year and where was the first computer based on electronic lamps?

1945, USA

1944, England

1946, France

What basis were the third generation computers were created?

Integrated schemes

semiconductors

electronic lamps

superbound integrated circuits

What was the name of the first personal computer?

Name the central device of the computer.

CPU

System unit

Power Supply

Motherboard

The processor processes the information presented:

IN decimal system Note

In English

In Russian

In engine language (in binary code)

To enter numeric and text information used

Keyboard

The scanner is used for ...

To enter images of images and text documents

For drawing on it a special handle

Moving the cursor on the monitor screen

Holographic images

10. What type of printer is advisable to use financial documents to print?

Matrix printer

Jet printer

Laser printer

What type of printer is advisable to use to print essays?

Matrix printer

Jet printer

Laser printer

What type of printer is advisable to use photos for printing?

Matrix printer

Jet printer

Laser printer

With non-compliance with the sanitary and hygienic requirements of the computer, the harmful effect on human health can be provided ...

Monitor on an electronic radiation tube

Monitor on liquid crystals

Plasma panels

When the computer is turned off, all information is erased from ...

Random access memory

Hard disk

Laser Disc

In which computer is stored in the computer?

External memory;

cPU;

Optical tracks have a smaller thickness and placed more tightly on ...

Digital Video Engine (DVD Disk)

Compact Disk (CD - disk)

Input devices enter ...

The output device includes ...

Keyboard, Mouse, Joystick, Light Feather, Scanner, digital cameraMicrophone

Sound columns, monitor, printer, headphone

HDD, processor, memory modules, motherboarddiskette

The program is called ...

Computer program can manage the work of the computer if it is ...

In RAM

On a flexible disk

On hard disk

On CD - disk

Data is ...

The sequence of commands that computer performs during data processing

Information presented in digital form and processed on the computer

Data having a name and stored in long-term memory

File is ...

Text printed on a computer

Information presented in digital form and processed on the computer

Program or data having a name and stored in long-term memory

With rapid formatting of a flexible disk ...

Clear disk directory

All data is erased

Disc defragmentation is performed

Verification of the disc surface

With full formatting of a flexible disk ...

all data is erased

a complete check of the disk is performed.

clear disk directory

the disk becomes systemic

In a multi-level hierarchical file system ...

Files are stored in a system of nested folders.

Files are stored in a system that is a linear sequence

The history of the development of computing equipment:

1. Name the first computing device.
1) Abak
2) Calculator
3) arithmometer
4) Russian scores

2. What idea was put forward in the mid-19th century English mathematician Charles Babbage?
1) the idea of \u200b\u200bcreating a software controlled countable machine having an arithmetic device, a control device, as well as an input and printing device
2) the idea of \u200b\u200bcreating a cell phone
3) the idea of \u200b\u200bcreating robots managed by a computer
3. Name the first programmer computing machines.
1) hell lavley
2) Sergey Lebedev
3) Bill Gates
4) Sophia Kovalevskaya

4. In which year and where was the first computer based on electronic lamps?
1) 1945, USA
2) 1950, USSR
3) 1944, England
4) 1946, France

5. What basis were the third generation computer created?
1) integrated circuits
2) semiconductors
3) electronic lamps
4) super-high integrated circuits

6. What was the first personal computer called?
1) Apple II
2) IBM PC
3) dell.
4) Corvette
Computer device ......................... 15
1. Name the central device of the computer.
1) Processor
2) System Block
3) power supply
4) motherboard
2. How is the physical information in the computer recorded and transmitted?
1) figures;
2) using programs;
3) appears in the form of electrical signals.

3. The processor processes the information presented:
1) in the decimal number system
2) in English
3) in Russian
4) on the machine (in binary code)
4. To enter numeric and text information used
1) Keyboard
2) Mouse
3) Trekball
4) Handle
5. The most important characteristic The coordinate input devices is the resolution, which is usually 500 DPI (Dot Per Inch - dots per inch (1 inch \u003d 2.54 cm)), which means ...
1) When moving mouse to one inch, the mouse pointer moves by 500 points
2) when moving the mouse by 500 points, the mouse pointer moves one inch
6. Scanner is used for ...
1) to enter images and text documents
2) for drawing on it a special handle
3) Moving the cursor on the monitor screen
4) getting holographic images
Information output devices ................. 21
1. What type of printer is appropriate to use financial documents for printing?
1) Matrix Printer
2) inkjet printer
3) Laser printer
2. What type of printer is advisable to use to print abstracts?
1) Matrix Printer
2) inkjet printer
3) Laser printer

1. What type of printer is advisable to use photos for printing?
1) Matrix Printer
2) inkjet printer
3) Laser printer
2. In case of non-compliance with the sanitary and hygienic requirements of the computer, the harmful effect on human health can be provided ...
1) Monitor on an electronic radiation tube
2) Monitor on liquid crystals
4) Plasma panels
3. A device that provides an entry and reading of information is called ...
1) Drive or Drive

4. When the computer is turned off, all the information is erased from ...
4) RAM
5) hard disk
6) Laser Disc
7) Diets
13. In which computer is stored for information?
1) external memory;
2) monitor;
3) processor;
2. Optical tracks have a smaller thickness and placed more tightly on ...
1) Digital Video Engine (DVD - Disk)
2) Compact Disk (CD - disk)
3) diskette
3. On which disc information is stored on concentric paths, on which the magnetized and non-vitrate sections alternate
1) on a diskette
2) on a compact disc
3) on DVD - disk

4. In the input devices included ...

1) Hard disk, processor, memory modules, motherboard, floppy disk
5. In the output device included ...
1) Keyboard, Mouse, Joystick, Light Feather, Scanner, Digital Camera, Microphone
2) Sound columns, monitor, printer, earphone
3) Hard disk, processor, memory modules, motherboard, floppy disk
6. The program is called ...

7. Computer program can manage the work of the computer if it is ...
1) in RAM
2) on a flexible disk
3) on hard disk
4) on CD - disk
8. Data is ...
1) The command sequence that the computer performs during the data processing process
2) information presented in digital form and processed on the computer
3) data having a name and stored in long-term memory
9. File is ...
1) text printed on a computer
2) information presented in digital form and processed on the computer
3) Program or data having a name and stored in long-term memory

10. With the rapid formatting of the flexible disk ...
1) Clean the disk directory is cleaned.
2) all data is erased
3) disk defragmentation
4) Check on


To begin with, we understand the terminology.

Machine code - The system of commands of a particular computing machine (processor), which is interpreted directly to the processor. The team, as a rule, is an integer that is written to the processor register. The processor reads this number and performs an operation that matches this command. Popularly this is described in the book How to Become a Programmer.

Low Level Programming Language (Low-level programming language) is a programming language, as close as possible to programming in machine codes. Unlike machine codes, in the low level language, each command corresponds to a non-number, but the abbreviated name of the command (mnemonic). For example, the Add command is a reduction from the word Addition. Therefore, the use of a low level language will significantly simplify writing and reading programs (compared with programming in machine codes). Low level language is tied to a specific processor. For example, if you wrote a program in a low-level language for the PIC processor, you can be sure that it will not work with the AVR processor.

High-level programming language - This is a programming language, as close as possible to the human language (usually to English, but there are programming languages \u200b\u200bin national languages, for example, Language 1C is based in Russian). The high level language is practically not tied to a specific processor or to the operating system (if specific directives are not used).

Assembler language - This is a low-level programming language on which you write your programs. For each processor, there is its own assembler language.

Assembler - This is a special program that converts (compiles) the source texts of your program written in the assembler language into the executable file (file with the EXE or COM extension). To be accurate, then additional programs are required to create an executable file, and not just an assembler. But about this later ...

In most cases, the Assembler says, and imply "assembler language." Now you know that these are different things and so say not quite right. Although all programmers will understand you.

IMPORTANT!
Unlike high-level languages, such as Pascal, Beysik, etc., there is its own assembly language for each assembler. This rule is radically distinguished by the assembler language from high-level languages. The source texts of the program (or simply "sources") written in a high-level language, you in most cases can compile different compilers for different processors and different operating systems. With assembler sources to do this much more difficult. Of course, this difference is almost not tangible for different assembler, which are intended for the same processors. But the fact of the matter is that for each processor there is its own assembler and its assembler language. In this sense, it is much easier to program in high-level languages. However, all the pleasures should be paid. In the case of high-level languages, we can encounter such things as larger executable file, worst speed, etc.


In this book we will only talk about programming for computers with Intel processors (or compatible). In order to in practice, check the examples given in the book, you will need the following programs (or at least some of them):

  1. . Good programespecially for beginners. Includes source editor and some other useful things. Works in Windows, although programs are written under DOS. Unfortunately, the program costs money (but it is worth it))). For details, see the site http://www.emu8086.com.
  2. - Turbo Assembler from Borland. You can create programs for both DOS and for Windows. Also worth the money and at the moment no longer supported (and Borland does not exist). In general, the thing is good.
  3. - Assembler from Microsoft (deciphered as a macro assembler, and not Microsoft Assembler, as many uninitiated) think. Perhaps the most popular assembler for Intel processors. Supported so far. Conditionally free program. That is, if you buy it separately, it will cost money. But it is available free MSDN subscribers and enters the Visual Studio software package from Microsoft.
  4. - Assembler from Watcom. Like all others, has advantages and disadvantages.
  5. - It has modest possibilities, but has a big plus - enters the standard Windows set. Look for it in the Windows \\ Command or Windows \\ System32 folder. If you do not find, then in other Windows directory folders.
  6. It is also desirable to have any. A DISSION FILM manager, such as wolves Commander (VC) or Norton Commander (NC), does not prevent. With their help, you can also see hexadecimal file codes, but cannot be edited. Free hexadecimal editors on the Internet are quite a lot. Here is one of them: McAfee Fileinsight v2.1. The same editor can be used to work with the source texts of the programs. However, I like it more to do this with the following editor:
  7. Text editor. We are interested in writing the source texts of your programs. I can recommend free editor PSPAD, which supports many programming languages, including the assembler language.
All Programs presented in this book (and program examples) are tested for performance. And it is these programs that are used to implement examples of the programs given in this book.

And yet - the source code written, for example for EMU8086, will be slightly different from the code written, for example, for TASM. These differences will be specified.

Most of the programs shown in the book are written for. First, because this assembler is most popular and still supported. Secondly, because it comes with MSDN and with Microsoft's Visual Studio software package. Well, in third, because I am a happy owner of a licensed copy of MASM.

If you already have any assembler that has not included in the list listed above, you will have to independently deal with its syntax and read the user's manual to learn how to work with it. But the general recommendations given in this book will be fair for any (well, or almost for any) assembler.

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 detailed description The necessary team. 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 most simple programThe programmer must be qualified, and its level of knowledge is quite high. 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 equipment this language Fits perfectly. 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 teams, these parameters, having various functionsDifferent thanks 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.