µÃC/C++ÖбäÁ¿µÄ´óÐ
¡£¬Ò»¸ö±äÁ¿µÄ´óСÊÇLENGTHºÍTYPEµÄ³Ë»ý
¡£TYPEÓÃÀ´È¡µÃÒ»¸ö±äÁ¿µÄ´óС
£¬Èç¹ûÊÇÒ»¸öÊý×é
£¬ËüµÃµ½µÄÒ»¸öÊý×éÖеĵ¥¸öÔªËصĴóС¡£
?8.×¢ÊÍ
?¿ÉÒÔʹÓÃC/C++µÄ×¢ÊÍ£¬µ«ÍƼöÓÃASMµÄ×¢ÊÍ£¬¼´";"ºÅ¡£
?9._EMITαָÁî
?_EMITαָÁîÏ൱ÓÚMASMÖеÄDB£¬µ«Ò»´ÎÖ»Äܶ¨ÒåÒ»¸ö×Ö½Ú£¬±ÈÈç:
???__asm
???{
?????JMP?? _CodeOfAsm
?????_EMIT? 0x00??; ¶¨Òå»ìºÏÔÚ´úÂë¶ÎµÄÊý¾Ý
?????_EMIT? 0x01
???_CodeOfAsm:
?????; ÕâÀïÊÇ´úÂë
?????_EMIT? 0x90??; NOPÖ¸Áî
???}
ËÄ¡¢ÔÚ__asm¿éÖÐʹÓÃC/C++ÓïÑÔÔªËØ
?C/C++Óë»ã±à¿ÉÒÔ»ìºÏʹÓã¬ÔÚÄÚÁª»ã±à¿ÉÒÔʹÓÃC/C++µÄ±äÁ¿ºÍºÜ¶àÆäËüC/C++µÄÔªËØ¡£ÔÚ__asm¿éÖпÉÒÔʹÓÃÒÔÏÂC/C++ÔªËØ:
?1.·ûºÅ£¬°üÀ¨±êºÅ¡¢±äÁ¿ºÍº¯ÊýÃû£»
?2.³£Á¿£¬°üÀ¨·ûºÅ³£Á¿ºÍö¾ÙÐÍ(enum)³ÉÔ±£»
?3.ºê¶¨ÒåºÍÔ¤´¦Àíָʾ·û£»
?4.×¢ÊÍ£¬°üÀ¨"/**/"ºÍ"//"£»
?5.ÀàÐÍÃû£¬°üÀ¨ËùÓÐMASMÖкϷ¨µÄÀàÐÍ
?6.typedefÃû³Æ£¬ ÏñPTR¡¢TYPE¡¢Ìض¨µÄ½á¹¹³ÉÔ±»òö¾Ù³ÉÔ±ÕâÑùµÄͨÓòÙ×÷·û¡£
?ÔÚ__asm¿éÖУ¬¿ÉÒÔʹÓÃC/C++»òASMµÄ»ùÊý¼ÆÊý·¨(±ÈÈç: 0x100ºÍ100HÊÇÏàµÈµÄ)¡£
?__asm¿éÖв»ÄÜʹÓÃÏñ<<Ò»ÀàµÄC/C++²Ù×÷·û¡£C/C++ºÍMASMͨÓõIJÙ×÷·û£¬±ÈÈç"*"ºÍ"[]"²Ù×÷·û£¬¶¼±»ÈÏΪÊÇ»ã±àÓïÑԵIJÙ×÷·û¡£¾Ù¸öÀý×Ó:
???int array[[10]];
???__asm MOV array[[6]], BX ;?Store BX at array+6 (not scaled)
???array[[6]] = 0;???? /* Store 0 at array+12 (scaled) */
?* С¼¼ÇÉ: ÄÚÁª»ã±àÖУ¬Äã¿ÉÒÔʹÓÃTYPE²Ù×÷·ûʹ×÷ÆäÓëCÒ»Ö¡£±ÈÈ磬ÏÂÃæÁ½ÌõÓï¾äÊÇÒ»ÑùµÄ:
???__asm MOV array[[6 * TYPE int ], 0 ; Store 0 at array + 12
???array[[6]] = 0;????????? /* Store 0 at array + 12 */
?ÄÚÁª»ã±àÄÜͨ¹ý±äÁ½ÃûÖ±½ÓÒýÓÃC/C++µÄ±äÁ¿¡£__asm¿éÖпÉÒÔÒýÓÃÈκηûºÅ£¬°üÀ¨±äÁ¿Ãû¡£
?Èç¹ûC/C++ÖеÄÀà¡¢½á¹¹»òÕßö¾Ù³ÉÔ±¾ßÓÐΨһµÄÃû³Æ£¬Èç¹ûÔÚ"."²Ù×÷·û֮ǰ²»Ö¸¶¨±äÁ¿»òÕßtypedefÃû³Æ£¬Ôò__asm¿éÖÐÖ»ÄÜÒýÓóÉÔ±Ãû³Æ¡£È»¶ø£¬Èç¹û³ÉÔ±²»ÊÇΨһµÄ£¬Äã±ØÐëÔÚ"."²Ù×÷·û֮ǰ¼ÓÉϱäÁ¿Ãû»òtypedefÃû³Æ¡£ÀýÈ磬ÏÂÃæµÄÁ½¸ö½á¹¹¶¼¾ßÓÐsame_nameÕâ¸ö³ÉÔ±±äÁ¿:
???struct first_type
???{
?????char *weasel;
?????int same_name;
???};
???struct second_type
???{
?????int wonton;
?????long same_name;
???};
?Èç¹û°´ÏÂÃæÉùÃ÷±äÁ¿:
???struct first_type hal;
???struct second_type oat;
?ÄÇô£¬ËùÓÐÒýÓÃsame_name³ÉÔ±µÄµØ·½¶¼±ØÐëʹÓñäÁ¿Ãû£¬ÒòΪsame_name²»ÊÇΨһµÄ¡£ÁíÍ⣬ÉÏÃæµÄweasel±äÁ¿¾ßÓÐΨһµÄÃû³Æ£¬Äã¿ÉÒÔ½ö½öʹÓÃËüµÄ³ÉÔ±Ãû³ÆÀ´ÒýÓÃËü:
???__asm
???{
?????MOV EBX,