¦b©¹«áªº¤@¡B¨â³¹ùØ¡A¤p¤ì°¸·Q½Í½Í¿é¥X¤J°ð¡A©Ò¿×¿é¥X¤J°ð¡A´N¬O^¤åªº Input/Output port¡A²ºÙ¬°¡uI/O port¡v¡A¥L¬O¹q¸£»P©PÃä³]³Æ·¾³qªººÞ¹D¡C
¦b IBM PC ¬Û®e¹q¸£ùØ¡A©Ò¦³ªº©PÃä³]³Æ³£¬OÂǵۿé¥X¤J°ð©M CPU ¬Û³s¡AIBM PC ¦@¦³ 65536 Ó¿é¥X¤J°ð¡A¥Ñ½s¸¹ 0000H ¨ì 0FFFFH¡A¨ä½s±Æ¤è¦¡¦³ÂI¹³¤@ӰϬqªº°O¾ÐÅé¡A¦ýn¼g¤J©ÎŪ¨ú«o§¹¥þ¤£¦P¡A¦³¨Ç¿é¥X¤J°ð¥u¯àŪ¤£¯à¼g¡A¦³¨Ç¥u¯à¼g¤£¯àŪ¡A¦³¨Ç¥i¼g¥iŪ¡A³£¸ò©M¨º¤@ºØ©PÃä³]³Æ¦³Ãö¡C¨C¤@ºØ©PÃä³]³Æ¨Ï¥Î¼ÆÓ¿é¥X¤J°ð»P CPU ¬Û³s¡A·íµM PC ´£¨Ñ¤F¤»¸U¦hÓ¿é¥X¤J°ð¡A¦Ó©PÃä³]³Æ¤£¥i¯à¦³³o»ò¦h¡A©Ò¥H¦³³\¦h¿é¥X¤J°ð¬OªÅ¤U¨Óªº¡A¨Ã¨S¦³¨Ï¥Î¡C¨Ò¦p¤Uªí´N¬O PC/XT ±`¥Îªº©PÃä¸Ë¸m»P¬Û¹ïÀ³ªº¿é¥X¤J°ð¡C( PC/AT »P PC/XT ªº I/O °ðµy·L¤£¦P )
PC/XT I/O°ð |
©PÃä¸Ë¸m | ´y¡@z |
00¡ã0F | 8237A¡Ð5 DMA ±±¨î´¹¤ù | 8237A¡Ð5 ¬O¥Î¨Ó¥[³t°O¾ÐÅé©M©PÃä¸Ë¸m ( ¦pµwºÐ ) ¤§¶¡ªº¸ê®Æ¶Ç°e ( µù¤@ ) |
20¡ã21 | 8259A ¤¤Â_±±¨î¾¹ | t³dºÞ²z¤¤Â_¤Î¤¤Â_½Ð¨D ( IRQ ) |
40¡ã43 | 8253¡Ð5 p®É¾¹ | ¤º§t¤TÓp®É¾¹¡A¨£¤U¤@³¹ |
60¡ã63 | 8255A¡Ð5 PPI | 8255A ¬O¤@ºØ¥iµ{¦¡©PÃä¬É±´¹¤ù ( Programmable Peripheral Interface¡A§Y PPI )¡A³q±`Áä½L»P³â¥z±µ¦b³oÓ´¹¤ù¤W¡C·N§Y¥i¸g¥Ñµ{¦¡±±¨îÁä½L»P³â¥z¡C |
200¡ã20F | JOYSTICK | ¤@¯ë¥Î¨Ó±µ·n±ì¡Aª±¹qª±¥Î |
278¡ã27F | ²Ä¤GÓ¥¦æ°ð | §Y PARALLEL 2 ©Î LPT 2¡A¤@¯ë¥Î¨Ó±µ KEY PRO |
2F8¡ã2FF | ²Ä¤G«D¦P¨B°ð | §Y COM 2 ©Î²Ä¤GÓ RS¡Ð232¡A¤@¯ë¥Î¨Ó±µ¼Æ¾Ú¾÷©Î·Æ¹« |
378¡ã37F | ²Ä¤@Ó¥¦æ°ð | §Y PARALLEL 1 ©Î LPT 1¡A¤@¯ë¥Î¨Ó±µ¦Lªí¾÷ |
3F8¡ã3FF | ²Ä¤@«D¦P¨B°ð | §Y COM 1 ©Î²Ä¤@Ó RS¡Ð232¡A¤@¯ë¥Î¨Ó±µ¼Æ¾Ú¾÷©Î·Æ¹« |
¦^·Q¥H«e¡AÁÙ¥¼¦³ PnP ªº®É¥NùØ¡A°²¦p±z·Q¦Û¤v²Õ¸Ë¹q¸£ªº¸Ü¡A¤@©wnª¾¹D¸Ó©PÃä³]³Æ©Ò¨Ï¥Îªº¿é¥X¤J°ð½s¡A©ÎªÌ¦³¨Ç©PÃä¸Ë¸m¥i¥H¦Û¦æ½Õ¾ã¿é¥X¤J°ð¡A¨Ï±o©Ò¦³ªº©PÃä¸Ë¸m³£¦³¿W¤@µL¤Gªº¿é¥X¤J°ð¡A³o¼Ë´¡¤JÂX¥R¼Ñ«á¤~¯à¥¿±`¨Ï¥Î¡C°²¦p¦³¥ô¦ó¨âÓ©PÃä¸Ë¸m¨Ï¥Î¬Û¦Pªº¿é¥X¤J°ð¡A©ÎªÌ¦³³¡¥÷«Å|¡A¨º»ò¤U³õ¥u¦³¨âºØ¡A¤£¬O¤£¯à¶}¾÷¡A´N¬O¤£¯à¥¿±`¹B§@¡C
¦^Âk¥¿¶Ç¡A¼gµ{¦¡®É¦pªGn¦b¿Ã¹õ¤WÅã¥Ü¬Y¤@Ó¦r¤¸¡A¥Ñ¦Lªí¾÷¦L¥X¤@¥÷¤å¥ó¡A¬Æ¦Ü¥ÑÁä½L¿é¤J¤@Ó¦r¡K¡K®É¡A§ÚÌ«ç»ò°µ¡H¤j¦h¼Æªº¤H³£¬OÂÇ¥Ñ INT ¤¤Â_ªA°Èµ{¦¡¨Ó´À§Ú̧¹¦¨¡A¦ý¹ê»Ú¤W³o¨Ç¤¤Â_µ{¦¡¬OÂǥѿé¥X¤J°ð©M©PÃä³]³Æ ( Åã¥Ü¾¹¡B¦Lªí¾÷¡BÁä½L¡K¡K ) ·¾³q¡C³o¨Ç³£¬O¦]¬° DOS ©Î Win 9x ³£¤w¸g¼g¦n³o¨ÇªA°Èµ{¦¡¡A§ÚÌ¥u»Ý®³¨Ó¥Î´N¦n¤F¡A°²¦p§Ú̦³¨¬°÷ªº¸ê®Æ¡A§Ṳ́]¯à¦Û¦æ±±¨î³o¨Ç¿é¥X¤J°ð¡A¹F¨ì¤Wz¥Øªº¡C
·í§Ú̧ïÅܬYÓ¿é¥X¤J°ð¤ºªº¸ê®Æ¡A¨ä¹ê´N¬O°e¬YÓ¸ê®Æ¨ì¬Û¹ïÀ³ªº©PÃä³]³Æ¥h¡A¦Ó©PÃä³]³Æ´N¯à¨Ì·Ó§Ú̪ºn¨D°µ°Ê§@¡A¨Ò¦p¦b¿Ã¹õ¤W¦L¥X¤@Ó¦r¡C¬Û¤Ïªº°²¦pnŪ¨ú¬YÓ©PÃä³]³Æªºª¬ºA¡A¤]¬O§Q¥Î¿é¥X¤J°ð§â¨ä¤ºªº¸ê®Æ¶Ç¦^¨Ó¡C80X86 CPU ´£¨Ñ©³¤U¨âÓ«ü¥O¥Î¨Ó·¾³q¿é¥X¤J°ðªº¡C
»yªk¬O¡G
out dx,al out ¿é¥X¤J°ð½s¸¹,al out dx,ax out ¿é¥X¤J°ð½s¸¹,ax
OUT «ü¥O¬O§â¤@Ӧ줸²Õ©Î¤@Ó¦r²Õªø«×ªº¸ê®Æ°e¨ì¿é¥X¤J°ð¡A©Ò°e¥Xªº¸ê®Æ©ñ¦b AL ©Î AX ¼È¦s¾¹¡C°e¥X¨ì¨º¤@Ó¿é¥X¤J°ð«h¥Ñ DX ¼È¦s¾¹«ü©w¡A©ÎªÌ¤]¥i¥Hª½±µ¥Î¿é¥X¤J°ð½s¸¹«ü©w¡C
»yªk¬O¡G
in al,dx in al,¿é¥X¤J°ð½s¸¹ in ax,dx in ax,¿é¥X¤J°ð½s¸¹
IN «ü¥O©M OUT «ü¥O«ê¦n¬Û¤Ï¡A¬O§â¿é¥X¤J°ðªº¸ê®Æ¶Ç¦^ AL ©Î AX ¼È¦s¾¹¤¤¡C¿é¥X¤J°ð½s¸¹¥i¥Hª½±µ¼g¥X¨Ó¤]¥i¥H©ñ¦b DX ¼È¦s¾¹¤¤¡C
¹q¸£ªº©PÃä³]³Æ«Ü¦h¡A¦Ó¨C¤@ºØ©PÃä³]³Æªº¿é¥X¤J°ð¾Þ§@¤èªk¤£¦P¡A¦Ó¥B¦³®ÉÔ¤£·íªº¼ÆÈ·|¨Ï©PÃä³]³Æ¤£¥¿±`¹B§@¡A¬Æ¦Ü·í¾÷¡A¥[¤W²{¦b¹q¸£²£«~ªº§Þ³N¸ê®Æ´X¥GµLªk¨ú±o¡A¦]¦¹¿é¥X¤J°ðªº¨Ï¥Î±`»X¤W¤@¼h¯«¯¦ªº³±¼v¡A¤p¤ì°¸´N±N¤âÃä²{¦³ªº¸ê®Æ»P¤j®a¤À¨É¡C( ¤p¤ì°¸°Ñ¦Ò¥Á°ê 83 ¦~ 4 ¤ë¥÷²Ä¤TªiÂø»xªLÀA·ç¥ý¥Íªº¤å³¹ (²Ä 16 ¶ )¡B CMOS Registers ¥H¤Î Marc Feeley ªººô¶¡C)
CMOS ( complementary metal oxide semiconductor ªºÂ²¼g¡A¬O«ü¤¬¸Éª÷ª÷®ñ¤Æª«¥b¾ÉÅé ) ¬O¤@ºØ¯Ó¹q«Ü§Cªº°O¾ÐÅé¡A¥¦¬O¥Î¨ÓÀx¦s¹q¸£¤¤ªº°ò¥»³]³Æ¡A¨Ò¦pµwºÐ¼Æ¥Ø¤Î§Î¦¡¡B³nºÐ¼Æ¥Ø¤Î§Î¦¡¡B°O¾ÐÅé¤j¤p¡BÅã¥Ü¾¹µ¥µ¥¡AÁÙ¦³¹³p®É³oºØÀH®É§ïÅܪº¸ê®Æ¡CCMOS ¬O¾a¹q¸£¤ºªº¹q¦À¨ÑÀ³¹q¬y¡A©Ò¥H§Y¨Ï¹q¸£ªº¹q·½Ãö±¼¡A¨ä¤ºªº¸ê®Æ¤]¤£·|¬y¥¢¡A¦ý¬O¦pªG¹q¦À¨S¹q¡ACMOS ªº¸ê®Æ´N«á¤£¥¿½T¡A¥²¶·«³]¡A©¯¦n CMOS ¨Ï¥Îªº¹q¦À¬O¥i¥R¹qªº¾Y¹q¦À¡A¥un±z±`¨Ï¥Î¹q¸£¡A´N¯à¦b¨Ï¥Î®É¦P®É¥R¹q¡A©Ò¥H¤£¥²¾á¤ß³oºØ°ÝÃD¡C
IBM PC/XT µ¥¯Åªº¹q¸£¬O¨S¦³ CMOS¡A¨ì¤F IBM PC/AT ¹q¸£¤~°t³Æ¤F CMOS¡A±Ä¥Îªº¬O MC146818A ´¹¤ù¡A¥i¦s©ñ¦³ 64 ¦ì¤¸²Õªº¸ê®Æ¡C¦Ó 386 ¾÷ºØ³q±`¬O§â¥¦¾ã¦X¨ì¨ä¥L´¹¤ù¤¤ ( ¨Ò¦p 82C206 ´¹¤ù )¡A®e¶q¤]ÂX¥R¨ì 128 ¨ì 256 ¦ì¤¸²Õ¡C
CMOS ªº¸ê®Æ¬Ý±o¨£¶Ü¡H³o¬O·íµMªº¡A¦b¹q¸£¤@¶}¾÷®É¡A·|¥X²{¹³©³¤Uªºµe±¡A´N¬O¨Ì¾Ú CMOS ¤ºªº¸ê®ÆÅã¥Ü©ó¿Ã¹õ¤Wªº¡C
°£¤F¦b¶}¾÷®É¯à¬Ý¨ì¥~¡A±z¤]¥i¥H¦b¶}¾÷®É©|¥¼¶i¤J§@·~¨t²Î«e¡A¶i¤J BIOS ³]©wµ{¦¡¡A¤]¥i¥H¬Ý¨ì°O¿ý©ó CMOS ¤ºªº¤º®e¡C¦b³o¤@¸`ùØ¡A¤p¤ì°¸±Nn¥H¦Û¤v»s§@ªºµ{¦¡¨ÓŪ¨ú CMOS¡A·íµM¤]¥i¼g¤J ( ³]©w BIOS ®É¡A¨ä¹ê´N¬Oקï CMOS ªº¤º®e )¡A¦ý¬O³o¬O«Ü¦MÀIªº¡A¦]¬°³]©wȤ£¹ï«Ü®e©ö³y¦¨·í¾÷¡C
n¼gµ{¦¡Åã¥Ü CMOS ªº¸ê®Æ¡An¥ý¤F¸Ñ¨ä¤º®e¡C¤p¤ì°¸¥u§ä¨ì«e 64 Ӧ줸²Õªº¸ê®Æ¡A¦p¤Uªí¡G
°¾²¾¦ì§} | ·N¸q |
00H¡ã0DH | §Y®É®ÉÄÁ ( realtime clock ) |
0EH | ¶EÂ_ª¬ºA ( diagnostic status ) |
0FH | ¶}¾÷ª¬ºA ( reat code ) |
10H | ³nºÐ¾÷«¬¦¡ ( diskette type ) |
11H | «O¯d |
12H | µwºÐ¾÷«¬¦¡ ( harddisk type ) |
13H | «O¯d |
14H | ³]³Æª¬ºA ( equipment status ) |
15H¡ã16H | ¶Ç²Î°O¾ÐÅé¤j¤p ( base memory ) |
17H¡ã18H | ©µ¦ù°O¾ÐÅé¤j¤p ( extended memory ) |
19H | ²Ä¤@¥xµwºÐ«¬ºA ( first HD type ) |
1AH | ²Ä¤G¥xµwºÐ«¬ºA ( second HD type ) |
1BH¡ã2DH | «O¯d |
2EH¡ã2FH | °O¾ÐÅ餧¬d®ÖÈ ( check sum ) |
30H¡ã31H | ©µ¦ù°O¾ÐÅé¤j¤p ( extended memory ) |
32H | ¥@¬ö¼Æ ( BCD ®æ¦¡ ) |
33H | ±Ò°ÊºX¼Ð |
34H¡ã3FH | «O¯d |
¹q¸£¬O¥H 70H »P 71H ¨âÓ¿é¥X¤J°ð»P CMOS ·¾³q¡A·ínŪ¨ú CMOS ªº¬YÓ¦ì§}®É¡A¥ý§â¸Ó¦ì§}¶ñ¤J°ð 70H¡AµM«á¦A¥Ñ°ð 71H Ū¨ú¸Ó¦ì§}¤§¸ê®Æ¡CÁ|¨Ò¨Ó»¡¡AnŪ¨ú¡y¥@¬ö¼Æ¡z¡A¥i¥H¥Î¤U±µ{¦¡¡G
mov al,32h out 70h,al in al,71h
³o¼Ë¡ACMOS ªº¦ì§} 32H ªº¼ÆÈ´N¦b AL ¼È¦s¾¹ùØ¡C¦P²z¡An§ï¼g¥@¬ö¼Æ¡A¤]¬On§â CMOS ªº¦ì§}¶ñ¤J°ð 70H¡A¦A§ân§ï¼gªº¥@¬öÈ¿é¥X¨ì°ð 71H¡A¦p¤U±µ{¦¡
mov al,32h out 70h,al mov al,20h out 71h,al
¤p¤ì°¸´N¦Û¤v©Ò¦¬¶°¨ìªº¸ê®Æ¡A»¡©ú¦b CMOS ¤ºªº¸ê®Æ·N¸q¡C
¦ì§} 00H ¡ã 0DH ªí¥Ü§Y®É®ÉÄÁ¡A¨ä¤º®e½Ð¬Ý¤Uªí¡G
¦ì§} | ·N¸q | ¦ì§} | ·N¸q |
00H | ¬í | 07H | ¤é |
01H | 08H | ¤ë | |
02H | ¤À | 09H | ¦~ |
03H | 0AH | ||
04H | ¤p®É | 0BH | |
05H | 0CH | ||
06H | ¬P´Á | 0DH |
¦ì§} 0EH ªí¥Ü¶EÂ_ª¬ºA¡A³oӦ줸²Õ¦U¦ì¤¸ªº·N¸q¬O
¦ì¤¸ | ·N¸q |
7 | ¹q¦Àª¬ºA |
6 | ¬d®ÖȪ¬ºA |
5 | µ²ºcª¬ºA |
4 | °O¾ÐÅé¤j¤p°O¿ýª¬ºA |
3 | µwºÐª¬ºA |
2 | §Y®É®ÉÄÁª¬ºA |
1 | «O¯d |
0 | «O¯d |
·í¦ì¤¸È¬°¤@®É¡Aªí¥Ü¸Ó¶µ¥¿±`¡C¨Ò¦p¦ì¤¸¤C¬°¤@¡Aªí¥Ü¹q¦À¥¿±`¡AY¬°¹s¡Aªí¥Ü¹q¤O¤£¨¬¡C
¦ì§} 10H ªí¥Ü³nºÐ¾÷«¬¦¡¡A³oӦ줸²Õ³Q¤À¦¨¨â³¡¥÷¡A¸û°ªªº¥|Ӧ줸ªí¥Ü³nºÐ¾÷ A: ªº«¬¦¡¡F¸û§Cªº¥|Ӧ줸ªí¥Ü³nºÐ¾÷ B: ªº«¬¦¡¡CÁöµM¨CÓ³nºÐ¾÷³Q¤À°t¨ì¥|Ӧ줸²Õ¡A¦@¥i¥Hªí¥Ü 16 ºØ¤£¦P«¬¦¡ªº³nºÐ¾÷¡A¦ý¨Æ¹ê¤W¡A¥«±¤W©Ò³c½æªººÏºÐ¾÷¥u¦³¤ºØ¦Ó¤w¡A¦p¤Uªí¡G
BIT È ³nºÐ¾÷«¬¦¡ ¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð 0000 ¥¼¸Ë¸m¸Ó³nºÐ¾÷ 0001 5.25 ¦T 360K ³nºÐ¾÷ 0010 5.25 ¦T 1.2M ³nºÐ¾÷ 0011 3.5 ¦T 720K ³nºÐ¾÷ 0100 3.5 ¦T 1.44M ³nºÐ¾÷ 0101 3.5 ¦T 2.88M ³nºÐ¾÷
¦ì§} 12H ¬Oªí¥ÜµwºÐ¾÷ªº«¬ºA¡A¦P³nºÐ¾÷Ãþ¦ü¡A¦¹¦ì¤¸²Õ¤]¤À¦¨¨â³¡¤À¡A¸û°ªªº¥|Ӧ줸²Õ¬Oªí¥Ü²Ä¤@¥xµwºÐ«¬¦¡¡A¸û§Cªº¥|Ӧ줸²Õ¬Oªí¥Ü²Ä¤G¥xµwºÐ«¬¦¡¡A¦pªG¬° 0000 ªí¥Ü¸ÓµwºÐ¤£¦s¦b¡A¤£¬°¹s¡Aªí¥Ü¸ÓµwºÐ«¬¦¡¡C¦]¬°¨C¥xµwºÐ³Q¤À¨ì¥|Ӧ줸²Õ¡A¬G¥iªí¥Ü 16 ºØ«¬¦¡ªºµwºÐ¡A¦ý¬OµwºÐµo®i»·¸û³nºÐ§Ö³t¡A±q³Ì¥ý IBM XT ©Ò°t³Æªº 20MB µwºÐ¡A¨ì²{¦b 80G ªºµwºÐ¡A¬G¥iª¾³o¤Q¤»ºØ«¬¦¡¡A®Ú¥»¤£°÷¥Î¡A©Ò¥H³o¥|Ӧ줸¦pªG¬O¡y1111¡zªº¸Ü¡Aªí¥Ün¨ì¦ì§} 19H ©Î 1AH ¥h¨ú±o¯u¥¿ªºµwºÐ«¬¦¡¡C¦ý«á¨Ó¤j·§¬O¯uªºµo®i¤Ó§Ö¡A¤S¥[¤W¤£¦A¨Ï¥ÎºÏy¡BºÏ°Ï¡BºÏ±¨Óªí¥ÜµwºÐ«¬¦¡¡A³£§ï¥Î TYPE 46¡A¥Ñ¨Ï¥ÎªÌ©w¸q¡A«á¨Ó§ó¶i¤@¨B¥Ñ BIOS ¦Û¤v°»´ú¡C
¦ì§} 14H ¬Oªí¥Ü³]³Æª¬ºA¡A¦ì¤¸ 7¡B6 ªí¥Ü³nºÐ¾÷¼Æ¥Ø¡C¦ì¤¸ 5¡B4 ªí¥ÜÅã¥Ü¥dºØÃþ¡G
¦ì¤¸5 ¦ì¤¸4 Åã¥Ü¥d ¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð 0 0 EGA/VGA 0 1 40 ¦æ CGA 1 0 80 ¦æ CGA 1 1 MGA ( ³æ¦â¥d )
¦ì¤¸ 2¡B3 «O¯d¡C¦ì¤¸ 1 ªí¥Ü¬O§_¦³¯BÂI¹Bºâ¾¹¡A1 ªí¥Ü¦³¡A0 ªí¥Ü¨S¦³¡C¦ì¤¸ 0 ªí¥Ü¬O§_¦³ºÏºÐ¾÷ A:¡A1 ªí¥Ü¦³¡A0 ªí¥Ü¨S¦³¡C
¦ì§} 15¡B16 ³o¨âӦ줸²Õªí¥Ü¶Ç²Î°O¾ÐÅé¤j¤p¡A³æ¦ì¬O 1KB¡A§Y 1024 Ӧ줸²Õ¬°³æ¦ì¡CÁ|¨Ò¨Ó»¡¡AY¦ì§} 15¡B16 ªº¤º®e¤À§O¬O 80H¡B02H¡Aªí¥Ü¦³ 280HKB¡A´«¦¨¤Q¶i¦ì§Y 640KB¡C
¦ì§} 17¡B18 ³o¨âӦ줸²Õªí¥Ü©µ¦ù°O¾ÐÅé¤j¤p¡A³æ¦ì¬O 1KB¡C
©³¤U³oÓµ{¦¡¬O¥Î¨Ó§â CMOS ªº«e 64 Ӧ줸²Õ©ó¿Ã¹õ¤W¦L¥X¨Ó¡A¨ÃÅã¥Ü«n½Ñ¤¸¡G
tab equ 09h cr equ 0dh lf equ 0ah ;*************************************** code segment assume cs:code,ds:code extrn print_bl_hex:near org 100h ;--------------------------------------- start: jmp begin cmos db 64 dup (?) ;011 str00 db '²Ä¤@¥x³nºÐ¾÷¡G$' str01 db '²Ä¤G¥x³nºÐ¾÷¡G$' str02 db '²Ä¤@¥xµwºÐ¾÷¡G$' str03 db '²Ä¤G¥xµwºÐ¾÷¡G$' str04 db '¯BÂI¹Bºâ¾¹¡G$' str05 db '¶Ç²Î°O¾ÐÅé¡G$' str06 db 'KB',cr,lf,'©µ¦ù°O¾ÐÅé¡G$' str07 db 'Åã¥Ü¥dºØÃþ¡G$' str08 db '²{¦b®É¶¡¡G2003¦~09¤ë27¤é 06¡G40$' str50 db '¦s¦b$' str51 db '¤£¦s¦b$' str52 db '5.25 ¦T 360KB$' str53 db '5.25 ¦T 1.2MB$' str54 db '3.5 ¦T 720KB $' str55 db '3.5 ¦T 1.44MB$' str56 db '3.5 ¦T 2.88MB$' str57 db 'VGA/EGA$' str58 db '40 ¦æ CGA$' str59 db '80 ¦æ CGA$' str60 db 'MGA$' pbcd dt ? ;032 display dw str57,str58,str59,str60 ;033 begin: mov dl,tab ;034 ²Ä038 ¨ì 044 ¦æ call print_char ;035 ¦L¥X¦ì§}¤§Ó¦ì¼Æ mov cx,16 sub bx,bx ;037 BX¬°¤Q¤»¶i¦ì¤§Ó¦ì¼Æ next1: push cx ;038¡X¢{ call print_bl_hex ;039 ¢x pop cx ;040 ¢u¦L¥X¦ì§}¤§¤Q¤»¶i¦ì mov dl,' ' ;041 ¡UÓ¦ì¼Æ¡A§Y BL ¤§È inc bx ;042 ¡U call print_char ;043 ¡U loop next1 ;044¡X¢} call print_cr_lf ;045 ´«¦æ call print_line ;046 ¦L¥X¤À¹j½u mov di,offset cmos cld sub bx,bx ;050 BX=CMOS«ü¼Ð mov cx,64 ;051 CX=¦@Ū¨ú64Ӧ줸²Õ next2: mov dx,70h ;052¡X¢{ mov al,bl ;053 ¢x out dx,al ;054 ¡U mov dx,71h ;055 ¢uŪ¨úCMOS¤º®e64¦ì¤¸²Õ¡A¨Ã in al,dx ;056 ¡U¦s©ó²Ä12¦æªºCMOSÅܼƤº stosb ;057 ¡U inc bx ;058 ¡U loop next2 ;059¡X¢} sub dx,dx ;061 ¨C°õ¦æ¤@¦¸¤p°j°é¡ADL´N¥[10H mov si,offset cmos ;062 SI «ü¦VCMOSÅܼƤºªº¨C¤@Ó¦ì§} next3: mov bl,dl ;063¡X¡X¡X¡X¡X¡X¡X¡X¡X¢{ push dx ;064 ¢x call print_bl_hex ;065 ¡U mov dl,'H' ;066 ¡U call print_char ;067 ¡U mov dl,tab ;068 ¡U call print_char ;069 ¡U mov ch,10h ;070 ¡U next4: mov bl,[si] ;071¡X¢{ ¡U call print_bl_hex ;072 ¢x ¢u¥|¦æCMOS mov dl,' ' ;073 ¡U¥H16Ӧ줸²Õ¬°¡Uªº°j°é call print_char ;074 ¢u¤@¦æ¡A¦L¥X¤@¦æ¡U inc si ;075 ¡UCMOS¤º®eªº°j°é¡U dec ch ;076 ¡U ¡U jnz next4 ;077¡X¢} ¡U call print_cr_lf ;079 ¡U pop dx ;080 ¡U add dx,10h ;081 ¡U cmp dl,40h ;082 ¡U jnz next3 ;083¡X¡X¡X¡X¡X¡X¡X¡X¡X¢} call print_line call print_cr_lf call floppy_type ;087 ¦L¥X³nºÐ¾÷«¬¦¡ call print_cr_lf call hd_type ;090 ¦L¥XµwºÐ¾÷«¬¦¡ call print_cr_lf call equipment ;093 ¦L¥X³]³Æ call print_cr_lf call memory ;096 ¦L¥X°O¾ÐÅé¤j¤p call print_cr_lf call date_and_time ;099 ¦L¥X®É¶¡¤Î¤é´Á mov ax,4c00h ;101 µ²§ô¡Aªð¦^ DOS int 21h ;--------------------------------------- ;¦L¥X¦r¦ê ;¿é¤J¡GDX¡Ð¦r¦ê¦ì§} print_string proc near push ax mov ah,9 int 21h pop ax ret print_string endp ;--------------------------------------- print_line: ;114 ¦L¥X¤À¹j½u mov cx,58 mov dl,'-' pnt_m: call print_char loop pnt_m ;--------------------------------------- print_cr_lf: ;120 ´«¦æ mov dl,cr call print_char mov dl,lf ;--------------------------------------- print_char proc near ;125 ¦L¥X¤@Ó¦r¤¸ push ax mov ah,2 int 21h pop ax ret print_char endp ;--------------------------------------- equipment proc near mov dx,offset str07 ;134 ¦L¥X¡yÅã¥Ü¥dºØÃþ¡G¡z¦r¦ê call print_string mov bx,offset cmos+14h mov al,[bx] ;137 ¨ú±o CMOS ªº³]³Æª¬ºA push ax mov cl,4 ;139 ¥ÑALªº²Ä5¡B4¦ì¤¸¡ApºâÅã¥Ü¥dºØÃþ shr al,cl and al,0ch mov si,ax shl si,1 add si,offset display mov dx,[si] ;145 DX«ü¦VSTR57¡ã60¥|Ó¦r¦êªº¨ä¤¤¤§¤@ call print_string ;146 ¦L¥XÅã¥Ü¥dºØÃþ call print_cr_lf mov dx,offset str04 ;149 150¦æ¨ì159¦æ¦L¥X¬O§_¦³FPU call print_string pop ax mov dx,offset str50 ;152 «ü¦V¡y¦s¦b¡z¦r¦ê and al,2 jnz fpu_yes mov dx,offset str51 ;155 «ü¦V¡y¤£¦s¦b¡z¦r¦ê fpu_yes: call print_string call print_cr_lf ret equipment endp ;--------------------------------------- hd_type proc near ;162 ¦L¥XµwºÐ¾÷«¬¦¡°Æµ{¦¡ mov bx,offset cmos+12h mov al,[bx] mov ch,al mov bx,offset cmos+19h mov cl,4 mov dx,offset str02 ;168 DX«ü¦V¡y²Ä¤@¥xµwºÐ¾÷¡G¡z¦r¦ê shr al,cl call hd_c mov al,ch mov bx,offset cmos+1ah mov dx,offset str03 ;173 DX«ü¦V¡y²Ä¤G¥xµwºÐ¾÷¡G¡z¦r¦ê and al,0fh hd_c: call print_string ;176 ¦L¥X¡y²ÄXXµwºÐ¾÷¡G¡zªº¦r¦ê cbw or ax,ax jz no_hd ;179 YAX=0¡Aªí¥Ü¨S¦³¸Ó¥xµwºÐ¾÷ cmp al,0fh ; YAL=0FH¡Aªí¥ÜµwºÐ¾÷«¬¦¡¦b 19H ©Î 1AH ³B jne hd_no mov al,[bx] hd_no: sub dx,dx ;183 µwºÐ¾÷«¬¦¡¦s©ó AX ¤¤ mov di,offset pbcd ;184 ±N AX ¤§¤Q¤»¶i¦ì¼ÆÅܦ¨»E¶° BCD ¼Æ call hex32_to_pbcd mov dl,[di] shr dl,cl call h_digit ;188 ¦L¥XµwºÐ«¬¦¡¤§¤Q¦ì¼Æ mov dl,[di] call l_digit ;190 ¦L¥XµwºÐ«¬¦¡¤§Ó¦ì¼Æ call print_cr_lf ret no_hd: mov dx,offset str51 ;193 ¦L¥X¡y¤£¦s¦b¡z¦r¦ê call print_string ret hd_type endp ;--------------------------------------- floppy_type proc near ;198 ¦L¥X³nºÐ¾÷«¬¦¡°Æµ{¦¡ mov bx,offset cmos+10h mov al,[bx] mov cl,4 mov ah,al mov dx,offset str00 ;203 «ü¦V¡y²Ä¤@¥x³nºÐ¾÷¡G¡z¦r¦ê call floppy_a mov al,ah mov dx,offset str01 ;206 «ü¦V¡y²Ä¤G¥x³nºÐ¾÷¡G¡z¦r¦ê and al,0fh floppy_a: call print_string ;209 ¦L¥X¡y²ÄXX³nºÐ¾÷¡G¡z¦r¦ê mov dx,offset str51 ;210 pºâDXÀ³«ü¦Vªº¦ì§} shr al,cl jz floppy_ok add dx,7 cmp al,1 je floppy_ok dec al floppy_exist: add dx,14 dec al jnz floppy_exist floppy_ok: call print_string ;222 DX«ü¦V³nºÐ¾÷«¬¦¡ call print_cr_lf ret floppy_type endp ;--------------------------------------- date_and_time proc near ;227 ¦L¥X®É¶¡¡B¤é´Á°Æµ{¦¡ mov di,offset str08+10 mov bx,offset cmos+32h ;230 BX«ü¦V¡y¥@¬ö¼Æ¡z mov cl,4 call a_byte mov bx,offset cmos+09h ;233 BX«ü¦V¦~¥÷ call a_byte inc di inc di dec bx ;238 BX«ü¦V¤ë¥÷ call a_byte inc di inc di dec bx ;243 BX«ü¦V¤é call a_byte add di,4 sub bx,3 ;247 BX«ü¦V¤p®É call a_byte inc di inc di dec bx dec bx ;253 BX«ü¦V¤À call a_byte call print_cr_lf mov dx,offset str08 ;257 ¦L¥X®É¶¡ call print_string ret ;¨ÏBX©Ò«ü¦ì§}ªº¦ì¤¸²Õ(¸Ó¦ì¤¸²Õ¬°¤@»E¶°BCD¼Æ)Åܦ¨¤Q¶i¦ì ;¼Æ¦s©óAX¡AAH¬°Ó¦ì¼Æ¡AAL¬°¤Q¦ì¼Æ¡A¦A¦s©óDI©Ò«üªº¦ì§} a_byte: mov al,[bx] mov ah,al and ah,0fh shr al,cl add ax,3030h stosw ret date_and_time endp ;--------------------------------------- ;§â¦s©ó DX:AX ¤ºªº¤Q¤»¶i¦ì¼ÆÂà´«¦¨»E¶° BCD ¼Æ¡A¦s©ó ES:DI ©Ò«üªº¦ì§} ;¿é¤J¡GDX:AX 32 ¦ì¤¸ªº¤Q¤»¶i¦ì¼Æ ; ES:DI 6 Ӧ줸²Õªø¡A»E¶°ªº BCD ¼Æ ;¿é¥X¡GES:DI ¤w¶ñ¦nµ¥È©ó DX:AX ªº»E¶° BCD ¼Æ ; DX:AX ·|³Q¯}Ãa hex32_to_pbcd proc near public hex32_to_pbcd push bx push cx mov bx,ax mov cx,3 xor ax,ax repz stosw sub di,6 mov cx,20h ;32 bits n_bit: shl bx,1 rcl dx,1 xchg es:[di],ax call decimal xchg es:[di],ax xchg es:[di+2],ax call decimal xchg es:[di+2],ax xchg es:[di+4],ax call decimal xchg es:[di+4],ax adc al,0 loop n_bit pop cx pop bx ret decimal: adc al,al daa xchg al,ah adc al,al daa xchg al,ah ret hex32_to_pbcd endp ;--------------------------------------- l_digit: and dl,0fh h_digit: add dl,'0' call print_char ret ;--------------------------------------- memory proc near mov dx,offset str05 ;325 DX«ü¦V¡y¶Ç²Î°O¾ÐÅé¡G¡z¦r¦ê call print_string mov bx,offset cmos+15h mov ax,[bx] sub dx,dx ;329 DX:AX=¶Ç²Î°O¾ÐÅé¤j¤p(¥H1K¬°³æ¦ì) mov di,offset pbcd call hex32_to_pbcd ;331 §âDX:AX§ï¦¨¤Q¶i¦ì mov cl,4 mov dl,[di+1] call l_digit ;334 ¦L¥X¶Ç²Î°O¾ÐÅé¤j¤pªº¦Ê¦ì¼Æ mov dl,[di] shr dl,cl call h_digit ;337 ¦L¥X¶Ç²Î°O¾ÐÅé¤j¤pªº¤Q¦ì¼Æ mov dl,[di] call l_digit ;339 ¦L¥X¶Ç²Î°O¾ÐÅé¤j¤pªºÓ¦ì¼Æ mov dx,offset str06 call print_string ret memory endp ;--------------------------------------- code ends ;*************************************** end start
³oÓµ{¦¡¦b²ÕĶ¡B³sµ²®É¡A¥²¶·¨Ì¥H¤U¤è¦¡¡G
H:\HomePage\SOURCE>masm dumpcmos; [Enter] Microsoft (R) Macro Assembler Version 5.00 Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved. 51362 + 386030 Bytes symbol space free 0 Warning Errors 0 Severe Errors H:\HomePage\SOURCE>link dumpcmos [Enter] Microsoft (R) Personal Computer Linker Version 2.40 Copyright (C) Microsoft Corp 1983, 1984, 1985. All rights reserved. Run File [DUMPCMOS.EXE]:[Enter] List File [NUL.MAP]:[Enter] Libraries [.LIB]: myasmlib [Enter] Warning: no stack segment H:\HomePage\SOURCE>exe2bin dumpcmos dumpcmos.com [Enter]
¦Ó°õ¦æµ²ªG¡A¦p¤U¹Ï¡G
³oÓµ{¦¡ÁöµM¬Ý°_¨Ó«Ü¤j¡A¦ý¨Æ¹ê¤W¨Ã¨S¦³¤°»ò§Þ¥©¡A¤j³¡¤À³£¬O¦b¤ñ¹ï¸ê®Æ¡A¬Ý¬OÄݩ󨺤@ºØÃþ«¬ªº³]³Æ¡C§Ú·Qȱo¤@´£ªº¬O²Ä 33 ¦æªº display ÅܼơC³oÓÅܼƪº¤º®e¬O¥|Ó¦ì§}ªº¶°¦X¡A¤À§O«ü¦V str57¡Bstr58¡Bstr59¡Bstr60 ³o¥|Ó¦r¦ê¡A¸Ó¥|Ó¦r¦ê¬Oªí¥ÜÅã¥Ü¥dºØÃþªº¦r¦ê¡C§Ú·Q¡A±zÀ³¸Ó®É®É°O±o¡A¦b²Õ¦X»y¨¥¤¤ªºÅܼơA¨ä¹ê¥Nªí¤@Ó¦ì§}¡A©Ò¥H str57 ªí¥Ü¤@Ó¦ì§}¡A·í¤p¤ì°¸¥Î¤U±¦¡¤lªí¥Ü®É
str57 db 'VGA/EGA$' display dw str57
¥NªíµÛ display ªº¤º®e¬O str57 ©Ò¦b¦ì§}¡A±z¥un§ä¨ì display ³oÓÅܼƪº¤º®e¡A¨Ì¦¹¤º®e´N¥i¥H§ä¨ì str57 ©Ò¦b¡C
¦pªG¼g¦¨
display dw str57,str58,str59,str60
¨º»ò´Nªí¥Ü display Åܼƥ]§t¥|Ó¦ì§}¡A¤À§Oªí¥Ü str57 ¡ã str60 ©Ò¦b¦ì§}¡C¨CÓ¦ì§}³£¬O¤@Ó¦r²Õªºªø«×¡A©Ò¥H¶Z display ©Ò«ü¦ì§}ªº²Ä¹sӦ줸²Õ¬O str57¡A¶Z display ©Ò«ü¦ì§}ªº²Ä¤GÓ¬O str58¡A¶Z display ©Ò«ü¦ì§}ªº²Ä¥|Ó¦r²Õ¬O str59 ¡K¡K¡C
·Ó CMOS ³]³Æª¬ºA¸ê®Æ¡A¦pªG§â²Ä 4¡B5 ¨âӦ줸²¾¨ì²Ä 0¡B1 ¨âӦ줸¡A¨º»ò¥Ñ 0 ¨ì 3 ¤À§O¥Nªí¤£¦PªºÅã¥Ü¥d¡A¤]´N¬O 0 ¨ì 3 ¤À§O¥Nªí str57 ¨ì str60 ³o¥|Ó¦r¦ê¡A¦ý³o¥|Ó¦r¦êªøµu¤£¤@¡AY§â¥L´«¦¨¦ì§}¡A´N¤@¼Ëªø¤F ( ³£¬O¨âӦ줸²Õ )¡A©Ò¥H«Ü®e©öpºâ¨ä¦ì§}¡C
mov al,[bx] ;137 ¨ú±o CMOS ªº³]³Æª¬ºA push ax mov cl,4 ;139 ¥ÑALªº²Ä5¡B4¦ì¤¸¡ApºâÅã¥Ü¥dºØÃþ shr al,cl and al,0ch mov si,ax shl si,1 add si,offset display mov dx,[si] ;145 DX«ü¦VSTR57¡ã60¥|Ó¦r¦êªº¨ä¤¤¤§¤@
²Ä 137 ¦æ¨ú±o³]³Æª¬ºA«á¡A¥Ñ²Ä 140¡B141 ¦æªº¦ì¤¸²¾°Ê¨Ï²Ä 4¡B5 ¦ì¤¸Åܦ¨²Ä 0¡B1 ¦ì¤¸¡AµM«á¦A¥Ñ²Ä 143 ¦æ¼¥H 2¡A´N±o¨ì¥Ñ display ©Ò«üªº¦ì§}¶}©l¦A°¾²¾ªº¦ì¤¸²Õ¼Æ¡C¬°¦ón¼¥H 2 ©O¡H³o¬O¦]¬°¨CÓ¦ì§}¦û¨âӦ줸²Õ¡C
¥t¥~ÁÙȱo¤@´£ªº¬O floppy_type °Æµ{¦¡¡CÁöµM»¡³nºÐ«¬¦¡¥]§t¡y¨S¦w¸Ë³nºÐ¡z¡A¤j·§´N¥u³o¤»ºØ¡C¦pªG¥Î¡yY AL=0¡A«h¥¼¸Ë³nºÐ¡z¡A¡yY AL=1¡A«h¦w¸Ë5.25 ¦T 360K ³nºÐ¾÷¡z¡K¡K³o¼Ëªº§PÂ_¤è¦¡Áö¤]¥i¥H¡A¦ýÁ`ı¤£°÷ºë²¡C¥J²ÓÆ[¹î str51¡ãstr56 ³o´XÓ¦r¦ê¡A±zÀ³¸Ó·|µo²{°£¤F str51 ªø 7 Ӧ줸²Õ¥~¡A¨ä¾l§¡ªø 14 Ӧ줸²Õ¡A¥i»¡ÅܤƳW«h¡A©Ò¥H¤p¤ì°¸¥Î¤F¤@¨Ç¤p§Þ¥©Â²¤Æ¤Fµ{¦¡¡C½Ð¦Û¦æ°Ñ¦Ò²Ä 210 ¨ì²Ä 220 ªºµ{¦¡½X¡A¬Û«H¤£¤ÓÃøÀ´¡C
°Æµ{¦¡ hex32_to_ubcd ¬O¥Î¨Ó§â¦s¦b©ó DX:AX ùتº 32 ¦ì¤¸ªøªº¤Q¤»¶i¦ì¼Æ¡AÂà´«¦¨»E¶° BCD ¼Æ¡A¨Ò¦p DX:AX=0200:ABCD Âà´««á¨Ì¦ì§}¥Ñ§C¦Ó°ª¬O 13 84 59 33¡A¤]´N¬O¤Q¶i¦ìªº 33598413¡C³oӰƵ{¦¡Âà´«ªºì²z²³æÁ¿¬O¥Ñ DX:AX ªº³Ì§C¦ì¤¸¶}©l³B²z¡A¦s©ó ES:DI ©Ò«üªº¦ì§}¡A¨C¦V¥ª³B²z¤@Ӧ줸¡A«K¨Ï ES:DI ¤§È¼¥H 2¡AµM«á¦A¾A·íªº½Õ¾ã¨Ï¨äÅܬ°¦b 0¡ã9 ¤§¶¡¡A¦p¦¹³B²z 32 ¦¸´N±o¨ìµª®×¡C
¦Ü©ó©µ¦ù°O¾ÐÅé¤j¤p¡A¤p¤ì°¸©Ò§ä¨ìªº¸ê®Æ¤¤¡A¦ü¥G¦b 64MB ¥H¤Uªº°O¾ÐÅé¤~¥¿½T¡A¦b 64MB ¥H¤Wªº°O¾ÐÅ餣¬Û²Å¡AÁÙ±æ½Ñ¦ì¥ý¶i´£¨Ñ¸ê®Æ¡C
µù¤@¡G
°²¦p§ÚÌn§â¸ê®Æ¥ÑµwºÐŪ¨ì°O¾ÐÅ餤¡A¦pªG¥Î CPU ¥h¤@µ§¤@µ§ªº§â¸ê®ÆŪ¶i¨Ó¡AµM«á¦b§â³o¨Ç¸ê®Æ·h¨ì«ü©wªº°O¾ÐÅé¤W¡A¬O«Üªá®É¶¡ªº¡C§Ú̪º°µªk¬O CPU ¥un¤U«ü¥O§i¶D 8237 »Ýn§â¨º¤@¨Ç¸ê®ÆŪ¶i°O¾ÐÅéµM«án©ñ¦b°O¾ÐÅ騺¨à§Y¥i¡AµM«á CPU ´N¥i¥H¦^¹LÀY¥h°õ¦æ¤U¤@¹D«ü¥O¡A¦Ó 8237 ·|t³d§âµwºÐ¤Wªº¸ê®Æ·h¨ì«ü©wªº°O¾ÐÅé¤W¥h¡C
¹³³o¼Ë¤£¶·³z¹L CPU ¦Óª½±µ§â¸ê®Æ·h¹Bªº¹Lµ{¡A¥i¥H¥[³tµwºÐ»P°O¾ÐÅ餧¶¡¸ê®ÆªºÂಾ¡C©Ò¥H 8237 ¤]ºÙ¬° DMA (Direct Memory Access) ±±¨î¾¹¡C