C/C++ÖÐnearºÍfarµÄÇø±ð
C/C++ÖÐnearºÍfarµÄÇø±ð
¹Ø¼ü×ÖnearºÍfarÊÜÄ¿±ê¼ÆËã»úÌåϵ½á¹¹µÄÓ°Ï졣Ŀǰ±à³ÌÖÐʹÓò»¶à¡£
near¹Ø¼ü×Ö´´½¨Ò»¸öÖ¸Ïò¿ÉÑ°Ö·ÄÚ´æµÍ¶Ë²¿·ÖµÄÄ¿±êÖ¸Õë¡£ÕâЩָÕëÕ¼ÓÃÄÚ´æµÄµ¥Ò»×Ö½Ú£¬²¢ÇÒËûÃÇÄܹ»Ö¸ÏòµÄÄÚ´æµ¥Ôª±»ÏÞÖƵ½256¸öλÖã¬Í¨³£ÊÇÔÚ0x0000~0x00ff·¶Î§ÖС£
int near * ptr£»
far¹Ø¼ü×Ö´´½¨Ò»¸öÄܹ»Ö¸ÏòÄÚ´æÖÐÈκÎÊý¾ÝµÄÖ¸Õ룺
char far * ptr£»
near (½ü)Ö¸Õ룺16λ¶ÎÄÚÆ«ÒƵØÖ·
far(Ô¶)Ö¸Õ룺16λ¶ÎµØÖ·£«16λ¶ÎÄÚÆ«ÒƵØÖ·
huge(¾Þ)Ö¸Õ룺32λ¹æ¸ñ»¯µÄ¾ßÓÐΨһÐÔµÄÄÚ´æµØÖ·
CÓïÑԵĴæÖüÊôÐÔÓÉÁùÖÖ±àÒëģʽ¾ö¶¨(²Î¼ûTC¼¯³É»·¾³²Ëµ¥ÖеÄoption->compiler->modelÑ¡Ïî)£¬Ä¬ÈϵıàÒëģʽΪsmall, ÔڸñàÒëģʽÏ£¬Ö¸ÕëµÄĬÈÏÊôÐÔΪnear¡£
²¹³ä£ºnearÖ¸ÕëÊÇ16λָÕ룬ÒÀÀµÒ»¸ö¶ÎµØÖ·¼Ä´æÆ÷£¬Ö¸Õë±äÁ¿¾ÍÊÇλÒÆÁ¿£¬ÀûÓà ¶ÎµØÖ·¼Ä´æÆ÷+Ö¸Õë À´Ñ°Ö·£¬ËùÒÔÓÐ64KÖ®ÏÞÖÆ¡£
far Ö¸ÕëÊÇ32λָÕ룬²»µ«ÓÐ16λµÄλÒÆÁ¿£¬»¹ÓÐ16λµÄ¶ÎµØÖ·£¬µ«´ËÖ¸ÕëÓиöȱÏÝ£¬ÔöÁ¿Ê±Ö»¼Óµ½Î»ÒƲ¿·Ö£¬Ò»µ©16λµÄλÒÆÁ¿³¬¹ýÁËFFFF¾Í»á»Øµ½Õâ¸ö¶ÎµØÖ·µÄ³õʼ¡£
ËùÒÔ£¬ÓÖÒýÈëÁËhugeÖ¸Õ룬hugeÖ¸ÕëÓëfarÒ»Ñù£¬ÆäÇø±ð½öÔÚÓÚʹÓÃÁ˱ê×¼»¯µÄ·½·¨À´±íʾ£¬ÕâÑùËùÓеĵØÖ·¶¼ÓÐÒ»¸öΨһµÄ±íʾ·½·¨£¬´Ó¶ø±ÜÃâÁËfarÖ¸ÕëµÄÎÊÌâ¡£
¿ÕÖ¸Õë¹æ¶¨ÁËÒ»ÖÖÖ¸Õë״̬£¬Èç¹ûûÓÐÕâ¸ö¿ÕÖ¸Õ룬¾ÍÈçÊý×ÖûÓÐÁË0¡£
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
1.JavaÔÚÐéÄâ»úÉÏÔËÐÐ
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·Òë³ÉΪÐéÄâ»ú¿ÉÒÔÖ´ÐеĴúÂë¡£Ò»¸öJava½âÊÍÆ÷×îÖÕÖ´ÐÐÕâЩ´úÂë¡£ÕâÆäÖÐûÓÐÁ¬½ÓµÄ¹ý³Ì£»½âÊÍÔÚÐèÒªµÄʱºò¶¯Ì¬µÄ¼ÓÔØһЩÀࣻ
2.JavaÊÇÍêÈ«ÃæÏò¶ÔÏóµÄ
JavaÊÇÒ»ÖÖÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ¡£ÕâÒâζ×ÅÄã¶ÔÈκÎÒ»¸öJava¶ÔÏóËù×öµÄ¶ ......
Í·ÎļþµÄ×÷ÓÃ
ÔçÆڵıà³ÌÓïÑÔÈçBasic¡¢Fortran ûÓÐÍ·ÎļþµÄ¸ÅÄC++/C ÓïÑԵijõѧÕßËäÈ»»áÓÃʹÓÃÍ·Îļþ£¬µ«³£³£²»Ã÷ÆäÀí¡£ÕâÀï¶ÔÍ·ÎļþµÄ×÷ÓÃÂÔ×÷½âÊÍ£º
£¨1£©Í¨¹ýÍ·ÎļþÀ´µ÷Óÿ⹦ÄÜ¡£ÔںܶೡºÏ£¬Ô´´úÂë²»±ã£¨»ò²»×¼£©ÏòÓû§¹«²¼£¬Ö»ÒªÏòÓû§ÌṩͷÎļþºÍ¶þ½øÖƵĿ⼴¿É¡£Óû§Ö»ÐèÒª°´ÕÕÍ·ÎļþÖеĽӿÚÉùÃ÷À´µ÷Óÿ⹦ ......
Ò»¡¢
1¡¢¹ØÓÚ×Ö½Ú˳Ðò£º»°ËµÔÚÌض¨µÄÓ²¼þƽ̨ÉÏ£¬¶à×Ö½ÚÊý¾ÝµÄ˳Ðò´æ·ÅÓÐÁ½ÖÖ·½Ê½£¨little-endian¡¢big-endian£©¡£Ç°ÕßµÄÊý¾ÝµÄµÍ×Ö½Ú
²¿·Ö´æ·ÅÔڵ͵ØÖ·Äڴ棬ºóÕßÇ¡ºÃÏà·´¡£PCÒ»°ãÊÇ»ùÓÚIA-32΢´¦ÀíÆ÷£¬ÊôÓÚlittle-endian¡£Ä³Ð©RISC¼Ü¹¹µÄCPU£¬ÀýÈçSPARC¡¢
POWERPCµÈ£¬ÔòÊ ......
×óÖµÐÔ£¨lvalueness£©ÔÚC/C++ÖÐÊDZí´ïʽµÄÒ»¸öÖØÒªÊôÐÔ¡£Ö»ÓÐͨ¹ýÒ»¸ö×óÖµ±í´ïʽ²ÅÄÜÀ´ÒýÓü°¸ü¸ÄÒ»¸ö¶ÔÏó£¨object£©µÄÖµ¡££¨Ä³Ð©Çé¿öÏ£¬ÓÒÖµ±í´ïʽҲÄÜÒýÓã¨refer£©µ½Ä³Ò»¸ö¶ÔÏ󣬲¢ÇÒ¿ÉÄܼä½ÓÐ޸ĸöÔÏóµÄÖµ£¬ºóÊö£©¡£
ºÎν¶ÔÏó£¿Èç¹ûûÓÐÃ÷ȷ˵Ã÷£¬ÕâÀï˵µÄ¶ÔÏ󣬺ÍÏÁÒåµÄÀà/¶ÔÏó£¨class/object£© ......