¼È¦s¾¹¬O¦b CPU ¤¤¤@ӼȮÉÀx¦s¸ê®Æªº¦a¤è¡C¥¦¦³ÂI¨à¹³°O¾ÐÅé ( DRAM )¡A¦ý¬O¤£¹³°O¾ÐÅé³o»ò¤j¡A¤@ӼȦs¾¹¥u¦³¤@Ó¡B¨âÓ©Î¥|Ӧ줸²Õªº¤j¤p¡A¨ì¤F AMD64¡BINTEL64 ( ©Î¦XºÙ x86-64 ) ªº CPU ®É¥N¡A¼È¦s¾¹¤~¦³¤KӦ줸²Õ ( ¨Æ¹ê¤W«Ü¤Ö¤H¥Î¤KӦ줸²Õ³oºØÃã·J¡A³q±`¬O¥Î¥|¦r²Õ¡A¥ç§Y QWORD¡A¤@Ó¥|¦r²Õ¦@¦³ 64 ¦ì¤¸ ) ªº¤j¤p¡CCPU ¥i¥Hª½±µ¹ï¼È¦s¾¹§@¥[¡B´î¡B¼¡B°£¡B¥B¡B©Î¡B·h²¾µ¥¹Bºâ¡C8086/8088 ¦@¦³ 14 Ó 16 ¦ì¤¸ªº¼È¦s¾¹¡A¨ä¦WºÙ³£¥H¨âÓ^¤å¦rªí¥Ü¡A¤jP¥i¤À¬°¥H¤U¥|Ãþ¡C
³o¥|ӼȦs¾¹¡A¨C¤@Ó³£¯à©î¶}¨Ó¡A¦¨¬°¨âÓ 8 ¦ì¤¸ªº¼È¦s¾¹¨Ï¥Î¡A¨Ò¦p AX ¥i³Q¤À¦¨¸û§Cªº 8 ¦ì¤¸ºÙ¬° AL¡A¥H¤Î¸û°ªªº 8 ¦ì¤¸ AH ¨Ó¨Ï¥Î¡C¨ä¾l BX¡BCX¡BDX ¤]³£Ãþ¦ü¡C
¨º¤°»ò±¡§Î·|n±N¸ê®Æ¦s¤J°ïÅ|¤º©O¡H¦³¦n´XºØ±¡§Î¡A¨Ò¦p©I¥s°Æµ{¦¡®É¡A·|¹w¥ý§âªð¦^¦ì§}¦s¤J°ïÅ|¡Q©I¥s¤¤Â_®É¤]¬O¦p¦¹¡CBP ³q±`¥Î©ó©I¥s°Æµ{¦¡®É¡A¶Ç»¼°Ñ¼Æ¤§¥Î¡C
IP (instruction pointer¡AºÙ¬°«ü¥O«ü¼Ð) °t¦X CS Åܦ¨ CS:IP¡A«ü¦V±Nn°õ¦æªº 8086/8088 ¦ì§}¡C·í CPU n°õ¦æµ{¦¡®É¡A¥²¶·¨ì°O¾ÐÅé¥h´£¨ún°õ¦æªº«ü¥O¡A¦Ón¨ì¨º¤@Ó°O¾ÐÅé¦ì§}¥h´£¨ú«ü¥O©O¡H³o®É CPU ´N·|¨ì CS:IP «ü¨ìªº¦ì§}¥h´£¨ú¡C¦bµ{¦¡¤¤¡A¤@¯ë¬O¨S¦³¿ìªk§ïÅÜ CS:IP ªºÈ¡A°£«D¬O¸õÅD (jmp¡Bjzµ¥) «ü¥O©Î¬O©I¥s (call¡Bretµ¥) «ü¥O¡C
SI (source index¡AºÙ¬°¨Ó·½¯Á¤Þ¼È¦s¾¹) ©M DI (destination index¡AºÙ¬°¥Øªº¯Á¤Þ¼È¦s¾¹) ³q±`¬O¥Î¨Ó·í§@¦ì§}«ü¼Ð¡A¤]¥i¥Î§@¥[´îªk¡C³o¤Ó¼È¦s¾¹¡A¨C¤@Ó³£¤£¯à¤À¶}¨Ó·í§@¨âÓ 8 ¦ì¤¸ªº¼È¦s¾¹¨Ï¥Î¡C
·í¸ê®Æ°Ï¬q¤£°÷¥Î®É¡A´N¥i¥H¥ÎÃB¥~°Ï¬q¨Ó¸É¨¬¡A¨Ò¦p·Qn±N¤@ӰϬqªº¬Y¨Ç¤º®e½Æ»s¨ì¥t¤@°Ï¬q¤¤¡A´N¥i¥H¦P®É«ü©w DS¡BES ¤À§Oªí¥Ü³o¨âӰϬq¡C
³o 9 ÓºX¼Ð¥i¤À¬°¤TÃþ¡Gª¬ºAºX¼Ð ( status flag )¡B±±¨îºX¼Ð ( control flag ) »P¨t²ÎºX¼Ð ( system flag )¡Cª¬ºAºX¼Ð¥]§t CF¡BPF¡BAF¡BZF¡BSF ©M OF¡A¥¦Ì·|¨ü¨ìºâ³N¡B¤ñ¸û©ÎÅÞ¿è¹Bºâµ²ªGª¬ºAªº¼vÅT¡A¦Ó¨ÏºX¼Ð³Q³]©w ( set¡A¨äȬ° 1 )¡A©Î³Q²M°£ ( clear¡A¨äȬ°¹s )¡C²Ä 10 ¦ì¤¸ªº DF ¥Î¨Ó±±¨î±½´y¡B·h²¾¡B·j´M¦r¦êªº¤è¦V¡AÄݩ󱱨îºX¼Ð¡C¦Ü©ó IF¡BTF ¬°³]p§@·~¨t²Î¡B°£¿ù®É¤~»Ýn¥Î¨ì¡AÄÝ©ó¨t²ÎºX¼Ð¡A¤@¯ëÀ³¥Îµ{¦¡«Ü¤Ö¨Ï¥Î¡C©³¤U²³æ¤¶²Ð³o¨ÇºX¼Ð¡G
¦WºÙ | ¦ì¤¸ | ª¬ºA | »¡©ú |
¶i¦ìºX¼Ð carry flag CF | 0 | CF=1¡ACY CF=0¡ANC |
·í¹Bºâµo¥Í¶i¦ì©Îɦì®É¡ACF ³Q³]¬° 1¡F¤Ï¤§³]¬° 0¡C¨Ò¦p¨â¼Æ¬Û¥[¡G
mov ax,8000h
8000h¡Ï8000h À³¬° 10000h¡Aµo¥Í¶i¦ì¡AÁöµM AX ¬° 0¡A¦ý¬O·|¨Ï CF ³]¬°¤@¡Aªí¥Ü¶i¦ì¡Cadd ax,8000h |
¦P¦ìºX¼Ð parity flag PF | 2 | PF=1¡APE PF=0¡APO |
¹Bºâªºµ²ªG´«¦¨¤G¶i¦ì«á¡A³Ì§Cªº 8 Ӧ줸¤¤¡AY¦³°¸¼ÆÓ 1¡A«h¦¹¦ì¤¸³]¬° 1¡A¤Ï¤§¬° 0¡C |
»²§U¶i¦ìºX¼Ð auxiliary carry flag AF | 4 | AF=1¡AAC AF=0¡ANA |
·í¹Bºâ¹Lµ{¤¤¡A²Ä 3 ¦ì¤¸»P²Ä 4 ¦ì¤¸¤§¶¡µo¥Í¶i¦ì©Îɦì®É¡AAF ³Q³]¬° 1¡A§_«h³Q³]¬° 0¡A±`¥Î©ó BCD ªº¹Bºâ¡C |
¹sȺX¼Ð zero flag ZF | 6 | ZF=1¡AZR ZF=0¡ANZ |
¹Bºâµ²ªG¬°¹s®É¡AZF ·|³Q³]©w¬° 1¡CY¤ñ¸û¬Û¦P¨â¼Æ¡A ZF ¤]·|³Q³]¬°¤@¡AY¤ñ¸û¤£¬Û¦Pªº¨â¼Æ¡AZF ·|³Q²M°£¬°¹s¡C¨Ò¦p¡G
mov ax,8000h
¬Û¥[«á¡AAX ¬°¹s¡A¬G ZF ³]¬°¤@¡Cadd ax,8000h |
²Å¸¹ºX¼Ð sign flag SF | 7 | SF=1¡ANG SF=0¡APL |
¹Bºâµ²ªGªº³Ì°ª¦ì¤¸¬° 1 ®É¡ASF ·|³Q³]¬° 1 ( ªí¥Üt¼Æ )¡A§_«h³Q²M°£¡C |
³´¨ÀºX¼Ð trap flag TF | 8 | ¡@ | ¥Î©ó³æ¨B°lÂÜ°£¿ù®É¡A©Ò¥H¤]ºÙ¬°°lÂܺX¼Ð ( trace flag )¡A¨Ò¦p¦b MS-DOS ªº DEBUG ¤¤¡A´N¬O§Q¥Î TF ¹F¨ì³æ¨B°lÂܪº¥Øªº¡C·í TF ³]¬°¤@®É¡A¨C°õ¦æ¤@Ó«ü¥O«K·|µo¥Í¤¤Â_¡A¦¹¤¤Â_´N±N°õ¦æ¸Ó«ü¥O«á¼È¦s¾¹¦C¥X¡C |
¤¤Â_ºX¼Ð interrupt flag IF | 9 | IF=1¡AEI IF=0¡ADI |
·í IF ³Q³]©w®É¡A¥i¾B¸nªºµwÅ餤Â_¤~¯à¨Ï CPU ²£¥Í¤¤Â_®ÄªG¡F¤Ï¤§©Ò¦³¥i¾B¸nªºµwÅ餤Â_§¡·|³Q§í¨î¡C¦ý¬O¤£¥i¾B¸n¤¤Â_¥H¤Î CPU ²£¥Íªº¨Ò¥~«o§¹¥þ¤£¨ü IF ¼vÅT¡C |
¤è¦VºX¼Ð direction flag DF | 10 | DF=1¡ADN DF=0¡AUP |
·í DF ³Q²M°£®É ( §Y DF=0 )¡A³B²z¦r¦êªº¯Á¤Þ¼È¦s¾¹·|»¼¼W¡A©¹°ª¦ì§}¤è¦V³B²z¡F¤Ï¤§ DF ³Q³]©w¡A«h»¼´î¡A©¹§C¦ì§}¤è¦V³B²z¡C |
·¸¦ìºX¼Ð overflow flag OF | 11 | OF=1¡AOV OF=0¡ANV |
·í¹Bºâµ²ªG¶W¹L©Ò¯àªí¥Üªº½d³ò®É¡A·¸¦ìºX¼Ð·|³Q³]¬°¤@¡A¤Ï¤§³]¬°¹s¡C¤jP¥i¤À¤TºØ±¡§Î¡G(1)¨â¦P¸¹¼Æ¬Û¥[©Î¨â²§¸¹¼Æ¬Û´î¡A(2)¼°£¹Bºâ®É¡A©Ò±oªº¿n©Î°Ó¶W¹L¹Bºâ¤¸¦s©ñ½d³ò¡A¦b²¾¦ì©Î±ÛÂà«ü¥O®É¡A³Ì°ª¦ì¤¸È¨ü¨ì§ó°Ê ( 0 Åܦ¨ 1 ©Î 1 Åܦ¨ 0 )¡C( ¸Ô²Ó±¡§Î½Ð°Ñ¾\·sª©²Ä 14 ³¹©Îª©²Ä 35 ³¹¡C) |
¤W±ªºªí»¡©úºX¼Ð¼È¦s¾¹ªº·N¸q¡C¥HºX¼Ð¼È¦s¾¹ªº¦ì¤¸ 0 ¬°¨Ò¡A¦ì¤¸ 0 ºÙ¬°¡y¶i¦ìºX¼Ð¡z¡A·í¥¦³Q³]©w®É¡A¨äȬ° 1¡A¦b DEBUG ùØ¥H CY ªí¥Ü¡F³Q²M°£®É¡A¨äȬ° 0¡A¦b DEBUG ùØ¥H NC ªí¥Ü¡C©³¤U¦C¥X DEBUG ¤¤°õ¦æ r «ü¥O«áªº·N¸q¡G
-r [Enter] AX=0000 BX=0000 CX=0025 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000 DS=10F7 ES=10F7 SS=10F7 CS=10F7 IP=0100 NV UP EI PL NZ NA PO NC 10F7:0100 EB19 JMP 0119
¤W±¥Õ¦âªº³¡¤À´N¬OºX¼Ðªºª¬ºA¡C¤Uªí¬O¦UºX¼Ð¦WºÙ¥H¤Î¦UºØª¬ºAªºªí¥Ü¤è¦¡¡G
ºX¼Ð¦WºÙ | ³]©w ( ³]©w®É¨äȬ° 1 ) | ²M°£ ( ²M°£®É¨äȬ° 0 ) |
CF¡A¶i¦ìºX¼Ð PF¡A¦P¦ìºX¼Ð AF¡A»²§U¶i¦ìºX¼Ð ZF¡A¹sȺX¼Ð SF¡A²Å¸¹ºX¼Ð IF¡A¤¤Â_ºX¼Ð DF¡A¤è¦VºX¼Ð OF¡A·¸¦ìºX¼Ð |
CY PE AC ZR NG EI DN OV |
NC PO NA NZ PL DI UP NV |
³Ì¦¨Ï¥Î¦b IBM PC ¤Î¬Û®e¾÷ºØªº FPU ¬O 8087¡A«á¨Ó¤S¤À§O¦³¶i¶¥ªº 80287¡B80387¡A¦o̦XºÙ¬° x87¡Cx87 ¦@¦³¤Ãþ¼È¦s¾¹¡A¥¦Ì¬O°ïÅ|¼È¦s¾¹ ( register stack )¡Bª¬ºA¦r²Õ ( status word )¡B±±¨î¦r²Õ ( control word )¡B¼ÐÅÒ¦r²Õ ( tag word )¡B¨Ò¥~«ü¼Ð ( exception pointer )¡C
x87 ¦@¦³¤KÓ°ïÅ|¼È¦s¾¹¡A¨ä¦WºÙ¬O ST(0)¡BST(1)¡BST(2)¡K¡KST(7)¡A¨ä¤¤ ST(0) ³QºÙ¬°°ïÅ|³» ( TOS¡ATop Of Stack )¡A¦b²Õ¦X»y¨¥¤¤¤]¥i²¼g¦¨ ST¡C³o¤KÓ°ïÅ|¼È¦s¾¹¨C¤@Ó³£¦³ 80 ¦ì¤¸ªº¤j¤p¨Ó¦s©ñ¯BÂI¼Æ¡A¨Ã¥B¥H¼È®É¹ê¼Æªº§ÎºA¦s©ñ¡A¥i¥H»¡¬Û·íªº·Ç½T¡C·í x87 °õ¦æ FLD¡BFILD µ¥«ü¥O¡A±q°O¾ÐÅ餤ªº¾ã¼Æ¡Bµu¹ê¼Æµ¥¤£¦P®æ¦¡¸ü¤J¼ÆȮɡAx87 ¯à¦Û°ÊÂà´«¦¨¼È®É¹ê¼Æ®æ¦¡¨ì°ïÅ|¼È¦s¾¹ùØ¡F·í x87 ¹J¨ì¹³ FIST¡BFST µ¥«ü¥O¡An§â°ïÅ|¼È¦s¾¹¤ºªº¼ÆȦs¤J°O¾ÐÅ餤¡Ax87 ·|¦Û°ÊÂà´«¦¨©Ò«ü©wªº®æ¦¡¡C
x87 ¥i¥H°õ¦æ³\¦h½ÆÂøªºpºâ¡A¦p¨D¥¿©¶¡B¾l©¶¡B¹ï¼Æ¡K¡Kµ¥¹Bºâ¡A³£¬O¥H°ïÅ|¼È¦s¾¹¤ºªº¼È®É¹ê¼Æ¬°¹Bºâªº¸ê®Æ¡A¦]¦¹¤]ºÙ¬°¸ê®Æ¼È¦s¾¹ ( data register )¡C¦³³\¦hªº¹Bºâ³£¬O·|²o¯A¨ì TOS ¡A¦³®É¤]¦³ TOS ©M¨ä¥L°ïÅ|¼È¦s¾¹°µ¹Bºâ¡A©Ò¥H TOS ±`±`¬O¥i¥H¬Ù²¤¡Aµ{¦¡³]p®v±o¤p¤ß³oºØ¡yÁô§t¡zªº¼gªk¡A¥H§K³y¦¨§xÂZ¡C
³o 8 Ó°ïÅ|¼È¦s¾¹ªº¦WºÙ¡AST(0)¡BST(1)¡BST(2)¡K¡Kµ¥µ¥¡A¨Ã¤£¬O©T©w«ü¬YÓ°ïÅ|¼È¦s¾¹¡C¦Ó¬O¥Ñª¬ºA¦r²Õ ( ©³¤U»¡©ú ) ªº¤TÓ ST ¦ì¤¸«ü©w°ïÅ|³»¡A¦Ó¤U¤@Ó°ïÅ|¼È¦s¾¹´N¬O ST(1)¡B¦A¤U¤@Ó´N¬O ST(2)¡K¡K¡C
³oÓ 16 ¦ì¤¸ªº¼È¦s¾¹¨M©w¤F x87 ¹ï¤£¦P¨Ò¥~±ø¥óªº³B²z¡B¦p¦ó±Ë¤J¡B±±¨î¹ê¼Æºë½T«×µ¥µ¥¡C±±¨î¦r²Õªº¦UÓÄæ¦ì¦p¤U¹Ï©Ò¥Ü¡G
RC | ±Ë¤J±±¨î | »¡©ú | ¨Ò¤l |
00 | ¥|±Ë¤¤J | ¦V³Ìªñªº¾ã¼Æ ³{¥|±Ë¥h¡A¹J¤¶i¦ì |
4.5 ==> 5 -4.5 ==> -5 |
01 | ¦VtµL½a¤j±Ë¤J | ¥¿È±Ë¥h¤p¼Æ³¡¤À tȱ˥h¤p¼Æ³¡¤À«á¦A´î¤@ |
4.5 ==> 4 -4.4 ==> -5 |
10 | ¦V¥¿µL½a¤j±Ë¤J | ¥¿È±Ë¥h¤p¼Æ³¡¤À«á¦A¥[¤@ tȱ˥h¤p¼Æ³¡¤À |
4.5 ==> 5 -4.5 ==> -4 |
11 | ¦V¹s±Ë¥h | ¤£½×¥¿tȧ¡±Ë¥h¤p¼Æ³¡¤À | 4.5 ==> 4 -4.5 ==> -4 |
00 ªí¥Ü 24 ¦ì¤¸¦³®Ä¼Æ 01 «O¯d¥¼¨Ï¥Î 10 ªí¥Ü 53 ¦ì¤¸¦³®Ä¼Æ 11 ªí¥Ü 64 ¦ì¤¸¦³®Ä¼Æ¡@¡@¤º©wÈ
IM¡BDM¡BZM ³o¤TӦ줸¬O x87 ¦b°õ¦æ«ü¥O¤§«e¡A´N¯à°»´ú¨ìªº¡FOM¡BUM¡BPM «h¬O¦b«ü¥O°õ¦æ«á¡A¤~¯à°»´ú¨ì¡C
ÅU¦W«ä¸q¡A³oӼȦs¾¹¬O¥Î¨Óªí¥Ü 80x87 ª¬ºAªº¡A¨äµ²ºc¦p¤U¹Ï¡G
8087 ¦³¤@Ó 16 ¦ì¤¸ªº¼ÐÅÒ¦r²Õ¡A¼ÐÅÒ¦r²Õùئ³¤KÓ¼ÐÅÒ¡A¨C¨âӦ줸¬°¤@Ó¼ÐÅÒ¡A¤À§O¹ïÀ³¨ì¤KÓ°ïÅ|¼È¦s¾¹¡C¦p¤U¹Ï¡G
¨CÓ¼ÐÅÒ¥Nªí¬Û¹ïÀ³ªº°ïÅ|¼È¦s¾¹¤º¦s¤Jªº¼ÆȧκA¡C
8087 ©Ò¯à³B²zªº¼Æȸê®ÆÃþ«¬¡A°£¤F¤CºØ°ò¥»§ÎºA ( ¦r²Õ¾ã¼Æ¡Bµu¾ã¼Æ¡Bªø¾ã¼Æ¡Bµu¹ê¼Æ¡Bªø¹ê¼Æ¡B¼È®É¹ê¼Æ¡B»E¶° BCD ¾ã¼Æ ) ¤§¥~¡AÁÙ«O¯d¤F¬Y¨Ç¯S®íªº½s½X¤è¦¡¨Óªí¥Ü¯S®íªº¸ê®Æ¡A³o¨Ç¯S®íªº¸ê®Æ¤@¯ëÀ³¥Î¤W¸û¤Ö¨Ï¥Î¡A¥i°Ñ¦Ò²Ä 22 ³¹µù¥|ªº»¡©ú¡C
¨Ò¥~«ü¼Ð¥]§t¤TӼȦs¾¹¡G«ü¥O«ü¼Ð¼È¦s¾¹ ( last instruction pointer )¡B¹Bºâ¤¸«ü¼Ð¼È¦s¾¹ ( last operand pointer¡A¤]¥s¸ê®Æ«ü¼Ð¼È¦s¾¹¡Alast data pointer )¡B«ü¥O½X¼È¦s¾¹ ( last instruction opcode )¡C³o¤TӼȦs¾¹¥Î©ó¨Ò¥~µo¥Í®É¡AÅýµ{¦¡ª¾¹Dµo¥Í¨Ò¥~®É¡Ax87 ªº°õ¦æ±¡§Î¡C«ü¥O«ü¼Ð¼È¦s¾¹»P¹Bºâ¤¸«ü¼Ð¼È¦s¾¹³£¬O 48 ¦ì¤¸ªø¡A«ü¥O½X¼È¦s¾¹¬° 11 ¦ì¤¸ªø¡C
¨ì¤F¥Á¹L 74 ¦~¤Q¤ë¡A^¯Sº¸±À¥X¤F·s¤@¥Nªº CPU¡A80386¡C´N²Õ¦X»y¨¥ªºÆ[ÂI¨Ó¬Ý¡A³oÁû CPU »P¤§«eªº 8086/80286 ¦³«Ü¤jªº¤£¦P¡A¥¦¨ã¦³ 32 ¦ì¤¸¼È¦s¾¹¡A¥i¥H¤@¦¸°µ 32 ¦ì¤¸¹Bºâ¡A¤@ª½¨ì Pentium 4 ¬°¤î¡A³q¥Î¼È¦s¾¹¡B«ü¼Ð»P¯Á¤Þ¼È¦s¾¹¡B°Ï¬q¼È¦s¾¹¡BºX¼Ð¼È¦s¾¹³£¬Û¦P¡C
80386 ªº³q¥Î¼È¦s¾¹¦@¦³ 4 Ó¡A¤À§O¬O EAX¡BEBX¡BECX¡BEDX¡A¥¦Ìªº¦WºÙ©M 8086/80286 ³q¥Î¼È¦s¾¹¦WºÙ«Ü¬Û¦ü¡A«e±ªº¡yE¡zªí¥Ü¡yextended¡z¡A©µ¦ù¤§·N¡A¨ä¹ê´N¬O§âì¨Ó¤Q¤»¦ì¤¸ªº¼È¦s¾¹ÂX¥R¬°¤T¤Q¤G¦ì¤¸¡C³o¥|Ó 32 ¦ì¤¸ªº³q¥Î¼È¦s¾¹¡A¨C¤@Ó¸û§C¦r²Õªº 16 ¦ì¤¸¤S¥i¿W¥ß¨Ï¥Î¡A¦WºÙ»P 8086 ¬Û¦P¡C¦Ó³o§C¦r²Õªº 16 ¦ì¤¸¼È¦s¾¹¤S¥i¦A¤À¦¨°ª¦ì¤¸²Õªº 8 ¦ì¤¸»P§C¦ì¤¸²Õªº 8 ¦ì¤¸¨âӼȦs¾¹¡C
¨Ò¦p²Ö¥[¾¹ EAX ¸û§C¦r²Õªº 16 ¦ì¤¸¬° AX ¼È¦s¾¹¡AAX ¤S¥i¤À¦¨ AH »P AL ¨âÓ¤K¦ì¤¸ªº¼È¦s¾¹¡A¦ý¬O EAX ¸û°ª¦r²Õªº 16 ¦ì¤¸µLªk³æ¿W¨Ï¥Î¤F¡A¤]¨S¯S®íªº¦WºÙ¡C¦Ü©ó EBX¡BECX¡BEDX ¤]©M EAX ¬Û¦P¡A¨£¤U¹Ï¡C
°²¦pì¨Ó EAX ¬° 12345678H¡A«á¨Óµ{¦¡¦]»Ýn¶È§â AH ¤§È§ï¦¨ 00¡A¨º³o®ÉÔ¦AŪ¨ú EAX ®É¡AEAX ·|Åܦ¨ 12340078H¡C
80386 ¦³ 4 Ó 32 ¦ì¤¸ªº«ü¼Ð»P¯Á¤Þ¼È¦s¾¹¡A¤À§O¬O ESP¡BEBP¡BEIP¡BESI¡BEDI¡A¦Ó¨C¤@Ó¤S¥i¥H§â¸û§Cªº 16 ¦ì¤¸©î¥X¨Ó¨Ï¥Î¡A¤À§OºÙ¬° SP¡BBP¡BIP¡BSI¡BDI¡A¦P¼Ëªº¸û°ªªº¦r²ÕµLªk³æ¿W¨Ï¥Î¡A¤]¨S¯S®íªº¦WºÙ¡C³o¨Ç¼È¦s¾¹ªº¥Îªk»P 8086/80286 ¬Û¦P¡A¨Ò¦p¦b¨Ï¥Î
rep movsb
®É¡A´N¥²¶·§â¨Ó·½¦r¦ê¦ì§}¦s©ó ESI¡A¥Øªº¦r¦ê¦ì§}¦s©ó EDI¡A²¾°Êªº¦ì¤¸²Õ¼Æ¦s©ó ECX¡C
80386/80486/Pentium ¦³¤»Ó 16 ¦ì¤¸ªº°Ï¬q¼È¦s¾¹¡A¤À§O¬O CS¡BDS¡BES¡BSS¡BFS ©M GS¡A¤ñ 8086/80286 ¦h¥X¨âÓ¡AFS ©M GS¡C«e±¥|Óªº¥Îªk»P 8086/80286 ¬Û¦P¡A¨Ò¦p CS «ü¦Vµ{¦¡½X°Ï¬q¡BDS «ü¦V¸ê®Æ°Ï¬q¡C¦h¥X¨Óªº FS ©M GS ¥iµø¬°ÃB¥~°Ï¬q¡C¦ý¬O¦b«OÅ@¼Ò¦¡¤¤°Ï¬qªº·N¸q»P¯u¹ê¼Ò¦¡¤£¦P¡A½Ð°Ñ¦Ò«OÅ@¼Ò¦¡ªº¤åÄm¡C
»P 8086 ªº 16 ¦ì¤¸ºX¼Ð¼È¦s¾¹¤ñ¸û¡A80386/80486/Pentium ªº©µ¦ùºX¼Ð¼È¦s¾¹¦³ 32 ¦ì¤¸¼e¡AÁöµM¦h¤F¤@¨Ç¤j³¡¤À»P«OÅ@¼Ò¦¡¦³Ãö¨t²ÎºX¼Ð¡A¦ý¤´µM¦³³\¦h¦ì¤¸¥¼³Q¨Ï¥Î¡A¨Ã¥B±±¨îºX¼Ð»Pª¬ºAºX¼Ð³£¯à»P 8086 ¬Û®e¡C¤U¹Ï¬O©µ¦ùºX¼Ðªº¦U¦ì¤¸¦WºÙ¡G
¦WºÙ | ¦ì¤¸ | »¡©ú |
I/O ¯SÅvµ¥¯Å I/O privilege level | 12¡B13 | ¦¹¨â¦ì¤¸¬O¥Î¨Ó¨M©wµ{¦¡¬O§_¤¹³\¦s¨ú I/O °ð©Î°õ¦æ»Ýn¯SÅvµ¥¯Å«ü¥O ( ¦p lgdt¡Bmov cr0,ax µ¥µ¥ )¡A·íµ{¦¡ªº¯SÅvµ¥¯Å ( CPL ) ¤p©ó©Îµ¥©ó IOPL ®É¡A¤~¥i¥H¦s¨ú I/O °ð©Î°õ¦æ»Ýn¯SÅvµ¥¯Å«ü¥O¡Cª`·N¡A¦b 386 ¤Î¨ä°ª¶¥ CPU ªº«OÅ@¼Ò¦¡¤¤¡A¦@¤À¬° RING0¡BRING1¡BRING2¡BRING3 ¥|ºØ¯SÅvµ¥¯Å¡ARING0 ¬O³Ì°ª¯Å¡A¤@¯ë§@·~¨t²Î¡BÅX°Êµ{¦¡³£¦b³oºØµ¥¯Å¤U°õ¦æ¡CRING3 ¬O³Ì§Cµ¥¯Å¡A¤@¯ëÀ³¥Îµ{¦¡¦b RING3 ¤¤°õ¦æ¡C |
Task ¦ê±µºX¼Ð nested task NT | 14 | ¦¹ºX¼Ð¥Î¨Óªí¥Ü¥Ø«e°õ¦æªºµ{¦¡ ( task ) ¤§«e¬O§_ÁÙ¦³¨ä¥Lµ{¦¡µ¥«Ý³Q°õ¦æ¡AY NT=1¡Aªí¥ÜÁÙ¦³µ{¦¡µ¥«Ý°õ¦æ¡F¤Ï¤§«h§_¡C |
¦^´_ºX¼Ð resume flag RF | 16 | ¦¹ºX¼Ð¥Î¨Ó¬O§_¼È®É§í¨î°»¿ù¨Ò¥~¡AY RF=1¡ACPU ·|¥h³B²z°»¿ù¨Ò¥~¡A¤Ï¤§¤£·|¡C |
µêÀÀ 86 ¼Ò¦¡ virtual 86 mode VM | 17 | µêÀÀ 86 ¼Ò¦¡ ( V86 mode ) ¥iµø¬°¤@ºØ¯S®íªº«OÅ@¼Ò¦¡¡ACPU n¥ý¶i¤J«OÅ@¼Ò¦¡¤§«á¡A¤~¥i¶i¤J V86 ¼Ò¦¡¡A©Ò¥H·í VM=1 ®É¬° V86 ¼Ò¦¡¡FVM=0 ®É¬°«OÅ@¼Ò¦¡¡C |
¹ï»ôÀˬd alignment check AC | 18 | ·í AC »P CR0 ¼È¦s¾¹¦P®É¬°¤@®É¡ACPU ·|Àˬd°O¾ÐÅé¦s¨ú¦ì§}¬O§_¹ï»ô¡A¨S¦³¹ï»ôªº¦s¨ú°Ê§@·|²£¥Í¡y¹ï»ôÀˬd¨Ò¥~¡z¡C©Ò¿×¡yÀˬd°O¾ÐÅé¦s¨ú¦ì§}¬O§_¹ï»ô¡zªº·N«ä¬O¡G¹ï©ó¦s¨ú¦r²Õ ( word ) ¸ê®ÆÃþ«¬ªº¸ê®Æ©Ò¦b¦ì§}¥²¶·¬O 2 ªº¿¼Æ¡B¦s¨úÂù¦r²Õ ( dword ) ¸ê®ÆÃþ«¬ªº¸ê®Æ©Ò¦b¦ì§}¥²¶·¬O 4 ªº¿¼Æ¡C |
µêÀÀ¤¤Â_ºX¼Ð virtual interrupt flag VIF | 19 | ¥Î©ó¦h¤uÀô¹Ò¤U¤ä´©¤¤Â_ºX¼Ð¡C |
µêÀÀ¤¤Â_Äa¸mºX¼Ð virtual interrupt pending flag VIP | 20 | ¥Î©ó¦h¤uÀô¹Ò¤U¤ä´©¤¤Â_ºX¼Ð¡C |
ÃѧOºX¼Ð identification flag ID | 21 | ¦pªGÀ³¥Îµ{¦¡¥i¥H²M°£©Î³]©wÃѧOºX¼Ð¡Aªí¥Ü CPU ¤ä´© CPUID «ü¥O¡C |
80386/80486/Pentium ¨Ï¥Î¥|Ó°O¾ÐÅéºÞ²z¼È¦s¾¹¨Ó°O¿ý«OÅ@¼Ò¦¡©³¤U¡A°O¾ÐÅé´yz¾¹ªí®æ¦ì§}©Ò¦b¡A¥¦Ì¬O¡G
80386/80486 ¦³¥|Ó±±¨î¼È¦s¾¹¡A¤À§O¬O CR0¡BCR1¡BCR2¡BCR3¡APentium ÁÙ¦h¤F¤@Ó CR4¡C