APCS Network

 Quên mật khẩu
 Đăng ký
Tìm
Xem: 4229|Trả lời: 3
Thu gọn cột thông tin

Thuật ngữ trong CS201

[Lấy địa chỉ]
Đăng lúc 19-12-2012 22:05:04 | Xem tất |Chế độ đọc
Bên dưới liệt kê tất cảthuật ngữ chúng ta sẽ gặp trong CS201. Từ từ cập nhật đầy đủ sau...
Operands
Immediate

Register
Memory
Accessing Memory
Absolute,
Indirect,
Base + displacement,
Indexed/Scaled index

Arithmetic andLogical Operations
IA32 leal

Binary Operations
add S, D
sub S, D
imul S, D
xor S, D
or S, D
and S, D

Shift Operations
sal
shl
sar
shr
Đăng lúc 19-12-2012 22:23:48 | Xem tất
Bài được trmquang sửa lúc  19-12-2012 22:26

phân loại mấy cái register đó nó có purpose j đi Đăng, có những loại đâu nhất thiết phải xài eax, ebx đâu
Đăng lúc 21-12-2012 02:55:42 | Xem tất
Bài được boylove142 sửa lúc  21-12-2012 03:00

The tables of instructions include:

·        The instruction code
·        The operands used
·        The flags used
·        A brief description of what the instruction does

In the operands section,it will list the type of operands it takes. If it takes more
than one operand, each operand will be separated by a comma. Each operand will
have a list of codes which tell whether the operand can be:
·        an immediate-mode value (I)
·        a register (R)
·        a memory address (M).

In the flags section:

O
Overflowflag. This is set to true if the destination operand was not large
enough to hold the result of the instruction.
S
Sign flag. This isset to the sign of the last result.
Z
Zero flag. This flagis set to true if the result of the instruction is zero.
A
Auxiliary carry flag. This flag is set for carries and borrows between the
thirdand fourth bit. It is not often used.
P
Parityflag. This flag is set to true if the low byte of the last result had an even
numberof 1 bits.
C
Carryflag. Used in arithmetic to say whether or not the result should be
carriedover to an additional byte. If the carry flag is set, that usually means
thatthe destination register could not hold the full result. It is up to the
programmerto decide on what action to take (i.e. - propogate the result to
anotherbyte, signal an error, or ignore it entirely).

Other flags exist, but they are muchless important.

Data TransferInstructions

  Instruction
  
  Operands
  
  Affected Flags
  
  movl
  
  I/R/M, I/R/M
  
  O/S/Z/A/C
  
  This copies a word of data from one location to another. movl %eax, %ebx copies the contents of %eax to %ebx
  
  movb
  
  I/R/M, I/R/M
  
  O/S/Z/A/C
  
  Same as movl, but operates on individual bytes.
  
  leal
  
  M, I/R/M
  
  O/S/Z/A/C
  
  This takes a memory location given in the standard format, and, instead of loading the contents of the memory location, loads the computed address. For example, leal 5(%ebp,%ecx,1), %eax loads the address computed by 5 + %ebp + 1*%ecx and stores that in %eax
  
  popl
  
  R/M
  
  O/S/Z/A/C
  
  Pops the top of the stack into the given location. This is equivalent to performing movl (%esp),R/M followed by addl $4,%esp.
  popfl is a variant which pops the top of the stack into the %eflags register.
  
  pushl
  
  I/R/M
  
  O/S/Z/A/C
  
  Pushes the given value onto the stack. This is the equivalent to performing subl $4, %esp followed by movl I/R/M, (%esp).
  pushfl is a variant which pushes the current contents of the %eflags register onto the top of the stack.
  
  xchgl
  
  R/M, R/M
  
  O/S/Z/A/C
  
  Exchange the values of the given operands.
  


Còn tiếp...
Đăng lúc 21-12-2012 02:56:44 | Xem tất
Integer Instructions
  Instruction
  
   Operands
  
  Affected Flags
  
  adcl  
  
  I/R/M, R/M
  
  O/S/Z/A/P/C
  
  Add with carry. Adds  the carry bit and the first operand to the second, and, if there is an  overflow, sets overflow and carry to true. This is usually used for  operations larger than a machine word. The addition on the least-significant  word would take place using addl, while additions to the other words would  used the adcl instruction to take the carry from the previous add into  account. For the usual case, this is not used, and addl is used instead.
  
  addl
  
  I/R/M, R/M
  
  O/S/Z/A/P/C
  
  Addition. Adds the  first operand to the second, storing the result in the second. If the result  is larger than the destination register, the overflow and carry bits are set  to true. This instruction operates on both signed and unsigned integers.
  
  cdq
  
  
  
  O/S/Z/A/P/C
  
  Converts the %eax word  into the double-word consisting of %edx:%eax with sign extension. The q  signifies that it is a quad-word. It’s actually a double-word, but it’s  called a quad-word because of the terminology used in the 16-bit days. This  is usually used before issuing an idivl instruction.
  
  cmpl
  
  I/R/M, R/M
  
  O/S/Z/A/P/C
  
  Compares two integers.  It does this by subtracting the first operand from the second. It discards  the results, but sets the flags accordingly. Usually used before a  conditional jump.
  
  decl
  
  R/M
  
  O/S/Z/A/P
  
  Decrements the  register or memory location. Use decb to decrement a byte instead of a word.
  
  divl
  
  R/M
  
  O/S/Z/A/P
  
  Performs unsigned  division. Divides the contents of the double-word contained in the combined  %edx:%eax registers by the value in the register or memory location  specified. The %eax register contains the resulting quotient, and the %edx  register contains the resulting remainder. If the quotient is too large to  fit in %eax, it triggers a type 0 interrupt.
  
  idivl
  
  R/M
  
  O/S/Z/A/P
  
  Performs signed  division. Operates just like divl above.
  
  imull
  
  R/M/I, R
  
  O/S/Z/A/P/C
  
  Performs signed  multiplication and stores the result in the second operand. If the second  operand is left out, it is assumed to be %eax, and the full result is stored  in the double-word %edx:%eax.
  
  incl
  
  R/M
  
  O/S/Z/A/P
  
  Increments the given  register or memory location. Use incb to increment a byte instead of a word.
  
  mull
  
  R/M/I, R
  
  O/S/Z/A/P/C
  
  Perform unsigned  multiplication. Same rules as apply to imull.
  
  negl
  
  R/M
  
  O/S/Z/A/P/C
  
  Negates (gives the  two’s complement inversion of) the given register or memory location.
  
  sbbl
  
  I/R/M, R/M
  
  O/S/Z/A/P/C
  
  Subtract with  borrowing. This is used in the same way that adc is, except for subtraction.  Normally only subl is used.
  
  subl
  
  I/R/M, R/M
  
  O/S/Z/A/P/C
  
  Subtract the two  operands. This subtracts the first operand from the second, and stores the  result in the second operand. This instruction can be used on both signed and  unsigned numbers.
  
Còn tiếp...


Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

Quy tắc điểm

Phòng tối|APCS Forum

GMT+7, 16-7-2019 01:07 , Processed in 0.126633 second(s), 14 queries .

Powered by APCS-HCMUS

© 2007-2013 APCS Network.

Trả lời nhanh Lên trên Trở lại danh sách