13 Matching Annotations
  1. Jan 2022
    1. The testinstructions behave in the same manner as the and instructions, except that theyset the condition codes without altering their destinations.

      test 指令的作用是什么?

    2. The cmp instructions set the condition codes according to the differences of theirtwo operands. They behave in the same way as the sub instructions, except thatthey set the condition codes without updating their destinations.

      cmp 指令集的作用是什么?

    3. By using a PC-relativeencoding of the jump targets, the instructions can be compactly encoded (requiringjust 2 bytes), and the object code can be shifted to different positions in memorywithout alteration.

      pc-relative encoding 的计算方式是什么,有什么优势?

    4. It is important to recognize that the suffixes forthese instructions denote different conditions and not different operand sizes. Forexample, instructions setl and setb denote “set less” and “set below,” not “setlong word” or “set byte.”

      set 指令的后缀代表的含义是什么?

  2. Dec 2021
    1. one for unsigned (mulq) and one for two’s-complement (imulq) multiplication.For both of these instructions, one argument must be in register %rax, and theother is given as the instruction source operand.

      mulq 和 imulq 分别表示什么指令集,他们的操作数有什么要求?

    2. The different shift instructions can specify the shift amount either asan immediate value or with the single-byte register %cl.

      shift 指令可以接受哪些操作数?

  3. Nov 2021
    1. As with themov instructions, the two operands cannot both be memory locations.

      binary operation 的两个操作数可以是 memory location 吗?

    2. The destination operand must be a register.

      load effective address 的 destination 需要是什么?

    3. The ability of the leaq instruction to perform addition and limited forms ofmultiplication proves useful when compiling simple arithmetic expressions suchas this example.

      leaq 在什么情况下有用?

    4. logicallybe named movzlq, but this instruction does not exist. Instead, this type of datamovement can be implemented using a movl instruction having a register as thedestination. This technique takes advantage of the property that an instructiongenerating a 4-byte value with a register as the destination will fill the upper 4bytes with zeros.

      为什么在 movz 的指令中缺少 movzlq?

    5. in memory, to a register destination. Instructions in the movz class fill out theremaining bytes of the destination with zeros, while those in the movs class fillthem out by sign extension, replicating copies of the most significant bit of thesource operand.

      那两种 move 指令针对 copy smaller source 到 larger destination,他们的做法分别是什么?

    6. The source operand designates a value that is immediate, stored in a register,or stored in memory. The destination operand designates a location that is either aregister or a memory address. x86-64 imposes the restriction that a move instruc-tion cannot have both operands refer to memory locations. Copying a value fromone memory location to another requires two instructions—the first to load thesource value into a register, and the second to write this register value to the des-tination.

      move 的 source operand 和 destination operand 分别可以是哪些类型?

    7. The most general form is shown at the bottomof the table with syntax Imm(rb,ri,s). Such a reference has four components: animmediate offset Imm, a base register rb, an index register ri, and a scale factors, where s must be 1, 2, 4, or 8. Both the base and index must be 64-bit registers.The effective address is computed as Imm + R[rb] + R[ri] . s.

      访问 $$Imm(r_b, r_i, s)$$ 的内存应该如何计算,有哪些限制条件?