APCS Network

 Quên mật khẩu
 Đăng ký
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...

Accessing Memory
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
Đă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:

Overflowflag. This is set to true if the destination operand was not large
enough to hold the result of the instruction.
Sign flag. This isset to the sign of the last result.
Zero flag. This flagis set to true if the result of the instruction is zero.
Auxiliary carry flag. This flag is set for carries and borrows between the
thirdand fourth bit. It is not often used.
Parityflag. This flag is set to true if the low byte of the last result had an even
numberof 1 bits.
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

  Affected Flags
  I/R/M, I/R/M
  This copies a word of data from one location to another. movl %eax, %ebx copies the contents of %eax to %ebx
  I/R/M, I/R/M
  Same as movl, but operates on individual bytes.
  M, I/R/M
  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
  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.
  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.
  R/M, R/M
  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
  Affected Flags
  I/R/M, R/M
  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.
  I/R/M, R/M
  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.
  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.
  I/R/M, R/M
  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.
  Decrements the  register or memory location. Use decb to decrement a byte instead of a word.
  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.
  Performs signed  division. Operates just like divl above.
  R/M/I, R
  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.
  Increments the given  register or memory location. Use incb to increment a byte instead of a word.
  R/M/I, R
  Perform unsigned  multiplication. Same rules as apply to imull.
  Negates (gives the  two’s complement inversion of) the given register or memory location.
  I/R/M, R/M
  Subtract with  borrowing. This is used in the same way that adc is, except for subtraction.  Normally only subl is used.
  I/R/M, R/M
  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