Главная » Просмотр файлов » Т.А. Волошина, Л.Б. Саратовская - English Reader in Computer Science

Т.А. Волошина, Л.Б. Саратовская - English Reader in Computer Science (1098536), страница 9

Файл №1098536 Т.А. Волошина, Л.Б. Саратовская - English Reader in Computer Science (Т.А. Волошина, Л.Б. Саратовская - English Reader in Computer Science) 9 страницаТ.А. Волошина, Л.Б. Саратовская - English Reader in Computer Science (1098536) страница 92019-04-25СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 9)

This gives rise to the idea of the scope of a variable. The scope of a variable is the part of a program in which it may be used. Variables which are declared for use in one procedure only are called local variables. Their scope is limited to that procedure. Variables which are declared for use in the whole program are called global variables. Their scope is the whole program. The intention of providing each variable with a scope is to enable a program to be broken up into ‘watertight’ blocks, or modules. Each block uses only the information it requires. This simplifies the task of designing, writing and testing programs, and limits the effects of errors.

Almost all high level languages include the notion of data types. In Basic language the standard data types are numeric and character strings. These types can be incorporated into arrays, which are tables of items of the same type. In most high level languages, numbers can be integers or real numbers (generally stored in floating point from). PL/1 even permits the number of significant figures in a number to be declared. Another common standard data type is Boolean, with the range of values ‘true’ and ‘false’. Data types can contain single documents, or be structures such as arrays, stacks, lists, trees, etc.

The Pascal Programming Language

The earliest computers were programmed in machine code and assembly. This type of programming is tedious and error-prone, as well as extremely difficult to understand and modify. Programming is a time-consuming and expensive process. High level languages were developed to resolve this problem. High level languages provide a set of instructions that read like English, but can be translated by a program called a compiler into machine code. Pascal is one such language.

Nicklaus Wirth completed development of the original Pascal programming language in 1970. He based it upon the block structured style of the Algol programming language. There were two original goals for Pascal. According to the Pascal Standard (ISO 7185), these goals were to make available a language suitable for teaching programming as a systematic discipline based on fundamental concepts clearly and naturally reflected by the language, and to define a language whose implementations could be both reliable and efficient on then-available computers.

Pascal went far beyond its original design goals, with commercial use of the language often exceeding academic interest. Pascal provides rich data structures, including both the enumerated and record data types, and defined with a pleasing and powerful clarity. It provided an orthogonal and recursive approach to data structures, with arrays of arrays, arrays of records, records containing arrays, files of records, files of arrays, files of records containing arrays of records, and so on. Pascal’s popularity exploded in the 1970’s, as it was used in writing both system and application software. For this reason, the International Standards committee decided that a formal standard was needed to promote the stability of the Pascal language. By the end of the 1970’s, more than 80 computer systems had Pascal implementations in use.

In 1978, Richard Gleaves and Mark Allen, working on campus in San Diego, used UCSD Pascal to develop the 6502 interpreter which became the basis for Apple Pascal. By the 1980’s, Pascal was used by most universities to teach programming, while still invading the commercial markets. It became so popular that even FORTRAN began to change, taking advantage of Pascal’s innovations.

Due to the strong popularity of the Pascal language in system and application software development, and in response to the many cited drawbacks of the original Pascal implementation, an Extended Pascal evolved to address the needs of commercial development.

In addition to Extended Pascal, in 1986, Apple Computer released the first Object Pascal implementation, a version of its Apple Pascal that supported object-oriented programming.

In 1993, the Pascal Standards Committee published an Object-Oriented Extensions to Pascal technical report which was based upon Apple’s Object Pascal implementation.

Pascal is still used today, both as a powerful educational tool for programming, as well as a viable language for industrial, commercial, scientific, shareware and freeware applications. The Pascal Language is available on a number of different platforms, both commercially and through open source.

