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

Assembly calls in Keil C !?!

Hello,

My name is Mihai Pogorevici. I need little assistance and i would be very happy if someone would agree to help me.
I'm working on a big project which includes microcontroller programming and i use Keil uVision 2.20a (C51 ver 6.20c, A51 ver 6.20, BL51 ver 4.20).
Question 1:
Does Keil C51 support Assembler statements within the C code ?!
Question 2:
How could i call another program loaded in memory (written in Keil C) within from a C51 program (written in Keil C too) ?! We suppose that we know the startup address.
I tried to use an external assembly module to call another program but it didnt work at all.
I really need help. Can someone give me any example ?!

Thank You,
Mihai Pogorevici.

P.S. My target system is a Philips 80C552.

Parents
  • Does Keil C51 support Assembler statements within the C code ?!

    Yes. Read the C51 manual for the details.

    Calling external functions at known addresses can be either hard or simple, depending on how, exactly, they were made. I.e.: do they take arguments? If so: where? What about return values? It can be as simple as

    	typedef void (*func_ptr)(int);
    
    	func_ptr whatever_function = (func_ptr) 0x12345;
    
    	funcptr(5);
    

    Or it can be a whole lot more complicated.

Reply
  • Does Keil C51 support Assembler statements within the C code ?!

    Yes. Read the C51 manual for the details.

    Calling external functions at known addresses can be either hard or simple, depending on how, exactly, they were made. I.e.: do they take arguments? If so: where? What about return values? It can be as simple as

    	typedef void (*func_ptr)(int);
    
    	func_ptr whatever_function = (func_ptr) 0x12345;
    
    	funcptr(5);
    

    Or it can be a whole lot more complicated.

Children
No data