£¨4£©3¸ö16λµÄ¶¨Ê±Æ÷/¼ÆÊýÆ÷£¨51×ÓϵÁнöÓÐ2¸ö¶¨Ê±Æ÷£©£¬Ã¿¸ö¶¨Ê±Æ÷/¼ÆÊýÆ÷¿ÉÒÔÉèÖÃΪ¼ÆÊý·½Ê½£¬ÓÃÓÚ¶ÔÍⲿʼþÐźŽøÐмÆÊý£¬Ò²¿ÉÒÔÉèÖÃΪ¶¨Ê±·½Ê½£¬Âú×ã¸÷ÖÖ¶¨Ê±ÒªÇó¡£
£¨5£©ÓÐÒ»¸ö¹ÜÀí6¸öÖжÏÔ´£¨51×ÓϵÁÐ1ÊÇ5¸öÖжÏÔ´£©¡¢Á½¸öÓÅÏȼ¶µÄÖжϿØÖÆÆ÷¡£
£¨6£©4¸ö8λ²¢ÐÐI/O¶Ë£¬Ã¿¸ö¶Ë¿Ú¼È¿ÉÒÔÓÃ×÷ÊäÈ룬Ҳ¿ÉÒÔÓÃÓÚÊä³ö¡£
£¨7£©Ò»¸öȫ˫¹¤µÄUART£¨Í¨ÓÃÒì²½½ÓÊÕ·¢ËÍÆ÷£©´®ÐÐI/O¿Ú£¬ÓÃÓÚµ¥Æ¬»úÖ®¼äµÄ´®ÐÐͨÐÅ£¬»òÕßµ¥Æ¬»úÓëPC»ú¡¢ÆäËüÉ豸¡¢ÆäËüоƬ֮¼äµÄ´®ÐÐͨÐÅ¡£
£¨8£©Æ¬ÄÚÕñµ´µç·ºÍʱÖÓ·¢ÉúÆ÷£¬Ö»ÐèÍâÃæ½ÓÉÏÒ»¾§Õñ»òÊäÈëÕñµ´ÐźžͿɲúÉúµ¥Æ¬»úËùÐèÒªµÄ¸÷ÖÖʱÖÓÐźš£
£¨9£©ÓÐÒ»¸ö¿ÉѰַ64KBÍⲿÊý¾Ý´æ´¢Æ÷¡¢»¹¿ÉÒÔѰַ64KBÍⲿ³ÌÐò´æ´¢Æ÷µÄÈý×ÜÏߵĿØÖƵç·¡£
5£®MCS-51µ¥Æ¬»úµÄEAÒý½ÅÓкι¦ÄÜ£¿ÐźÅΪºÎÖÖµçÆ½£¿ ´ð:EAΪƬÍâ³ÌÐò´æ´¢Æ÷Ñ¡ÔñÊäÈë¶Ë¡£¸ÃÒý½ÅΪµÍµçƽʱ£¬Ê¹ÓÃÆ¬Íâ³ÌÐò´æ´¢Æ÷£¬Îª¸ßµçƽʱ£¬Ê¹ÓÃÆ¬ÄÚ³ÌÐò´æ´¢Æ÷¡£ 6£®MCS-51µ¥Æ¬»úµÄALEÒý½ÅÓкι¦ÄÜ£¿ÐźŲ¨ÐÎÊÇʲô£¿ ´ð:ALEΪµØÖ·Ëø´æÐźţ¬Ã¿¸ö»úÆ÷ÖÜÆÚÊä³öÁ½¸öÕýÂö³å¡£ÔÚ·ÃÎÊÆ¬Íâ´æ´¢Æ÷ʱ£¬Ï½µÑØÓÃÓÚ¿ØÖÆÍâ½ÓµÄµØÖ·Ëø´æÆ÷Ëø´æ´ÓP0¿ÚÊä³öµÄµÍ8λµØÖ·¡£ÔÚûÓнÓÍⲿ´æ´¢Æ÷ʱ£¬¿ÉÒÔ½«¸ÃÒý½ÅµÄÊä³ö×÷ΪʱÖÓÐźÅʹÓá£
7£®MCS-51µ¥Æ¬»úµÄ´æ´¢Æ÷·ÖΪÄö¿Õ¼ä£¿ÈçºÎÇø·Ö²»Í¬¿Õ¼äµÄѰַ£¿
´ð:MCS-51µ¥Æ¬»úÓÐ4¸ö´æ´¢¿Õ¼ä£¬ËüÃÇÊÇÆ¬ÄÚ³ÌÐò´æ´¢Æ÷ºÍÊý¾Ý´æ´¢Æ÷£¬ÔÚÆ¬Íâ¿ÉÒÔÀ©Õ¹µÄ³ÌÐò´æ´¢Æ÷ºÍÊý¾Ý´æ´¢Æ÷¡£Õâ4¸ö´æ´¢¿Õ¼ä¿ÉÒÔ·Ö³ÉÈýÀࣺƬÄÚÊý¾Ý´æ´¢¿Õ¼ä£¨256BµÄRAMºÍ128BµÄÌØÊ⹦ÄܼĴæÆ÷£©¡¢Æ¬ÍâÊý¾Ý´æ´¢¿Õ¼ä£¨64KB£©¡¢Æ¬ÄÚºÍÆ¬Íâͳһ±àÖ·µÄ³ÌÐò´æ´¢¿Õ¼ä£¨64KB£©¡£
8£®¼òÊöMCS-51µ¥Æ¬»úƬÄÚRAMµÄ¿Õ¼ä·ÖÅä¡£ÄÚ²¿RAMµÍ128×Ö½Ú·ÖΪÄöÖ÷Òª²¿·Ö£¿¸÷²¿·ÖÖ÷Òª¹¦ÄÜÊÇʲô£¿
´ð:ƬÄÚÊý¾Ý´æ´¢Æ÷°´ÕÕѰַ·½Ê½£¬¿ÉÒÔ·ÖΪÈý¸ö²¿·Ö£ºµÍ128×Ö½ÚÊý¾ÝÇø£¬¸ß128×Ö½ÚÊý¾ÝÇø¼ä£¬ÌØÊ⹦ÄܼĴæÆ÷Çø¡£µÍ128×Ö½ÚÊý¾ÝÇø·ÖΪÈý¸öÇøÓò£º¹¤×÷¼Ä´æÆ÷Çø£¬Î»Ñ°ÕÒÇøºÍͨÓÃÊý¾ÝÇø¡£¹¤×÷¼Ä´æÆ÷Çø4×鹤×÷¼Ä´æÆ÷£»Î»Ñ°ÕÒÇø¼È¿ÉÒÔ×öλ²Ù×÷£¬Ò²¿ÉÒÔ×Ö½Ú²Ù×÷£»Í¨ÓÃÊý¾ÝÇøÓÃÓÚ¶ÑÕ»ºÍ´æ·Å³ÌÐòÔËÐÐʱµÄÊý¾ÝºÍÖмä½á¹û¡£ 9£®MCS-51µ¥Æ¬»úµÄ³ÌÐò״̬¼Ä´æÆ÷PSWµÄ×÷ÓÃÊÇʲô£¿³£ÓñêÖ¾ÓÐÄÄЩλ£¿×÷ÓÃÊÇʲô£¿
´ð:PSWÊÇÒ»¸ö8λ¼Ä´æÆ÷£¬ÓÃÓÚÉ趨CPUµÄ״̬ºÍָʾָÁîÖ´ÐкóµÄ״̬¡£
CY£¨PSW.7£©£º½øÎ»±êÖ¾¡£ÔÚÖ´ÐмӼõÔËËãÖ¸Áîʱ£¬Èç¹ûÔËËã½á¹ûµÄ×î¸ß루D7£©·¢ÉúÁ˽øÎ»»ò½è룬ÔòCYÓÉÓ²¼þ×Ô¶¯ÖÃ1¡£ AC£¨PSW.6£©£º°ë½øÎ»±ê־룬Ҳ³ÆÎª¸¨Öú±ê־λ¡£ÔÚÖ´ÐмӼõÔËËãÖ¸Áîʱ£¬Èç¹ûÔËËã½á¹ûµÄµÍ°ë×Ö½Ú£¨D3£©·¢ÉúÁËÏò¸ß°ë×Ö½Ú½øÎ»»ò½è룬ÔòACÓÉÓ²¼þ×Ô¶¯ÖÃ1¡£
F0¡¢F1£¨PSW.5ºÍPSW.1£©£ºÓû§±ê־λ¡£Óû§¿ÉÒÔ¸ù¾ÝÐèÒª¶ÔF0¡¢F1¸³ÓèÒ»¶¨µÄº¬Ò壬ÓÉÓû§ÖÃ1ºÍÇå0£¬×÷ΪÈí¼þ±êÖ¾¡£
RS1¡¢RS0£¨PSW.4ºÍPSW.3£©£º¹¤×÷¼Ä´æÆ÷×éÑ¡Ôñ¿ØÖÆÎ»¡£Í¨¹ý¶ÔÕâÁ½Î»É趨£¬¿ÉÒÔ´Ó4¸ö¹¤×÷¼Ä´æÆ÷×éÖÐÑ¡ÔñÒ»×é×÷Ϊµ±Ç°¹¤×÷¼Ä´æÆ÷¡£
OV£¨PSW.2£©£ºÒç³ö±ê־룬ÓÐÁ½ÖÖÇé¿öÓ°Ïì¸Ãλ¡£Ò»ÊÇÖ´ÐмӼõÔËËãʱ£¬Èç¹ûD7»òD6ÈÎһ룬²¢ÇÒֻһλ·¢ÉúÁ˽øÎ»»ò½è룬ÔòOV×Ô¶¯ÖÃ1£¬
P£¨PSW.0£©£ºÆæÅ¼±ê־λ¡£Ã¿ÌõÖ¸ÁîÖ´ÐÐÍêºó£¬¸Ãλ¶¼»áָʾµ±Ç°ÀÛ¼ÓÆ÷AÖÐ1µÄ¸öÊý¡£Èç¹ûAÖÐÓÐÆæÊý¸ö1£¬ÔòP×Ô¶¯ÖÃ1¡£ 10£®MCS-51µ¥Æ¬»ú¸´Î»ºó£¬CPUʹÓÃÄÄ×鹤×÷¼Ä´æÆ÷£¿ËüÃǵĵØÖ·ÊÇʲô£¿Óû§ÈçºÎ¸Ä±äµ±Ç°¹¤×÷¼Ä´æÆ÷×飿
´ð:MCS-51µ¥Æ¬»ú¸´Î»ºó£¬CPUʹÓÃ0×鹤×÷¼Ä´æÆ÷¡£ËüÃǵĵØÖ·ÊÇ00H~07H¡£Í¨¹ý³ÌÐò״̬×ÖPSWÖеÄRS1¡¢RS0±ê־λ¸Ä±äµ±Ç°¹¤×÷¼Ä´æÆ÷×é¡£
11£®Ê²Ã´½Ð¶ÑÕ»£¿¶ÑÕ»Ö¸ÕëSPµÄ×÷ÓÃÊÇʲô£¿
´ð:¶ÑÕ»ÊÇÔÚRAMרÃÅ¿ª±ÙµÄÒ»¸öÌØÊâÓÃ;µÄ´æ´¢Çø¡£¶ÑÕ»Êǰ´ÕÕ¡°ÏȽøºó³ö¡±£¨¼´ÏȽøÈë¶ÑÕ»µÄÊý¾ÝºóÒÆ³ö¶ÑÕ»£©µÄÔÔò´æÈ¡Êý¾Ý¡£¶ÑÕ»Ö¸ÕëSPÊÇÒ»¸ö8λ¼Ä´æÆ÷£¬ÆäֵΪջ¶¥µÄµØÖ·£¬¼´Ö¸ÏòÕ»¶¥£¬SPΪ·ÃÎʶÑÕ»µÄ¼äÖ·¼Ä´æÆ÷¡£
12£®²âÊÔÄĸöÒý½Å£¬¿ÉÒÔ¿ì½ÝµØÅжϵ¥Æ¬»úÊÇ·ñÕýÔÚ¹¤×÷£¿ ´ð:ÈôÒª¼ì²éµ¥Æ¬»úÊÇ·ñ¹¤×÷£¬¿ÉÒÔʹÓÃʾ²¨Æ÷²é¿´ALEÒý½ÅÊÇ·ñÓÐÂö³åÐźÅÊä³ö¡£
13£®MCS-51µ¥Æ¬»úµÄP0¡«P3¿Ú½á¹¹Óкβ»Í¬£¿ÓÃ×÷ͨÓÃI/O¿ÚÊäÈëÊý¾ÝʱӦעÒâʲô£¿
´ð:P2¿ÚÊÇÒ»¸öË«¹¦Äܿڣ¬Ò»ÊÇͨÓÃI/O¿Ú£¬¶þÊÇÒÔ×ÜÏß·½Ê½·ÃÎÊÍⲿ´æ´¢Æ÷ʱ×÷Ϊ¸ß8λµØÖ·¿Ú¡£P2ÓëP1¿ÚµÄ½á¹¹ÀàËÆ£¬Çý¶¯²¿·Ö»ù±¾ÉÏÓëP1¿ÚÏàͬ¡£P3¿ÚÊÇÒ»¸ö¶à¹¦Äܿڣ¬P3¿Ú³ýÁ˾ßÓÐP1¿ÚµÄ׼˫ÏòI/O¿ÚµÄ¹¦ÄÜÖ®Í⣬»¹¿ÉÒÔʹÓø÷Òý½ÅËù¾ßÓеĵÚ2¹¦ÄÜ¡£P0¶àÁËһ·×ÜÏßÊä³ö£¨µØÖ·/Êý¾Ý£©¡¢×ÜÏßÊä³ö¿ØÖƵç·¡£ 14£®P0¿ÚÓÃ×÷ͨÓÃI/O¿ÚÊä³öÊý¾ÝʱӦעÒâʲô£¿
´ð:P0¿ÚÓëÆäËü¶Ë¿Ú²»Í¬£¬ËüµÄÊä³ö¼¶ÎÞÉÏÀµç×è¡£µ±°ÑËüÓÃ×÷ͨÓÃI/O¿Úʱ£¬Êä³ö¼¶ÊÇ¿ªÂ©µç·£¬¹ÊÓÃÆäÊä³öÈ¥Çý¶¯NMOSÊäÈëʱÍâ½ÓÉÏÀµç×裬ÕâʱÿһλÊä³ö¿ÉÒÔÇý¶¯4¸öLSÐÍTTL¸ºÔØ¡£ÓÃ×÷ÊäÈëʱ£¬Ó¦ÏÈÏò¶Ë¿ÚËø´æÆ÷д1¡£
15£®Ê²Ã´½ÐʱÖÓÖÜÆÚ£¿Ê²Ã´½Ð»úÆ÷ÖÜÆÚ£¿Ê²Ã´½ÐÖ¸ÁîÖÜÆÚ£¿Ê±ÖÓÖÜÆÚ¡¢»úÆ÷ÖÜÆÚÓëÕñµ´ÖÜÆÚÖ®¼äÓÐʲô¹ØÏµ£¿
´ð:ʱÖÓÖÜÆÚ¼´Õñµ´ÖÜÆÚ£ºÎª¾§ÕñµÄÕñµ´ÖÜÆÚ£¬ÊÇ×îСµÄʱÐòµ¥Î»¡£×´Ì¬ÖÜÆÚ£ºÊÇÕñµ´ÆµÂÊ2·ÖƵºóµÄʱÖÓÖÜÆÚ¡£ÏÔÈ»£¬Ò»¸ö״̬ÖÜÆÚ°üº¬2¸öÕñµ´ÖÜÆÚ¡£»úÆ÷ÖÜÆÚ£¨MC£©£º1¸ö»úÆ÷ÖÜÆÚÓÉ6¸ö״̬ÖÜÆÚ¡¢¼´12¸öÕñµ´ÖÜÆÚ×é³É£¬ÊÇÁ¿¶ÈÖ¸ÁîÖ´ÐÐʱ¼äµÄµ¥Î»¡£Ö¸ÁîÖÜÆÚ£ºÊÇÖ´ÐÐÒ»ÌõÖ¸ÁîËùÐèÒªµÄʱ¼ä¡£Ò»¸öÖ¸ÁîÖÜÆÚÓÉ1¡«4¸ö»úÆ÷ÖÜÆÚ×é³É¡£
16£®MCS-51µ¥Æ¬»ú³£Óõĸ´Î»µç·ÓÐÄÄЩ£¿¸´Î»ºó»úÆ÷µÄ³õʼ״̬ÈçºÎ£¿
´ð:¸´Î»µç·ÓÐÁ½ÖÖ·½Ê½£ºÉϵç×Ô¶¯¸´Î»µç·ºÍÊÖ¶¯¸´Î»µç·¡£¸´Î»ºó£¬³ÌÐò¼ÆÊýÆ÷PC±äΪ0000H£¬Ê¹µ¥Æ¬»ú´Ó³ÌÐò´æ´¢Æ÷µØÖ·0000H
µ¥Ôª¿ªÊ¼Ö´ÐС£³ýP0¡«P3ΪFFH£»SPΪ07H£»SBUFΪ²»È·¶¨¡£´ó²¿·ÖÌØÊ⹦ÄܼĴæÆ÷ÇåÁã¡£
17£®MCS-51µ¥Æ¬»úÓм¸Öֵ͹¦ºÄ¹¤×÷·½Ê½£¿ÈçºÎʵÏÖ£¬ÓÖÈçºÎÍ˳ö£¿ ´ð:MCS-51µ¥Æ¬»úÓпÕÏк͵ôµçÁ½Öֵ͹¦ºÄ¹¤×÷·½Ê½¡£µ±CPUÖ´ÐÐÍêÖÃIDL=1µÄÖ¸Áîºó£¬ÏµÍ³¾Í½øÈë¿ÕÏз½Ê½¡£½øÈë¿ÕÏз½Ê½Ö®ºó£¬ÓÐÁ½ÖÖ·½·¨¿ÉÒÔÍ˳ö¡£Ò»ÖÖÊÇÈκÎÖжÏÇëÇó±»ÏìÓ¦¶¼¿ÉÒÔÓÉÓ²¼þ½«IDLλÇå0¶ø½áÊø¿ÕÏз½Ê½¡£ÁíÒ»ÖÖÍ˳ö¿ÕÏз½Ê½µÄ·½·¨ÊÇÓ²¼þ¸´Î»¡£µ±CPUÖ´ÐÐÍêÖÃPD=1µÄÖ¸Áîºó£¬ÏµÍ³¾Í½øÈëµôµç¹¤×÷·½Ê½¡£¶ÔÓÚÒ»°ãµÄµ¥Æ¬»úÀ´Ëµ£¬Í˳öµôµç·½Ê½µÄΨһ·½·¨ÊÇÓÉÓ²¼þ¸´Î»¡£ 18£®ÓÃC51±à³Ì½Ï»ã±àÓïÑÔÓÐÄÄЩÓÅÊÆ£¿ ´ð:£¨1£©±à³ÌÈÝÒ×
£¨2£©ÈÝÒ×ʵÏÖ¸´ÔÓµÄÊýÖµ¼ÆËã £¨3£©ÈÝÒ×ÔĶÁ¡¢µ÷ÊÔ¡¢Î¬»¤³ÌÐò £¨4£©ÈÝÒ×ʵÏÖÄ£¿é»¯¿ª·¢ £¨5£©³ÌÐò¿ÉÒÆÖ²ÐÔºÃ
19£®C51×Ö½ÚÊý¾Ý¡¢ÕûÐÍÊý¾ÝÒÔ¼°³¤ÕûÐÍÊý¾ÝÔÚ´æ´¢Æ÷ÖеĴ洢·½Ê½¸÷ÊÇÔõÑùµÄ£¿
´ð:×Ö·û±äÁ¿£¨char£©ÎÞÂÛÊÇunsignedcharÊý¾Ý»¹ÊÇsignedcharÊý¾Ý£¬¾ùΪ1¸ö×Ö½Ú£¬¼´8룬Òò´Ë±»Ö±½Ó´æ´¢ÔÚRAMÖУ¬¿ÉÄÜ´æ´¢ÔÚ0¡«0x7fÇøÓò£¨°üÀ¨Î»Ñ°Ö·ÇøÓò£©£¬Ò²¿ÉÄÜ´æ´¢ÔÚ0x80¡«0xffÇøÓò£¬Óë±äÁ¿µÄ¶¨ÒåÓйء£
ÕûÐͱäÁ¿£¨int£©²»¹ÜÊÇunsignedintÊý¾Ý»¹ÊÇsignedintÊý¾Ý£¬¾ùΪ2¸ö×Ö½Ú£¬¼´16룬Æä´æ´¢·½·¨ÊǸßλ×Ö½Ú±£´æÔڵ͵ØÖ·£¨ÔÚÇ°Ãæ£©£¬µÍλ×Ö½Ú±£´æÔڸߵØÖ·£¨ÔÚºóÃæ£©¡£
³¤ÕûÐͱäÁ¿£¨long£©Îª4¸ö×Ö½Ú£¬¼´32룬Æä´æ´¢·½·¨ÓëÕûÐÍÊý¾ÝÒ»Ñù£¬ÊÇ×î¸ßλ×Ö½Ú±£´æµÄµØÖ·×îµÍ£¨ÔÚ×îÇ°Ãæ£©£¬×îµÍλ×Ö½Ú±£´æµÄµØÖ·×î¸ß£¨ÔÚ×îºóÃæ£©
20.ÈçºÎ¶¨Òå8λ×Ö½ÚÐÍÌØÊ⹦ÄܼĴæÆ÷£¿ÈçºÎ¶¨Òå16Î»ÌØÊ⹦ÄܼĴæÆ÷£¿ÈçºÎ¶¨ÒåÌØÊ⹦ÄܼĴæÆ÷µÄλ±äÁ¿£¿ ´ð:sfrÌØÊ⹦ÄܼĴæÆ÷Ãû£½µØÖ·³£Êý