|
significant bits of___ CS (code segment) register.
__ CPU accomplishes this by using_____ bitmask array, where each bit
corresponds to____ port. If____ bit is 1, access is disallowed and________
exception occurs whenever access to____ corresponding port is attempted.
Упражнение 14. Подчеркните слово, к которому относится артикль, и переведите словосочетание, начиная с артикля:
... defines an I/O privilege level (IOPL) value, which is...
...in two bits of the processor’s EFLAGS register.
... I/O ports on a task-by-task basis.
Tlie I/O address space of processors...
Уражнение IS. Просмотрите Текст, подчеркните и отметьте в нем соответствующими цифрами перевод следующих словосочетаний, которые могут использоваться в профессиональном разговоре:
1) сам по себе
2) попытка обращения к порту ввода/вывода
3) для полного доступа в режиме ядра
4) текущий уровень привилегий
5) в числовом отношении больше
6) при совершении попытки обращения к порту
7) обращение к порту в пользовательском режиме
8) достигает этого, используя
9) исключительная ситуация возникает
10) когда бы ни предпринималась попытка обращения к соответствующему порту
11) длиной 8192 байт
12) существует даже гибкость в том, сколько
13) вы можете выбрать, не предоставлять
14) массив, называемый
15) в специальном сегменте, на который ссылается селектор сегмента
Упражнение 16. Теперь вы можете сказать по-английски следующие словосочетания. Не забывайте о правилах использования артиклей и предлогов:
Он не может работать сам по себе; в числовом отношении больше, чем...; они провалились (failed), когда пытались (при совершении попытки) сделать это; они достигают этого, используя последние достижения; исключительная ситуация возникает всегда, когда бы ни предпринимался доступ; у вас есть выбор, не делать этого; для некоторых людей жизнь могла бы (could) быть такой легкой без машины, называемой PC.
Упражнение 17. Подчеркните в предложениях сказуемые (действия) и подлежащие (то, о чем идет речь в предложении). Переведите предложения.
То figure out how to grant I/O access to a user mode app, you have to understand how I/O protection is implemented in Windows NT.
The first mechanism that must be understood is the privilege-level system used by the 80x86 processors Text.
Rather than statically defining which privilege levels can have access, the CPU defines an I/O privilege level value, which is compared against the CPL to determine if I/O instructions can be used freely.
Because the IOPL cannot be less than 0, programs running at privilege level 0(like kernel-mode device drivers) will always have direct port I/O access.
Any part of the bitmask that you do not provide is assumed to be 1, and therefore access is not granted to those ports.
Теперь вы можете прочесть Текст, хорошо понимая его.
Text
Accomplishing I/O Protection in NT To figure out how to grant I/O access to a user mode app, you have to understand how I/O protection is implemented in Windows NT. NT doesn't actually implement the
I/O' protection on its own. Since the CPU can trap attempted I/O port access, NT depends on this feature. The first mechanism that must be understood is the privilege-level system used by the 80x86 processors. Four privileged levels are defined by the processor - 0, 1, 2, and 3 - and the CPU always operates at one of these levels. The most privileged level is 0; the least privileged, 3. NT uses only levels 0 and 3. Privilege level 0 is used for the full-access kernel mode and 3 for the more-restrictive user mode. The current privilege level (CPL) of the processor is stored in the two least- significant bits of the CS (code segment) register.
Rather than statically defining which privilege levels can have I/O access, the CPU defines an I/O privilege level (IOPL) value, which is compared against the CPL to determine if I/O instructions can be used freely. The IOPL is stored in two bits, of the processor's EFLAGS register. Any process with a CPL that is numerically greater than the IOPL must go through the I/O protection mechanism when attempting port I/O access. Because the IOPL cannot be less than 0, programs running at privilege level '0 (like kernel-mode device drivers) will always have direct port I/O access. NT sets the IOPL to 0. User-mode code always has a CPL of 3, which is larger than the IOPL. Therefore, user-mode port I/O access attempts must go through the protection mechanism. Determining if CPL>IOPL is the first step in the protection mechanism. I/O protection is not all-or-nothing. The processor uses a flexible mechanism that allows the operating system to grant direct access to any subset of I/O ports on a task-by-task basis.
The CPU accomplishes this by using a bitmask array, where each bit corresponds to an I/O port. If the bit is a 1, access is disallowed and an exception occurs whenever access to the corresponding port is attempted. If the bit is a 0, direct and unhampered access is granted to that particular port. The I/O address space of the 80x86 processors encompasses 65,536 8-bit ports. The bitmask array is 8192 (0x2000) bytes long, since the bitmask array is packed so that each byte holds eight bits of the array. There is even flexibility in how much of the bitmask array must be provided. You can provide anywhere from 0 to the full 8192 bytes of the table. The
table always starts from I/O address 0, but you can choose not to provide the bitmask for upper I/O addresses. Any part of the bitmask that you do'not provide is assumed to be 1, and therefore, access is not granted to those ports.
The bitmask array, called the I/O Permission bit Map (IOPM), is stored in the Task State Segment (TSS) structure in main memory, which is contained in a special, segment referenced by the segment selector in the processor' s Task Register (TR). The location of the IOPM within the TSS is flexible. The offset of the IOPM within the TSS is stored in a 2-byte integer at location 0x66 in the TSS.
Упражнение 18. Вы внимательно читали Тексты (урок 5 и 6)? Можете ли теперь расшифровать сокращения?
DDK; CPL; CS; IOPL; TSS; TR; IOPM;
Упражнение 19. Переведите:
Listing Three
/‘From inspection of the TSS we know that NT’s default IOPM offset is 0x20AD.
From an inspection of a dump of a process structure, we can find the bytes ‘AD 20’ at offset 0x30. This is where NT stores the IOPM offset for each process, so that I/O access can be granted on a process-by- process basis.
This portion of the process structure is not documented in the DDK.
This kernel mode driver fragment illustrates the brute force method of poking the IOPM base into the process structure. */ void GivelO()
{
char*CurProc;
CurProc = loGetCurrentProcess();
((USHORT)(CurProc + 0x30)) = 0x88
Грамматика
Существительные с предлогами
Грамматика этого урока разнообразия ради рассчитана только на запоминание.
Фиксированные сочетания предлогов с существительными надо учить наизусть. Их правильное употребление в устной и письменной речи — хороший тон.
Как мы уже поняли, служебные слова крайне важны в английском, предлоги в частности. Есть два момента, которые надо помнить, имея дело с английским существительным:
1) С существительными надо употреблять правильные предлоги.
2) Знать точное расположение предлогов — до или после существительного.
§ 1. Предлоги с существительными надо употреблять правильно, если вы хотите правильно понять ситуацию.
V In the end — наконец, результат ситуации, at the end — в конце; то, когда происходит ситуация.
At the end of the work we got the results and in the end we understood that the solution of our problem was very easy.
VOn time — пунктуально, не поздно, in time — достаточно быстро для чего-то, чтобы сделать что-то.
We hope to obtain the results on time. We hope to get your remarks in time to debug the program.
Более того, есть существительные, которые требуют совершенно определенных предлогов, и их лучше замечать и заучивать, внимательно читая любой английский текст.
Предлоги после существительного:
An advantage/disadvantage of
The advantages of our software are much greater than its weak points. An answer to
I don’t know the answer to the question.
An attitude to/towards
My attitude to such a way of working is negative.
A cause of
Nobody knows the cause of such behavior.
A cheque for
To finish the work we need a cheque for $1000.
Damage to
The damage to the program would be great.
A demand /need for
There is a demand for such programs and we ’ll fulfil it.
A decrease/increase in
There is a constant increase in the need for such programs.
A fall/rise in
A fall in our work is quite understandable.
An invitation to
We won’t be invited to the party.
A key to
A key to the problem was lost.
A photograph/picture of
I like to have photographs of my family on my desk.
A reaction to
We can't predict the reaction to the thing done for the first time.
A reason for
There was no reason for delaying the start of the experiment.
A relationship/ connection/contact with
We can’t but stop the work in connection with this problem.
We must have a good relationship with our partners.
A relationship/ connection/contact/difference between (two things) There is no connection between the problem and the work.
There is some difference between these problems.
A reply to
I’ll explain the reason in my reply to your letter.
A solution to
Can you find a solution to the problem?
Предлоги перед существительным:
(То do) by accident
It was by accident.
(To have) for breakfast/lunch/dinner/supper What do you like to eat for breakfast?
(To be) on a business/holiday/trip/tour/excursion/cruise/expedition I am on business trip here in London.
(To do) by chance
Many discoveries are known to be made by chance.
(To pay) by cheque/ to pay (in) cash
Did you pay by cheque for your computer or did you pay cash?
(To be) on a diet
I’ll have to go on a diet (To go) for a drink/walk/swim
Let s have a break and go for a drink.
(To be) on fire
Don’t be in a hurry with the program. The building’s not on fire.
(To be/to fall) in love with
I can tell you that I am really in love with computers.
(To do) by mistake
I’m sorry, I’ve done it by mistake.
In (my) opinion
In his opinion the work wasn’t done well.
(Done) by somebody
The Microsoft was created by Bill Gates.
(To be) on strike
Why aren’t you working? Are you on strike?
(To be) on the telephone/phone
I can be reached on only the phone.
On television/radio
I don’t like to listen to the news on radio, I prefer to watch it on TV.
Упражнение 1. Для тренировки переведите все предложения-примеры. Они несложные.
§ 2. Знать точное значение предлогов важно и для перевода собственно существительных. Словосочетания с предлогами могут создавать новые существительные (правда, и не только существительные), которые могут использоваться самостоятельно или предшествовать другому существительному. А язык вычислительной техники просто обожает создавать сложные слова (input/output, in-out). Слова эти, как правило, пишутся через дефис.
an out-of-date hat — немодная шляпа an out-of-date program — несовременная программа
an off-the-cuff remark — неподготовленное замечание an off-the-cuff speech — импровизированная речь
Упражнение 2. Переведите:
Up-grade; up-counter; up-date; up-loading; up-time; upward-compatible; on-line; on-off; on-parameter; on-position; on-site; on-the-fly; off-line; off-peak; off-punch; off-the-shelf; in-symbol; in-plant; in-gate; in-house.
Лексика и чтение
Список слов к текстам урока
Memorize the words to the texts.
Прочтите вслух и допишите перевод однокоренных слов, используя знание суффиксов.
to implement выполнять, осуществлять
implementation______________
to exist существовать, находиться, быть
existence_____________
existent______________
to point out выделять exception исключение, возражение The exception proves the rule. Исключение подтверждает правило. to follow следовать, придерживаться property собственность, свойство, качество to describe описывать, характеризовать(ся)
description______________
reference ссылка, сноска, обращение
to check проверять, контролировать, сличать
convention соглашение, обычай, условность
token обозначение, знак, система
to require требовать, нуждаться
adjacent примыкающий, смежный, соседний
to parse анализировать, разбирать
to nest вкладывать, формировать гнездо
arbitrary произвольный
to count (as) полагать, считать, иметь значение
underscore подчеркивание
Упражнение 3. Please, try to define what programming language is. If you like, use the words.
Определите, что такое язык программирования. Если хотите, используйте слова: system, designation, for, description, program, algorithm.
Упражнение 4. Пробуем говорить.
Read the Webster’s definition and compare it to that given by you.
Прочтите определение из словаря Вебстера и сравните его с определением, данным вами.
A programming language is the set of words,, and rules governing their use, employed in constructing a program.
Используйте слова: easier to understand, more complete, sounds more scientific, more professional.
Упражнение 5. Пробуем говорить.
Для того, чтобы ответить на вопросы, измените их на утвердительные предложения. Используйте сам вопрос, начиная с подчеркнутой части, в некоторых меняя you на/, ставя на второе место сказуемое (действие).
Are programming languages artificial or natural?
What types of programming languages do you know?
What programming languages are preferable to programmers?
What programming languages can you name?
Which of them do ygu like best?
What programming languages have you already worked with?
What are the differences between them?
Упражнение 6. Match the words to the definitions:
Сопоставьте названия и определения к ним. Можно проговаривать вслух: "High-level language is...
1. High-level language 1. a programming language, such as
COBOL, designed to describe the steps necessary to solve certain types of problems.
2. Low-level language 2. a programming language, such as
RPG, designed to describe more readily the problems to be solved, rather than to specify the steps to be taken to solve the problem.
3. Procedure-oriented language 3. a programming language, using
symbolic code, that is based on the machine language of a particular computer and requires an assembler to translate it into actual machine language.
4. Problem-oriented language 4. a programming language that
correspondes closely to the machine language of a computer, such as an assembly language.
5. Machine language 5. a programming language, such as
BASIC or COBOL or..., that is not dependent upon the machine Ian guage of a computer, requires a compiler to translate it into machine language, and has been designed to allow the use of words similar to those in the English language.
6. Machine-oriented language 6. the programming language com
prised of a set of unique machine codes that can be directly executed by a given computer.
Упражнение 7. Сопоставьте заголовки и тексты-объяснения:
1. We know at least three meanings of this word. First, it is the rules and conventions governing the interpretation of and assignment of meaning to a construction in a language. Hence, semantics is the science of the development of the meanings and changes in words. And since any programming language is a language, a programmer can describe semantics as the relationship between the words and symbols in a programming language and the meanings assigned to them.
2. It is a grammatical structure in sentences. In programming languages, syntax means the rules governing the structure of statements used in a program: for example, the statements in some programming languages must begin in certain columns and be terminated with a specific symbol, such as a period, in order to be executed properly.
3. Though parsing is essentially the same as syntax analysis, it differs greatly from syntax analysis of a natural language. Parsing is the process of separating a programmipg statement into the basic units that can be translated into machine instructions: this process is performed by a language processor according to the laid down rules in a given programming language.
(_) PARSING
(_) SYNTAX ANALYSIS
(_) SEMANTICS. SYNTAX.
Упражнение 8. Постарайтесь перевести словосочетания самостоятельно, помня, что все они относятся к языковой лексике. Проверьте себя по ключу:
a) context-free grammar; lexical analyzer; parse tree; derivation sequence; context free language; token; shift-reduce parsing; absolute language; explicit language; nested language; reference language; requirement statement language; time-sharing language;
b) computer-dependent language; computer-independent language; conversational language; declarative language; defining language; descriptive language; end-user language; control language; human language; human-oriented language; machine-dependent language; machine-in- dependent language; multidimensional language; one-dimensional language; synthetic language; self-contained language; source language; super-high-level language; interactive language.
Упражнение 9. Give synonyms for the following:
Подберите синонимы для следующих выражений:
man-to-computer language, artificial language, very-high-level language, natural language, parsing, absolute language.
Упражнение 10. Пробуем говорить.
Say what the difference is between synthetic and human languages.
Прочтите и скажите, в чем разница между искусственными и естественными языками. Используйте конструкцию: There is/are (по)... in... language.
Язык программирования — система обозначений, служащая для точного описания программ или алгоритмов для ЭВМ. Языки программирования являются искусственными языками, в которых синтаксис и семантика строго определены. Поэтому при применении их по назначению они не допускают свободного толкования (interpretation) выражения, характерного для естественного языка.
Упражнение 11. We are going to read some paragraphs from this book:
![]() |
Answer the questions. Ответьте на вопросы.
What is the book called?
What kind of book is this?
Who is the author?
Where was it published?
Упражнение 12. Translate the combinations of words:
Переведите словосочетания:
to point out implementation-dependent details; follow directly from the properties; describe in the C book; extend with classes; functions and so on; to parse into tokens; require to separate; to enclose in single quotes; to surround by double quotes.
Упражнение 13. Translate paying attention to the suffixes:
Переведите, обращая внимание на суффиксы:
Require, requirement, requiring, required;
Identify, identification, identifier;
Long, length;
Note, notation;
Alternate, alternating, alternation, alternative, alternator;
Option, optional;
Access, to access, accessible.
Упражнение 14. Translate and mark the auxiliaries:
Переведите и отметьте вспомогательные глаголы:
Use, used, uses, are using;
Enclose, enclosed, encloses, has enclosed;
Denotes, denoted, having denoted;
Determine, determines, are determined;
Declared, to declare, is declaring, declares;
Treat, are treated, treated, have been treating;
To refer, referred, are referred to;
Hide, were hidden, hid.
Упражнение 15. Translate without a dictionary:
Переведите без словаря:
Detail; declaration; collectively; to ignore; to separate; to reserve; to list; to specify; to initialize; fraction.
Упражнение 16. Be sure that you know what the words mean:
Убедитесь, что вы помните значение этих слов:
Few; such; between; other; otherwise; next; which; below; certain; according to; throughout; this; from... to....
Упражнение 17. Memorize the information and translate the verbs:
Запомните информацию и переведите глаголы:
Приставка еп- (en-,in; ет- перед Ь, р, т) служит для образования глаголов и придает им значение:
а) включения внутрь чего-либо: to encage — сажать в клетку; to entruck — сажать в грузовик;
б) приведения в какое-либо состояние: to encourage — ободрять; to enslave — порабощать.
То enable, to encipher, to enforce, to enjoy, to ensoul.
To encamp, to enchain, to enclose, to enclasp, to encircle, to empanel, to enisle, to enfold, to entrain, to encompass.
Упражнение 18. Translate, paying attention to «both... and...», «neither... nor...», «either... or...»:
Переведите, обращая внимание на парные союзы:
both the integer and fraction part; either the integer part or the fraction part; both the and the new-line; include either e or E; neither with this task nor with that one;
Упражнение 19. Read text I, underline and translate terminological phrases very carefully. Прочтите Текст I. Подчеркните и как можно точнее переведите терминологические фразы.
Text I
1. INTRODUCTION
This manual describes the C++ programming language. Where implementation-dependent details exist it tries to point them out. With few exceptions, such dependencies follow directly from the properties of the hardware. They are summarized in #2.6. C++ is "old C" as described in the C book extended with classes, inline functions, operator overloading, function name overloading, constant types, references, free store management, function argument checking, and a new function declaration syntax. The differences between C++ and "old C" are summarized in #19.
Упражнение 20. Read text II carefully and say what is a token, a comment, an identifier, a keyword, a constant.
Прочтите Текст II внимательно и скажите по-английски, что такое лексема, коментарий, идентификатор, ключевое слово, константа.
Text II
2. LEXICAL CONVENTIONS
There are six classes of tokens: identifiers, key
words, constants, strings, operators, and other separators. Blanks, tabs, new-lines, and comments (collectively, "white space") as described below are ignored except as they serve to separate tokens. Some white space is required to separate otherwise adjacent identifiers, keywords, and constants.
If the input stream has been parsed into tokens up to a given character, the next token is taken to include the longest string of characters.
2.1 Comments
The characters /* introduce a comment, which terminates with the characters */. Comments do not nest.
2-2 Identifiers (Names)
An identifier is an arbitrarily long sequence of letters and digits; the first character must be a letter; the underscore counts as a letter; upper- and lowercase letters are different.
2.3 Keywords The following identifiers are reserved for use as
|
|
Упражнение 21. Translate the questions and answer them:
Переведите вопросы и ответьте на них:
Что такое C++ по сравнению со старым С?
Сколько существует классов лексем?
Каковы эти классы?
Является ли символ новой строки «пустым символом»?
Как организуются комментарии?
Могут ли комментарии быть вложенными один в другой?
Должен ли первый символ идентификатора быть буквой? Различаются ли в этом случае большие и маленькие буквы?
Любое ли слово, начинающееся с буквы, может быть идентификатором?
Упражнение 22. Translate:
Как идентификаторы, так и ключевые слова относятся к лексемам. Как старый, так и новый С являются языком высокого уровня. Мы можем использовать или маленькую, или большую букву «I». Десятичная, восьмеричная или шестнадцатиричная целочисленная константа, за которой сразу же следует или маленькая, или большая буква «I», является длинной константой. В этом случае игнорируются как \, так и новая строка. Могут опускаться или целая часть, или дробная (но не обе). Опускается либо десятичная точка, либо буква «е» и экспонента (но не обе).
Грамматика
Прилагательные
Прилагательные — это характеристики объекта, поэтому употребляются они с существительными. Как и в русском, обычно стоят перед существительными, но не меняют свою форму в зависимости от него.
§ 1. Напоминаю, что прилагательные могут образовываться и от глаголов, и от существительных.
От глаголов | |||
-able/-ible | шугь(ся) | to flex | flexible |
-ant/-ent | сопротивляться | to resist | resistant |
-ive | решать | to decide | decisive |
-al/-ial/-ual | ум, рассудок | intellect | intellectual |
Or существительных | |||
-ful | польза | use | useful |
-less | польза | use | useless |
-ic | основа | base | basic |
-ous/-ious | количество | number | numerous |
-У | легкость | ease | easy |
-ish | книга | book | bookish |
-ary | элемент | element | elementary |
-ern | север | north | northern |
|
Упражнение 1. Переведите прилагательные из таблицы и постарайтесь запомнить приведенные в ней суффиксы для правильного понимания и точного перевода.
§ 2. Прилагательные — это характеристики, а характеристики можно усилить. Это можно сделать или добавив слово-усилитель, или изменив степень самой характеристики (степени сравнения прилагательных).
Дата добавления: 2015-09-30; просмотров: 133 | Нарушение авторских прав
<== предыдущая лекция | | | следующая лекция ==> |