Click here to Skip to main content
15,913,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionalternative function for MCIWndCreate API Pin
VCProgrammer31-Oct-11 1:17
VCProgrammer31-Oct-11 1:17 
AnswerRe: alternative function for MCIWndCreate API Pin
Code-o-mat31-Oct-11 2:02
Code-o-mat31-Oct-11 2:02 
Question[SOLVED] Inline assembly syntax error.. Pin
CodingLover30-Oct-11 21:59
CodingLover30-Oct-11 21:59 
AnswerRe: Inline assembly syntax error.. Pin
Malli_S30-Oct-11 22:39
Malli_S30-Oct-11 22:39 
GeneralRe: Inline assembly syntax error.. Pin
CodingLover30-Oct-11 23:41
CodingLover30-Oct-11 23:41 
AnswerRe: Inline assembly syntax error.. Pin
Richard MacCutchan30-Oct-11 23:50
mveRichard MacCutchan30-Oct-11 23:50 
GeneralRe: Inline assembly syntax error.. Pin
CodingLover30-Oct-11 23:56
CodingLover30-Oct-11 23:56 
GeneralRe: Inline assembly syntax error.. Pin
enhzflep31-Oct-11 0:51
enhzflep31-Oct-11 0:51 
I just tried a search for P2LTCH with google, finding the following block of code here.

/**********************************************************************  
 *  
 * Function:    toggleLed()  
 *  
 * Description: Toggle the state of one or both LED's.  
 *  
 * Notes:       This function is specific to Arcom's Target188EB board.  
 *  
 * Returns:     None defined.  
 *  
 **********************************************************************/   
void    
toggleLed(unsigned char ledMask)   
{   
    #define P2LTCH 0xFF5E       /* The address of the I/O register.   */   
   
    asm {   
        mov dx, P2LTCH          /* Load the address of the register.  */   
        in  al, dx              /* Read the contents of the register. */   
   
        mov ah, ledMask         /* Move the ledMask into a register.  */   
        xor al, ah              /* Toggle the requested bits.         */   
   
        out dx, al              /* Write the new register contents.   */   
    };   
   
}   /* toggleLed() */   


Reading through this, I thought of your asm statement - In the code you showed using round braces, you used the asm keyword. Later you showed some code with curly braces, however I see that in the seconds code snippet you have used the __asm keyword, instead.
If you haven't already, I'd try the syntax used in the above snippet. I've a very hazy memory that somewhere I read that the __asm keyword is a MS thing. Dunno, too lazy to check. Big Grin | :-D
Though I do note that in Code::Blocks, asm gets syntax-highlighted, while __asm doesn't..
GeneralRe: Inline assembly syntax error.. Pin
CodingLover31-Oct-11 1:02
CodingLover31-Oct-11 1:02 
GeneralRe: Inline assembly syntax error.. Pin
enhzflep31-Oct-11 1:18
enhzflep31-Oct-11 1:18 
GeneralRe: Inline assembly syntax error.. Pin
David Crow31-Oct-11 3:13
David Crow31-Oct-11 3:13 
GeneralRe: Inline assembly syntax error.. Pin
enhzflep31-Oct-11 3:19
enhzflep31-Oct-11 3:19 
GeneralRe: Inline assembly syntax error.. Pin
Richard MacCutchan31-Oct-11 0:54
mveRichard MacCutchan31-Oct-11 0:54 
GeneralRe: Inline assembly syntax error.. Pin
CodingLover31-Oct-11 1:03
CodingLover31-Oct-11 1:03 
GeneralRe: Inline assembly syntax error.. Pin
Snorri Kristjansson31-Oct-11 1:09
professionalSnorri Kristjansson31-Oct-11 1:09 
GeneralRe: Inline assembly syntax error.. Pin
CodingLover31-Oct-11 1:12
CodingLover31-Oct-11 1:12 
AnswerRe: Inline assembly syntax error.. Pin
CodingLover31-Oct-11 23:53
CodingLover31-Oct-11 23:53 
JokeRe: Inline assembly syntax error.. Pin
David Crow1-Nov-11 2:57
David Crow1-Nov-11 2:57 
QuestionHow to get the current active document of MDI application? Pin
rahul.kulshreshtha30-Oct-11 20:41
rahul.kulshreshtha30-Oct-11 20:41 
AnswerRe: How to get the current active document of MDI application? Pin
«_Superman_»30-Oct-11 21:55
professional«_Superman_»30-Oct-11 21:55 
QuestionIIS Metadata, can't write the default pages and Mimes. Pin
jkirkerx30-Oct-11 6:43
professionaljkirkerx30-Oct-11 6:43 
AnswerRe: IIS Metadata, can't write the default pages and Mimes. Pin
jkirkerx30-Oct-11 9:42
professionaljkirkerx30-Oct-11 9:42 
AnswerI'm almost there, how to add to safe array Pin
jkirkerx31-Oct-11 13:18
professionaljkirkerx31-Oct-11 13:18 
QuestionBuild problems Pin
columbos1492730-Oct-11 1:24
columbos1492730-Oct-11 1:24 
AnswerRe: Build problems Pin
Richard MacCutchan30-Oct-11 2:51
mveRichard MacCutchan30-Oct-11 2:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.