Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
методичка английский.doc
Скачиваний:
13
Добавлен:
21.09.2019
Размер:
675.33 Кб
Скачать

Текст II

Задание 1. Найдите в Тексте II «Memory Operands» эквиваленты следующих выражений;

  1. явное задание адреса операндов;

  2. содержащий операнд;

  3. используя префикс переопределения сегментного регистра;

  4. помещенный в начало;

  5. называемый mod R/M;

  6. базовый регистр, индексный регистр, масштабирующий множитель и смещение;

  7. за которым следует другой байт;

  8. задан непосредственно в коде команды;

  9. используя регистр ESI.

Задание 2. Найдите в Тексте II "Memory Operands" случаи употребления прилагатель­ных в степенях сравнения. Внимательно переведите эти предложения и напишите противо­положные им по значению.

MEMORY OPERANDS

Instructions with explicit operands in memory must reference the segment containing the operand and the offset from the beginning of the segment to the operand. Segments are specified using a segment-override prefix, which is a byte placed at the beginning of an instruc­tion. If no segment is specified, simple rules assign the segment by default. The offset is specified in one of the following ways:

1. Most instructions which access memory contain a byte for specifying the addressing method of the operand. The byte, called the.mod R/M byte, comes after the opcode and specifies whether the operand is in a register or in memory. If the operand is in memory, the address is calculated from a segment register and any of the following values: a base register, an index register, a scaling factor, and a displacement. When an index register is used, the mod R/M byte also is followed by another byte to specify the index register and ruling factor. This form of addressing is the most flexible.

2. A few instructions select segments by default:

A MOV instruction with the Kb 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, and1 inter­rupts).

Текст III

Задание 1. Прочтите Текст III внимательно и найдите в нём эквиваленты следующих выражений:

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

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

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

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

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

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

SEGMENT SELECTION

Explicit specification of a segment is optional. If a segment 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, J so when either register is used, the stack segment (the SS segment) is selected.

Segment-override prefixes are used to override the default segment selection. 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:

  • Destination strings in string instructions use the ES segment.

  • Stack operands use the SS segment.

  • Instruction fetches use the CS segment.