Cirrus Logic CS485 Manual de usuario Pagina 13

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 67
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 12
CS485G Spring 2015 13
3. Registers
32-bit 16-bit 8-bit original purpose
eax ax ah/al accumulator
ebx bx bh/bl base
ecx cx ch/cl counter
edx dx dh/dl data
esi source index
edi destination index
esp sp stack pointer
ebp bp base pointer
4. Moving data: mov1 source dest
5. Operand types
(a) Immediate: integer constant, such as $0x400 or $-533 The
actual constant is represented in 1, 2, or 4 bytes, depending on
size; the assembler chooses the right representation. The source
may be immediate, but not the destination.
(b) Register: any of the 8 integer registers, such as: %ecx (although
%esp and %ebp have special purposes). Either source or desti-
nation or both may be register.
(c) Lecture 9, 2/4/2015
(d) Memory: 4 bytes of memory whose first byte is addressed by
any register, such as (%eax) (note the parentheses). Either source
or destination, but not both, may be memory.
(e) Displacement: 4 bytes of memory whose first byte is addressed
by any register plus some constant, such as 8(%eax). Either
source or destination, but not both, may be memory or displace-
ment.
6. Example in C: Swap
1 void swap(int
*
xp, int
*
yp)
2 {
3 int t0 =
*
xp;
4 int t1 =
*
yp;
5
*
xp = t1;
6
*
yp = t0;
7 }
7. Same thing in assembler
Vista de pagina 12
1 2 ... 8 9 10 11 12 13 14 15 16 17 18 ... 66 67

Comentarios a estos manuales

Sin comentarios