Ex.1. Answer the following questions:

  1. What is a high-level language?

  2. What is the relationship of the high-level language to the computer which supports it?

  3. What are the major advantages of this relationship?

  4. What are the ways of classifying high-level languages?

  5. In what way do declarative languages differ from procedural languages?

  6. What are the objectives of high-level languages?

  7. What can be found in character list of any language?

  8. How are the rules of syntax expressed?

  9. What is the powerful feature for dealing with data structures in many languages?

  10. In what way do high-level languages handle the data items used in a program?

  11. What is the intention of providing each variable with a scope?

  12. What notion do almost all high-level languages include?

  13. What can data types contain?

  14. When was the original Pascal programming language completed?

  15. What was it based on?

  16. What were the two original goals for Pascal?

  17. What does Pascal provide?

  18. What is Pascal used for?

Ex. 2. Give the main ideas of the text in logical order.

Ex. 3. Translate in writing:

Языки программирования принято делить на две основные группы, по мере их близости или удаления от языка машинных команд.

Языки низкого уровня – например, ассемблера - мало похожи на привычный человеку язык. Они обычно лаконичны и оперируют не буквами или словами, а цифрами. Чем ближе к машинному уровню языка, тем меньше и конкретнее задачи, которые ставят перед каждой командой. Большие, громоздкие команды на таких языках пишут редко, т.к. это – сложная и кропотливая работа. Зато если программа будет написана на языке низкого уровня, работать она будет быстро, занимая маленький объем и допуская минимум ошибок.

Языки высокого уровня – например, известные всем Basic, Pascal, C – гораздо в большей степени ориентированы на человека. Команды этих языков – понятные человеку английские слова. Компьютеру для выполнения любой из них придется проделать не одну операцию, как в ассемблере, а несколько.

Понятно, что повседневным орудием программистов сегодня являются именно языки высокого уровня. И практически все программные пакеты, которыми мы пользуемся сегодня, созданы с помощью именно этих или подобных им языков. Поэтому и обучение программированию начинают с таких языков как Basic или Pascal - они просты и лучше других иллюстрируют принципы программирования.

Ex. 4.Topics for discussion:

  1. The main characteristics of high-level languages.

  2. The four objectives of high-level languages.

  3. The advantages and the disadvantages of high-level languages.

  4. Pascal as a general-purpose programming language.

UNIT 11

Assembler

Key vocabulary

  1. As opposed to – в отличие

  2. Error-prone adj. – подверженный

ошибкам

  1. Tedium n. – скука,

утомительное дело

  1. Subroutine n. – подпрограмма

  2. Scheduling n. – планирование

  3. Exploit v. – использовать

  4. Sequence n.-последовательность

  5. Facilitate v. – облегчить,

способствовать

  1. Distinction n. – различие

  2. Stand-alone adj. – отдельный,

независимый

  1. Alter v. – менять,

варьировать

  1. Vendor n. – продавец

  2. Initial adj. – изначальный

  3. Locate v. – определять

местонахождение, находить

  1. Similar adj. – похожий,

аналогичный

  1. Bitwise adv. – поразрядно

  2. Call v. – вызвать

(функцию)

  1. Inherit v. – наследовать

  2. Raw adj. – сырой,

необработанный

  1. Lack n. – нехватка,

недостаток

  1. Decipher v. – расшифровать,

понять

  1. Widespread acceptance – широкое

распространение

  1. Reliability n. – надежность

  2. Handful adj. – несколько

  3. Take advantage of – использовать

  1. Take for granted – считать

доказанным, не требующим доказательств

  1. Underlying concepts – основные

понятия

  1. Appropriate adj. – соответствующий, уместный

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture. This representation is usually defined by the hardware manufacturer, and is based on abbreviations (called mnemonics) that help the programmer remember individual instructions, registers, etc. An assembly language is thus specific to certain physical or virtual computer architecture (as opposed to most high-level languages, which are portable).

