This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ASM + C

I have a problem.
My program with inline work, but when I add Printf or Scanf it do nothing. If smbd have working project with inline #pragma asm ... and Printf Help me, Please.

Parents
  • Thank you for your answer,
    I'd really like to get rid of inline ASM, but
    It's my task (I have a laboratory course in institute), so
    I have no problems with separate assembler function ( .a51) I call it from 'C'.
    But inline ASM code ...
    I get SRC file.

    My simpliest prog: (printf JMP nowhere)

    #include <reg51.h>
    #include <stdio.h>
    
    void button(void) interrupt 2 {
    #pragma asm
       CPL p3.4
       CPL p3.6
       SETB p3.5
    #pragma endasm
    }
    void main ( void ){
       SCON = 0x52;
       TMOD |= 0x20;
       TH1 = 0xF5;
       TR1 = 1;
       TI = 1;
    
       TCON |=0x04;
       IE |=0x84;
       printf ("YANA");
       while(1){}
    }
    

Reply
  • Thank you for your answer,
    I'd really like to get rid of inline ASM, but
    It's my task (I have a laboratory course in institute), so
    I have no problems with separate assembler function ( .a51) I call it from 'C'.
    But inline ASM code ...
    I get SRC file.

    My simpliest prog: (printf JMP nowhere)

    #include <reg51.h>
    #include <stdio.h>
    
    void button(void) interrupt 2 {
    #pragma asm
       CPL p3.4
       CPL p3.6
       SETB p3.5
    #pragma endasm
    }
    void main ( void ){
       SCON = 0x52;
       TMOD |= 0x20;
       TH1 = 0xF5;
       TR1 = 1;
       TI = 1;
    
       TCON |=0x04;
       IE |=0x84;
       printf ("YANA");
       while(1){}
    }
    

Children