Re: clock cycle values AMD manual



On May 17, 4:11 am, roger21 <spamt...@xxxxxxxxxx> wrote:
hi,

just a newb question : where do i get the length of each instruction or
at last the number of clock cycle for each instruction in the amd docs ?

thx

The length of an instruction adds up from these components:
- its prefixes (segment override, lock, rep(e/ne), operand size
override, address size override, and if 64-bit mode, REX). These can
be combined and with the exception of the REX prefix the order is
arbitrary.
- its opcode byte(s): there're single-byte opcodes and two-byte
opcodes (the first in the two-byte one is 0fh). Intel seems to have a
few three-byte opcodes among new multimedia instructions.
- ModR/M byte, potentially followed by a SIB byte, potentially
followed by an 8/16/32 displacement. These add up to 1 to 6 bytes.
- any immediate operands, whose size depends on the instruction,
operand and address sizes.
Maximum allowed instruction length is 15 bytes.

There's no way to say how many bytes are in an arbitrary instruction
without knowing the CPU mode, operand size, address size and some
additional information specific to the instruction. See the volume 3
"General-Purpose and System Instructions", "Appendix A Opcode and
Operand Encodings".

Alex

.



Relevant Pages

  • Re: Intel 8086 opcodes
    ... listing all the "legal" Intel 8086 opcodes and mnemonics. ... other operand, there is no D field to specify which operand is ... The LEA instruction provides access to the offset address of the ... 16-bit register designated as the destination operand. ...
    (comp.os.cpm)
  • Re: Introducing delay in a assembler.
    ... The first equal sign is because BINTVL is a keyword operand of the STIMER ... This is a use of an assembler ... storage area can be specified in the instruction where it is used. ... If the programmer "forgets" I vaguely remember that the assembler ...
    (bit.listserv.ibm-main)
  • Re: GNUH8 mixed C and assembly
    ... Assembler Instructions with C Expression Operands ... In an assembler instruction using asm', ... constraint string for each operand. ...
    (comp.arch.embedded)
  • Re: 64bit operations efficiency...
    ... In Long Mode, we have 64bit registers, as well as operations, available. ... REX prefix with the apropriate flags, ... My guess is that it has to do with instruction density. ... to the 32 bit operand; ...
    (comp.lang.asm.x86)
  • Re: Intel 8086 opcodes
    ... The ADD instruction performs a byte or word ... and stores the result back in the destination operand. ... the operands can be in a register or in memory (MOD and R/M ... add immediate with register/memory to register/memory ...
    (comp.os.cpm)