A utility program called an assembler is used to translate assembly language statements into the target computer’s machine code. The assembler performs a more or less isomorphic translation (a one-to-one mapping) from mnemonic statements into machine instructions and data. (This is in contrast with high-level languages, in which a single statement generally results in many machine instructions. A compiler, analogous to an assembler, is used to translate high-level language statements into machine code; an interpreter executes statements directly.)

Typically a modern assembler creates object code by translating assembly instruction mnemonics into opcodes, and by resolving symbolic names for memory locations and other entities. The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications.

Most sophisticated high-level assemblers provide language abstractions such as:

  • Advanced control structures

  • High-level procedure/function declarations and invocations

  • High-level abstract data types, including structures/records, unions, classes, and sets

  • Sophisticated macro processing

  • Object-Oriented features such as encapsulation, polymorphism, inheritance, interfaces.

Assembly Language

A program written in assembly language consists of a series of instructions (mnemonics) that correspond to a stream of executable instructions, when translated by an assembler, that can be loaded into memory and executed.

For example, an x86/IA-32 processor can execute the following binary instructions as expressed in machine language:

Binary 10110000 01100001 (Hexadecimal: 0xb0 0x61)

The equivalent assembly language representation is easier to remember (more mnemonic): Mov al, #061h

This instructions means:

Move the hexadecimal value 61 (97 decimal) into the processor register named “al”.

The mnemonic “mov” represents the opcode 1011 which moves the value in the second operand into the register indicated by the first operand. The mnemonic was chosen by the instruction set designer to abbreviate “move”, making it easier for the programmer to remember. A comma-separated list of arguments of parameters follows the opcode; this is a typical assembly language statement.

Transforming assembly into machine language is accomplished by an assembler, and the reverse by a disassembler. Unlike in high-level languages, there is usually a one-to-one correspondence between simple assembly statements and machine language instructions. However, in some cases, an assembly may provide pseudo instructions which expend into several machine language instructions to provide commonly needed functionality. For example, for a machine that lacks a “branch if greater or equal” instructions, an assembler may provide a pseudo instruction that expands to the machine’s “set if less than” and “branch if zero” (on the result of the set instruction).

Every computer architecture has its own machine language. On this level, each instruction is simple enough to be executed using a relatively small number of electronic circuits. Computers differ by the number and type of operations they support. For example, a new 64-bit machine would have different circuitry than a 32-bit machine. They may also have different sizes and numbers of registers, and different representations of data types in storage.

While most general-purpose computers are able to carry out essentially the same functionality, the ways they do so differ; the corresponding assembly languages reflect these differences.

Language Design

Basic Elements

Instructions (statements) in assembly language are generally very simple, unlike those in high-level languages. Each instruction typically consists of an operation or opcode plus zero or more operands. Most instructions refer to a single executable machine language instruction.

Some assemblers also support pseudo-instructions, which generate two or more machine instructions.

Assembly languages, like most other computer languages, allow comments to be added to assembly source code that are ignored by the assembler. Good use of comments is even more important with assembly code than with higher-level languages, as the meaning of a sequence of instructions is harder to decipher from the code itself.

Use of Assembly Language .Historical Perspective

Historically, a large number of programs have been written entirely in assembly language.

Operating systems were almost exclusively written in assembly language until the widespread acceptance of C in the 1970s and early 1980s. Many commercial applications were written in assembly language as well, including a large amount of the IBM mainframe software written by large corporations.

In a more commercial context, the biggest reasons for using assembly language were size (and hence speed), and reliability: the writers of Card box-Plus simply said: “We use assembler because then all the bugs are ours.”

Typical examples of large assembly language programs from this time are the MS-DOS operating system, the early IBM PC spreadsheet program Lotus 1-2-3, and almost all popular games for the Atari 800 family of home computers.

Current Usage

Характеристики

Тип файла
Документ
Размер
382 Kb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6458
Авторов
на СтудИзбе
305
Средний доход
с одного платного файла
Обучение Подробнее