home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mass61.zip / ML611D.EXE / PENTIUM.TXT < prev    next >
Text File  |  1995-09-19  |  38KB  |  854 lines

  1.                    Notes on Intel(R) Pentium(TM) Processor
  2.                      (c) Copyright Microsoft Corp. 1993
  3.  
  4.  
  5.   This file contains the following information:
  6.   
  7.   - Implementation of the .586 and .586P directives
  8.   - New instructions for the Intel(R) Pentium(TM) processor
  9.   - Pentium clock cycles for all instructions
  10.  
  11. =============================================================================  
  12.  
  13.   .586 and .586P Directives
  14.   -------------------------
  15.   The .586 directive enables assembly of non-privileged instructions 
  16.   available for the Pentium processor. The .586P directive enables 
  17.   privileged instructions in addition to the non-privileged instructions
  18.   for the Pentium.
  19.  
  20.   The following example demonstrates implementation of the .586 directive.
  21.      
  22.   .model small, C
  23.   .586
  24.  
  25.   .data
  26.   ; .586  gives 110100111111y = 0D3Fh
  27.   ; .586p gives 110110111111y = 0DBFh
  28.   var1 dw @cpu
  29.  
  30.   IF  @Cpu AND 0100000y
  31.       %echo Pentium instructions enabled.
  32.   ELSE
  33.       %echo Pentium instructions Not enabled.
  34.   ENDIF
  35.  
  36.   end
  37.  
  38.      
  39. =============================================================================
  40.  
  41.   New Pentium Instructions
  42.   ------------------------
  43.   The new Pentium instructions are extensions to the Intel486 instruction 
  44.   set; for information on instructions for the 8086, 8088, 80286, 80386, 
  45.   and 80486 processors, see Chapter 4, "Processor," in the Microsoft MASM 
  46.   Reference. For additional information on the new Pentium instructions,
  47.   refer to you Intel documentation.
  48.  
  49.  
  50. CMPXCHG8B       Compare and Exchange 8 Bytes
  51.  
  52.   Compares the 64-bit value in EDX:EAX with a 64-bit value in memory. If 
  53.   they are equal, the 64-bit value in memory is replaced by the value in 
  54.   ECX:EBX. Otherwise, the value in memory is loaded into EDX:EAX.
  55.  
  56.   Flags:  The ZF flag is set if the destination operand and EDX:EAX are 
  57.   equal; otherwise it is cleared. The CF, PF, AF, SF, and OF flags are 
  58.   unaffected.
  59.  
  60.   Encoding:  00001111 11000111 mod 001 r/m
  61.            
  62.   Syntax                  Example                 Clock Cycles  
  63.   ------                  -------                 -----------
  64.   CMPXCHG8B mem64         cmpxchg8b [bx]          10  
  65.  
  66.  
  67. -----------------------------------------------------------------------------
  68. CPUID           CPU Identification
  69.  
  70.   Syntax:  CPUID
  71.  
  72.   Provides information to the software about the model of microprocessor 
  73.   on which it is executing. An input value loaded into the EAX register
  74.   for this instruction indicates what information should be returned by
  75.   the CPUID instruction. 
  76.   
  77.   Following execution of the CPUID instruction with zero in EAX, the EAX
  78.   register contains the highest input value understood by the CPUID 
  79.   instruction. For the Pentium, the value in EAX will be 1. Also included
  80.   in this output is a vendor identification string contained in EBX, EDX,
  81.   and ECX. EBX contains the first four characters, EDX the next four, and
  82.   ECX the last four. For Intel processors, the vendor identification string
  83.   is "GenuineIntel".
  84.  
  85.   Following execution of the CPUID instruction with input value 1 in EAX,
  86.   EAX[3:0] contains the stepping ID of the microprocessor, EAX[7:4] 
  87.   contains the model (the first model will be indicated by 0001B) and
  88.   EAX[11:8] contains the family (5 for the Pentium). EAX[31:12], EBX, and
  89.   ECX are reserved. The Pentium processor sets the feature register, EDX,
  90.   to 1BFH, indicating which features the Pentium supports. A feature flag
  91.   set to 1 indicates that the corresponding feature is supported.
  92.   
  93.   Flags:  No flags affected.
  94.  
  95.   Encoding:  00001111 10100010
  96.  
  97.   Syntax                  Example                 Clock Cycles  
  98.   ------                  -------                 -----------
  99.   CPUID                   cpuid                   14
  100.  
  101.  
  102. -----------------------------------------------------------------------------
  103. MOV             Move to/from Control Registers
  104.  
  105.   Store or load the Control Registers (CR0, CR2, CR3, CR4) to or from a 
  106.   general purpose register.
  107.  
  108.   Flags:  The OF, SF, ZF, AF, PF, and CF flags are undefined.
  109.  
  110.   Encoding:  00001111 00100010 11 eee reg  (Move to Control Register)
  111.  
  112.   Syntax                  Example                 Clock Cycles  
  113.   ------                  -------                 -----------
  114.   MOV reg32,controlreg    mov cr0,eax             22
  115.                           mov cr2,eax             12
  116.                           mov cr3,eax             21,46
  117.                           mov cr4,eax             14
  118.  
  119.  
  120.   Encoding:  00001111 00100000 11 eee reg  (Move from Control Register)
  121.  
  122.   Syntax                  Example                 Clock Cycles  
  123.   ------                  -------                 -----------
  124.   MOV controlreg,reg32    mov eax,cr0             4
  125.  
  126.  
  127. -----------------------------------------------------------------------------
  128. RDMSR           Read from Model-Specific Register
  129.  
  130.   The value in ECX specifies one of the 64-bit Model-Specific Registers of
  131.   the Pentium processor. The content of that Model-Specific Register is 
  132.   copied into EDX:EAX. EDX is loaded with the high-order 32 bits, and EAX 
  133.   is loaded with the low-order 32 bits.
  134.  
  135.   Flags:  No flags affected.
  136.  
  137.   Encoding:  00001111 00110010
  138.  
  139.   Syntax                  Example                 Clock Cycles  
  140.   ------                  -------                 -----------
  141.   RDMSR                   rdmsr                   20-24
  142.  
  143.  
  144. -----------------------------------------------------------------------------
  145. RDTSC           Read from Time Stamp Counter
  146.  
  147.   Copies the contents of the Time Stamp Counter (TSC) into EDX EAX. (The 
  148.   Pentium maintains a 64-bit Time Stamp Counter (TSC) that is incremented 
  149.   every clock cycle.) When the Current Privilege Level is 0, the state of 
  150.   the TSD bit in CR4 does not affect the operation of this instruction. 
  151.   When the CPL is equal to 1, 2, or 3, the TSC may be read only if the TSD 
  152.   bit in CR4 is 0. Only a supervisor level program may modify the value of 
  153.   the TSC.
  154.  
  155.   Flags:  No flags affected.
  156.  
  157.   Encoding:  00001111 00110001
  158.  
  159.   Syntax                  Example                 Clock Cycles  
  160.   ------                  -------                 -----------
  161.   RDTSC                   rdtsc                   6, 11
  162.  
  163.  
  164. -----------------------------------------------------------------------------
  165. RSM             Resume from System Management Mode
  166.  
  167.   The processor state is restored from the dump created upon entrance to
  168.   System Management Mode. However, the contents of the model-specific
  169.   registers are not affected. The processor leaves SMM and returns control
  170.   to the interrupted application or operating system. If the processor 
  171.   detects any invalid state information, it enters the shutdown state.
  172.  
  173.   Flags:  All flags are affected.
  174.  
  175.   Encoding:  00001111 10101010
  176.  
  177.   Syntax                  Example                 Clock Cycles  
  178.   ------                  -------                 -----------
  179.   RSM                     rsm                     83
  180.  
  181.  
  182. -----------------------------------------------------------------------------
  183. WRMSR           Write to Model-Specific Register
  184.  
  185.   The value in ECX specifies one of the 64-bit Model-Specific Registers of
  186.   the Pentium processor. The content of EDX:EAX is copied to that Model-
  187.   Specific Register. The high-order 32 bits are copied from EDX, and the
  188.   low-order 32 bits are copied from EAX.
  189.  
  190.   Flags:  No flags affected.
  191.  
  192.   Encoding:  00001111 00110000
  193.  
  194.   Syntax                  Example                 Clock Cycles  
  195.   ------                  -------                 -----------
  196.   WRMSR                   wrmsr                   30-45
  197.  
  198.  
  199. =============================================================================
  200.  
  201.   Pentium Clock Cycles
  202.   --------------------
  203.   The following table contains clock cycles information for all Intel 
  204.   Pentium processor instructions. For more detailed information on clock 
  205.   cycles for these instructions, see your Intel documentation. For more 
  206.   general information on these instructions, see Chapter 4, "Processor," 
  207.   and Chapter 5, "Coprocessor," in the Microsoft MASM Reference.
  208.  
  209.  
  210. Instruction Syntax      Example                         Clock Cycles
  211. ------------------      -------                         ------------
  212. AAA                     aaa                             3
  213.  
  214. AAD                     aad                             10
  215.  
  216. AAM                     aam                             18
  217.  
  218. AAS                     aas                             3
  219.  
  220. ADC reg,reg             adc dx,cx                       1
  221. ADC mem,reg             adc WORD PTR m16[2],dx          3
  222. ADC reg,mem             adc dx,DWORD PTR m32[2]         2
  223.  
  224. ADD reg,reg             add ax,bx                       1
  225. ADD mem,reg             add total, cx                   3
  226. ADD reg,mem             add cx,incr                     2
  227. ADD reg,immed           add bx,6                        1
  228. ADD mem,immed           add pointers[bx][si],6          3
  229. ADD accum,immed         add ax,10                       1
  230.  
  231. AND reg,reg             and dx,bx                       1
  232. AND mem,reg             and bitmask,bx                  3
  233. AND reg,mem             and bx,masker                   2
  234. AND reg,immed           and dx,0F7h                     1
  235. AND mem,immed           and masker,100lb                3
  236. AND accum,immed         and ax,0B6h                     1
  237.  
  238. ARPL reg,reg            arpl ax,cx                      pm=7
  239. ARPL mem,reg            arpl selector,dx                pm=7
  240.  
  241. BOUND reg16,mem32       bound di,base-4                 8 (within bounds);
  242.                                                         int+32 (out of bounds)
  243. BOUND reg32,mem64       bound di,base-4                 8 (within bounds);
  244.                                                         int+32 (out of bounds)
  245.  
  246. BSF reg16,reg16         bsf cx,bx                       6-34
  247. BSF reg32,reg32         bsf cx,bx                       6-42
  248. BSF reg16,mem16         bsf ecx,bitmask                 6-35
  249. BSF reg32,mem32         bsf ecx,bitmask                 6-43
  250.  
  251. BSR reg16,reg16         bsr cx,dx                       7-39
  252. BSR reg32,reg32         bsr cx,dx                       7-71
  253. BSR reg16,mem16         bsr eax,bitmask                 7-40
  254. BSR reg32,mem32         bsr eax,bitmask                 7-72
  255.  
  256. BSWAP reg32             bswap ebx                       1
  257.  
  258. BT reg16,immed8*        bt ax,4                         4
  259. BT mem16,immed8*        bt [bx],4                       4
  260. BT reg16,reg16*         bt ax,bx                        4
  261. BT mem16,reg16*         bt [bx],dx                      9
  262. * Operands can also be 32 bits 
  263.  
  264. BTC reg16,immed8*       btc edi,4                       7
  265. BTC mem16,immed8*       btc color[di],4                 8
  266. BTC reg16,reg16*        btc eax,ebx                     7
  267. BTC mem16,reg16*        btc [bp+8],si                   13
  268. * Operands can also be 32 bits 
  269.  
  270.  
  271. BTR reg16,immed8*       btr bx,17                       7
  272. BTR mem16,immed8*       btr [bx],27                     8
  273. BTR reg16,reg16*        btr cx,di                       7
  274. BTR mem16,reg16*        btr rotate,cx                   13
  275. * Operands can also be 32 bits 
  276.  
  277. BTS reg16,immed8*       bts ax,4                        7
  278. BTS mem16,immed8*       bts maskit,4                    8
  279. BTS reg16,reg16*        bts bx,ax                       7
  280. BTS mem16,reg16*        bts flags[bx],cx                13
  281. * Operands can also be 32 bits 
  282.  
  283. CALL label              call upcase                     1
  284.                         call distant                    4
  285. CALL reg                call ax                         2
  286. CALL mem32              call [bx]                       2
  287. CALL mem32              call DWORD PTR [bx]             5
  288.  
  289. CBW                     cbw                             3
  290.  
  291. CDQ                     cdq                             2
  292.  
  293. CLC                     clc                             2
  294.  
  295. CLD                     cld                             2
  296.  
  297. CLI                     cli                             7
  298.  
  299. CLTS                    clts                            10
  300.  
  301. CMC                     cmc                             2
  302.  
  303. CMP reg,reg             cmp dl,cl                       1
  304. CMP mem,reg             cmp array[si],bl                2
  305. CMP reg,mem             cmp bh,array[si]                2
  306. CMP reg,immed           cmp bx,24                       1
  307. CMP mem,immed           cmp tester,4000                 2
  308. CMP accum,immed         cmp ax,1000                     1
  309.  
  310. CMPS [segreg:] src,
  311.  [ES:] dest             cmps source,es:dest             5
  312.  
  313. CMPSB [[segreg:[src,]
  314.  ES:] dest]             cmpsb                           5
  315.  
  316. CMPSW [[segreg:[src,]
  317.  ES:] dest]             cmpsw                           5
  318.  
  319. CMPSD [[segreg:[src,]
  320.  ES:] dest]             cmpsd                           5
  321.  
  322. CMPXCHG mem,reg         cmpxchg string,bl               6
  323. CMPXCHG reg,reg         cmpxchg bx,cx                   6
  324.  
  325. CMPXCHG8B reg,mem64     cmpxchg8b ax,[bx]               10
  326.  
  327. CPUID                   cpuid                           14
  328.  
  329. CWD                     cwd                             2
  330.  
  331. CWDE                    cwde                            3
  332.  
  333. DAA                     daa                             3
  334.  
  335. DAS                     das                             3
  336.  
  337. DEC reg                 dec ax                          1
  338. DEC mem                 dec counter                     3
  339.  
  340. DIV reg                 div cx                          byte=17, word=25,
  341. DIV mem                 div [bx]                        dword=41
  342.  
  343. ENTER immed16,0         enter 4,0                       11
  344. ENTER immed16,1         enter 0,1                       15
  345. ENTER immed16,immed8    enter 6,4                       15+2imm8
  346.  
  347. F2XM1                   fm2xi                           13-57
  348.  
  349. FABS                    fabs                            1
  350.  
  351. FADD [reg,reg]          fadd                            3, 1
  352. FADD memreal            fadd shortreal                  3, 1
  353. FADDP reg,ST            faddp st(6),st                  3, 1
  354. FIADD memint            fiadd int16                     7, 4
  355.  
  356. FBLD membcd             fbld packbck                    48-58
  357.  
  358. FBSTP membcd            fbstp bcds[bx]                  148-154
  359.  
  360. FCHS                    fchs                            1
  361.  
  362. FCLEX                   fclex                           9+
  363. FNCLEX                  fnclex                          9
  364.  
  365. FCOM                    fcom                            4, 1
  366. FCOMP                   fcomp                           4, 1
  367. FCOMPP                  fcompp                          4, 1
  368. FICOM memint            ficom double                    8, 4
  369. FICOMP memint           ficomp darray[di]               8, 4
  370.  
  371. FCOS                    fcos                            18-124
  372.  
  373. FDECSTP                 fdecstp                         1
  374.  
  375. FDIV [reg,reg]          fdiv st(5),st                   39                           
  376. FDIV memreal            fdiv longreal                   39
  377. FDIVP reg,ST            fdivp st(6),st                  39
  378. FIDIV memint            didiv warray[di]                42
  379.  
  380. FDIVR [reg,reg]         fdivr st(5),st                  39                           
  381. FDIVR memreal           fdivr longreal                  39
  382. FDIVRP reg,ST           fdivrp st(6),st                 39
  383. FIDIVR memint           didivr warray[di]               42
  384.  
  385. FFREE ST(i)             ffree st(3)                     1
  386.  
  387. FILD memint             fild quads[si]                  3, 1
  388.  
  389. FINCSTP                 fincstp                         1
  390.  
  391. FINIT                   finit                           16
  392. FNINIT                  fninit                          12
  393.  
  394. FIST memint             fist doubles[8]                 6
  395. FISTP memint            fistp longint                   6
  396.  
  397. FLD reg                 fld st(3)                       1
  398. FLD mem32real           fld longreal                    1
  399. FLD mem64real                                           1
  400. FLD mem80real                                           3
  401.  
  402. FLD1                    fld1                            2
  403. FLDZ                    fldz                            2
  404. FLDPI                   fldpi                           5, 3
  405. FLDL2E                  fldl2e                          5, 3
  406. FLDL2T                  fldl2t                          5, 3
  407. FLDLG2                  fldlg2                          5, 3
  408. FLDLN2                  fldln2                          5, 3
  409.  
  410. FLDCW mem16             fldcw ctrlword                  7
  411.  
  412. FLDENV mem              fldenv [bp+10]                  37, 16-bit pm=32,                 
  413.                                                         32-bit pm=33
  414.  
  415. FMUL [reg,reg]          fmul st(5),st                   3, 1
  416. FMULP reg,ST            fmulp st(6),st                  3, 1
  417. FIMUL memint            fimul warray[di]                7, 4
  418.  
  419. FNOP                    fnop                            1
  420.  
  421. FPATAN                  fpatan                          17-173
  422.  
  423. FPREM                   fprem                           16-64
  424. FPREM1                  fprem1                          20-70
  425.  
  426. FPTAN                   fptan                           17-173
  427.  
  428. FRNDINT                 frndint                         9-20
  429.  
  430. FRSTOR mem              frstor [bp-94]                  16-bit rm or vm=75;
  431.                                                         32-bit rm or vm=95; 
  432.                                                         pm=70
  433.  
  434. FSAVE mem               fsave [bp-94]                   16-bit rm or vm=127+;
  435.                                                         32-bit rm or vm=151+;
  436.                                                         pm=124+
  437.  
  438. FNSAVE mem              fnsave [bp-94]                  16-bit rm or vm=127;
  439.                                                         32-bit rm or vm=151;
  440.                                                         pm=124
  441.  
  442. FSCALE                  fscale                          20-31
  443.  
  444. FSIN                    fsin                            16-126
  445.  
  446. FSINCOS                 fsincos                         17-137
  447.  
  448. FSQRT                   fsqrt                           70
  449.  
  450. FST reg                 fst st                          1
  451. FST memreal             fst longs[bx]                   2
  452. FSTP reg                fstp st(3)                      1
  453. FSTP mem32real          fstp longreal                   2
  454. FSTP mem64real                                          2
  455. FSTP mem80real                                          3
  456.  
  457. FSTCW mem16             fstcw ctrlword                  2+
  458. FNSTCW mem16            fnstcw ctrlword                 2
  459.  
  460. FSTENV mem              fstenv [bp-14]                  16-bit rm or vm=50+;
  461.                                                         32-bit rm or vm=48+;
  462.                                                         16-bit pm=49+;
  463.                                                         32-bit pm=50+
  464. FNSTENV mem             fnstenv [bp-14]                 16-bit rm or vm=50;
  465.                                                         32-bit rm or vm=48;
  466.                                                         16-bit pm=49;
  467.                                                         32-bit pm=50
  468.  
  469. FSTSW mem16             fstsw statword                  2+
  470. FSTSW AX                fstsw ax                        2+
  471. FNSTSW mem16            fnstsw statword                 2
  472. FNSTSW AX               fnstsw ax                       2
  473.  
  474. FSUB [reg,reg]          fsub st,st(2)                   3, 1
  475. FSUB memreal            fsub longreal                   3, 1
  476. FSUBP reg,ST            fsubp st(6),st                  3, 1
  477. FISUB memint            fisub double                    7, 4
  478.  
  479. FSUBR [reg,reg]         fsubr st,st(2)                  3, 1
  480. FSUBR memreal           fsubr longreal                  3, 1
  481. FSUBRP reg,ST           fsubrp st(6),st                 3, 1
  482. FISUBR memint           fisubr double                   7, 4
  483.  
  484. FTST                    ftst                            4, 1
  485.  
  486. FUCOM [reg]             fucom st(2)                     4, 1
  487. FUCOMP [reg]            fucomp st(7)                    4, 1
  488. FUCOMPP                 fucompp                         4, 1
  489.  
  490. FWAIT                   fwait                           1-3
  491.  
  492. FXAM                    fxam                            21
  493.  
  494. FXCH [reg]              fxchg st(3)                     1
  495.  
  496. FXTRACT                 fxtract                         13
  497.  
  498. FYL2X                   fyl2x                           22-111
  499.  
  500. FYL2XP1                 fyl2xp1                         22-103
  501.  
  502. HLT                     hlt                             12
  503.  
  504. IDIV reg                idiv dl                         8-bit=22; 16-bit=30;
  505. IDIV mem                idiv itemp                      32-bit=46
  506.  
  507. IMUL reg                imul dx                         11                
  508. IMUL mem                imul factor                     11
  509. IMUL reg,immed          imul cx,25                      10
  510. IMUL reg,reg,immed      imul dx,ax,18                   10
  511. IMUL reg,mem,immed      imul bx,[si],60                 10
  512. IMUL reg,reg            imul cx,ax                      10
  513. IMUL reg,mem            imul dx,[si]                    10
  514.  
  515. IN accum,immed          in ax,60h                       7, pm=4,21*, vm=19
  516. IN accum,DX             in ax,dx                        7, pm=4,21*, vm=19
  517. (*First protected mode timing: CPL < or = IOPL. Second timing: CPL > IOPL.)
  518.  
  519. INC reg                 inc bx                          1                                                 
  520. INC mem                 inc vpage                       3
  521.  
  522. INS [ES:]dest, DX       ins es:instr,dx                 9, pm=6,24*, vm=22
  523. INSB                    insb                            9, pm=6,24*, vm=22
  524. INSW                    insw                            9, pm=6,24*, vm=22
  525. INSD                    insd                            9, pm=6,24*, vm=22
  526. (*First protected mode timing: CPL < or = IOPL. Second timing: CPL > IOPL.)
  527.  
  528. INT immed8              int 25h                         16, pm=31,48*
  529. INT 3                   int 3                           13, pm=27,44*
  530. INTO                    into                            13, pm=27,44*
  531. (*First protected mode timing is for interrupts to the same privilege
  532. level. The second is for interrupts to a higher privilege level.)
  533.  
  534. INVD                    invd                            15
  535.  
  536. INVLPG                  invlpg es:entry                 25
  537.  
  538. IRET                    iret                            8*,10, pm=27
  539. IRETD                   iretd                           10, pm=27
  540. IRETF                   iretf
  541. IRETDF                  iretdf
  542. (* Real or V86 mode.)
  543.  
  544. Jcondition label        je next                         1
  545. JCXZ label              jcxz not found                  6,5
  546. JECXZ label                                             6,5
  547.  
  548. JMP label               jmp NEAR PTR distant            1
  549.                         jmp distant                     3
  550. JMP reg16               jmp ax                          2
  551. JMP mem16               jmp table[di]                   2
  552. JMP reg32               jmp eax                         3
  553. JMP mem32               jmp fpointer[si]                2
  554. JMP mem48               jmp FWORD PTR [di]              4
  555.  
  556. LAHF                    lahf                            2
  557.  
  558. LAR reg,reg             lar ax,bx                       8
  559. LAR reg,mem             lar cx,selector                 8
  560.  
  561. LDS reg,mem             lds si,fpointer                 4
  562. LES reg,mem             les di,fpointer                 4
  563. LFS reg,mem             lfs edi,fpointer                4
  564. LGS reg,mem             lgs bx,fpointer                 4
  565. LSS reg,mem             lss bp, fpointer                4, pm=8
  566.  
  567. LEA reg,mem             lea bx,npointer                 1
  568.  
  569. LEAVE                   leave                           3
  570.  
  571. LGDT mem48              lgdt descriptor                 6
  572. LIDT mem48              lidt descriptor                 6
  573. LLDT reg16              lldt ax                         9
  574. LLDT mem16              lldt selector                   9
  575.  
  576. LMSW reg16              lmsw ax                         8
  577. LMSW mem16              lmsw machine                    8
  578.  
  579. LOCK                    lock                            1
  580.  
  581. LODS [segreg:]src       lods es:source                  2                           
  582. LODSB [[segreg:]src]    lodsb                           2
  583. LODSW [[segreg:]src]    lodsw                           2
  584. LODSD [[segreg:]src]    lodsd                           2
  585.  
  586. LOOP label              loop wend                       5, 6
  587. LOOPE label             loope again                     7, 8
  588. LOOPZ label             loopz again                     7, 8
  589. LOOPNE label            loopne for_next                 7, 8
  590. LOOPNZ label            loopnz for_next                 7, 8
  591.  
  592. LSL reg,reg             lsl ax,bx                       8             
  593. LSL reg,mem             lsl cx,seg_lim                  8
  594.  
  595. LTR reg16               ltr ax                          10
  596. LTR mem16               ltr task                        10
  597.  
  598. MOV reg,reg             mov bp,sp                       1
  599. MOV mem,reg             mov array[di],bx                1
  600. MOV reg,mem             mov bx,pointer                  1
  601. MOV mem,immed           mov [bx],15                     1
  602. MOV reg,immed           mov cx,256                      1
  603. MOV mem,accum           mov total,ax                    1
  604. MOV accum,mem           mov al,string                   1
  605. MOV segreg,reg16        mov ds,ax                       2, 3
  606. MOV segreg,mem16        mov es,psp                      2, 3
  607. MOV reg16,segreg        mov ax,ds                       1
  608. MOV mem16,segreg        mov stack_save,ss               1
  609. MOV reg32,controlreg    mov eax,cr0                     22
  610.                         mov eax,cr2                     12
  611.                         mov eax,cr3                     21, 46
  612.                         mov eax,cr4                     14
  613. MOV controlreg,reg32    mov cr0,eax                     4
  614. MOV reg32,debugreg      mov edx,dr0                     DR0-DR3,DR6,DR7=11;
  615.                                                         DR4,DR5=12 
  616. MOV debugreg,reg32      mov dr0,ecx                     DR0-DR3,DR6,DR7=11;
  617.                                                         DR4,DR5=12 
  618.                                                         
  619. MOVS [ES:]dest,
  620.  [segreg:]src           movs dest,es:source             4
  621. MOVSB [[ES:]dest,
  622.  [segreg:]src]          movsb                           4
  623. MOVSW [[ES:]dest,
  624.  [segreg:]src]          movsw                           4
  625. MOVSD [[ES:]dest,
  626.  [segreg:]src]          movsd                           4
  627.  
  628. MOVSX reg,reg           movsx bx,al                     3
  629. MOVSX reg,mem           movsx eax,bsign                 3
  630.  
  631. MOVZX reg,reg           movzx bx,al                     3
  632. MOVZX reg,mem           movzx eax,bunsign               3
  633.  
  634. MUL reg                 mul bx                          8,16-bit=11;
  635. MUL mem                 mul WORD PTR [bx]               32-bit=10
  636.  
  637. NEG reg                 neg ax                          1
  638. NEG mem                 neg balance                     3
  639.  
  640. NOP                     nop                             1
  641.  
  642. NOT reg                 not ax                          1
  643. NOT mem                 not masker                      3
  644.  
  645. OR reg,reg              or ax,dx                        1
  646. OR mem,reg              or bits,dx                      3
  647. OR reg,mem              or dx,color[di]                 2
  648. OR reg,immed            or dx,110110b                   1
  649. OR mem,immed            or flag_rec,8                   3
  650. OR accum,immed          or ax,40h                       1
  651.  
  652. OUT immed8,accum        out 60h,al                      12, pm=9,26, VM=24
  653. OUT DX,accum            out dx,ax                       12, pm=9,25  VM=24
  654.  
  655. OUTS DX,[segreg:]src    outs dx,buffer                  13, pm=10,27, VM=24
  656. OUTSB [DX,[segreg:]src] outsb                           13, pm=10,27, VM=24
  657. OUTSW [DX,[segreg:]src] outsw                           13, pm=10,27, VM=24
  658. OUTSD [DX,[segreg:]src] outsd                           13, pm=10,27, VM=24
  659.  
  660. POP reg                 pop cx                          1
  661. POP mem                 pop param                       3
  662. POP segreg              pop es                          3
  663.  
  664. POPA                    popa                            5
  665. POPAD                   popad                           5
  666.  
  667. POPF                    popf                            6, pm=4
  668. POPFD                   popfd                           6, pm=4
  669.  
  670. PUSH reg                push dx                         1
  671. PUSH mem                push [di]                       2
  672. PUSH segreg             push es                         1
  673. PUSH immed              push 15000                      1
  674.  
  675. PUSHA                   pusha                           5
  676. PUSHAD                  pushad                          5
  677.  
  678. PUSHF                   pushf                           4, pm=3
  679. PUSHFD                  pushfd                          4, pm=3
  680.  
  681. RCL reg,1               rcl dx,1                        1
  682. RCL mem,1               rcl WORD PTR [si],1             3
  683. RCL reg,CL              rcl dx,cl                       7-24
  684. RCL mem,CL              rcl masker,cl                   9-26
  685. RCL reg,immed8          rcl bx,5                        8-25
  686. RCL mem,immed8          rcl WORD PTR [bp+8],3           10-27
  687. RCR reg,1               rcr bl,1                        1
  688. RCR mem,1               rcr WORD PTR m32[0],1           3
  689. RCR reg,CL              rcr bl,cl                       7-24
  690. RCR mem,CL              rcl WORD PTR [bx=di],cl         9-26
  691. RCR reg,immed8          rcr si,9                        8-25
  692. RCR mem,immed8          rcr masker,3                    10-27
  693. ROL reg,1               rol ax,1                        1
  694. ROL mem,1               rol bits,1                      3
  695. ROL reg,CL              rol ax,cl                       4
  696. ROL mem,CL              rol color,cl                    4
  697. ROL reg,immed8          rol ax,13                       1
  698. ROL mem,immed8          rol BYTE PTR [bx],10            3
  699. ROR reg,1               ror ax,1                        1
  700. ROR mem,1               ror WORD PTR [bx],1             3
  701. ROR reg,CL              ror dx,cl                       4
  702. ROR mem,CL              ror color,cl                    4
  703. ROR reg,immed8          ror bl,3                        1
  704. ROR mem,immed8          ror bits,6                      3
  705.  
  706. RDMSR                   rdmsr                           20-24
  707.  
  708. REP INS dest,DX         rep ins dest,dx                 11+3n, pm=(8,25)+3n*
  709. REP MOVS dest,src       rep movs dest,source            6, 13n
  710. REP OUTS DX,src         rep outs dx,source              13+4n, pm=(10,27)+4n*
  711. REP LODS dest           rep lods dest                   7, 7+3n 
  712. REP STOS dest           rep stos dest                   6, 9+3n
  713. (*First protected mode timing: CPL < or = IOPL. Second timing: CPL > IOPL.)
  714.  
  715. REPE CMPS src,dest      repe cmps src,dest              7, 9+4n
  716. REPE SCAS dest          repe scas dest                  7, 9+4n
  717.  
  718. REPNE CMPS src,dest     repne cmps src,dest             7, 8+4n
  719. REPNE SCAS dest         repne scas dest                 7, 9+4n
  720.  
  721. RETN                    retn                            2
  722. RETN immed16            retn 8                          3
  723. RETF                    retf                            4, 23
  724. RETF immed16            retf 32                         4, 23
  725.  
  726. RSM                     rsm                             83
  727.  
  728. SAHF                    sahf                            2
  729.  
  730. SAL reg,1               sal bx,1                        1
  731. SAL mem,1               sal WORD PTR m32[0],1           3
  732. SAL reg,CL              sal ah,cl                       4
  733. SAL mem,CL              sal BYTE PTR [di],cl            4
  734. SAL reg,immed           sal cx,6                        1
  735. SAL mem,immed           sal array[bx+di],14             3
  736. SAR reg,1               sar di,1                        1
  737. SAR mem,1               sar count,1                     3
  738. SAR reg,CL              sar bx,cl                       4
  739. SAR mem,CL              sar sign,cl                     4
  740. SAR reg,immed           sar bx,5                        1
  741. SAR mem,immed           sar sign_count,3                3
  742. SHL reg,1               shl si,1                        1
  743. SHL mem,1               shl index,1                     3
  744. SHL reg,CL              shl di,cl                       4
  745. SHL mem,CL              shl index,cl                    4
  746. SHL reg,immed           shl di,2                        1
  747. SHL mem,immed           shl unsign,4                    3
  748. SHR reg,1               shr dh,1                        1
  749. SHR mem,1               shr unsign[di],1                3
  750. SHR reg,CL              shr dx,cl                       4
  751. SHR mem,CL              shr WORD PTR m32[2],cl          4
  752. SHR reg,immed           shr bx,8                        1
  753. SHR mem,immed           shr mem16,11                    3
  754.  
  755. SBB accum,immed         sbb ax,320                      1
  756. SBB reg,immed           sbb dx,45                       1
  757. SBB mem,immed           sbb WORD PTR m32[2],40          3
  758. SBB reg,reg             sbb dx,cx                       1
  759. SBB mem,reg             sbb WORD PTR m32[2],dx          3
  760. SBB reg,mem             sbb dx,WORD PTR m32[2]          2
  761.  
  762. SCAS [ES]dest           scas es:destin                  4
  763. SCASB                   scasb                           4
  764. SCASW                   scasw                           4
  765. SCASD                   scasd                           4
  766.  
  767. SETcondition reg8       setc dh                         1
  768. SETcondition mem8       setle flag                      2 
  769.  
  770. SGDT mem48              sgdt descriptor                 4
  771. SIDT mem48              sidt descriptor                 4
  772.  
  773. SHLD reg16,reg16,immed8 shld ax,dx,10                   4
  774. SHLD reg32,reg32,immed8                                 
  775. SHLD mem16,reg16,immed8 shld bits,cx,5                  4
  776. SHLD mem32,reg32,immed8 
  777. SHLD reg16,reg16,CL     shld ax,dx,cl                   4
  778. SHLD reg32,reg32,CL             
  779. SHLD mem16,reg16,CL     shld masker,ax,cl               5
  780. SHLD mem32,reg32,CL
  781.  
  782. SHRD reg16,reg16,immed8 shrd cx,si,3                    4
  783. SHRD reg32,reg32,immed8                                 
  784. SHRD mem16,reg16,immed8 shrd [di],dx,5                  4
  785. SHRD mem32,reg32,immed8 
  786. SHRD reg16,reg16,CL     shrd ax,dx,cl                   4
  787. SHRD reg32,reg32,CL             
  788. SHRD mem16,reg16,CL     shrd [bx],ax,cl                 5
  789. SHRD mem32,reg32,CL
  790.  
  791. SLDT reg16              sldt ax                         2
  792. SLDT mem16              sldt selector                   2
  793.  
  794. SMSW reg16              smsw ax                         4
  795. SMSW mem16              smsw machine                    4
  796.  
  797. STC                     stc                             2
  798.  
  799. STD                     std                             2
  800.  
  801. STI                     sti                             7
  802.  
  803. STOS [ES:]dest          stor es:dstring                 3
  804. STOSB [[ES:]dest]       stosb                           3
  805. STOSW [[ES:]dest]       stosw                           3
  806. STOSD [[ES:]dest]       stosd                           3
  807.  
  808. STR reg16               str cx                          2
  809. STR mem16               str taskreg                     2
  810.  
  811. SUB reg,reg             sub ax,bx                       1
  812. SUB mem,reg             sub array[di],bi                3
  813. SUB reg,mem             sub al,[bx]                     2
  814. SUB reg,immed           sub bl,7                        1
  815. SUB mem,immed           sub total,4000                  3                   
  816. SUB accum,immed         sub ax,32000                    1
  817.  
  818. TEST reg,reg            test dx,bx                      1
  819. TEST mem,reg            test flags,dx                   2
  820. TEST reg,immed          test cx,30h                     1
  821. TEST mem,immed          test masker,1                   2
  822. TEST accum,immed        test ax,90h                     1
  823.  
  824. VERR reg16              verr ax                         7
  825. VERR mem16              verr selector                   7
  826. VERW reg16              verw cx                         7
  827. VERW mem16              verw selector                   7
  828.  
  829. WAIT                    wait                            1
  830.  
  831. WBINVD                  wbinvd                          2000+
  832.  
  833. WRMSR                   wrmsr                           30-45
  834.  
  835. XADD reg,reg            xadd dl,al                      3
  836. XADD mem,reg            xadd string,bl                  4
  837.  
  838. XCHG reg,reg            xchg cx,dx                      3
  839. XCHG reg,mem            xchg bx,pointer                 3
  840. XCHG mem,reg            xchg [bx],ax                    3
  841. XCHG accum,reg          xchg ax,cx                      2
  842. XCHG reg,accum          xchg cx,ax                      2
  843.  
  844. XLAT [[segreg:]mem]     xlat                            4
  845. XLATB [[segreg:]mem]    xlatb es:table                  4
  846.  
  847. XOR reg,reg             xor cx,bx                       1
  848. XOR reg,mem             xor cx,flags                    2
  849. XOR mem,reg             xor [bp+10],cx                  3
  850. XOR reg,immed           xor bl,1                        1
  851. XOR mem,immed           xor switches[bx],101b           3
  852. XOR accum,immed         xor ax,01010101b                1
  853.  
  854.