Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Тексты(все).docx
Скачиваний:
4
Добавлен:
01.07.2025
Размер:
1 Мб
Скачать
☆
  1. A few instructions select segments by default:

A MOV instruction with the AL or EAX register as either source or destination can address memory with a double-word encoded in the instruction. This special form of the MOV instruction allows no base register, index register, or scaling factor to be used. This form is one byte shorter than the general-purpose form.

String operations address memory in the DS segment using the ESI register, (the MOVS, CMPS, OUTS, LODS, and SCAS instructions) or using the ES segment and EDI, register(the MOVS, CMPS, INS, and STOS instructions).

Stack operations address memory in the SS segment using the ESP register(the PUSH, POP, PUSHA, PUSHAD,

POPA, POPAD, PUSHF, PUSHFD, POPF, POPFD. CALL. RET,

Iret, and iretd instructions, exceptions, and inter­rupts) .

Упражнение 11. Ask somebody to explain, putting indirect questions. Begin with “Will you explain (tell)...”.

Научимся задавать косвенные вопросы, тем более что они легче прямых вопросов. Обязательная схема вопроса уже содержится в первой его части, которую легко запомнить, а потом мы присоединяем то, что нас интересует в виде обычного предложения. Первый раз лучше выполнить это упражнение письменно.

Model: What are memory operands?

Will you explain what memory operands are?

Will you tell me what memory operands are?

  1. What is a segment-override prefix?

  2. What are two ways to specify the offset?

  3. What does the modR/M specify?

  4. What instructions select segments by default?

Упражнение 12. Read text III carefully and find the equivalents of the following: Прочтите Текст III внимательно и найдите в нем эквиваленты следующих выражений:

  1. явное определение;

  2. согласно правилам таблицы;

  3. правила для выбора сегментов не очевидны (однозначны) для...;

  4. различные виды;

  5. поэтому, когда любой из регистров используется;

  6. на который не воздействует префикс переопределения сегментного регистра.

Text III

Segment selection

Explicit specification of a segment is optional. If a segrrjent is not specified using a segment-override pre­fix, the processor automatically chooses a segment ac­cording to the rules of the table. (If a flat model of memory organization is used, the rules for selecting segments are not apparent to application programs).

Type of reference

Segment used register used

Segment register default selection rule

instructions

Code segment CS register

automatic with instruction fetch

stack

stack segment SS register

all stacks pushes and pops any memory reference which uses ESP or EBP as a base register

local data

data segment DS register

all data references except when rela­tive to stack or string destination

destination

strings

E-space segment ES register

destination of string instructions

Different kinds of memory access have different default segments. Data operands usually use the main data segment (the DS segment). However, the ESP and EBP registers are used for addressing the stack, so when either registner is used, the stack segment (the SS segment) is selected.

Segment-override prefixes are used to override the default segment selecton. Segment-override prefixes are provided for each of the segment registers. Only the following special cases have a default segment selection which is not affected by a segment-override prefix: