Студопедия.Орг Главная | Случайная страница | Контакты | Мы поможем в написании вашей работы!  
 

LESSON 32



PROGRAMMING LANGUAGES [2]

Task 1. Read and translate the text:

Задание 1. Прочитайте и переведите текст:

1. In order to communicate with each other, men use languages. In the same way, 'languages' of one sort or another are used in order to communicate instructions or commands to a computer.

2. When the user wishes to communicate with the computer, he uses a spectrum of languages.

Let us discuss the three lowest members of this spectrum, beginning with the first three from the bottom: machine language, mnemonic machine language, and assembly language.

3. A machine language which is sometimes called as a basic programming language or autocode refers to instructions written in a machine code. This machine code can be immediately obeyed by a computer without translation. The machine code is the coding system adopted in the design of a computer to represent the instruction repertoire of the computer. The actual machine language is generated' by software, not a programmer. The programmer writes in a programming language which is translated into the machine language.

4. A mnemonic machine language uses symbolic names for each, part of instruction that is easier for the programmer to remember than the numeric code for the machine. A mnemonic is an alphanumeric name, usually beginning with a letter rather than a number to refer to fields, files, and subroutines in a program. For example, the operation 'multiplication' might be represented as MULT, the 'load' instruction as L, DISP NAME ADDR in the mnemonic form means 'display name and address', etc.

5. An assembly language is the most machine-dependent language used by programmers today. There are four advantages to using an assembly language rather than machine language. They are the following: 1) it is mnemonic, e.g.,1 we write ST instead of the bit configuration 0101 0000 for the STORE instruction; 2) addresses are symbolic, not absolute as in a machine language; 3) reading is easier; 4) introduction of data to a program is easier.

6. A disadvantage of assembly language is that it requires the use of an assembler to translate a source program into object code (program) in order to be directly understood by the computer. The program written in assembly language is called an assembler. The assembler usually uses such instructions as A (ADD), L (LOAD), ST (STORE), START, TEST, BEGIN, USING, BALR (Branch And Link Register), DC (Define Constant), DS (Define Storage), END, etc. Let us consider some of them.

7. The USING instruction is a pseudo-op. A pseudo-op is an assembly language instruction that specifies an operation of the assembler; it is distinguished from a machine-op which represents to the assembler a machine instruction. So, USING indicates to the assembler which general register to use as a base and what its contents will be. This is necessary because no special registers are set aside for addressing, thus the programmer must inform the assembler which register(s) to use and how to use them. Since addresses are relative, he can indicate to the assembler the address contained to the base register. The assembler is thus able to produce the machine code with the correct base register and offset.

8. BALR is an instruction to the computer to load a register with the next address and branch to the address in the second field. It is important to see the distinction between the BALR which loads the base register, and the USING which informs the assembler what is in the base register. Hence, USING only provides information to the assembler but does not load the register. Therefore, if the register does not contain the address that the USING says it should contain, 'a program error may result.

9. START is a pseudo-op that tells the assembler where the beginning of the program is and allows the user to give a name to the program, e.g., it may be the name TEST. END is a pseudo-op that tells the assembler that the last card of the program has been reached.

10. Note that in the assembler instead of addresses in the operand fields of the instruction there are symbolic names. The main reason for assemblers coming into existence was to shift the burden2 of calculating specific addresses from the programmer to the computer.

Task 2. Answer the following questions:

Задание 2. Ответьте на следующие вопросы:

1. Which languages are the best for machine?

2. Which languages are the best for programmer?

3. What language do you call a machine language?

4. What advantages to using the assembly language do you know?

5. What is a disadvantage of the assembly language?

6. Which program can the computer directly understand?

7. What is a source program?

8. What is an object program?

Task.3. Find the English equivalent for the words given below in the text:

Задание 3. Найдите эквиваленты следующих слов в тексте:

Для того чтобы, перемещать, сборщик, требовать, автокод, нижняя часть, ссылаться на, представлять, причина, ошибка, позволять.

Task 4. Translate the following words given below into Russian:

Прочтите следующие слова и словосочетания и переведите их на русский язык:

obey, assembly, wish, distinction, base register, mnemonic, subroutines, distinguish, multiplication, display name and address, hence, load, operand fields.

Task 5. Make the sentences interrogative:

Задание 5. Поставьте следующие предложения в вопросительную форму:

1. When the user wishes to communicate with the computer, he uses a spectrum of languages.

2. The main reason for assemblers coming into existence was to shift the burden2 of calculating specific addresses from the programmer to the computer.

3. BALR is an instruction to the computer to load a register with the next address and branch to the address in the second field.

4. The assembler is thus able to produce the machine code with the correct base register and offset.

5. A disadvantage of assembly language is that it requires the use of an assembler to translate a source program into object code (program) in order to be directly understood by the computer.

Task 6. Use the right prepositions and fill in the blanks:

Задание 6. Вместо пропусков вставьте соответствующие предлоги, слова из текста:





Дата публикования: 2014-11-02; Прочитано: 772 | Нарушение авторского права страницы | Мы поможем в написании вашей работы!



studopedia.org - Студопедия.Орг - 2014-2024 год. Студопедия не является автором материалов, которые размещены. Но предоставляет возможность бесплатного использования (0.01 с)...