לוגו אתר Fresh          
 
 
  אפשרות תפריט  ראשי     אפשרות תפריט  צ'אט     אפשרות תפריט  מבזקים     אפשרות תפריט  צור קשר     חץ שמאלה ‎print ‎"Hello World!"; if‎ ‎not rules.‎know ‎then rules.‎read(); חץ ימינה  

לך אחורה   לובי הפורומים > מחשבים > תכנות ובניית אתרים
שמור לעצמך קישור לדף זה באתרי שמירת קישורים חברתיים
תגובה
 
כלי אשכול חפש באשכול זה



  #1  
ישן 01-12-2004, 13:32
צלמית המשתמש של fat fish
  fat fish fat fish אינו מחובר  
 
חבר מתאריך: 20.06.03
הודעות: 5,616
או בהרחבה....

Inline Assembler Overview

Microsoft Specific


The inline assembler lets you embed assembly-language instructions in your C and C++ source programs without extra assembly and link steps. The inline assembler is built into the compiler — you don't need a separate assembler such as the Microsoft Macro Assembler (MASM).

Because the inline assembler doesn't require separate assembly and link steps, it is more convenient than a separate assembler. Inline assembly code can use any C or C++ variable or function name that is in scope, so it is easy to integrate it with your program's C and C++ code. And because the assembly code can be mixed with C and C++ statements, it can do tasks that are cumbersome or impossible in C or C++ alone.

The __asm keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It cannot appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at the very least, an empty pair of braces. The term "__asm block" here refers to any instruction or group of instructions, whether or not in braces.

The following code is a simple __asm block enclosed in braces. (The code is a custom function prolog sequence.)
קוד PHP:
 // asm_overview.cpp
void __declspec(nakedmain()
{
    
// Naked functions must provide their own prolog...
    
__asm {
        
push ebp
        mov esp
ebp
        sub esp
__LOCAL_SIZE
    
}
    
    
// ... and epilog
    
__asm {
        
pop ebp
        ret
    
}



Alternatively, you can put __asm in front of each assembly instruction:
קוד PHP:
 __asm push ebp
__asm mov  ebp
esp
__asm sub  esp
__LOCAL_SIZE 


Since the __asm keyword is a statement separator, you can also put assembly instructions on the same line:
קוד PHP:
 __asm push ebp   __asm mov  ebpesp   __asm sub  esp__LOCAL_SIZE 

מידע נוסף תוכל למצא בקישורים הבאים:

http://msdn.microsoft.com/library/d...e_assembler.asp
http://msdn.microsoft.com/library/d...e.29_.tasks.asp
http://msdn.microsoft.com/library/d....29_.Topics.asp
_____________________________________
[ זיו ]
[ fat fish ]

תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
תגובה

כלי אשכול חפש באשכול זה
חפש באשכול זה:

חיפוש מתקדם
מצבי תצוגה דרג אשכול זה
דרג אשכול זה:

מזער את תיבת המידע אפשרויות משלוח הודעות
אתה לא יכול לפתוח אשכולות חדשים
אתה לא יכול להגיב לאשכולות
אתה לא יכול לצרף קבצים
אתה לא יכול לערוך את ההודעות שלך

קוד vB פעיל
קוד [IMG] פעיל
קוד HTML כבוי
מעבר לפורום



כל הזמנים המוצגים בדף זה הם לפי איזור זמן GMT +2. השעה כעת היא 18:12

הדף נוצר ב 0.09 שניות עם 11 שאילתות

הפורום מבוסס על vBulletin, גירסא 3.0.6
כל הזכויות לתוכנת הפורומים שמורות © 2024 - 2000 לחברת Jelsoft Enterprises.
כל הזכויות שמורות ל Fresh.co.il ©

צור קשר | תקנון האתר